summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2015-01-22 16:36:23 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-01-22 19:33:17 +0100
commit9e4400077d3979db65eb79cdc494d1d76e500593 (patch)
tree8e019558e5f24f8f300584fba16dd644c270cdc1
parent35b219a1ca6ac3a89ee06dae5b4e73900eeab94c (diff)
drm/atomic-helpers: Recover full cursor plane behaviour
Cursor plane updates have historically been fully async and mutliple updates batched together for the next vsync. And userspace relies upon that. Since implementing a full queue of async atomic updates is a bit of work lets just recover the cursor specific behaviour with a hint flag and some hacks to drop the vblank wait. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
-rw-r--r--drivers/gpu/drm/drm_atomic_helper.c11
-rw-r--r--include/drm/drm_crtc.h2
2 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index f693344d9573..6c47acb93249 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -909,6 +909,11 @@ drm_atomic_helper_wait_for_vblanks(struct drm_device *dev,
if (!crtc->state->enable)
continue;
+ /* Legacy cursor ioctls are completely unsynced, and userspace
+ * relies on that (by doing tons of cursor updates). */
+ if (old_state->legacy_cursor_update)
+ continue;
+
if (!framebuffer_changed(dev, old_state, crtc))
continue;
@@ -1335,6 +1340,9 @@ retry:
if (ret != 0)
goto fail;
+ if (plane == crtc->cursor)
+ state->legacy_cursor_update = true;
+
/* Driver takes ownership of state on successful commit. */
return 0;
fail:
@@ -1410,6 +1418,9 @@ retry:
plane_state->src_h = 0;
plane_state->src_w = 0;
+ if (plane == plane->crtc->cursor)
+ state->legacy_cursor_update = true;
+
ret = drm_atomic_commit(state);
if (ret != 0)
goto fail;
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 093577005af6..15003ba00152 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -905,6 +905,7 @@ struct drm_bridge {
* struct struct drm_atomic_state - the global state object for atomic updates
* @dev: parent DRM device
* @allow_modeset: allow full modeset
+ * @allow_modeset: hint to enforce legacy cursor ioctl semantics
* @planes: pointer to array of plane pointers
* @plane_states: pointer to array of plane states pointers
* @crtcs: pointer to array of CRTC pointers
@@ -917,6 +918,7 @@ struct drm_bridge {
struct drm_atomic_state {
struct drm_device *dev;
bool allow_modeset : 1;
+ bool legacy_cursor_update : 1;
struct drm_plane **planes;
struct drm_plane_state **plane_states;
struct drm_crtc **crtcs;