drm/armada: wait for previous work when moving overlay window
authorRussell King <rmk+kernel@armlinux.org.uk>
Sat, 8 Jul 2017 09:22:34 +0000 (10:22 +0100)
committerRussell King <rmk+kernel@armlinux.org.uk>
Fri, 8 Dec 2017 12:21:57 +0000 (12:21 +0000)
We must wait for the previous plane work to complete before moving
the overlay window, as it could overwrite our positioning update.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
drivers/gpu/drm/armada/armada_overlay.c

index e5fa346..853f889 100644 (file)
@@ -239,16 +239,16 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc,
        if (!dplane->base.state.changed)
                return 0;
 
+       /* Wait for pending work to complete */
+       if (armada_drm_plane_work_wait(&dplane->base, HZ / 25) == 0)
+               armada_drm_plane_work_cancel(dcrtc, &dplane->base);
+
        /* Just updating the position/size? */
        if (!dplane->base.state.vsync_update) {
                armada_ovl_plane_work(dcrtc, work);
                return 0;
        }
 
-       /* Wait for pending work to complete */
-       if (armada_drm_plane_work_wait(&dplane->base, HZ / 25) == 0)
-               armada_drm_plane_work_cancel(dcrtc, &dplane->base);
-
        if (!dcrtc->plane) {
                dcrtc->plane = plane;
                armada_ovl_update_attr(&dplane->prop, dcrtc);