[PATCH weston] compositor-drm: Fix disabling cursor plane

Derek Foreman derekf at osg.samsung.com
Thu Apr 13 19:02:00 UTC 2017


commit a7cba1d4cd4c9013c3ac6cb074fcb7842fb39283 changed the way
the cursor plane is setup.  Previously it was pre-emptively set
disabled for the next frame, and that would be changed at next
frame time if the cursor plane was to be used.  It was changed
to be disabled at plane assignment time.

We disable the use of planes entirely by setting disable_planes to
a non-zero value, which bypasses all calls to assign_planes - so
if the plane was set-up in the previous frame it will retain its
state post-disable.

This leads to desktop zoom leaving the cursor plane in place when
it sets disable_planes.

This patch partially reverts a7cba1d4cd4c9013c3ac6cb074fcb7842fb39283
and returns the behaviour setting the cursor view to be disabled for
the next render.

Signed-off-by: Derek Foreman <derekf at osg.samsung.com>
---

This is a bit of a quick fix for the problem while ignoring any
implications it might have for the atomic plane series.  I haven't
read enough of that code to see if we'll end up leaving *all* planes
on at the point of setting disable_planes (for a zoom, or a screenshot
or whatever)

 libweston/compositor-drm.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
index 707ef7ab..5857de17 100644
--- a/libweston/compositor-drm.c
+++ b/libweston/compositor-drm.c
@@ -1436,8 +1436,17 @@ drm_output_set_cursor(struct drm_output *output)
 	struct gbm_bo *bo;
 	float x, y;
 
+	/* We reset this to NULL now in case the next render has
+	 * disable_planes set, which avoids any other code path
+	 * that results in clearing the view.
+	 * Otherwise, using desktop zoom will leave the hardware
+	 * cursor in place.
+	 */
+	output->cursor_view = NULL;
 	if (ev == NULL) {
 		drmModeSetCursor(b->drm.fd, output->crtc_id, 0, 0, 0);
+		output->cursor_plane.x = INT32_MIN;
+		output->cursor_plane.y = INT32_MIN;
 		return;
 	}
 
-- 
2.11.0



More information about the wayland-devel mailing list