]> git.karo-electronics.de Git - linux-beck.git/blobdiff - drivers/gpu/drm/drm_crtc.c
drm: Add consistency check for page-flipping
[linux-beck.git] / drivers / gpu / drm / drm_crtc.c
index 781aef524b3bd7f850341ca98f218f67e35d2df9..3bdf2a650d9c4c4ec8f65d1c8f0e1ebd3bcc507e 100644 (file)
@@ -3792,6 +3792,13 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,
                /* Keep the old fb, don't unref it. */
                old_fb = NULL;
        } else {
+               /*
+                * Warn if the driver hasn't properly updated the crtc->fb
+                * field to reflect that the new framebuffer is now used.
+                * Failing to do so will screw with the reference counting
+                * on framebuffers.
+                */
+               WARN_ON(crtc->fb != fb);
                /* Unref only the old framebuffer. */
                fb = NULL;
        }