asahi: Do not leak staging resources for PIPE_MAP_READ
authorAsahi Lina <lina@asahilina.net>
Wed, 7 Dec 2022 09:33:46 +0000 (18:33 +0900)
committerMarge Bot <emma+marge@anholt.net>
Sat, 17 Dec 2022 18:10:28 +0000 (18:10 +0000)
commit331c2f4b7e48eb9cd451c3a9b27a664cb01d379a
treeae4d1471f7fd6cbd99c94d86a4b7fb3fb56b597f
parenteba2b182c8df20ce339997a72a96f82c3955b5b6
asahi: Do not leak staging resources for PIPE_MAP_READ

We were only dereferencing the resource in the PIPE_MAP_WRITE path of
agx_transfer_unmap, which means that read-only transfers leaked the
staging resource/BO. Always free the staging resource unconditionally.

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