From 91029b7e87bba2a28aeb202cdf920d6ec6a70fa7 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Thu, 17 Aug 2023 01:22:50 +0200 Subject: [PATCH] nouveau: take glsl_type ref unconditionally Calling into tgsi_to_nir requires it, which we are running into with vdpau and potential other state-trackers still handing us TGSIs over. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9481 Fixes: 5889c13fcd4 ("nv50,nvc0: Use ttn for tgsi shaders by default") Signed-off-by: Karol Herbst Reviewed-by: M Henning Part-of: --- src/gallium/drivers/nouveau/nouveau_screen.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/gallium/drivers/nouveau/nouveau_screen.c b/src/gallium/drivers/nouveau/nouveau_screen.c index ed5759231ea..22924204514 100644 --- a/src/gallium/drivers/nouveau/nouveau_screen.c +++ b/src/gallium/drivers/nouveau/nouveau_screen.c @@ -296,9 +296,6 @@ nouveau_screen_init(struct nouveau_screen *screen, struct nouveau_device *dev) nouveau_mesa_debug = atoi(nv_dbg); screen->force_enable_cl = debug_get_bool_option("NOUVEAU_ENABLE_CL", false); - if (screen->force_enable_cl) - glsl_type_singleton_init_or_ref(); - screen->disable_fences = debug_get_bool_option("NOUVEAU_DISABLE_FENCES", false); /* These must be set before any failure is possible, as the cleanup @@ -444,6 +441,9 @@ nouveau_screen_init(struct nouveau_screen *screen, struct nouveau_device *dev) NOUVEAU_BO_GART | NOUVEAU_BO_MAP, &mm_config); screen->mm_VRAM = nouveau_mm_create(dev, NOUVEAU_BO_VRAM, &mm_config); + + glsl_type_singleton_init_or_ref(); + return 0; err: @@ -457,8 +457,7 @@ nouveau_screen_fini(struct nouveau_screen *screen) { int fd = screen->drm->fd; - if (screen->force_enable_cl) - glsl_type_singleton_decref(); + glsl_type_singleton_decref(); if (screen->has_svm) os_munmap(screen->svm_cutout, screen->svm_cutout_size);