From fdebbc60d89cdc1b3353424b6568b25a61dcf372 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Corentin=20No=C3=ABl?= Date: Mon, 1 Aug 2022 16:03:38 +0200 Subject: [PATCH] glamor: Only check for llvmpipe renderer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The virgl driver exposes the name of the host renderer which might be llvmpipe. In this case we still need glamor to be initialized. Only check if the renderer starts with llvmpipe (which is what llvmpipe exposes). Signed-off-by: Corentin Noël Reviewed-by: Adam Jackson --- glamor/glamor_egl.c | 2 +- hw/xwayland/xwayland-glamor-gbm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c index aa82a5608..e2a2a1050 100644 --- a/glamor/glamor_egl.c +++ b/glamor/glamor_egl.c @@ -1080,7 +1080,7 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd) "glGetString() returned NULL, your GL is broken\n"); goto error; } - if (strstr((const char *)renderer, "llvmpipe")) { + if (!strncmp("llvmpipe", (const char *)renderer, strlen("llvmpipe"))) { if (scrn->confScreen->num_gpu_devices) xf86DrvMsg(scrn->scrnIndex, X_INFO, "Allowing glamor on llvmpipe for PRIME\n"); diff --git a/hw/xwayland/xwayland-glamor-gbm.c b/hw/xwayland/xwayland-glamor-gbm.c index ec5514fd2..5e2c618ab 100644 --- a/hw/xwayland/xwayland-glamor-gbm.c +++ b/hw/xwayland/xwayland-glamor-gbm.c @@ -1030,7 +1030,7 @@ xwl_glamor_gbm_init_egl(struct xwl_screen *xwl_screen) ErrorF("glGetString() returned NULL, your GL is broken\n"); goto error; } - if (strstr((const char *)renderer, "llvmpipe")) { + if (!strncmp("llvmpipe", (const char *)renderer, strlen("llvmpipe"))) { ErrorF("Refusing to try glamor on llvmpipe\n"); goto error; }