mesa/st: release variants for active programs before unref
authorTapani Pälli <tapani.palli@intel.com>
Wed, 1 Apr 2020 09:08:41 +0000 (12:08 +0300)
committerTapani Pälli <tapani.palli@intel.com>
Mon, 6 Apr 2020 05:00:00 +0000 (08:00 +0300)
commit84e845c9696ab673f1d95fda47843028ed0c71a7
treeda5e37896d2eada77d6035f17f90790c608c869f
parent4822cc97007b0dae4d095c507efc182628510434
mesa/st: release variants for active programs before unref

Programs can be shared among many contexts and each program holds a
variant list which has context specific variants. When context gets
destroyed it must make sure it relases all variants, otherwise remaining
context that utilizes same program will attempt to save a zombie shader
for already deleted context when releasing program and its variants.

Fixes:
   dEQP-EGL.functional.sharing.gles2.program.render

and other flaky multihread dEQP-EGL failures.

v2: pass program pointer via & (Marek)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Cc: mesa-stable@lists.freedesktop.org
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4386>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4386>
src/mesa/state_tracker/st_context.c
src/mesa/state_tracker/st_program.c
src/mesa/state_tracker/st_program.h