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>
dev
Rob Clark 13 years ago committed by Kristian Høgsberg
parent 4339add9e9
commit ab5b1e3149
  1. 13
      src/compositor-drm.c

@ -99,6 +99,8 @@ struct drm_compositor {
struct wl_list sprite_list; struct wl_list sprite_list;
int sprites_are_broken; int sprites_are_broken;
int cursors_are_broken;
uint32_t prev_state; uint32_t prev_state;
}; };
@ -736,6 +738,8 @@ drm_output_prepare_cursor_surface(struct weston_output *output_base,
return NULL; return NULL;
if (es->output_mask != (1u << output_base->id)) if (es->output_mask != (1u << output_base->id))
return NULL; return NULL;
if (c->cursors_are_broken)
return;
if (es->buffer == NULL || !wl_buffer_is_shm(es->buffer) || if (es->buffer == NULL || !wl_buffer_is_shm(es->buffer) ||
es->geometry.width > 64 || es->geometry.height > 64) es->geometry.width > 64 || es->geometry.height > 64)
return NULL; return NULL;
@ -780,15 +784,20 @@ drm_output_set_cursor(struct drm_output *output)
handle = gbm_bo_get_handle(bo).s32; handle = gbm_bo_get_handle(bo).s32;
if (drmModeSetCursor(c->drm.fd, 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"); weston_log("failed to set cursor: %m\n");
c->cursors_are_broken = 1;
}
} }
x = es->geometry.x - output->base.x; x = es->geometry.x - output->base.x;
y = es->geometry.y - output->base.y; y = es->geometry.y - output->base.y;
if (output->cursor_plane.x != x || output->cursor_plane.y != 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"); weston_log("failed to move cursor: %m\n");
c->cursors_are_broken = 1;
}
output->cursor_plane.x = x; output->cursor_plane.x = x;
output->cursor_plane.y = y; output->cursor_plane.y = y;
} }

Loading…
Cancel
Save