pan/decode: handle more than one panfrost_device
authorItalo Nicola <italonicola@collabora.com>
Thu, 13 Jul 2023 12:13:19 +0000 (12:13 +0000)
committerMarge Bot <emma+marge@anholt.net>
Mon, 14 Aug 2023 22:41:10 +0000 (22:41 +0000)
commit56be9a55be03cce9925989e7d22696733488e05b
tree54ae21598fdf1d00a39620f79cb3f93db6cfca4b
parentcea0cc5b1631874ebc077c25df61975bf1336e3a
pan/decode: handle more than one panfrost_device

Before this commit, if an application tried to create more than one
panfrost_device, such as piglit's "ext_image_dma_buf_import" tests,
it would result in a crash when running with PAN_MESA_DEBUG=sync or
PAN_MESA_DEBUG=trace.

This commit fixes that by introducing a pandecode_context, which
encapsulates all the information that is being tracked, and thus
avoiding memory conflicts.

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24144>
14 files changed:
src/gallium/drivers/panfrost/pan_context.c
src/gallium/drivers/panfrost/pan_job.c
src/gallium/drivers/panfrost/pan_resource.c
src/panfrost/lib/genxml/decode.c
src/panfrost/lib/genxml/decode.h
src/panfrost/lib/genxml/decode_common.c
src/panfrost/lib/genxml/decode_csf.c
src/panfrost/lib/genxml/decode_jm.c
src/panfrost/lib/pan_bo.c
src/panfrost/lib/pan_device.h
src/panfrost/lib/pan_props.c
src/panfrost/lib/wrap.h
src/panfrost/tools/panfrostdump.c
src/panfrost/vulkan/panvk_vX_device.c