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>