All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 08/13] drm/i915/overlay: Use VMA as the primary tracker for images
Date: Fri,  5 Aug 2016 10:05:59 +0100	[thread overview]
Message-ID: <1470387964-3363-9-git-send-email-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <1470387964-3363-1-git-send-email-chris@chris-wilson.co.uk>

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/intel_overlay.c | 31 +++++++++++++------------------
 1 file changed, 13 insertions(+), 18 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_overlay.c b/drivers/gpu/drm/i915/intel_overlay.c
index 0b39b4c76be4..0753cb34527d 100644
--- a/drivers/gpu/drm/i915/intel_overlay.c
+++ b/drivers/gpu/drm/i915/intel_overlay.c
@@ -171,8 +171,7 @@ struct overlay_registers {
 struct intel_overlay {
 	struct drm_i915_private *i915;
 	struct intel_crtc *crtc;
-	struct drm_i915_gem_object *vid_bo, *old_vid_bo;
-	struct i915_vma *vid_vma, *old_vid_vma;
+	struct i915_vma *vma, *old_vma;
 	bool active;
 	bool pfit_active;
 	u32 pfit_vscale_ratio; /* shifted-point number, (1<<12) == 1.0 */
@@ -317,15 +316,14 @@ static void intel_overlay_release_old_vid_tail(struct i915_gem_active *active,
 {
 	struct intel_overlay *overlay =
 		container_of(active, typeof(*overlay), last_flip);
-	struct drm_i915_gem_object *obj = overlay->old_vid_bo;
 
-	i915_gem_track_fb(obj, NULL,
+	i915_gem_track_fb(overlay->old_vma->obj, NULL,
 			  INTEL_FRONTBUFFER_OVERLAY(overlay->crtc->pipe));
 
-	i915_gem_object_unpin_from_display_plane(overlay->old_vid_vma);
-	i915_gem_object_put(obj);
+	i915_gem_object_unpin_from_display_plane(overlay->old_vma);
+	i915_gem_object_put(overlay->old_vma->obj);
 
-	overlay->old_vid_bo = NULL;
+	overlay->old_vma = NULL;
 }
 
 static void intel_overlay_off_tail(struct i915_gem_active *active,
@@ -335,13 +333,12 @@ static void intel_overlay_off_tail(struct i915_gem_active *active,
 		container_of(active, typeof(*overlay), last_flip);
 
 	/* never have the overlay hw on without showing a frame */
-	if (WARN_ON(overlay->vid_vma))
+	if (WARN_ON(overlay->vma))
 		return;
 
-	i915_gem_object_unpin_from_display_plane(overlay->vid_vma);
-	i915_gem_object_put(overlay->vid_bo);
-	overlay->vid_vma = NULL;
-	overlay->vid_bo = NULL;
+	i915_gem_object_unpin_from_display_plane(overlay->vma);
+	i915_gem_object_put(overlay->vma->obj);
+	overlay->vma = NULL;
 
 	overlay->crtc->overlay = NULL;
 	overlay->crtc = NULL;
@@ -421,7 +418,7 @@ static int intel_overlay_release_old_vid(struct intel_overlay *overlay)
 	/* Only wait if there is actually an old frame to release to
 	 * guarantee forward progress.
 	 */
-	if (!overlay->old_vid_bo)
+	if (!overlay->old_vma)
 		return 0;
 
 	if (I915_READ(ISR) & I915_OVERLAY_PLANE_FLIP_PENDING_INTERRUPT) {
@@ -835,13 +832,11 @@ static int intel_overlay_do_put_image(struct intel_overlay *overlay,
 	if (ret)
 		goto out_unpin;
 
-	i915_gem_track_fb(overlay->vid_bo, new_bo,
+	i915_gem_track_fb(overlay->vma->obj, new_bo,
 			  INTEL_FRONTBUFFER_OVERLAY(pipe));
 
-	overlay->old_vid_bo = overlay->vid_bo;
-	overlay->old_vid_vma = overlay->vid_vma;
-	overlay->vid_bo = new_bo;
-	overlay->vid_vma = vma;
+	overlay->old_vma = overlay->vma;
+	overlay->vma = vma;
 
 	intel_frontbuffer_flip(dev_priv, INTEL_FRONTBUFFER_OVERLAY(pipe));
 
-- 
2.8.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2016-08-05  9:06 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-05  9:05 First class i915_vma Chris Wilson
2016-08-05  9:05 ` [PATCH 01/13] drm/i915: Reduce amount of duplicate buffer information captured on error Chris Wilson
2016-08-05  9:05 ` [PATCH 02/13] drm/i915: Stop the machine whilst capturing the GPU crash dump Chris Wilson
2016-08-05 18:50   ` Daniel Vetter
2016-08-05 19:01     ` Chris Wilson
2016-08-05 19:57       ` Daniel Vetter
2016-08-05  9:05 ` [PATCH 03/13] drm/i915: Scan GGTT active list for context object Chris Wilson
2016-08-05  9:05 ` [PATCH 04/13] drm/i915: Move setting of request->batch into its single callsite Chris Wilson
2016-08-05  9:05 ` [PATCH 05/13] drm/i915: Mark unmappable GGTT entries as PIN_HIGH Chris Wilson
2016-08-05  9:05 ` [PATCH 06/13] drm/i915: Track pinned vma inside guc Chris Wilson
2016-08-05  9:05 ` [PATCH 07/13] drm/i915: Track pinned VMA Chris Wilson
2016-08-05  9:05 ` Chris Wilson [this message]
2016-08-05  9:06 ` [PATCH 09/13] drm/i915: Print the batchbuffer offset next to BBADDR in error state Chris Wilson
2016-08-05  9:06 ` [PATCH 10/13] drm/i915: Move per-request pid from request to ctx Chris Wilson
2016-08-05  9:06 ` [PATCH 11/13] drm/i915: Store the active context object on all engines upon error Chris Wilson
2016-08-05  9:06 ` [PATCH 12/13] drm/i915: Only record active and pending requests upon a GPU hang Chris Wilson
2016-08-05  9:06 ` [PATCH 13/13] drm/i915: Compress GPU objects in error state Chris Wilson
2016-08-05 18:56   ` Daniel Vetter
2016-08-05 19:15     ` Chris Wilson
2016-08-05 19:58       ` Daniel Vetter
2016-08-05  9:09 ` ✗ Ro.CI.BAT: failure for series starting with [01/13] drm/i915: Reduce amount of duplicate buffer information captured on error Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1470387964-3363-9-git-send-email-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.