intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 5/5] drm/i915: Set crtc_state->fb_changed whenever a VMA is changed
Date: Tue, 15 Nov 2016 08:58:17 +0000	[thread overview]
Message-ID: <20161115085817.4210-5-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <20161115085817.4210-1-chris@chris-wilson.co.uk>

Since an fb may have multiple VMA (due to rotations etc), we need to
wait a vblank and unpin the old VMA not if the fb itself is changed, but
if the underlying VMA is changed.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/intel_display.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 4d578dc6d23f..a92adce033ab 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -12476,9 +12476,6 @@ int intel_plane_atomic_calc_changes(struct drm_crtc_state *crtc_state,
 	if (!was_visible && !visible)
 		return 0;
 
-	if (fb != old_plane_state->base.fb)
-		pipe_config->fb_changed = true;
-
 	turn_off = was_visible && (!visible || mode_changed);
 	turn_on = visible && (!was_visible || mode_changed);
 
@@ -14228,6 +14225,13 @@ intel_prepare_plane_fb(struct drm_plane *plane,
 			return PTR_ERR(vma);
 
 		to_intel_plane_state(new_state)->vma = vma;
+		if (to_intel_plane_state(plane->state)->vma != vma) {
+			struct intel_crtc_state *crtc_state;
+
+			crtc_state = intel_atomic_get_crtc_state(new_state->state,
+								 to_intel_crtc(new_state->crtc));
+			crtc_state->fb_changed = true;
+		}
 	}
 
 	return 0;
-- 
2.10.2

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

  parent reply	other threads:[~2016-11-15  8:58 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-15  8:58 [PATCH 1/5] drm/i915: Move intel_prepare_plane_fb() and intel_cleanup_plane_fb() Chris Wilson
2016-11-15  8:58 ` [PATCH 2/5] drm/i915: Always prepare planes at the start of an atomic commit Chris Wilson
2016-11-15  9:37   ` Daniel Vetter
2016-11-15  9:47     ` Tvrtko Ursulin
2016-11-15  9:57     ` Chris Wilson
2016-11-15 10:10       ` Daniel Vetter
2016-11-15 10:18         ` Chris Wilson
2016-11-15  8:58 ` [PATCH 3/5] drm/i915: Track pinned vma in intel_plane_state Chris Wilson
2016-11-15  9:52   ` Daniel Vetter
2016-11-15 10:02     ` Chris Wilson
2016-11-15 10:13       ` Daniel Vetter
2016-11-15 10:24   ` Daniel Vetter
2016-11-15  8:58 ` [PATCH 4/5] drm/i915: Quick spring clean of intel_prepare_plane_fb() Chris Wilson
2016-11-15 10:23   ` Daniel Vetter
2016-11-15  8:58 ` Chris Wilson [this message]
2016-11-15 10:15   ` [PATCH 5/5] drm/i915: Set crtc_state->fb_changed whenever a VMA is changed Daniel Vetter
2016-11-15  9:15 ` ✗ Fi.CI.BAT: warning for series starting with [1/5] drm/i915: Move intel_prepare_plane_fb() and intel_cleanup_plane_fb() Patchwork
2016-11-15  9:28 ` [PATCH 1/5] " Daniel Vetter
  -- strict thread matches above, loose matches on Subject: below --
2016-10-29 12:04 Chris Wilson
2016-10-29 12:04 ` [PATCH 5/5] drm/i915: Set crtc_state->fb_changed whenever a VMA is changed Chris Wilson

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=20161115085817.4210-5-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).