compositor-drm: don't keep trying if hw doesn't support cursors

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@ti.com>
diff --git a/src/compositor-drm.c b/src/compositor-drm.c
index 8ff7f3b..fc216bf 100644
--- a/src/compositor-drm.c
+++ b/src/compositor-drm.c
@@ -99,6 +99,8 @@
 	struct wl_list sprite_list;
 	int sprites_are_broken;
 
+	int cursors_are_broken;
+
 	uint32_t prev_state;
 };
 
@@ -736,6 +738,8 @@
 		return NULL;
 	if (es->output_mask != (1u << output_base->id))
 		return NULL;
+	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 NULL;
@@ -780,15 +784,20 @@
 
 		handle = gbm_bo_get_handle(bo).s32;
 		if (drmModeSetCursor(c->drm.fd,
-				     output->crtc_id, handle, 64, 64))
+				     output->crtc_id, handle, 64, 64)) {
 			weston_log("failed to set cursor: %m\n");
+			c->cursors_are_broken = 1;
+		}
 	}
 
 	x = es->geometry.x - output->base.x;
 	y = es->geometry.y - output->base.y;
 	if (output->cursor_plane.x != x || output->cursor_plane.y != y) {
-		if (drmModeMoveCursor(c->drm.fd, output->crtc_id, x, y))
+		if (drmModeMoveCursor(c->drm.fd, output->crtc_id, x, y)) {
 			weston_log("failed to move cursor: %m\n");
+			c->cursors_are_broken = 1;
+		}
+
 		output->cursor_plane.x = x;
 		output->cursor_plane.y = y;
 	}