Commit 3b4e83a2 authored by Nathan Chancellor's avatar Nathan Chancellor Committed by Alex Deucher

drm/amd/display: Reduce number of arguments of dml32_CalculatePrefetchSchedule()

Several of the arguments are identical between the two call sites and
they can be accessed through the 'struct vba_vars_st' pointer. This
reduces the total amount of stack space that
dml32_ModeSupportAndSystemConfigurationFull() uses by 208 bytes with
LLVM 16 (1936 -> 1728), 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_CalculatePrefetchSchedule(), 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 1df7e569
...@@ -755,30 +755,18 @@ static void DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerforman ...@@ -755,30 +755,18 @@ static void DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerforman
v->dummy_vars.DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation.myPipe.BytePerPixelY = v->BytePerPixelY[k]; v->dummy_vars.DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation.myPipe.BytePerPixelY = v->BytePerPixelY[k];
v->dummy_vars.DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation.myPipe.BytePerPixelC = v->BytePerPixelC[k]; v->dummy_vars.DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation.myPipe.BytePerPixelC = v->BytePerPixelC[k];
v->dummy_vars.DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation.myPipe.ProgressiveToInterlaceUnitInOPP = mode_lib->vba.ProgressiveToInterlaceUnitInOPP; v->dummy_vars.DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation.myPipe.ProgressiveToInterlaceUnitInOPP = mode_lib->vba.ProgressiveToInterlaceUnitInOPP;
v->ErrorResult[k] = dml32_CalculatePrefetchSchedule(v->dummy_vars.DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation.HostVMInefficiencyFactor, v->ErrorResult[k] = dml32_CalculatePrefetchSchedule(
&v->dummy_vars.DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation.myPipe, v->DSCDelay[k], v,
mode_lib->vba.DPPCLKDelaySubtotal + mode_lib->vba.DPPCLKDelayCNVCFormater, k,
mode_lib->vba.DPPCLKDelaySCL, v->dummy_vars.DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation.HostVMInefficiencyFactor,
mode_lib->vba.DPPCLKDelaySCLLBOnly, &v->dummy_vars.DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation.myPipe,
mode_lib->vba.DPPCLKDelayCNVCCursor, v->DSCDelay[k],
mode_lib->vba.DISPCLKDelaySubtotal, (unsigned int) (v->SwathWidthY[k] / v->HRatio[k]),
(unsigned int) (v->SwathWidthY[k] / mode_lib->vba.HRatio[k]),
mode_lib->vba.OutputFormat[k],
mode_lib->vba.MaxInterDCNTileRepeaters,
dml_min(v->VStartupLines, v->MaxVStartupLines[k]), dml_min(v->VStartupLines, v->MaxVStartupLines[k]),
v->MaxVStartupLines[k], v->MaxVStartupLines[k],
mode_lib->vba.GPUVMMaxPageTableLevels,
mode_lib->vba.GPUVMEnable,
mode_lib->vba.HostVMEnable,
mode_lib->vba.HostVMMaxNonCachedPageTableLevels,
mode_lib->vba.HostVMMinPageSize,
mode_lib->vba.DynamicMetadataEnable[k],
mode_lib->vba.DynamicMetadataVMEnabled,
mode_lib->vba.DynamicMetadataLinesBeforeActiveRequired[k],
mode_lib->vba.DynamicMetadataTransmittedBytes[k],
v->UrgentLatency, v->UrgentLatency,
v->UrgentExtraLatency, v->UrgentExtraLatency,
mode_lib->vba.TCalc, v->TCalc,
v->PDEAndMetaPTEBytesFrame[k], v->PDEAndMetaPTEBytesFrame[k],
v->MetaRowByte[k], v->MetaRowByte[k],
v->PixelPTEBytesPerRow[k], v->PixelPTEBytesPerRow[k],
...@@ -792,8 +780,8 @@ static void DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerforman ...@@ -792,8 +780,8 @@ static void DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerforman
v->MaxNumSwathC[k], v->MaxNumSwathC[k],
v->swath_width_luma_ub[k], v->swath_width_luma_ub[k],
v->swath_width_chroma_ub[k], v->swath_width_chroma_ub[k],
mode_lib->vba.SwathHeightY[k], v->SwathHeightY[k],
mode_lib->vba.SwathHeightC[k], v->SwathHeightC[k],
TWait, TWait,
/* Output */ /* Output */
&v->DSTXAfterScaler[k], &v->DSTXAfterScaler[k],
...@@ -3230,63 +3218,47 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l ...@@ -3230,63 +3218,47 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l
mode_lib->vba.NoTimeForPrefetch[i][j][k] = mode_lib->vba.NoTimeForPrefetch[i][j][k] =
dml32_CalculatePrefetchSchedule( dml32_CalculatePrefetchSchedule(
v,
k,
v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.HostVMInefficiencyFactor, v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.HostVMInefficiencyFactor,
&v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.myPipe, &v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.myPipe,
mode_lib->vba.DSCDelayPerState[i][k], v->DSCDelayPerState[i][k],
mode_lib->vba.DPPCLKDelaySubtotal + v->SwathWidthYThisState[k] / v->HRatio[k],
mode_lib->vba.DPPCLKDelayCNVCFormater, dml_min(v->MaxVStartup, v->MaximumVStartup[i][j][k]),
mode_lib->vba.DPPCLKDelaySCL, v->MaximumVStartup[i][j][k],
mode_lib->vba.DPPCLKDelaySCLLBOnly, v->UrgLatency[i],
mode_lib->vba.DPPCLKDelayCNVCCursor, v->ExtraLatency,
mode_lib->vba.DISPCLKDelaySubtotal, v->TimeCalc,
mode_lib->vba.SwathWidthYThisState[k] / v->PDEAndMetaPTEBytesPerFrame[i][j][k],
mode_lib->vba.HRatio[k], v->MetaRowBytes[i][j][k],
mode_lib->vba.OutputFormat[k], v->DPTEBytesPerRow[i][j][k],
mode_lib->vba.MaxInterDCNTileRepeaters, v->PrefetchLinesY[i][j][k],
dml_min(mode_lib->vba.MaxVStartup, v->SwathWidthYThisState[k],
mode_lib->vba.MaximumVStartup[i][j][k]), v->PrefillY[k],
mode_lib->vba.MaximumVStartup[i][j][k], v->MaxNumSwY[k],
mode_lib->vba.GPUVMMaxPageTableLevels, v->PrefetchLinesC[i][j][k],
mode_lib->vba.GPUVMEnable, mode_lib->vba.HostVMEnable, v->SwathWidthCThisState[k],
mode_lib->vba.HostVMMaxNonCachedPageTableLevels, v->PrefillC[k],
mode_lib->vba.HostVMMinPageSize, v->MaxNumSwC[k],
mode_lib->vba.DynamicMetadataEnable[k], v->swath_width_luma_ub_this_state[k],
mode_lib->vba.DynamicMetadataVMEnabled, v->swath_width_chroma_ub_this_state[k],
mode_lib->vba.DynamicMetadataLinesBeforeActiveRequired[k], v->SwathHeightYThisState[k],
mode_lib->vba.DynamicMetadataTransmittedBytes[k], v->SwathHeightCThisState[k], v->TWait,
mode_lib->vba.UrgLatency[i],
mode_lib->vba.ExtraLatency,
mode_lib->vba.TimeCalc,
mode_lib->vba.PDEAndMetaPTEBytesPerFrame[i][j][k],
mode_lib->vba.MetaRowBytes[i][j][k],
mode_lib->vba.DPTEBytesPerRow[i][j][k],
mode_lib->vba.PrefetchLinesY[i][j][k],
mode_lib->vba.SwathWidthYThisState[k],
mode_lib->vba.PrefillY[k],
mode_lib->vba.MaxNumSwY[k],
mode_lib->vba.PrefetchLinesC[i][j][k],
mode_lib->vba.SwathWidthCThisState[k],
mode_lib->vba.PrefillC[k],
mode_lib->vba.MaxNumSwC[k],
mode_lib->vba.swath_width_luma_ub_this_state[k],
mode_lib->vba.swath_width_chroma_ub_this_state[k],
mode_lib->vba.SwathHeightYThisState[k],
mode_lib->vba.SwathHeightCThisState[k], mode_lib->vba.TWait,
/* Output */ /* Output */
&v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.DSTXAfterScaler[k], &v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.DSTXAfterScaler[k],
&v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.DSTYAfterScaler[k], &v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.DSTYAfterScaler[k],
&mode_lib->vba.LineTimesForPrefetch[k], &v->LineTimesForPrefetch[k],
&mode_lib->vba.PrefetchBW[k], &v->PrefetchBW[k],
&mode_lib->vba.LinesForMetaPTE[k], &v->LinesForMetaPTE[k],
&mode_lib->vba.LinesForMetaAndDPTERow[k], &v->LinesForMetaAndDPTERow[k],
&mode_lib->vba.VRatioPreY[i][j][k], &v->VRatioPreY[i][j][k],
&mode_lib->vba.VRatioPreC[i][j][k], &v->VRatioPreC[i][j][k],
&mode_lib->vba.RequiredPrefetchPixelDataBWLuma[0][0][k], &v->RequiredPrefetchPixelDataBWLuma[0][0][k],
&mode_lib->vba.RequiredPrefetchPixelDataBWChroma[0][0][k], &v->RequiredPrefetchPixelDataBWChroma[0][0][k],
&mode_lib->vba.NoTimeForDynamicMetadata[i][j][k], &v->NoTimeForDynamicMetadata[i][j][k],
&mode_lib->vba.Tno_bw[k], &v->Tno_bw[k],
&mode_lib->vba.prefetch_vmrow_bw[k], &v->prefetch_vmrow_bw[k],
&v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.dummy_single[0], // double *Tdmdl_vm &v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.dummy_single[0], // double *Tdmdl_vm
&v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.dummy_single[1], // double *Tdmdl &v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.dummy_single[1], // double *Tdmdl
&v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.dummy_single[2], // double *TSetup &v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.dummy_single[2], // double *TSetup
......
...@@ -3363,28 +3363,14 @@ double dml32_CalculateExtraLatency( ...@@ -3363,28 +3363,14 @@ double dml32_CalculateExtraLatency(
} // CalculateExtraLatency } // CalculateExtraLatency
bool dml32_CalculatePrefetchSchedule( bool dml32_CalculatePrefetchSchedule(
struct vba_vars_st *v,
unsigned int k,
double HostVMInefficiencyFactor, double HostVMInefficiencyFactor,
DmlPipe *myPipe, DmlPipe *myPipe,
unsigned int DSCDelay, unsigned int DSCDelay,
double DPPCLKDelaySubtotalPlusCNVCFormater,
double DPPCLKDelaySCL,
double DPPCLKDelaySCLLBOnly,
double DPPCLKDelayCNVCCursor,
double DISPCLKDelaySubtotal,
unsigned int DPP_RECOUT_WIDTH, unsigned int DPP_RECOUT_WIDTH,
enum output_format_class OutputFormat,
unsigned int MaxInterDCNTileRepeaters,
unsigned int VStartup, unsigned int VStartup,
unsigned int MaxVStartup, unsigned int MaxVStartup,
unsigned int GPUVMPageTableLevels,
bool GPUVMEnable,
bool HostVMEnable,
unsigned int HostVMMaxNonCachedPageTableLevels,
double HostVMMinPageSize,
bool DynamicMetadataEnable,
bool DynamicMetadataVMEnabled,
int DynamicMetadataLinesBeforeActiveRequired,
unsigned int DynamicMetadataTransmittedBytes,
double UrgentLatency, double UrgentLatency,
double UrgentExtraLatency, double UrgentExtraLatency,
double TCalc, double TCalc,
...@@ -3425,6 +3411,7 @@ bool dml32_CalculatePrefetchSchedule( ...@@ -3425,6 +3411,7 @@ bool dml32_CalculatePrefetchSchedule(
double *VUpdateWidthPix, double *VUpdateWidthPix,
double *VReadyOffsetPix) double *VReadyOffsetPix)
{ {
double DPPCLKDelaySubtotalPlusCNVCFormater = v->DPPCLKDelaySubtotal + v->DPPCLKDelayCNVCFormater;
bool MyError = false; bool MyError = false;
unsigned int DPPCycles, DISPCLKCycles; unsigned int DPPCycles, DISPCLKCycles;
double DSTTotalPixelsAfterScaler; double DSTTotalPixelsAfterScaler;
...@@ -3461,27 +3448,27 @@ bool dml32_CalculatePrefetchSchedule( ...@@ -3461,27 +3448,27 @@ bool dml32_CalculatePrefetchSchedule(
double Tsw_est1 = 0; double Tsw_est1 = 0;
double Tsw_est3 = 0; double Tsw_est3 = 0;
if (GPUVMEnable == true && HostVMEnable == true) if (v->GPUVMEnable == true && v->HostVMEnable == true)
HostVMDynamicLevelsTrips = HostVMMaxNonCachedPageTableLevels; HostVMDynamicLevelsTrips = v->HostVMMaxNonCachedPageTableLevels;
else else
HostVMDynamicLevelsTrips = 0; HostVMDynamicLevelsTrips = 0;
#ifdef __DML_VBA_DEBUG__ #ifdef __DML_VBA_DEBUG__
dml_print("DML::%s: GPUVMEnable = %d\n", __func__, GPUVMEnable); dml_print("DML::%s: v->GPUVMEnable = %d\n", __func__, v->GPUVMEnable);
dml_print("DML::%s: GPUVMPageTableLevels = %d\n", __func__, GPUVMPageTableLevels); dml_print("DML::%s: v->GPUVMMaxPageTableLevels = %d\n", __func__, v->GPUVMMaxPageTableLevels);
dml_print("DML::%s: DCCEnable = %d\n", __func__, myPipe->DCCEnable); dml_print("DML::%s: DCCEnable = %d\n", __func__, myPipe->DCCEnable);
dml_print("DML::%s: HostVMEnable=%d HostVMInefficiencyFactor=%f\n", dml_print("DML::%s: v->HostVMEnable=%d HostVMInefficiencyFactor=%f\n",
__func__, HostVMEnable, HostVMInefficiencyFactor); __func__, v->HostVMEnable, HostVMInefficiencyFactor);
#endif #endif
dml32_CalculateVUpdateAndDynamicMetadataParameters( dml32_CalculateVUpdateAndDynamicMetadataParameters(
MaxInterDCNTileRepeaters, v->MaxInterDCNTileRepeaters,
myPipe->Dppclk, myPipe->Dppclk,
myPipe->Dispclk, myPipe->Dispclk,
myPipe->DCFClkDeepSleep, myPipe->DCFClkDeepSleep,
myPipe->PixelClock, myPipe->PixelClock,
myPipe->HTotal, myPipe->HTotal,
myPipe->VBlank, myPipe->VBlank,
DynamicMetadataTransmittedBytes, v->DynamicMetadataTransmittedBytes[k],
DynamicMetadataLinesBeforeActiveRequired, v->DynamicMetadataLinesBeforeActiveRequired[k],
myPipe->InterlaceEnable, myPipe->InterlaceEnable,
myPipe->ProgressiveToInterlaceUnitInOPP, myPipe->ProgressiveToInterlaceUnitInOPP,
TSetup, TSetup,
...@@ -3496,19 +3483,19 @@ bool dml32_CalculatePrefetchSchedule( ...@@ -3496,19 +3483,19 @@ bool dml32_CalculatePrefetchSchedule(
LineTime = myPipe->HTotal / myPipe->PixelClock; LineTime = myPipe->HTotal / myPipe->PixelClock;
trip_to_mem = UrgentLatency; trip_to_mem = UrgentLatency;
Tvm_trips = UrgentExtraLatency + trip_to_mem * (GPUVMPageTableLevels * (HostVMDynamicLevelsTrips + 1) - 1); Tvm_trips = UrgentExtraLatency + trip_to_mem * (v->GPUVMMaxPageTableLevels * (HostVMDynamicLevelsTrips + 1) - 1);
if (DynamicMetadataVMEnabled == true) if (v->DynamicMetadataVMEnabled == true)
*Tdmdl = TWait + Tvm_trips + trip_to_mem; *Tdmdl = TWait + Tvm_trips + trip_to_mem;
else else
*Tdmdl = TWait + UrgentExtraLatency; *Tdmdl = TWait + UrgentExtraLatency;
#ifdef __DML_VBA_ALLOW_DELTA__ #ifdef __DML_VBA_ALLOW_DELTA__
if (DynamicMetadataEnable == false) if (v->DynamicMetadataEnable[k] == false)
*Tdmdl = 0.0; *Tdmdl = 0.0;
#endif #endif
if (DynamicMetadataEnable == true) { if (v->DynamicMetadataEnable[k] == true) {
if (VStartup * LineTime < *TSetup + *Tdmdl + Tdmbf + Tdmec + Tdmsks) { if (VStartup * LineTime < *TSetup + *Tdmdl + Tdmbf + Tdmec + Tdmsks) {
*NotEnoughTimeForDynamicMetadata = true; *NotEnoughTimeForDynamicMetadata = true;
#ifdef __DML_VBA_DEBUG__ #ifdef __DML_VBA_DEBUG__
...@@ -3528,17 +3515,17 @@ bool dml32_CalculatePrefetchSchedule( ...@@ -3528,17 +3515,17 @@ bool dml32_CalculatePrefetchSchedule(
*NotEnoughTimeForDynamicMetadata = false; *NotEnoughTimeForDynamicMetadata = false;
} }
*Tdmdl_vm = (DynamicMetadataEnable == true && DynamicMetadataVMEnabled == true && *Tdmdl_vm = (v->DynamicMetadataEnable[k] == true && v->DynamicMetadataVMEnabled == true &&
GPUVMEnable == true ? TWait + Tvm_trips : 0); v->GPUVMEnable == true ? TWait + Tvm_trips : 0);
if (myPipe->ScalerEnabled) if (myPipe->ScalerEnabled)
DPPCycles = DPPCLKDelaySubtotalPlusCNVCFormater + DPPCLKDelaySCL; DPPCycles = DPPCLKDelaySubtotalPlusCNVCFormater + v->DPPCLKDelaySCL;
else else
DPPCycles = DPPCLKDelaySubtotalPlusCNVCFormater + DPPCLKDelaySCLLBOnly; DPPCycles = DPPCLKDelaySubtotalPlusCNVCFormater + v->DPPCLKDelaySCLLBOnly;
DPPCycles = DPPCycles + myPipe->NumberOfCursors * DPPCLKDelayCNVCCursor; DPPCycles = DPPCycles + myPipe->NumberOfCursors * v->DPPCLKDelayCNVCCursor;
DISPCLKCycles = DISPCLKDelaySubtotal; DISPCLKCycles = v->DISPCLKDelaySubtotal;
if (myPipe->Dppclk == 0.0 || myPipe->Dispclk == 0.0) if (myPipe->Dppclk == 0.0 || myPipe->Dispclk == 0.0)
return true; return true;
...@@ -3564,7 +3551,7 @@ bool dml32_CalculatePrefetchSchedule( ...@@ -3564,7 +3551,7 @@ bool dml32_CalculatePrefetchSchedule(
dml_print("DML::%s: DSTXAfterScaler: %d\n", __func__, *DSTXAfterScaler); dml_print("DML::%s: DSTXAfterScaler: %d\n", __func__, *DSTXAfterScaler);
#endif #endif
if (OutputFormat == dm_420 || (myPipe->InterlaceEnable && myPipe->ProgressiveToInterlaceUnitInOPP)) if (v->OutputFormat[k] == dm_420 || (myPipe->InterlaceEnable && myPipe->ProgressiveToInterlaceUnitInOPP))
*DSTYAfterScaler = 1; *DSTYAfterScaler = 1;
else else
*DSTYAfterScaler = 0; *DSTYAfterScaler = 0;
...@@ -3581,13 +3568,13 @@ bool dml32_CalculatePrefetchSchedule( ...@@ -3581,13 +3568,13 @@ bool dml32_CalculatePrefetchSchedule(
Tr0_trips = trip_to_mem * (HostVMDynamicLevelsTrips + 1); Tr0_trips = trip_to_mem * (HostVMDynamicLevelsTrips + 1);
if (GPUVMEnable == true) { if (v->GPUVMEnable == true) {
Tvm_trips_rounded = dml_ceil(4.0 * Tvm_trips / LineTime, 1.0) / 4.0 * LineTime; Tvm_trips_rounded = dml_ceil(4.0 * Tvm_trips / LineTime, 1.0) / 4.0 * LineTime;
Tr0_trips_rounded = dml_ceil(4.0 * Tr0_trips / LineTime, 1.0) / 4.0 * LineTime; Tr0_trips_rounded = dml_ceil(4.0 * Tr0_trips / LineTime, 1.0) / 4.0 * LineTime;
if (GPUVMPageTableLevels >= 3) { if (v->GPUVMMaxPageTableLevels >= 3) {
*Tno_bw = UrgentExtraLatency + trip_to_mem * *Tno_bw = UrgentExtraLatency + trip_to_mem *
(double) ((GPUVMPageTableLevels - 2) * (HostVMDynamicLevelsTrips + 1) - 1); (double) ((v->GPUVMMaxPageTableLevels - 2) * (HostVMDynamicLevelsTrips + 1) - 1);
} else if (GPUVMPageTableLevels == 1 && myPipe->DCCEnable != true) { } else if (v->GPUVMMaxPageTableLevels == 1 && myPipe->DCCEnable != true) {
Tr0_trips_rounded = dml_ceil(4.0 * UrgentExtraLatency / LineTime, 1.0) / Tr0_trips_rounded = dml_ceil(4.0 * UrgentExtraLatency / LineTime, 1.0) /
4.0 * LineTime; // VBA_ERROR 4.0 * LineTime; // VBA_ERROR
*Tno_bw = UrgentExtraLatency; *Tno_bw = UrgentExtraLatency;
...@@ -3622,7 +3609,7 @@ bool dml32_CalculatePrefetchSchedule( ...@@ -3622,7 +3609,7 @@ bool dml32_CalculatePrefetchSchedule(
min_Lsw = dml_max(min_Lsw, 1.0); min_Lsw = dml_max(min_Lsw, 1.0);
Lsw_oto = dml_ceil(4.0 * dml_max(prefetch_sw_bytes / prefetch_bw_oto / LineTime, min_Lsw), 1.0) / 4.0; Lsw_oto = dml_ceil(4.0 * dml_max(prefetch_sw_bytes / prefetch_bw_oto / LineTime, min_Lsw), 1.0) / 4.0;
if (GPUVMEnable == true) { if (v->GPUVMEnable == true) {
Tvm_oto = dml_max3( Tvm_oto = dml_max3(
Tvm_trips, Tvm_trips,
*Tno_bw + PDEAndMetaPTEBytesFrame * HostVMInefficiencyFactor / prefetch_bw_oto, *Tno_bw + PDEAndMetaPTEBytesFrame * HostVMInefficiencyFactor / prefetch_bw_oto,
...@@ -3630,7 +3617,7 @@ bool dml32_CalculatePrefetchSchedule( ...@@ -3630,7 +3617,7 @@ bool dml32_CalculatePrefetchSchedule(
} else } else
Tvm_oto = LineTime / 4.0; Tvm_oto = LineTime / 4.0;
if ((GPUVMEnable == true || myPipe->DCCEnable == true)) { if ((v->GPUVMEnable == true || myPipe->DCCEnable == true)) {
Tr0_oto = dml_max4( Tr0_oto = dml_max4(
Tr0_trips, Tr0_trips,
(MetaRowByte + PixelPTEBytesPerRow * HostVMInefficiencyFactor) / prefetch_bw_oto, (MetaRowByte + PixelPTEBytesPerRow * HostVMInefficiencyFactor) / prefetch_bw_oto,
...@@ -3833,7 +3820,7 @@ bool dml32_CalculatePrefetchSchedule( ...@@ -3833,7 +3820,7 @@ bool dml32_CalculatePrefetchSchedule(
#endif #endif
if (prefetch_bw_equ > 0) { if (prefetch_bw_equ > 0) {
if (GPUVMEnable == true) { if (v->GPUVMEnable == true) {
Tvm_equ = dml_max3(*Tno_bw + PDEAndMetaPTEBytesFrame * Tvm_equ = dml_max3(*Tno_bw + PDEAndMetaPTEBytesFrame *
HostVMInefficiencyFactor / prefetch_bw_equ, HostVMInefficiencyFactor / prefetch_bw_equ,
Tvm_trips, LineTime / 4); Tvm_trips, LineTime / 4);
...@@ -3841,7 +3828,7 @@ bool dml32_CalculatePrefetchSchedule( ...@@ -3841,7 +3828,7 @@ bool dml32_CalculatePrefetchSchedule(
Tvm_equ = LineTime / 4; Tvm_equ = LineTime / 4;
} }
if ((GPUVMEnable == true || myPipe->DCCEnable == true)) { if ((v->GPUVMEnable == true || myPipe->DCCEnable == true)) {
Tr0_equ = dml_max4((MetaRowByte + PixelPTEBytesPerRow * Tr0_equ = dml_max4((MetaRowByte + PixelPTEBytesPerRow *
HostVMInefficiencyFactor) / prefetch_bw_equ, Tr0_trips, HostVMInefficiencyFactor) / prefetch_bw_equ, Tr0_trips,
(LineTime - Tvm_equ) / 2, LineTime / 4); (LineTime - Tvm_equ) / 2, LineTime / 4);
......
...@@ -714,28 +714,14 @@ double dml32_CalculateExtraLatency( ...@@ -714,28 +714,14 @@ double dml32_CalculateExtraLatency(
unsigned int HostVMMaxNonCachedPageTableLevels); unsigned int HostVMMaxNonCachedPageTableLevels);
bool dml32_CalculatePrefetchSchedule( bool dml32_CalculatePrefetchSchedule(
struct vba_vars_st *v,
unsigned int k,
double HostVMInefficiencyFactor, double HostVMInefficiencyFactor,
DmlPipe *myPipe, DmlPipe *myPipe,
unsigned int DSCDelay, unsigned int DSCDelay,
double DPPCLKDelaySubtotalPlusCNVCFormater,
double DPPCLKDelaySCL,
double DPPCLKDelaySCLLBOnly,
double DPPCLKDelayCNVCCursor,
double DISPCLKDelaySubtotal,
unsigned int DPP_RECOUT_WIDTH, unsigned int DPP_RECOUT_WIDTH,
enum output_format_class OutputFormat,
unsigned int MaxInterDCNTileRepeaters,
unsigned int VStartup, unsigned int VStartup,
unsigned int MaxVStartup, unsigned int MaxVStartup,
unsigned int GPUVMPageTableLevels,
bool GPUVMEnable,
bool HostVMEnable,
unsigned int HostVMMaxNonCachedPageTableLevels,
double HostVMMinPageSize,
bool DynamicMetadataEnable,
bool DynamicMetadataVMEnabled,
int DynamicMetadataLinesBeforeActiveRequired,
unsigned int DynamicMetadataTransmittedBytes,
double UrgentLatency, double UrgentLatency,
double UrgentExtraLatency, double UrgentExtraLatency,
double TCalc, double TCalc,
......
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