Skip to content

Commit f8d7edb

Browse files
Dillon Varonealexdeucher
authored andcommitted
drm/amd/display: Set max for prefetch lines on dcn32
[WHY?] Max number of lines that can be used for prefetch due to type constraints is 63.75. [HOW?] Enforce maximum prefetch lines as 63.75. Reviewed-by: Jun Lei <Jun.Lei@amd.com> Acked-by: Tom Chung <chiahsuan.chung@amd.com> Signed-off-by: Dillon Varone <Dillon.Varone@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent c149947 commit f8d7edb

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@
4646
// Prefetch schedule max vratio
4747
#define __DML_MAX_VRATIO_PRE__ 4.0
4848

49+
#define __DML_VBA_MAX_DST_Y_PRE__ 63.75
50+
4951
#define BPP_INVALID 0
5052
#define BPP_BLENDED_PIPE 0xffffffff
5153

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3475,7 +3475,6 @@ bool dml32_CalculatePrefetchSchedule(
34753475
double min_Lsw;
34763476
double Tsw_est1 = 0;
34773477
double Tsw_est3 = 0;
3478-
double TPreMargin = 0;
34793478

34803479
if (v->GPUVMEnable == true && v->HostVMEnable == true)
34813480
HostVMDynamicLevelsTrips = v->HostVMMaxNonCachedPageTableLevels;
@@ -3669,6 +3668,7 @@ bool dml32_CalculatePrefetchSchedule(
36693668
dst_y_prefetch_equ = VStartup - (*TSetup + dml_max(TWait + TCalc, *Tdmdl)) / LineTime -
36703669
(*DSTYAfterScaler + (double) *DSTXAfterScaler / (double) myPipe->HTotal);
36713670

3671+
dst_y_prefetch_equ = dml_min(dst_y_prefetch_equ, __DML_VBA_MAX_DST_Y_PRE__);
36723672
#ifdef __DML_VBA_DEBUG__
36733673
dml_print("DML::%s: HTotal = %d\n", __func__, myPipe->HTotal);
36743674
dml_print("DML::%s: min_Lsw = %f\n", __func__, min_Lsw);
@@ -3701,8 +3701,6 @@ bool dml32_CalculatePrefetchSchedule(
37013701

37023702
dst_y_prefetch_equ = dml_floor(4.0 * (dst_y_prefetch_equ + 0.125), 1) / 4.0;
37033703
Tpre_rounded = dst_y_prefetch_equ * LineTime;
3704-
3705-
TPreMargin = Tpre_rounded - TPreReq;
37063704
#ifdef __DML_VBA_DEBUG__
37073705
dml_print("DML::%s: dst_y_prefetch_equ: %f (after round)\n", __func__, dst_y_prefetch_equ);
37083706
dml_print("DML::%s: LineTime: %f\n", __func__, LineTime);
@@ -3730,7 +3728,8 @@ bool dml32_CalculatePrefetchSchedule(
37303728
*VRatioPrefetchY = 0;
37313729
*VRatioPrefetchC = 0;
37323730
*RequiredPrefetchPixDataBWLuma = 0;
3733-
if (dst_y_prefetch_equ > 1 && TPreMargin > 0.0) {
3731+
if (dst_y_prefetch_equ > 1 &&
3732+
(Tpre_rounded >= TPreReq || dst_y_prefetch_equ == __DML_VBA_MAX_DST_Y_PRE__)) {
37343733
double PrefetchBandwidth1;
37353734
double PrefetchBandwidth2;
37363735
double PrefetchBandwidth3;

0 commit comments

Comments
 (0)