diff options
author | Tony Crisci <tony@dubstepdish.com> | 2017-07-27 15:57:29 -0400 |
---|---|---|
committer | Tony Crisci <tony@dubstepdish.com> | 2017-07-27 17:55:35 -0400 |
commit | d822e0768bb90c959bc9e59aa0e2cb6945ab839a (patch) | |
tree | 8b75d1647557234a632b4dfb9de8e340f5fda44d | |
parent | b1ec0dce3a8c5def94e497dd8b16f59a2038c0ed (diff) |
Use ARGB8888 pixel format for cursor bo
The previous pixel format (RGBA8888) is not supported on all devices for cursors.
Weston uses ARGB8888 exclusively for its cursor buffer object which leads me to
believe this pixel format is better supported.
-rw-r--r-- | backend/drm/drm.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c index bba3a390..6e969788 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -304,6 +304,13 @@ static bool wlr_drm_output_set_cursor(struct wlr_output_state *output, return true; } + if (!gbm_device_is_format_supported(state->renderer.gbm, + GBM_FORMAT_ARGB8888, GBM_BO_USE_CURSOR | GBM_BO_USE_WRITE)) { + wlr_log(L_ERROR, "Failed to create cursor bo: ARGB8888 pixel format is " + "unsupported on this device"); + return false; + } + uint64_t bo_width, bo_height; int ret; @@ -323,7 +330,7 @@ static bool wlr_drm_output_set_cursor(struct wlr_output_state *output, } output->cursor_bo[i] = gbm_bo_create(state->renderer.gbm, bo_width, bo_height, - GBM_FORMAT_RGBA8888, GBM_BO_USE_CURSOR | GBM_BO_USE_WRITE); + GBM_FORMAT_ARGB8888, GBM_BO_USE_CURSOR | GBM_BO_USE_WRITE); if (!output->cursor_bo[i]) { wlr_log(L_ERROR, "Failed to create cursor bo"); |