freedreno: Protect gmem_cache ralloc allocations
authorRob Clark <robdclark@chromium.org>
Mon, 9 Nov 2020 22:11:09 +0000 (14:11 -0800)
committerMarge Bot <eric+marge@anholt.net>
Tue, 10 Nov 2020 17:58:45 +0000 (17:58 +0000)
commitcb034ae44f4a1f3ed036ba71fc42746efb4cd775
treeb0665098faa583b2eff12f7cb79a03569a4e27c1
parent13d509c7e66439e3e85d24f3326c037a47d0ffc5
freedreno: Protect gmem_cache ralloc allocations

Since the ralloc context for cache_key allocation is shared between all
the contexts hanging off a screen, we need to allocate the key under the
screen->lock.

Fixes: 91f9bb99c5e ("freedreno: add gmem state cache")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7342>
src/gallium/drivers/freedreno/freedreno_gmem.c