Merge tag 'drm-misc-next-fixes-2019-03-06' of git://anongit.freedesktop.org/drm/drm...
[muen/linux.git] / drivers / gpu / drm / drm_atomic_helper.c
index 7a7231d007792091f23ff0387b427069026fc083..40ac1984803459b7a0e8f67e09f81b61820035ef 100644 (file)
@@ -1608,6 +1608,15 @@ int drm_atomic_helper_async_check(struct drm_device *dev,
            old_plane_state->crtc != new_plane_state->crtc)
                return -EINVAL;
 
+       /*
+        * FIXME: Since prepare_fb and cleanup_fb are always called on
+        * the new_plane_state for async updates we need to block framebuffer
+        * changes. This prevents use of a fb that's been cleaned up and
+        * double cleanups from occuring.
+        */
+       if (old_plane_state->fb != new_plane_state->fb)
+               return -EINVAL;
+
        funcs = plane->helper_private;
        if (!funcs->atomic_async_update)
                return -EINVAL;