drm/amd/display: fix array index out of bound error in DCN32 DML
authorAurabindo Pillai <aurabindo.pillai@amd.com>
Sat, 26 Nov 2022 00:13:41 +0000 (19:13 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 6 Dec 2022 15:17:13 +0000 (10:17 -0500)
[Why&How]
LinkCapacitySupport array is indexed with the number of voltage states and
not the number of max DPPs. Fix the error by changing the array
declaration to use the correct (larger) array size of total number of
voltage states.

Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.h

index d8a6b8e22504c75d810588c7eeca762829c58107..81e53e67cd0b025909bca4117ac90011bbded6b7 100644 (file)
@@ -1163,7 +1163,7 @@ struct vba_vars_st {
        double UrgBurstFactorLumaPre[DC__NUM_DPP__MAX];
        double UrgBurstFactorChromaPre[DC__NUM_DPP__MAX];
        bool NotUrgentLatencyHidingPre[DC__NUM_DPP__MAX];
-       bool LinkCapacitySupport[DC__NUM_DPP__MAX];
+       bool LinkCapacitySupport[DC__VOLTAGE_STATES];
        bool VREADY_AT_OR_AFTER_VSYNC[DC__NUM_DPP__MAX];
        unsigned int MIN_DST_Y_NEXT_START[DC__NUM_DPP__MAX];
        unsigned int VFrontPorch[DC__NUM_DPP__MAX];