From fa0abe9510ad2bd8659a693029dfa28e4c31a133 Mon Sep 17 00:00:00 2001 From: Icenowy Zheng Date: Wed, 8 Apr 2026 00:27:38 +0800 Subject: [PATCH] pvr: fix pvr_clear_vdm_state_get_size_in_dw() inverted feature condition The pvr_clear_vdm_state_get_size_in_dw() wrongly think instance count inputs are needed when doing RTA clear for cores without the gs_rta_support feature. However, the instance ID is exploited to output the target layer ID, which isn't supported at all for cores w/o that feature, so it looks that the condition is inverted. In addition, the pvr_pack_clear_vdm_state() function seems to have similar logic deciding whether to emit instance_count, and the logic is opposite to the logic in pvr_clear_vdm_state_get_size_in_dw() for the part checking the gs_rta_support feature. Invert the condition to take instance ID inputs for cores with the gs_rta_support feature instead of those without this feature. Fixes: b59eb30e8860 ("pvr: Fix cs corruption in pvr_pack_clear_vdm_state()") Signed-off-by: Icenowy Zheng Reviewed-by: Luigi Santivetti (cherry picked from commit 3db93bbf344340f61ff2ba30c172129703477ce2) Part-of: --- .pick_status.json | 2 +- src/imagination/vulkan/pvr_clear.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 0a46b318698..891d9b40ad2 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -3154,7 +3154,7 @@ "description": "pvr: fix pvr_clear_vdm_state_get_size_in_dw() inverted feature condition", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "b59eb30e8860a8bd40ba8747194ff91e27d1812c", "notes": null diff --git a/src/imagination/vulkan/pvr_clear.h b/src/imagination/vulkan/pvr_clear.h index 0c3ab67790a..faa8bb1e029 100644 --- a/src/imagination/vulkan/pvr_clear.h +++ b/src/imagination/vulkan/pvr_clear.h @@ -194,7 +194,7 @@ pvr_clear_vdm_state_get_size_in_dw(const struct pvr_device_info *const dev_info, pvr_cmd_length(VDMCTRL_INDEX_LIST2); const bool needs_instance_count = - !PVR_HAS_FEATURE(dev_info, gs_rta_support) && layer_count > 1; + PVR_HAS_FEATURE(dev_info, gs_rta_support) && layer_count > 1; if (needs_instance_count) size_in_dw += pvr_cmd_length(VDMCTRL_INDEX_LIST3);