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

Derek Foreman derekf at osg.samsung.com
Thu Apr 13 20:11:57 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 clears any stale cursor plane state from the redraw
handler if disable_planes is set so drm_output_set_cursor()
will do the right thing.

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

Difference from v1:
Do the clear in drm_output_repaint instead of back in
drm_output_set_cursor()

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

diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
index 707ef7ab..10adb463 100644
--- a/libweston/compositor-drm.c
+++ b/libweston/compositor-drm.c
@@ -865,6 +865,16 @@ drm_output_repaint(struct weston_output *output_base,
 
 	assert(!output->fb_last);
 
+	/* If disable_planes is set then assign_planes() wasn't
+	 * called for this render, so we could still have a stale
+	 * cursor plane set up.
+	 */
+	if (output->base.disable_planes) {
+		output->cursor_view = NULL;
+		output->cursor_plane.x = INT32_MIN;
+		output->cursor_plane.y = INT32_MIN;
+	}
+
 	drm_output_render(output, damage);
 	if (!output->fb_pending)
 		return -1;
-- 
2.11.0



More information about the wayland-devel mailing list