freedreno/drm: Start prying apart table_lock
authorRob Clark <robdclark@chromium.org>
Thu, 8 Dec 2022 22:35:28 +0000 (14:35 -0800)
committerMarge Bot <emma+marge@anholt.net>
Sat, 17 Dec 2022 19:14:12 +0000 (19:14 +0000)
commit75a4d902806d9a947924267efdfeb65b3ba4532a
tree9b7674127ba43dd2bd031fbf077b8164e23a6b88
parent2ee7012c2c664cedf94eb0b49b0eb5dd4f0bdfd9
freedreno/drm: Start prying apart table_lock

We want to get back to the point where table_lock is only doing what
it's named for (ie. protecting handle/name tables).  This is the first
step.  Add new locks to protect fencing and the bo caches.  A single
global lock for fences, to avoid atomic instructions in the loop per
submit bo attaching fences.

This couldn't be broken appart into different commits, otherwise there
would have been an ABBA deadlock in BO cache's call to fd_bo_state()
to check if a BO is idle.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
src/freedreno/drm/freedreno_bo.c
src/freedreno/drm/freedreno_bo_cache.c
src/freedreno/drm/freedreno_device.c
src/freedreno/drm/freedreno_pipe.c
src/freedreno/drm/freedreno_priv.h
src/freedreno/drm/freedreno_ringbuffer_sp.c
src/freedreno/drm/msm/msm_ringbuffer.c