Skip to content

Commit c4be0ac

Browse files
nathanchancealexdeucher
authored andcommitted
drm/amd/display: Reduce number of arguments of dml32_CalculateWatermarksMALLUseAndDRAMSpeedChangeSupport()
Most of the arguments are identical between the two call sites and they can be accessed through the 'struct vba_vars_st' pointer created at the top of dml32_ModeSupportAndSystemConfigurationFull(). This reduces the total amount of stack space that dml32_ModeSupportAndSystemConfigurationFull() uses by 216 bytes with LLVM 16 (2152 -> 1936), helping clear up the following clang warning: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn32/display_mode_vba_32.c:1721:6: error: stack frame size (2152) exceeds limit (2048) in 'dml32_ModeSupportAndSystemConfigurationFull' [-Werror,-Wframe-larger-than] void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_lib) ^ 1 error generated. Additionally, while modifying the arguments to dml32_CalculateWatermarksMALLUseAndDRAMSpeedChangeSupport(), use 'v' consistently, instead of 'v' mixed with 'mode_lib->vba'. Link: ClangBuiltLinux#1681 Reported-by: "Sudip Mukherjee (Codethink)" <[email protected]> Tested-by: Maíra Canal <[email protected]> Reviewed-by: Rodrigo Siqueira <[email protected]> Signed-off-by: Nathan Chancellor <[email protected]> Signed-off-by: Rodrigo Siqueira <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent d978c51 commit c4be0ac

File tree

3 files changed

+140
-259
lines changed

3 files changed

+140
-259
lines changed

drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c

Lines changed: 29 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,58 +1163,28 @@ static void DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerforman
11631163
v->dummy_vars.DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation.mmSOCParameters.SMNLatency = mode_lib->vba.SMNLatency;
11641164

11651165
dml32_CalculateWatermarksMALLUseAndDRAMSpeedChangeSupport(
1166-
mode_lib->vba.USRRetrainingRequiredFinal,
1167-
mode_lib->vba.UsesMALLForPStateChange,
1168-
mode_lib->vba.PrefetchModePerState[mode_lib->vba.VoltageLevel][mode_lib->vba.maxMpcComb],
1169-
mode_lib->vba.NumberOfActiveSurfaces,
1170-
mode_lib->vba.MaxLineBufferLines,
1171-
mode_lib->vba.LineBufferSizeFinal,
1172-
mode_lib->vba.WritebackInterfaceBufferSize,
1173-
mode_lib->vba.DCFCLK,
1174-
mode_lib->vba.ReturnBW,
1175-
mode_lib->vba.SynchronizeTimingsFinal,
1176-
mode_lib->vba.SynchronizeDRRDisplaysForUCLKPStateChangeFinal,
1177-
mode_lib->vba.DRRDisplay,
1178-
v->dpte_group_bytes,
1179-
v->meta_row_height,
1180-
v->meta_row_height_chroma,
1166+
v,
1167+
v->PrefetchModePerState[v->VoltageLevel][v->maxMpcComb],
1168+
v->DCFCLK,
1169+
v->ReturnBW,
11811170
v->dummy_vars.DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation.mmSOCParameters,
1182-
mode_lib->vba.WritebackChunkSize,
1183-
mode_lib->vba.SOCCLK,
1171+
v->SOCCLK,
11841172
v->DCFCLKDeepSleep,
1185-
mode_lib->vba.DETBufferSizeY,
1186-
mode_lib->vba.DETBufferSizeC,
1187-
mode_lib->vba.SwathHeightY,
1188-
mode_lib->vba.SwathHeightC,
1189-
mode_lib->vba.LBBitPerPixel,
1173+
v->DETBufferSizeY,
1174+
v->DETBufferSizeC,
1175+
v->SwathHeightY,
1176+
v->SwathHeightC,
11901177
v->SwathWidthY,
11911178
v->SwathWidthC,
1192-
mode_lib->vba.HRatio,
1193-
mode_lib->vba.HRatioChroma,
1194-
mode_lib->vba.vtaps,
1195-
mode_lib->vba.VTAPsChroma,
1196-
mode_lib->vba.VRatio,
1197-
mode_lib->vba.VRatioChroma,
1198-
mode_lib->vba.HTotal,
1199-
mode_lib->vba.VTotal,
1200-
mode_lib->vba.VActive,
1201-
mode_lib->vba.PixelClock,
1202-
mode_lib->vba.BlendingAndTiming,
1203-
mode_lib->vba.DPPPerPlane,
1179+
v->DPPPerPlane,
12041180
v->BytePerPixelDETY,
12051181
v->BytePerPixelDETC,
12061182
v->DSTXAfterScaler,
12071183
v->DSTYAfterScaler,
1208-
mode_lib->vba.WritebackEnable,
1209-
mode_lib->vba.WritebackPixelFormat,
1210-
mode_lib->vba.WritebackDestinationWidth,
1211-
mode_lib->vba.WritebackDestinationHeight,
1212-
mode_lib->vba.WritebackSourceHeight,
12131184
v->UnboundedRequestEnabled,
12141185
v->CompressedBufferSizeInkByte,
12151186

12161187
/* Output */
1217-
&v->Watermark,
12181188
&v->dummy_vars.DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation.dummy_dramchange_support,
12191189
v->MaxActiveDRAMClockChangeLatencySupported,
12201190
v->SubViewportLinesNeededInMALL,
@@ -3557,62 +3527,32 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l
35573527

35583528
{
35593529
dml32_CalculateWatermarksMALLUseAndDRAMSpeedChangeSupport(
3560-
mode_lib->vba.USRRetrainingRequiredFinal,
3561-
mode_lib->vba.UsesMALLForPStateChange,
3562-
mode_lib->vba.PrefetchModePerState[i][j],
3563-
mode_lib->vba.NumberOfActiveSurfaces,
3564-
mode_lib->vba.MaxLineBufferLines,
3565-
mode_lib->vba.LineBufferSizeFinal,
3566-
mode_lib->vba.WritebackInterfaceBufferSize,
3567-
mode_lib->vba.DCFCLKState[i][j],
3568-
mode_lib->vba.ReturnBWPerState[i][j],
3569-
mode_lib->vba.SynchronizeTimingsFinal,
3570-
mode_lib->vba.SynchronizeDRRDisplaysForUCLKPStateChangeFinal,
3571-
mode_lib->vba.DRRDisplay,
3572-
mode_lib->vba.dpte_group_bytes,
3573-
mode_lib->vba.meta_row_height,
3574-
mode_lib->vba.meta_row_height_chroma,
3530+
v,
3531+
v->PrefetchModePerState[i][j],
3532+
v->DCFCLKState[i][j],
3533+
v->ReturnBWPerState[i][j],
35753534
v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.mSOCParameters,
3576-
mode_lib->vba.WritebackChunkSize,
3577-
mode_lib->vba.SOCCLKPerState[i],
3578-
mode_lib->vba.ProjectedDCFCLKDeepSleep[i][j],
3579-
mode_lib->vba.DETBufferSizeYThisState,
3580-
mode_lib->vba.DETBufferSizeCThisState,
3581-
mode_lib->vba.SwathHeightYThisState,
3582-
mode_lib->vba.SwathHeightCThisState,
3583-
mode_lib->vba.LBBitPerPixel,
3584-
mode_lib->vba.SwathWidthYThisState, // 24
3585-
mode_lib->vba.SwathWidthCThisState,
3586-
mode_lib->vba.HRatio,
3587-
mode_lib->vba.HRatioChroma,
3588-
mode_lib->vba.vtaps,
3589-
mode_lib->vba.VTAPsChroma,
3590-
mode_lib->vba.VRatio,
3591-
mode_lib->vba.VRatioChroma,
3592-
mode_lib->vba.HTotal,
3593-
mode_lib->vba.VTotal,
3594-
mode_lib->vba.VActive,
3595-
mode_lib->vba.PixelClock,
3596-
mode_lib->vba.BlendingAndTiming,
3597-
mode_lib->vba.NoOfDPPThisState,
3598-
mode_lib->vba.BytePerPixelInDETY,
3599-
mode_lib->vba.BytePerPixelInDETC,
3535+
v->SOCCLKPerState[i],
3536+
v->ProjectedDCFCLKDeepSleep[i][j],
3537+
v->DETBufferSizeYThisState,
3538+
v->DETBufferSizeCThisState,
3539+
v->SwathHeightYThisState,
3540+
v->SwathHeightCThisState,
3541+
v->SwathWidthYThisState, // 24
3542+
v->SwathWidthCThisState,
3543+
v->NoOfDPPThisState,
3544+
v->BytePerPixelInDETY,
3545+
v->BytePerPixelInDETC,
36003546
v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.DSTXAfterScaler,
36013547
v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.DSTYAfterScaler,
3602-
mode_lib->vba.WritebackEnable,
3603-
mode_lib->vba.WritebackPixelFormat,
3604-
mode_lib->vba.WritebackDestinationWidth,
3605-
mode_lib->vba.WritebackDestinationHeight,
3606-
mode_lib->vba.WritebackSourceHeight,
3607-
mode_lib->vba.UnboundedRequestEnabledThisState,
3608-
mode_lib->vba.CompressedBufferSizeInkByteThisState,
3548+
v->UnboundedRequestEnabledThisState,
3549+
v->CompressedBufferSizeInkByteThisState,
36093550

36103551
/* Output */
3611-
&mode_lib->vba.Watermark, // Store the values in vba
3612-
&mode_lib->vba.DRAMClockChangeSupport[i][j],
3552+
&v->DRAMClockChangeSupport[i][j],
36133553
&v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.dummy_single2[0], // double *MaxActiveDRAMClockChangeLatencySupported
36143554
&v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.dummy_integer[0], // Long SubViewportLinesNeededInMALL[]
3615-
&mode_lib->vba.FCLKChangeSupport[i][j],
3555+
&v->FCLKChangeSupport[i][j],
36163556
&v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.dummy_single2[1], // double *MinActiveFCLKChangeLatencySupported
36173557
&mode_lib->vba.USRRetrainingSupport[i][j],
36183558
mode_lib->vba.ActiveDRAMClockChangeLatencyMargin);

0 commit comments

Comments
 (0)