diff mbox

drm/i915: Warn when cleanup the plane if the fb doesn't match the vma

Message ID 20170130111903.20091-1-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Wilson Jan. 30, 2017, 11:19 a.m. UTC
We track the plane state's framebuffer and VMA separately, giving us an
opportunity to detect if that pair becomes inconsistent when we cleanup
after the atomic modeset.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/intel_display.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 28159ce7bff7..63d346375a7b 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -14313,6 +14313,8 @@  intel_cleanup_plane_fb(struct drm_plane *plane,
 	/* Should only be called after a successful intel_prepare_plane_fb()! */
 	vma = fetch_and_zero(&to_intel_plane_state(old_state)->vma);
 	if (vma) {
+		WARN_ON(vma->obj != intel_fb_obj(old_state->fb));
+
 		mutex_lock(&plane->dev->struct_mutex);
 		intel_unpin_fb_vma(vma);
 		mutex_unlock(&plane->dev->struct_mutex);