OSDN Git Service

drm/amd/display: fix DML not calculating delivery time
authorJun Lei <Jun.Lei@amd.com>
Wed, 7 Aug 2019 20:24:46 +0000 (16:24 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 23 Aug 2019 16:43:35 +0000 (11:43 -0500)
[why]
Calculating DCFCLK DS time requires calculating
delivery time for luma/chroma, but this value is
not calculated in DMLv2, it was inadvertently
removed when porting DMLv2

[how]
Add the calculation back

Signed-off-by: Jun Lei <Jun.Lei@amd.com>
Reviewed-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20v2.c

index 22455db..0fafd69 100644 (file)
@@ -1475,6 +1475,33 @@ static void dml20v2_DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndP
                                                        / mode_lib->vba.ReturnBW;
 
        mode_lib->vba.LastPixelOfLineExtraWatermark = 0;
+       for (k = 0; k < mode_lib->vba.NumberOfActivePlanes; ++k) {
+                       if (mode_lib->vba.VRatio[k] <= 1.0)
+                               mode_lib->vba.DisplayPipeLineDeliveryTimeLuma[k] =
+                                               (double) mode_lib->vba.SwathWidthY[k]
+                                                               * mode_lib->vba.DPPPerPlane[k]
+                                                               / mode_lib->vba.HRatio[k]
+                                                               / mode_lib->vba.PixelClock[k];
+                       else
+                               mode_lib->vba.DisplayPipeLineDeliveryTimeLuma[k] =
+                                               (double) mode_lib->vba.SwathWidthY[k]
+                                                               / mode_lib->vba.PSCL_THROUGHPUT_LUMA[k]
+                                                               / mode_lib->vba.DPPCLK[k];
+
+                       if (mode_lib->vba.BytePerPixelDETC[k] == 0)
+                               mode_lib->vba.DisplayPipeLineDeliveryTimeChroma[k] = 0.0;
+                       else if (mode_lib->vba.VRatio[k] / 2.0 <= 1.0)
+                               mode_lib->vba.DisplayPipeLineDeliveryTimeChroma[k] =
+                                               mode_lib->vba.SwathWidthY[k] / 2.0
+                                                               * mode_lib->vba.DPPPerPlane[k]
+                                                               / (mode_lib->vba.HRatio[k] / 2.0)
+                                                               / mode_lib->vba.PixelClock[k];
+                       else
+                               mode_lib->vba.DisplayPipeLineDeliveryTimeChroma[k] =
+                                               mode_lib->vba.SwathWidthY[k] / 2.0
+                                                               / mode_lib->vba.PSCL_THROUGHPUT_CHROMA[k]
+                                                               / mode_lib->vba.DPPCLK[k];
+               }
 
        mode_lib->vba.UrgentExtraLatency = mode_lib->vba.UrgentRoundTripAndOutOfOrderLatency
                        + (mode_lib->vba.TotalActiveDPP * mode_lib->vba.PixelChunkSizeInKByte