drm/amd/display: fix array index out of bound error in DCN32 DML
PATCH 1/1 drm/amd/display: fix array index out of bound error in DCN32 DML
[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 <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.h +1 -1
@@ -1162,7 +1162,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 ];
Signature · 1 line
2.38.1
Quoted 16 lines · Aurabindo Pillai
[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 <[email protected]>--- drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.h +0
-0
drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.h struct vba_vars_st { · line 1168
Quoted 8 lines
drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.h +1
-1@@ -1162,7 +1162,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 ];
Reviewed-by Rodrigo Siqueira <[email protected]>