@@ -265,33 +265,13 @@ static void CalculateRowBandwidth(
265
265
266
266
static void CalculateFlipSchedule (
267
267
struct display_mode_lib * mode_lib ,
268
+ unsigned int k ,
268
269
double HostVMInefficiencyFactor ,
269
270
double UrgentExtraLatency ,
270
271
double UrgentLatency ,
271
- unsigned int GPUVMMaxPageTableLevels ,
272
- bool HostVMEnable ,
273
- unsigned int HostVMMaxNonCachedPageTableLevels ,
274
- bool GPUVMEnable ,
275
- double HostVMMinPageSize ,
276
272
double PDEAndMetaPTEBytesPerFrame ,
277
273
double MetaRowBytes ,
278
- double DPTEBytesPerRow ,
279
- double BandwidthAvailableForImmediateFlip ,
280
- unsigned int TotImmediateFlipBytes ,
281
- enum source_format_class SourcePixelFormat ,
282
- double LineTime ,
283
- double VRatio ,
284
- double VRatioChroma ,
285
- double Tno_bw ,
286
- bool DCCEnable ,
287
- unsigned int dpte_row_height ,
288
- unsigned int meta_row_height ,
289
- unsigned int dpte_row_height_chroma ,
290
- unsigned int meta_row_height_chroma ,
291
- double * DestinationLinesToRequestVMInImmediateFlip ,
292
- double * DestinationLinesToRequestRowInImmediateFlip ,
293
- double * final_flip_bw ,
294
- bool * ImmediateFlipSupportedForPipe );
274
+ double DPTEBytesPerRow );
295
275
static double CalculateWriteBackDelay (
296
276
enum source_format_class WritebackPixelFormat ,
297
277
double WritebackHRatio ,
@@ -2892,33 +2872,13 @@ static void DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerforman
2892
2872
for (k = 0 ; k < v -> NumberOfActivePlanes ; ++ k ) {
2893
2873
CalculateFlipSchedule (
2894
2874
mode_lib ,
2875
+ k ,
2895
2876
HostVMInefficiencyFactor ,
2896
2877
v -> UrgentExtraLatency ,
2897
2878
v -> UrgentLatency ,
2898
- v -> GPUVMMaxPageTableLevels ,
2899
- v -> HostVMEnable ,
2900
- v -> HostVMMaxNonCachedPageTableLevels ,
2901
- v -> GPUVMEnable ,
2902
- v -> HostVMMinPageSize ,
2903
2879
v -> PDEAndMetaPTEBytesFrame [k ],
2904
2880
v -> MetaRowByte [k ],
2905
- v -> PixelPTEBytesPerRow [k ],
2906
- v -> BandwidthAvailableForImmediateFlip ,
2907
- v -> TotImmediateFlipBytes ,
2908
- v -> SourcePixelFormat [k ],
2909
- v -> HTotal [k ] / v -> PixelClock [k ],
2910
- v -> VRatio [k ],
2911
- v -> VRatioChroma [k ],
2912
- v -> Tno_bw [k ],
2913
- v -> DCCEnable [k ],
2914
- v -> dpte_row_height [k ],
2915
- v -> meta_row_height [k ],
2916
- v -> dpte_row_height_chroma [k ],
2917
- v -> meta_row_height_chroma [k ],
2918
- & v -> DestinationLinesToRequestVMInImmediateFlip [k ],
2919
- & v -> DestinationLinesToRequestRowInImmediateFlip [k ],
2920
- & v -> final_flip_bw [k ],
2921
- & v -> ImmediateFlipSupportedForPipe [k ]);
2881
+ v -> PixelPTEBytesPerRow [k ]);
2922
2882
}
2923
2883
2924
2884
v -> total_dcn_read_bw_with_flip = 0.0 ;
@@ -3638,61 +3598,43 @@ static void CalculateRowBandwidth(
3638
3598
3639
3599
static void CalculateFlipSchedule (
3640
3600
struct display_mode_lib * mode_lib ,
3601
+ unsigned int k ,
3641
3602
double HostVMInefficiencyFactor ,
3642
3603
double UrgentExtraLatency ,
3643
3604
double UrgentLatency ,
3644
- unsigned int GPUVMMaxPageTableLevels ,
3645
- bool HostVMEnable ,
3646
- unsigned int HostVMMaxNonCachedPageTableLevels ,
3647
- bool GPUVMEnable ,
3648
- double HostVMMinPageSize ,
3649
3605
double PDEAndMetaPTEBytesPerFrame ,
3650
3606
double MetaRowBytes ,
3651
- double DPTEBytesPerRow ,
3652
- double BandwidthAvailableForImmediateFlip ,
3653
- unsigned int TotImmediateFlipBytes ,
3654
- enum source_format_class SourcePixelFormat ,
3655
- double LineTime ,
3656
- double VRatio ,
3657
- double VRatioChroma ,
3658
- double Tno_bw ,
3659
- bool DCCEnable ,
3660
- unsigned int dpte_row_height ,
3661
- unsigned int meta_row_height ,
3662
- unsigned int dpte_row_height_chroma ,
3663
- unsigned int meta_row_height_chroma ,
3664
- double * DestinationLinesToRequestVMInImmediateFlip ,
3665
- double * DestinationLinesToRequestRowInImmediateFlip ,
3666
- double * final_flip_bw ,
3667
- bool * ImmediateFlipSupportedForPipe )
3607
+ double DPTEBytesPerRow )
3668
3608
{
3609
+ struct vba_vars_st * v = & mode_lib -> vba ;
3669
3610
double min_row_time = 0.0 ;
3670
3611
unsigned int HostVMDynamicLevelsTrips ;
3671
3612
double TimeForFetchingMetaPTEImmediateFlip ;
3672
3613
double TimeForFetchingRowInVBlankImmediateFlip ;
3673
3614
double ImmediateFlipBW ;
3615
+ double LineTime = v -> HTotal [k ] / v -> PixelClock [k ];
3674
3616
3675
- if (GPUVMEnable == true && HostVMEnable == true) {
3676
- HostVMDynamicLevelsTrips = HostVMMaxNonCachedPageTableLevels ;
3617
+ if (v -> GPUVMEnable == true && v -> HostVMEnable == true) {
3618
+ HostVMDynamicLevelsTrips = v -> HostVMMaxNonCachedPageTableLevels ;
3677
3619
} else {
3678
3620
HostVMDynamicLevelsTrips = 0 ;
3679
3621
}
3680
3622
3681
- if (GPUVMEnable == true || DCCEnable == true) {
3682
- ImmediateFlipBW = (PDEAndMetaPTEBytesPerFrame + MetaRowBytes + DPTEBytesPerRow ) * BandwidthAvailableForImmediateFlip / TotImmediateFlipBytes ;
3623
+ if (v -> GPUVMEnable == true || v -> DCCEnable [ k ] == true) {
3624
+ ImmediateFlipBW = (PDEAndMetaPTEBytesPerFrame + MetaRowBytes + DPTEBytesPerRow ) * v -> BandwidthAvailableForImmediateFlip / v -> TotImmediateFlipBytes ;
3683
3625
}
3684
3626
3685
- if (GPUVMEnable == true) {
3627
+ if (v -> GPUVMEnable == true) {
3686
3628
TimeForFetchingMetaPTEImmediateFlip = dml_max3 (
3687
- Tno_bw + PDEAndMetaPTEBytesPerFrame * HostVMInefficiencyFactor / ImmediateFlipBW ,
3688
- UrgentExtraLatency + UrgentLatency * (GPUVMMaxPageTableLevels * (HostVMDynamicLevelsTrips + 1 ) - 1 ),
3629
+ v -> Tno_bw [ k ] + PDEAndMetaPTEBytesPerFrame * HostVMInefficiencyFactor / ImmediateFlipBW ,
3630
+ UrgentExtraLatency + UrgentLatency * (v -> GPUVMMaxPageTableLevels * (HostVMDynamicLevelsTrips + 1 ) - 1 ),
3689
3631
LineTime / 4.0 );
3690
3632
} else {
3691
3633
TimeForFetchingMetaPTEImmediateFlip = 0 ;
3692
3634
}
3693
3635
3694
- * DestinationLinesToRequestVMInImmediateFlip = dml_ceil (4.0 * (TimeForFetchingMetaPTEImmediateFlip / LineTime ), 1 ) / 4.0 ;
3695
- if ((GPUVMEnable == true || DCCEnable == true)) {
3636
+ v -> DestinationLinesToRequestVMInImmediateFlip [ k ] = dml_ceil (4.0 * (TimeForFetchingMetaPTEImmediateFlip / LineTime ), 1 ) / 4.0 ;
3637
+ if ((v -> GPUVMEnable == true || v -> DCCEnable [ k ] == true)) {
3696
3638
TimeForFetchingRowInVBlankImmediateFlip = dml_max3 (
3697
3639
(MetaRowBytes + DPTEBytesPerRow * HostVMInefficiencyFactor ) / ImmediateFlipBW ,
3698
3640
UrgentLatency * (HostVMDynamicLevelsTrips + 1 ),
@@ -3701,54 +3643,54 @@ static void CalculateFlipSchedule(
3701
3643
TimeForFetchingRowInVBlankImmediateFlip = 0 ;
3702
3644
}
3703
3645
3704
- * DestinationLinesToRequestRowInImmediateFlip = dml_ceil (4.0 * (TimeForFetchingRowInVBlankImmediateFlip / LineTime ), 1 ) / 4.0 ;
3646
+ v -> DestinationLinesToRequestRowInImmediateFlip [ k ] = dml_ceil (4.0 * (TimeForFetchingRowInVBlankImmediateFlip / LineTime ), 1 ) / 4.0 ;
3705
3647
3706
- if (GPUVMEnable == true) {
3707
- * final_flip_bw = dml_max (
3708
- PDEAndMetaPTEBytesPerFrame * HostVMInefficiencyFactor / (* DestinationLinesToRequestVMInImmediateFlip * LineTime ),
3709
- (MetaRowBytes + DPTEBytesPerRow * HostVMInefficiencyFactor ) / (* DestinationLinesToRequestRowInImmediateFlip * LineTime ));
3710
- } else if ((GPUVMEnable == true || DCCEnable == true)) {
3711
- * final_flip_bw = (MetaRowBytes + DPTEBytesPerRow * HostVMInefficiencyFactor ) / (* DestinationLinesToRequestRowInImmediateFlip * LineTime );
3648
+ if (v -> GPUVMEnable == true) {
3649
+ v -> final_flip_bw [ k ] = dml_max (
3650
+ PDEAndMetaPTEBytesPerFrame * HostVMInefficiencyFactor / (v -> DestinationLinesToRequestVMInImmediateFlip [ k ] * LineTime ),
3651
+ (MetaRowBytes + DPTEBytesPerRow * HostVMInefficiencyFactor ) / (v -> DestinationLinesToRequestRowInImmediateFlip [ k ] * LineTime ));
3652
+ } else if ((v -> GPUVMEnable == true || v -> DCCEnable [ k ] == true)) {
3653
+ v -> final_flip_bw [ k ] = (MetaRowBytes + DPTEBytesPerRow * HostVMInefficiencyFactor ) / (v -> DestinationLinesToRequestRowInImmediateFlip [ k ] * LineTime );
3712
3654
} else {
3713
- * final_flip_bw = 0 ;
3655
+ v -> final_flip_bw [ k ] = 0 ;
3714
3656
}
3715
3657
3716
- if (SourcePixelFormat == dm_420_8 || SourcePixelFormat == dm_420_10 || SourcePixelFormat == dm_rgbe_alpha ) {
3717
- if (GPUVMEnable == true && DCCEnable != true) {
3718
- min_row_time = dml_min (dpte_row_height * LineTime / VRatio , dpte_row_height_chroma * LineTime / VRatioChroma );
3719
- } else if (GPUVMEnable != true && DCCEnable == true) {
3720
- min_row_time = dml_min (meta_row_height * LineTime / VRatio , meta_row_height_chroma * LineTime / VRatioChroma );
3658
+ if (v -> SourcePixelFormat [ k ] == dm_420_8 || v -> SourcePixelFormat [ k ] == dm_420_10 || v -> SourcePixelFormat [ k ] == dm_rgbe_alpha ) {
3659
+ if (v -> GPUVMEnable == true && v -> DCCEnable [ k ] != true) {
3660
+ min_row_time = dml_min (v -> dpte_row_height [ k ] * LineTime / v -> VRatio [ k ], v -> dpte_row_height_chroma [ k ] * LineTime / v -> VRatioChroma [ k ] );
3661
+ } else if (v -> GPUVMEnable != true && v -> DCCEnable [ k ] == true) {
3662
+ min_row_time = dml_min (v -> meta_row_height [ k ] * LineTime / v -> VRatio [ k ], v -> meta_row_height_chroma [ k ] * LineTime / v -> VRatioChroma [ k ] );
3721
3663
} else {
3722
3664
min_row_time = dml_min4 (
3723
- dpte_row_height * LineTime / VRatio ,
3724
- meta_row_height * LineTime / VRatio ,
3725
- dpte_row_height_chroma * LineTime / VRatioChroma ,
3726
- meta_row_height_chroma * LineTime / VRatioChroma );
3665
+ v -> dpte_row_height [ k ] * LineTime / v -> VRatio [ k ] ,
3666
+ v -> meta_row_height [ k ] * LineTime / v -> VRatio [ k ] ,
3667
+ v -> dpte_row_height_chroma [ k ] * LineTime / v -> VRatioChroma [ k ] ,
3668
+ v -> meta_row_height_chroma [ k ] * LineTime / v -> VRatioChroma [ k ] );
3727
3669
}
3728
3670
} else {
3729
- if (GPUVMEnable == true && DCCEnable != true) {
3730
- min_row_time = dpte_row_height * LineTime / VRatio ;
3731
- } else if (GPUVMEnable != true && DCCEnable == true) {
3732
- min_row_time = meta_row_height * LineTime / VRatio ;
3671
+ if (v -> GPUVMEnable == true && v -> DCCEnable [ k ] != true) {
3672
+ min_row_time = v -> dpte_row_height [ k ] * LineTime / v -> VRatio [ k ] ;
3673
+ } else if (v -> GPUVMEnable != true && v -> DCCEnable [ k ] == true) {
3674
+ min_row_time = v -> meta_row_height [ k ] * LineTime / v -> VRatio [ k ] ;
3733
3675
} else {
3734
- min_row_time = dml_min (dpte_row_height * LineTime / VRatio , meta_row_height * LineTime / VRatio );
3676
+ min_row_time = dml_min (v -> dpte_row_height [ k ] * LineTime / v -> VRatio [ k ], v -> meta_row_height [ k ] * LineTime / v -> VRatio [ k ] );
3735
3677
}
3736
3678
}
3737
3679
3738
- if (* DestinationLinesToRequestVMInImmediateFlip >= 32 || * DestinationLinesToRequestRowInImmediateFlip >= 16
3680
+ if (v -> DestinationLinesToRequestVMInImmediateFlip [ k ] >= 32 || v -> DestinationLinesToRequestRowInImmediateFlip [ k ] >= 16
3739
3681
|| TimeForFetchingMetaPTEImmediateFlip + 2 * TimeForFetchingRowInVBlankImmediateFlip > min_row_time ) {
3740
- * ImmediateFlipSupportedForPipe = false;
3682
+ v -> ImmediateFlipSupportedForPipe [ k ] = false;
3741
3683
} else {
3742
- * ImmediateFlipSupportedForPipe = true;
3684
+ v -> ImmediateFlipSupportedForPipe [ k ] = true;
3743
3685
}
3744
3686
3745
3687
#ifdef __DML_VBA_DEBUG__
3746
- dml_print ("DML::%s: DestinationLinesToRequestVMInImmediateFlip = %f\n" , __func__ , * DestinationLinesToRequestVMInImmediateFlip );
3747
- dml_print ("DML::%s: DestinationLinesToRequestRowInImmediateFlip = %f\n" , __func__ , * DestinationLinesToRequestRowInImmediateFlip );
3688
+ dml_print ("DML::%s: DestinationLinesToRequestVMInImmediateFlip = %f\n" , __func__ , v -> DestinationLinesToRequestVMInImmediateFlip [ k ] );
3689
+ dml_print ("DML::%s: DestinationLinesToRequestRowInImmediateFlip = %f\n" , __func__ , v -> DestinationLinesToRequestRowInImmediateFlip [ k ] );
3748
3690
dml_print ("DML::%s: TimeForFetchingMetaPTEImmediateFlip = %f\n" , __func__ , TimeForFetchingMetaPTEImmediateFlip );
3749
3691
dml_print ("DML::%s: TimeForFetchingRowInVBlankImmediateFlip = %f\n" , __func__ , TimeForFetchingRowInVBlankImmediateFlip );
3750
3692
dml_print ("DML::%s: min_row_time = %f\n" , __func__ , min_row_time );
3751
- dml_print ("DML::%s: ImmediateFlipSupportedForPipe = %d\n" , __func__ , * ImmediateFlipSupportedForPipe );
3693
+ dml_print ("DML::%s: ImmediateFlipSupportedForPipe = %d\n" , __func__ , v -> ImmediateFlipSupportedForPipe [ k ] );
3752
3694
#endif
3753
3695
3754
3696
}
@@ -5340,33 +5282,13 @@ void dml314_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_
5340
5282
for (k = 0 ; k < v -> NumberOfActivePlanes ; k ++ ) {
5341
5283
CalculateFlipSchedule (
5342
5284
mode_lib ,
5285
+ k ,
5343
5286
HostVMInefficiencyFactor ,
5344
5287
v -> ExtraLatency ,
5345
5288
v -> UrgLatency [i ],
5346
- v -> GPUVMMaxPageTableLevels ,
5347
- v -> HostVMEnable ,
5348
- v -> HostVMMaxNonCachedPageTableLevels ,
5349
- v -> GPUVMEnable ,
5350
- v -> HostVMMinPageSize ,
5351
5289
v -> PDEAndMetaPTEBytesPerFrame [i ][j ][k ],
5352
5290
v -> MetaRowBytes [i ][j ][k ],
5353
- v -> DPTEBytesPerRow [i ][j ][k ],
5354
- v -> BandwidthAvailableForImmediateFlip ,
5355
- v -> TotImmediateFlipBytes ,
5356
- v -> SourcePixelFormat [k ],
5357
- v -> HTotal [k ] / v -> PixelClock [k ],
5358
- v -> VRatio [k ],
5359
- v -> VRatioChroma [k ],
5360
- v -> Tno_bw [k ],
5361
- v -> DCCEnable [k ],
5362
- v -> dpte_row_height [k ],
5363
- v -> meta_row_height [k ],
5364
- v -> dpte_row_height_chroma [k ],
5365
- v -> meta_row_height_chroma [k ],
5366
- & v -> DestinationLinesToRequestVMInImmediateFlip [k ],
5367
- & v -> DestinationLinesToRequestRowInImmediateFlip [k ],
5368
- & v -> final_flip_bw [k ],
5369
- & v -> ImmediateFlipSupportedForPipe [k ]);
5291
+ v -> DPTEBytesPerRow [i ][j ][k ]);
5370
5292
}
5371
5293
v -> total_dcn_read_bw_with_flip = 0.0 ;
5372
5294
for (k = 0 ; k < v -> NumberOfActivePlanes ; k ++ ) {
0 commit comments