Skip to content

Commit 1b54a01

Browse files
Rodrigo Siqueiraalexdeucher
authored andcommitted
drm/amd/display: Reduce stack size in the mode support function
When we use the allmodconfig option we see the following error: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn32/display_mode_vba_32.c: In function 'dml32_ModeSupportAndSystemConfigurationFull': drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn32/display_mode_vba_32.c:3799:1: error: the frame size of 2464 bytes is larger than 2048 bytes [-Werror=frame-larger-than=] 3799 | } // ModeSupportAndSystemConfigurationFull This commit fixes this issue by moving part of the mode support operation from ModeSupportAndSystemConfigurationFull to a dedicated function. Cc: Harry Wentland <harry.wentland@amd.com> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: Aurabindo Pillai <aurabindo.pillai@amd.com> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Tested-by: Stephen Rothwell <sfr@canb.auug.org.au> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent d587157 commit 1b54a01

1 file changed

Lines changed: 70 additions & 62 deletions

File tree

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

Lines changed: 70 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1654,6 +1654,75 @@ static void DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerforman
16541654
#endif
16551655
}
16561656

1657+
static void mode_support_configuration(struct vba_vars_st *v,
1658+
struct display_mode_lib *mode_lib)
1659+
{
1660+
int i, j;
1661+
1662+
for (i = v->soc.num_states - 1; i >= 0; i--) {
1663+
for (j = 0; j < 2; j++) {
1664+
if (mode_lib->vba.ScaleRatioAndTapsSupport == true
1665+
&& mode_lib->vba.SourceFormatPixelAndScanSupport == true
1666+
&& mode_lib->vba.ViewportSizeSupport[i][j] == true
1667+
&& !mode_lib->vba.LinkRateDoesNotMatchDPVersion
1668+
&& !mode_lib->vba.LinkRateForMultistreamNotIndicated
1669+
&& !mode_lib->vba.BPPForMultistreamNotIndicated
1670+
&& !mode_lib->vba.MultistreamWithHDMIOreDP
1671+
&& !mode_lib->vba.ExceededMultistreamSlots[i]
1672+
&& !mode_lib->vba.MSOOrODMSplitWithNonDPLink
1673+
&& !mode_lib->vba.NotEnoughLanesForMSO
1674+
&& mode_lib->vba.LinkCapacitySupport[i] == true && !mode_lib->vba.P2IWith420
1675+
&& !mode_lib->vba.DSCOnlyIfNecessaryWithBPP
1676+
&& !mode_lib->vba.DSC422NativeNotSupported
1677+
&& !mode_lib->vba.MPCCombineMethodIncompatible
1678+
&& mode_lib->vba.ODMCombine2To1SupportCheckOK[i] == true
1679+
&& mode_lib->vba.ODMCombine4To1SupportCheckOK[i] == true
1680+
&& mode_lib->vba.NotEnoughDSCUnits[i] == false
1681+
&& !mode_lib->vba.NotEnoughDSCSlices[i]
1682+
&& !mode_lib->vba.ImmediateFlipOrHostVMAndPStateWithMALLFullFrameOrPhantomPipe
1683+
&& !mode_lib->vba.InvalidCombinationOfMALLUseForPStateAndStaticScreen
1684+
&& mode_lib->vba.DSCCLKRequiredMoreThanSupported[i] == false
1685+
&& mode_lib->vba.PixelsPerLinePerDSCUnitSupport[i]
1686+
&& mode_lib->vba.DTBCLKRequiredMoreThanSupported[i] == false
1687+
&& !mode_lib->vba.InvalidCombinationOfMALLUseForPState
1688+
&& !mode_lib->vba.ImmediateFlipRequiredButTheRequirementForEachSurfaceIsNotSpecified
1689+
&& mode_lib->vba.ROBSupport[i][j] == true
1690+
&& mode_lib->vba.DISPCLK_DPPCLK_Support[i][j] == true
1691+
&& mode_lib->vba.TotalAvailablePipesSupport[i][j] == true
1692+
&& mode_lib->vba.NumberOfOTGSupport == true
1693+
&& mode_lib->vba.NumberOfHDMIFRLSupport == true
1694+
&& mode_lib->vba.EnoughWritebackUnits == true
1695+
&& mode_lib->vba.WritebackLatencySupport == true
1696+
&& mode_lib->vba.WritebackScaleRatioAndTapsSupport == true
1697+
&& mode_lib->vba.CursorSupport == true && mode_lib->vba.PitchSupport == true
1698+
&& mode_lib->vba.ViewportExceedsSurface == false
1699+
&& mode_lib->vba.PrefetchSupported[i][j] == true
1700+
&& mode_lib->vba.VActiveBandwithSupport[i][j] == true
1701+
&& mode_lib->vba.DynamicMetadataSupported[i][j] == true
1702+
&& mode_lib->vba.TotalVerticalActiveBandwidthSupport[i][j] == true
1703+
&& mode_lib->vba.VRatioInPrefetchSupported[i][j] == true
1704+
&& mode_lib->vba.PTEBufferSizeNotExceeded[i][j] == true
1705+
&& mode_lib->vba.DCCMetaBufferSizeNotExceeded[i][j] == true
1706+
&& mode_lib->vba.NonsupportedDSCInputBPC == false
1707+
&& !mode_lib->vba.ExceededMALLSize
1708+
&& ((mode_lib->vba.HostVMEnable == false
1709+
&& !mode_lib->vba.ImmediateFlipRequiredFinal)
1710+
|| mode_lib->vba.ImmediateFlipSupportedForState[i][j])
1711+
&& (!mode_lib->vba.DRAMClockChangeRequirementFinal
1712+
|| i == v->soc.num_states - 1
1713+
|| mode_lib->vba.DRAMClockChangeSupport[i][j] != dm_dram_clock_change_unsupported)
1714+
&& (!mode_lib->vba.FCLKChangeRequirementFinal || i == v->soc.num_states - 1
1715+
|| mode_lib->vba.FCLKChangeSupport[i][j] != dm_fclock_change_unsupported)
1716+
&& (!mode_lib->vba.USRRetrainingRequiredFinal
1717+
|| mode_lib->vba.USRRetrainingSupport[i][j])) {
1718+
mode_lib->vba.ModeSupport[i][j] = true;
1719+
} else {
1720+
mode_lib->vba.ModeSupport[i][j] = false;
1721+
}
1722+
}
1723+
}
1724+
}
1725+
16571726
void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_lib)
16581727
{
16591728
struct vba_vars_st *v = &mode_lib->vba;
@@ -3632,68 +3701,7 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l
36323701
}
36333702

36343703
/*Mode Support, Voltage State and SOC Configuration*/
3635-
for (i = v->soc.num_states - 1; i >= 0; i--) {
3636-
for (j = 0; j < 2; j++) {
3637-
if (mode_lib->vba.ScaleRatioAndTapsSupport == true
3638-
&& mode_lib->vba.SourceFormatPixelAndScanSupport == true
3639-
&& mode_lib->vba.ViewportSizeSupport[i][j] == true
3640-
&& !mode_lib->vba.LinkRateDoesNotMatchDPVersion
3641-
&& !mode_lib->vba.LinkRateForMultistreamNotIndicated
3642-
&& !mode_lib->vba.BPPForMultistreamNotIndicated
3643-
&& !mode_lib->vba.MultistreamWithHDMIOreDP
3644-
&& !mode_lib->vba.ExceededMultistreamSlots[i]
3645-
&& !mode_lib->vba.MSOOrODMSplitWithNonDPLink
3646-
&& !mode_lib->vba.NotEnoughLanesForMSO
3647-
&& mode_lib->vba.LinkCapacitySupport[i] == true && !mode_lib->vba.P2IWith420
3648-
&& !mode_lib->vba.DSCOnlyIfNecessaryWithBPP
3649-
&& !mode_lib->vba.DSC422NativeNotSupported
3650-
&& !mode_lib->vba.MPCCombineMethodIncompatible
3651-
&& mode_lib->vba.ODMCombine2To1SupportCheckOK[i] == true
3652-
&& mode_lib->vba.ODMCombine4To1SupportCheckOK[i] == true
3653-
&& mode_lib->vba.NotEnoughDSCUnits[i] == false
3654-
&& !mode_lib->vba.NotEnoughDSCSlices[i]
3655-
&& !mode_lib->vba.ImmediateFlipOrHostVMAndPStateWithMALLFullFrameOrPhantomPipe
3656-
&& !mode_lib->vba.InvalidCombinationOfMALLUseForPStateAndStaticScreen
3657-
&& mode_lib->vba.DSCCLKRequiredMoreThanSupported[i] == false
3658-
&& mode_lib->vba.PixelsPerLinePerDSCUnitSupport[i]
3659-
&& mode_lib->vba.DTBCLKRequiredMoreThanSupported[i] == false
3660-
&& !mode_lib->vba.InvalidCombinationOfMALLUseForPState
3661-
&& !mode_lib->vba.ImmediateFlipRequiredButTheRequirementForEachSurfaceIsNotSpecified
3662-
&& mode_lib->vba.ROBSupport[i][j] == true
3663-
&& mode_lib->vba.DISPCLK_DPPCLK_Support[i][j] == true
3664-
&& mode_lib->vba.TotalAvailablePipesSupport[i][j] == true
3665-
&& mode_lib->vba.NumberOfOTGSupport == true
3666-
&& mode_lib->vba.NumberOfHDMIFRLSupport == true
3667-
&& mode_lib->vba.EnoughWritebackUnits == true
3668-
&& mode_lib->vba.WritebackLatencySupport == true
3669-
&& mode_lib->vba.WritebackScaleRatioAndTapsSupport == true
3670-
&& mode_lib->vba.CursorSupport == true && mode_lib->vba.PitchSupport == true
3671-
&& mode_lib->vba.ViewportExceedsSurface == false
3672-
&& mode_lib->vba.PrefetchSupported[i][j] == true
3673-
&& mode_lib->vba.VActiveBandwithSupport[i][j] == true
3674-
&& mode_lib->vba.DynamicMetadataSupported[i][j] == true
3675-
&& mode_lib->vba.TotalVerticalActiveBandwidthSupport[i][j] == true
3676-
&& mode_lib->vba.VRatioInPrefetchSupported[i][j] == true
3677-
&& mode_lib->vba.PTEBufferSizeNotExceeded[i][j] == true
3678-
&& mode_lib->vba.DCCMetaBufferSizeNotExceeded[i][j] == true
3679-
&& mode_lib->vba.NonsupportedDSCInputBPC == false
3680-
&& !mode_lib->vba.ExceededMALLSize
3681-
&& ((mode_lib->vba.HostVMEnable == false
3682-
&& !mode_lib->vba.ImmediateFlipRequiredFinal)
3683-
|| mode_lib->vba.ImmediateFlipSupportedForState[i][j])
3684-
&& (!mode_lib->vba.DRAMClockChangeRequirementFinal
3685-
|| i == v->soc.num_states - 1
3686-
|| mode_lib->vba.DRAMClockChangeSupport[i][j] != dm_dram_clock_change_unsupported)
3687-
&& (!mode_lib->vba.FCLKChangeRequirementFinal || i == v->soc.num_states - 1
3688-
|| mode_lib->vba.FCLKChangeSupport[i][j] != dm_fclock_change_unsupported)
3689-
&& (!mode_lib->vba.USRRetrainingRequiredFinal
3690-
|| mode_lib->vba.USRRetrainingSupport[i][j])) {
3691-
mode_lib->vba.ModeSupport[i][j] = true;
3692-
} else {
3693-
mode_lib->vba.ModeSupport[i][j] = false;
3694-
}
3695-
}
3696-
}
3704+
mode_support_configuration(v, mode_lib);
36973705

36983706
MaximumMPCCombine = 0;
36993707

0 commit comments

Comments
 (0)