summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2023-02-01 15:40:24 +0100
committerOlivier Fourdan <fourdan@gmail.com>2023-02-13 13:26:59 +0000
commit5aebc0109611fb78ea040e386273c15d604087f3 (patch)
tree92671bbd83546b73c58b47d407cddfc690751cc7
parentd01a075d595522aa30043ede5d3a4824b41d24f2 (diff)
downloadxserver-5aebc0109611fb78ea040e386273c15d604087f3.tar.gz
xwayland: fix GBM on driver without explicit modifiers
Some drivers (e.g. AMD GFX8-) don't support explicit format modifiers. On these drivers, gbm_bo_create_with_modifiers() will fail. This results in "Error getting buffer" in the logs later on with all X11 windows staying invisible. Fallback to the modifier-less API gbm_bo_create() in that case. Signed-off-by: Simon Ser <contact@emersion.fr>
-rw-r--r--hw/xwayland/xwayland-glamor-gbm.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/hw/xwayland/xwayland-glamor-gbm.c b/hw/xwayland/xwayland-glamor-gbm.c
index 205d2feb3..3984d0b38 100644
--- a/hw/xwayland/xwayland-glamor-gbm.c
+++ b/hw/xwayland/xwayland-glamor-gbm.c
@@ -278,7 +278,7 @@ xwl_glamor_gbm_create_pixmap(ScreenPtr screen,
{
struct xwl_screen *xwl_screen = xwl_screen_get(screen);
struct xwl_gbm_private *xwl_gbm = xwl_gbm_get(xwl_screen);
- struct gbm_bo *bo;
+ struct gbm_bo *bo = NULL;
PixmapPtr pixmap = NULL;
if (width > 0 && height > 0 && depth >= 15 &&
@@ -297,9 +297,8 @@ xwl_glamor_gbm_create_pixmap(ScreenPtr screen,
format, modifiers, num_modifiers);
free(modifiers);
}
- else
#endif
- {
+ if (bo == NULL) {
bo = gbm_bo_create(xwl_gbm->gbm, width, height, format,
GBM_BO_USE_RENDERING);
}