From 21e3dc3b5a576d38b549716bda0a6b34612e1f1f Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Mon, 4 Oct 2021 09:36:23 +0200 Subject: xwayland: Set GLVND driver based on GBM backend name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With the GBM backend becoming usable with different drivers such as NVIDIA, set the GLVND vendor to the same value as the GBM backend name. Mesa implementation however returns "drm" so we need to special case this value - Basically, for anything other than "drm" we simply assume that the GBM backend name is the same as the vendor. Signed-off-by: Olivier Fourdan Reviewed-by: Michel Dänzer Reviewed-by: James Jones Tested-by: James Jones (cherry picked from commit 5daf42b48924b1e93d4fe40e600c42ae9835712f) --- hw/xwayland/xwayland-glamor-gbm.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/xwayland/xwayland-glamor-gbm.c b/hw/xwayland/xwayland-glamor-gbm.c index 386266a4e..466a1b052 100644 --- a/hw/xwayland/xwayland-glamor-gbm.c +++ b/hw/xwayland/xwayland-glamor-gbm.c @@ -938,6 +938,7 @@ xwl_glamor_gbm_init_egl(struct xwl_screen *xwl_screen) struct xwl_gbm_private *xwl_gbm = xwl_gbm_get(xwl_screen); EGLint major, minor; const GLubyte *renderer; + const char *gbm_backend_name; if (!xwl_gbm->fd_render_node && !xwl_gbm->drm_authenticated) { ErrorF("Failed to get wl_drm, disabling Glamor and DRI3\n"); @@ -989,6 +990,11 @@ xwl_glamor_gbm_init_egl(struct xwl_screen *xwl_screen) "EXT_image_dma_buf_import_modifiers")) xwl_gbm->dmabuf_capable = TRUE; + gbm_backend_name = gbm_device_get_backend_name(xwl_gbm->gbm); + /* Mesa uses "drm" as backend name, in that case, just do nothing */ + if (gbm_backend_name && strcmp(gbm_backend_name, "drm") != 0) + xwl_screen->glvnd_vendor = gbm_backend_name; + return TRUE; error: if (xwl_screen->egl_display != EGL_NO_DISPLAY) { -- cgit v1.2.1