asahi: Do not use memctx for pools / meta cache
authorAsahi Lina <lina@asahilina.net>
Wed, 15 Feb 2023 10:46:37 +0000 (19:46 +0900)
committerMarge Bot <emma+marge@anholt.net>
Wed, 15 Feb 2023 22:16:51 +0000 (22:16 +0000)
commit6ad64387dd065560035917a898e036af35b90da5
treed67dca42d3e5c82191f2cd78b342fd4e86491f8a
parent9daaa9e44e087de416fb78630b993af30ac67014
asahi: Do not use memctx for pools / meta cache

ralloc is not thread-safe, so we can't use dev->memctx for allocating
context-specific things without locking. On top of that, we always
need to explicitly clean up pools anyway since we need to unref the BOs,
so there is no point to using a memctx.

And since pools need to be explicitly cleaned up, the meta cache code
needs explicit cleanup, so add that and drop memctx from there too.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21348>
src/asahi/lib/agx_meta.c
src/asahi/lib/agx_meta.h
src/asahi/lib/pool.c
src/gallium/drivers/asahi/agx_pipe.c