summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2012-01-18 15:11:07 -0500
committerKristian Høgsberg <krh@bitplanet.net>2012-01-18 15:21:28 -0500
commit6916d9cb6f9cba8742b953847ea665a44bc0ab30 (patch)
treeb897ffceaa7b5781f99a06554d7e26f58e5eab03
parent2d5743959278a12347f92cc389905dfb5bf39ee6 (diff)
downloadweston-6916d9cb6f9cba8742b953847ea665a44bc0ab30.tar.gz
drm: Don't print warning if cursor stride isn't right
gbm_bo_create_from_egl_image() should catch this based on the GBM_BO_USE_CURSOR_64X64 flag. It currently doesn't so we end up with a cursor buffer with invalid stride.
-rw-r--r--src/compositor-drm.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/compositor-drm.c b/src/compositor-drm.c
index 063feaaf..1f30e7b6 100644
--- a/src/compositor-drm.c
+++ b/src/compositor-drm.c
@@ -229,16 +229,18 @@ drm_output_set_cursor(struct weston_output *output_base,
c->base.display,
eid->sprite->image, 64, 64,
GBM_BO_USE_CURSOR_64X64);
+ /* Not suitable for hw cursor, fall back */
+ if (bo == NULL)
+ goto out;
handle = gbm_bo_get_handle(bo).s32;
stride = gbm_bo_get_pitch(bo);
-
gbm_bo_destroy(bo);
- if (stride != 64 * 4) {
- fprintf(stderr, "info: cursor stride is != 64\n");
+ /* gbm_bo_create_from_egl_image() didn't always validate the usage
+ * flags, and in that case we might end up with a bad stride. */
+ if (stride != 64 * 4)
goto out;
- }
ret = drmModeSetCursor(c->drm.fd, output->crtc_id, handle, 64, 64);
if (ret) {