[Intel-gfx] [PATCH] drm/i915: Warn when cleanup the plane if the fb doesn't match the vma

Chris Wilson chris at chris-wilson.co.uk
Mon Jan 30 11:19:03 UTC 2017

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 at chris-wilson.co.uk>
Cc: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
 drivers/gpu/drm/i915/intel_display.c | 2 ++
 1 file changed, 2 insertions(+)

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));

More information about the Intel-gfx mailing list