Commit c4be0ac9 authored by Nathan Chancellor's avatar Nathan Chancellor Committed by Alex Deucher

drm/amd/display: Reduce number of arguments of...

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: https://github.com/ClangBuiltLinux/linux/issues/1681Reported-by: default avatar"Sudip Mukherjee (Codethink)" <sudipm.mukherjee@gmail.com>
Tested-by: default avatarMaíra Canal <mairacanal@riseup.net>
Reviewed-by: default avatarRodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
Signed-off-by: default avatarRodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent d978c51f
...@@ -1163,58 +1163,28 @@ static void DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerforman ...@@ -1163,58 +1163,28 @@ static void DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerforman
v->dummy_vars.DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation.mmSOCParameters.SMNLatency = mode_lib->vba.SMNLatency; v->dummy_vars.DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation.mmSOCParameters.SMNLatency = mode_lib->vba.SMNLatency;
dml32_CalculateWatermarksMALLUseAndDRAMSpeedChangeSupport( dml32_CalculateWatermarksMALLUseAndDRAMSpeedChangeSupport(
mode_lib->vba.USRRetrainingRequiredFinal, v,
mode_lib->vba.UsesMALLForPStateChange, v->PrefetchModePerState[v->VoltageLevel][v->maxMpcComb],
mode_lib->vba.PrefetchModePerState[mode_lib->vba.VoltageLevel][mode_lib->vba.maxMpcComb], v->DCFCLK,
mode_lib->vba.NumberOfActiveSurfaces, v->ReturnBW,
mode_lib->vba.MaxLineBufferLines,
mode_lib->vba.LineBufferSizeFinal,
mode_lib->vba.WritebackInterfaceBufferSize,
mode_lib->vba.DCFCLK,
mode_lib->vba.ReturnBW,
mode_lib->vba.SynchronizeTimingsFinal,
mode_lib->vba.SynchronizeDRRDisplaysForUCLKPStateChangeFinal,
mode_lib->vba.DRRDisplay,
v->dpte_group_bytes,
v->meta_row_height,
v->meta_row_height_chroma,
v->dummy_vars.DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation.mmSOCParameters, v->dummy_vars.DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation.mmSOCParameters,
mode_lib->vba.WritebackChunkSize, v->SOCCLK,
mode_lib->vba.SOCCLK,
v->DCFCLKDeepSleep, v->DCFCLKDeepSleep,
mode_lib->vba.DETBufferSizeY, v->DETBufferSizeY,
mode_lib->vba.DETBufferSizeC, v->DETBufferSizeC,
mode_lib->vba.SwathHeightY, v->SwathHeightY,
mode_lib->vba.SwathHeightC, v->SwathHeightC,
mode_lib->vba.LBBitPerPixel,
v->SwathWidthY, v->SwathWidthY,
v->SwathWidthC, v->SwathWidthC,
mode_lib->vba.HRatio, v->DPPPerPlane,
mode_lib->vba.HRatioChroma,
mode_lib->vba.vtaps,
mode_lib->vba.VTAPsChroma,
mode_lib->vba.VRatio,
mode_lib->vba.VRatioChroma,
mode_lib->vba.HTotal,
mode_lib->vba.VTotal,
mode_lib->vba.VActive,
mode_lib->vba.PixelClock,
mode_lib->vba.BlendingAndTiming,
mode_lib->vba.DPPPerPlane,
v->BytePerPixelDETY, v->BytePerPixelDETY,
v->BytePerPixelDETC, v->BytePerPixelDETC,
v->DSTXAfterScaler, v->DSTXAfterScaler,
v->DSTYAfterScaler, v->DSTYAfterScaler,
mode_lib->vba.WritebackEnable,
mode_lib->vba.WritebackPixelFormat,
mode_lib->vba.WritebackDestinationWidth,
mode_lib->vba.WritebackDestinationHeight,
mode_lib->vba.WritebackSourceHeight,
v->UnboundedRequestEnabled, v->UnboundedRequestEnabled,
v->CompressedBufferSizeInkByte, v->CompressedBufferSizeInkByte,
/* Output */ /* Output */
&v->Watermark,
&v->dummy_vars.DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation.dummy_dramchange_support, &v->dummy_vars.DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation.dummy_dramchange_support,
v->MaxActiveDRAMClockChangeLatencySupported, v->MaxActiveDRAMClockChangeLatencySupported,
v->SubViewportLinesNeededInMALL, v->SubViewportLinesNeededInMALL,
...@@ -3557,62 +3527,32 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l ...@@ -3557,62 +3527,32 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l
{ {
dml32_CalculateWatermarksMALLUseAndDRAMSpeedChangeSupport( dml32_CalculateWatermarksMALLUseAndDRAMSpeedChangeSupport(
mode_lib->vba.USRRetrainingRequiredFinal, v,
mode_lib->vba.UsesMALLForPStateChange, v->PrefetchModePerState[i][j],
mode_lib->vba.PrefetchModePerState[i][j], v->DCFCLKState[i][j],
mode_lib->vba.NumberOfActiveSurfaces, v->ReturnBWPerState[i][j],
mode_lib->vba.MaxLineBufferLines,
mode_lib->vba.LineBufferSizeFinal,
mode_lib->vba.WritebackInterfaceBufferSize,
mode_lib->vba.DCFCLKState[i][j],
mode_lib->vba.ReturnBWPerState[i][j],
mode_lib->vba.SynchronizeTimingsFinal,
mode_lib->vba.SynchronizeDRRDisplaysForUCLKPStateChangeFinal,
mode_lib->vba.DRRDisplay,
mode_lib->vba.dpte_group_bytes,
mode_lib->vba.meta_row_height,
mode_lib->vba.meta_row_height_chroma,
v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.mSOCParameters, v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.mSOCParameters,
mode_lib->vba.WritebackChunkSize, v->SOCCLKPerState[i],
mode_lib->vba.SOCCLKPerState[i], v->ProjectedDCFCLKDeepSleep[i][j],
mode_lib->vba.ProjectedDCFCLKDeepSleep[i][j], v->DETBufferSizeYThisState,
mode_lib->vba.DETBufferSizeYThisState, v->DETBufferSizeCThisState,
mode_lib->vba.DETBufferSizeCThisState, v->SwathHeightYThisState,
mode_lib->vba.SwathHeightYThisState, v->SwathHeightCThisState,
mode_lib->vba.SwathHeightCThisState, v->SwathWidthYThisState, // 24
mode_lib->vba.LBBitPerPixel, v->SwathWidthCThisState,
mode_lib->vba.SwathWidthYThisState, // 24 v->NoOfDPPThisState,
mode_lib->vba.SwathWidthCThisState, v->BytePerPixelInDETY,
mode_lib->vba.HRatio, v->BytePerPixelInDETC,
mode_lib->vba.HRatioChroma,
mode_lib->vba.vtaps,
mode_lib->vba.VTAPsChroma,
mode_lib->vba.VRatio,
mode_lib->vba.VRatioChroma,
mode_lib->vba.HTotal,
mode_lib->vba.VTotal,
mode_lib->vba.VActive,
mode_lib->vba.PixelClock,
mode_lib->vba.BlendingAndTiming,
mode_lib->vba.NoOfDPPThisState,
mode_lib->vba.BytePerPixelInDETY,
mode_lib->vba.BytePerPixelInDETC,
v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.DSTXAfterScaler, v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.DSTXAfterScaler,
v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.DSTYAfterScaler, v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.DSTYAfterScaler,
mode_lib->vba.WritebackEnable, v->UnboundedRequestEnabledThisState,
mode_lib->vba.WritebackPixelFormat, v->CompressedBufferSizeInkByteThisState,
mode_lib->vba.WritebackDestinationWidth,
mode_lib->vba.WritebackDestinationHeight,
mode_lib->vba.WritebackSourceHeight,
mode_lib->vba.UnboundedRequestEnabledThisState,
mode_lib->vba.CompressedBufferSizeInkByteThisState,
/* Output */ /* Output */
&mode_lib->vba.Watermark, // Store the values in vba &v->DRAMClockChangeSupport[i][j],
&mode_lib->vba.DRAMClockChangeSupport[i][j],
&v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.dummy_single2[0], // double *MaxActiveDRAMClockChangeLatencySupported &v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.dummy_single2[0], // double *MaxActiveDRAMClockChangeLatencySupported
&v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.dummy_integer[0], // Long SubViewportLinesNeededInMALL[] &v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.dummy_integer[0], // Long SubViewportLinesNeededInMALL[]
&mode_lib->vba.FCLKChangeSupport[i][j], &v->FCLKChangeSupport[i][j],
&v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.dummy_single2[1], // double *MinActiveFCLKChangeLatencySupported &v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.dummy_single2[1], // double *MinActiveFCLKChangeLatencySupported
&mode_lib->vba.USRRetrainingSupport[i][j], &mode_lib->vba.USRRetrainingSupport[i][j],
mode_lib->vba.ActiveDRAMClockChangeLatencyMargin); mode_lib->vba.ActiveDRAMClockChangeLatencyMargin);
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "os_types.h" #include "os_types.h"
#include "../dc_features.h" #include "../dc_features.h"
#include "../display_mode_structs.h" #include "../display_mode_structs.h"
#include "dml/display_mode_vba.h"
unsigned int dml32_dscceComputeDelay( unsigned int dml32_dscceComputeDelay(
unsigned int bpc, unsigned int bpc,
...@@ -807,58 +808,28 @@ void dml32_CalculateFlipSchedule( ...@@ -807,58 +808,28 @@ void dml32_CalculateFlipSchedule(
bool *ImmediateFlipSupportedForPipe); bool *ImmediateFlipSupportedForPipe);
void dml32_CalculateWatermarksMALLUseAndDRAMSpeedChangeSupport( void dml32_CalculateWatermarksMALLUseAndDRAMSpeedChangeSupport(
bool USRRetrainingRequiredFinal, struct vba_vars_st *v,
enum dm_use_mall_for_pstate_change_mode UseMALLForPStateChange[],
unsigned int PrefetchMode, unsigned int PrefetchMode,
unsigned int NumberOfActiveSurfaces,
unsigned int MaxLineBufferLines,
unsigned int LineBufferSize,
unsigned int WritebackInterfaceBufferSize,
double DCFCLK, double DCFCLK,
double ReturnBW, double ReturnBW,
bool SynchronizeTimingsFinal,
bool SynchronizeDRRDisplaysForUCLKPStateChangeFinal,
bool DRRDisplay[],
unsigned int dpte_group_bytes[],
unsigned int meta_row_height[],
unsigned int meta_row_height_chroma[],
SOCParametersList mmSOCParameters, SOCParametersList mmSOCParameters,
unsigned int WritebackChunkSize,
double SOCCLK, double SOCCLK,
double DCFClkDeepSleep, double DCFClkDeepSleep,
unsigned int DETBufferSizeY[], unsigned int DETBufferSizeY[],
unsigned int DETBufferSizeC[], unsigned int DETBufferSizeC[],
unsigned int SwathHeightY[], unsigned int SwathHeightY[],
unsigned int SwathHeightC[], unsigned int SwathHeightC[],
unsigned int LBBitPerPixel[],
double SwathWidthY[], double SwathWidthY[],
double SwathWidthC[], double SwathWidthC[],
double HRatio[],
double HRatioChroma[],
unsigned int VTaps[],
unsigned int VTapsChroma[],
double VRatio[],
double VRatioChroma[],
unsigned int HTotal[],
unsigned int VTotal[],
unsigned int VActive[],
double PixelClock[],
unsigned int BlendingAndTiming[],
unsigned int DPPPerSurface[], unsigned int DPPPerSurface[],
double BytePerPixelDETY[], double BytePerPixelDETY[],
double BytePerPixelDETC[], double BytePerPixelDETC[],
double DSTXAfterScaler[], double DSTXAfterScaler[],
double DSTYAfterScaler[], double DSTYAfterScaler[],
bool WritebackEnable[],
enum source_format_class WritebackPixelFormat[],
double WritebackDestinationWidth[],
double WritebackDestinationHeight[],
double WritebackSourceHeight[],
bool UnboundedRequestEnabled, bool UnboundedRequestEnabled,
unsigned int CompressedBufferSizeInkByte, unsigned int CompressedBufferSizeInkByte,
/* Output */ /* Output */
Watermarks *Watermark,
enum clock_change_support *DRAMClockChangeSupport, enum clock_change_support *DRAMClockChangeSupport,
double MaxActiveDRAMClockChangeLatencySupported[], double MaxActiveDRAMClockChangeLatencySupported[],
unsigned int SubViewportLinesNeededInMALL[], unsigned int SubViewportLinesNeededInMALL[],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment