panvk: fix a NULL pointer dereference in occlusion queries

If a meta operation (like a blit or clear) happens while occlusion
queries are active, we temporarily disable the query. Unfortunately
the code for this did not clear out the `syncobj` field. In rare
combinations of circumstances this could cause an attempt to issue
a write back of the occlusion query values, and since we've zeroed
the `ptr` field it writes to a NULL value, causing a bus fault and
device lost error.

Fixes: 61534faf4e ("panvk: Wire occlusion queries to internals")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36525>
This commit is contained in:
Eric R. Smith 2025-08-01 16:04:45 -03:00 committed by Marge Bot
parent 2d691d7dd3
commit 24c692c981

View file

@ -119,6 +119,9 @@ panvk_per_arch(cmd_meta_gfx_start)(
save_ctx->occlusion_query = cmdbuf->state.gfx.occlusion_query;
/* Ensure occlusion queries are disabled */
#if PAN_ARCH >= 10
cmdbuf->state.gfx.occlusion_query.syncobj = 0;
#endif
cmdbuf->state.gfx.occlusion_query.ptr = 0;
cmdbuf->state.gfx.occlusion_query.mode = MALI_OCCLUSION_MODE_DISABLED;
gfx_state_set_dirty(cmdbuf, OQ);