[PATCH 2/2] drm/rockchip: Send events for same-fb flips

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Rockchip previously treated a pageflip to the same framebuffer as a
no-op, discarding the event if one was requested. This breaks Weston,
which, when idle, sends a no-op vblank event to discover vblank
timings if the vblank query interface is not usable.

Silently dropping events is also quite a hostile thing to do to
userspace in general.

Signed-off-by: Daniel Stone <daniels@xxxxxxxxxxxxx>
Cc: Sjoerd Simons <sjoerd.simons@xxxxxxxxxxxxxxx>
Cc: Heiko Stuebner <heiko@xxxxxxxxx>
---
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 30 ++++++++++++++---------------
 1 file changed, 14 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
index ddf6dc2..dad607e 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
@@ -916,25 +916,23 @@ static int vop_update_plane_event(struct drm_plane *plane,
 	 * unreference any previous framebuffers.
 	 */
 	mutex_lock(&vop->vsync_mutex);
-	if (fb != vop_win_last_pending_fb(vop_win)) {
-		ret = drm_vblank_get(plane->dev, vop->pipe);
-		if (ret) {
-			DRM_ERROR("failed to get vblank, %d\n", ret);
-			mutex_unlock(&vop->vsync_mutex);
-			return ret;
-		}
+	ret = drm_vblank_get(plane->dev, vop->pipe);
+	if (ret) {
+		DRM_ERROR("failed to get vblank, %d\n", ret);
+		mutex_unlock(&vop->vsync_mutex);
+		return ret;
+	}
 
-		drm_framebuffer_reference(fb);
+	drm_framebuffer_reference(fb);
 
-		ret = vop_win_queue_fb(vop_win, fb, yrgb_mst, event);
-		if (ret) {
-			drm_vblank_put(plane->dev, vop->pipe);
-			mutex_unlock(&vop->vsync_mutex);
-			return ret;
-		}
-
-		vop->vsync_work_pending = true;
+	ret = vop_win_queue_fb(vop_win, fb, yrgb_mst, event);
+	if (ret) {
+		drm_vblank_put(plane->dev, vop->pipe);
+		mutex_unlock(&vop->vsync_mutex);
+		return ret;
 	}
+
+	vop->vsync_work_pending = true;
 	mutex_unlock(&vop->vsync_mutex);
 
 	spin_lock(&vop->reg_lock);
-- 
2.5.0

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux