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: 5889c13fcd ("nv50,nvc0: Use ttn for tgsi shaders by default")
Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: M Henning <drawoc@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24740>
(cherry picked from commit 91029b7e87)
This commit is contained in:
Karol Herbst 2023-08-17 01:22:50 +02:00 committed by Dylan Baker
parent 6865c117ab
commit 145db78fe2
2 changed files with 5 additions and 6 deletions

View file

@ -6774,7 +6774,7 @@
"description": "nouveau: take glsl_type ref unconditionally",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "5889c13fcd46ef984ea0acc02bdf68a7ef552924",
"notes": null

View file

@ -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);