asahi: Use a dynarray for writers
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Fri, 3 Mar 2023 19:22:08 +0000 (14:22 -0500)
committerMarge Bot <emma+marge@anholt.net>
Thu, 16 Mar 2023 20:42:01 +0000 (20:42 +0000)
commitc4aa7828b345a5c289b301a566488d2f080e0794
treef56bd054dd03ff774ed4bbe96f0d14f8d7499dd0
parent0cde42a506f400c17a7362d8707b61998e1ad03d
asahi: Use a dynarray for writers

We don't want a writer hash table with persistent pointers to resources, because
the resources could be freed without the hash table being updated (even though
the underlying BO will not be freed until it's ready). To avoid the reference
count hell, do away with the pointer hash table and instead use a flat dynarray
for mapping BO (handles) to writer (batch indices).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21620>
src/gallium/drivers/asahi/agx_batch.c
src/gallium/drivers/asahi/agx_pipe.c
src/gallium/drivers/asahi/agx_state.h