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: b59eb30e88 ("pvr: Fix cs corruption in pvr_pack_clear_vdm_state()")
Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Reviewed-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
(cherry picked from commit 3db93bbf34)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40979>
This commit is contained in:
Icenowy Zheng 2026-04-08 00:27:38 +08:00 committed by Eric Engestrom
parent eb4618b1b5
commit fa0abe9510
2 changed files with 2 additions and 2 deletions

View file

@ -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

View file

@ -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);