[PATCH weston] compositor-drm: don't keep trying if hw doesn't support cursors

Rob Clark rob.clark at linaro.org
Thu Aug 9 11:24:45 PDT 2012


From: Rob Clark <rob at ti.com>

Not all hw supports hw cursors.  Similar to the case with sprites, if
the driver does not support it, don't keep trying and spamming the log
with error messages.

Signed-off-by: Rob Clark <rob at ti.com>
---
 src/compositor-drm.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/compositor-drm.c b/src/compositor-drm.c
index 32949cf..235beaf 100644
--- a/src/compositor-drm.c
+++ b/src/compositor-drm.c
@@ -77,6 +77,8 @@ struct drm_compositor {
 	struct wl_list sprite_list;
 	int sprites_are_broken;
 
+	int cursors_are_broken;
+
 	uint32_t prev_state;
 };
 
@@ -688,6 +690,8 @@ drm_output_set_cursor(struct weston_output *output_base,
 		return;
 	if (es->output_mask != (1u << output_base->id))
 		return;
+	if (c->cursors_are_broken)
+		return;
 	if (es->buffer == NULL || !wl_buffer_is_shm(es->buffer) ||
 	    es->geometry.width > 64 || es->geometry.height > 64)
 		return;
@@ -709,6 +713,7 @@ drm_output_set_cursor(struct weston_output *output_base,
 		if (drmModeSetCursor(c->drm.fd,
 				     output->crtc_id, handle, 64, 64)) {
 			weston_log("failed to set cursor: %m\n");
+			c->cursors_are_broken = 1;
 			return;
 		}
 	}
@@ -718,6 +723,7 @@ drm_output_set_cursor(struct weston_output *output_base,
 	if (output->cursor_x != x || output->cursor_y != y) {
 		if (drmModeMoveCursor(c->drm.fd, output->crtc_id, x, y)) {
 			weston_log("failed to move cursor: %m\n");
+			c->cursors_are_broken = 1;
 			return;
 		}
 		output->cursor_x = x;
-- 
1.7.9.5



More information about the wayland-devel mailing list