From e1c2a304a01d24efa3d97db7fc233ae843a2433c Mon Sep 17 00:00:00 2001 From: Icenowy Zheng Date: Fri, 10 Apr 2026 16:55:14 +0800 Subject: [PATCH] pvr: wait for graphics jobs in CopyQueryPoolResults The last graphics job, which might write to the occlusion query result, could still be running when vkCmdCopyQueryPoolResults is called. Additionally wait for graphics jobs before copying the results. Fixes: 24b1e3946cc7 ("pvr: Add support to submit occlusion query sub cmds.") Signed-off-by: Icenowy Zheng Reviewed-by: Simon Perretta (cherry picked from commit 82925935d425b4465bcede519a671045fb58d098) Part-of: --- .pick_status.json | 2 +- src/imagination/vulkan/pvr_arch_cmd_query.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 411b698ee25..11a1ab4c97a 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -6464,7 +6464,7 @@ "description": "pvr: wait for graphics jobs in CopyQueryPoolResults", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "24b1e3946cc7e679a31aa07bd731464c900c1df7", "notes": null diff --git a/src/imagination/vulkan/pvr_arch_cmd_query.c b/src/imagination/vulkan/pvr_arch_cmd_query.c index 139089a60b4..308a9fc42ed 100644 --- a/src/imagination/vulkan/pvr_arch_cmd_query.c +++ b/src/imagination/vulkan/pvr_arch_cmd_query.c @@ -118,7 +118,7 @@ void PVR_PER_ARCH(CmdCopyQueryPoolResults)(VkCommandBuffer commandBuffer, cmd_buffer->state.current_sub_cmd->event = (struct pvr_sub_cmd_event){ .type = PVR_EVENT_TYPE_BARRIER, .barrier = { - .wait_for_stage_mask = PVR_PIPELINE_STAGE_TRANSFER_BIT, + .wait_for_stage_mask = PVR_PIPELINE_STAGE_ALL_GRAPHICS_BITS | PVR_PIPELINE_STAGE_TRANSFER_BIT, .wait_at_stage_mask = PVR_PIPELINE_STAGE_QUERY_BIT, }, }; @@ -138,7 +138,7 @@ void PVR_PER_ARCH(CmdCopyQueryPoolResults)(VkCommandBuffer commandBuffer, .type = PVR_EVENT_TYPE_BARRIER, .barrier = { .wait_for_stage_mask = PVR_PIPELINE_STAGE_QUERY_BIT, - .wait_at_stage_mask = PVR_PIPELINE_STAGE_TRANSFER_BIT, + .wait_at_stage_mask = PVR_PIPELINE_STAGE_ALL_GRAPHICS_BITS | PVR_PIPELINE_STAGE_TRANSFER_BIT, }, }; }