Commit ab5b1e31 authored by Rob Clark's avatar Rob Clark Committed by Kristian H. Kristensen

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: default avatarRob Clark <rob@ti.com>
parent 4339add9
......@@ -99,6 +99,8 @@ struct drm_compositor {
struct wl_list sprite_list;
int sprites_are_broken;
int cursors_are_broken;
uint32_t prev_state;
};
......@@ -736,6 +738,8 @@ drm_output_prepare_cursor_surface(struct weston_output *output_base,
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 @@ drm_output_set_cursor(struct drm_output *output)
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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment