From 3db93bbf344340f61ff2ba30c172129703477ce2 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 Part-of: --- src/imagination/vulkan/pvr_clear.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);