Skip to contentSkip to conversation

drm/amd/display: fix array index out of bound error in DCN32 DML

PATCH In review Aurabindo Pillai 2 participants 2 messages Dec 5, 2022

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

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.

---
 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
index d46aa4817e70..8a67f4d65d82 100644
@@ -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
Reviewed-by on v1 1/1
#1 lore raw
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.

---
  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
index d46aa4817e70..8a67f4d65d82 100644

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];