drm/amd/display: Enforce 60us prefetch for 200Mhz DCFCLK modes
authorjsg <jsg@openbsd.org>
Tue, 13 Jun 2023 03:23:52 +0000 (03:23 +0000)
committerjsg <jsg@openbsd.org>
Tue, 13 Jun 2023 03:23:52 +0000 (03:23 +0000)
From Alvin Lee
348dcdf102a44ab5b389c4cd932bc1a61e210f6d in linux-6.1.y/6.1.29
b504f99ccaa64da364443431e388ecf30b604e38 in mainline linux

sys/dev/pci/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c
sys/dev/pci/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.h

index 820042f..e02e9d4 100644 (file)
@@ -807,7 +807,8 @@ static void DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerforman
                                        v->SwathHeightY[k],
                                        v->SwathHeightC[k],
                                        TWait,
-                                       v->DRAMSpeedPerState[mode_lib->vba.VoltageLevel] <= MEM_STROBE_FREQ_MHZ ?
+                                       (v->DRAMSpeedPerState[mode_lib->vba.VoltageLevel] <= MEM_STROBE_FREQ_MHZ ||
+                                               v->DCFCLKPerState[mode_lib->vba.VoltageLevel] <= MIN_DCFCLK_FREQ_MHZ) ?
                                                        mode_lib->vba.ip.min_prefetch_in_strobe_us : 0,
                                        /* Output */
                                        &v->DSTXAfterScaler[k],
@@ -3288,7 +3289,7 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l
                                                        v->swath_width_chroma_ub_this_state[k],
                                                        v->SwathHeightYThisState[k],
                                                        v->SwathHeightCThisState[k], v->TWait,
-                                                       v->DRAMSpeedPerState[i] <= MEM_STROBE_FREQ_MHZ ?
+                                                       (v->DRAMSpeedPerState[i] <= MEM_STROBE_FREQ_MHZ || v->DCFCLKState[i][j] <= MIN_DCFCLK_FREQ_MHZ) ?
                                                                        mode_lib->vba.ip.min_prefetch_in_strobe_us : 0,
 
                                                        /* Output */
index c8b28c8..e92eee2 100644 (file)
@@ -52,6 +52,7 @@
 #define BPP_BLENDED_PIPE 0xffffffff
 
 #define MEM_STROBE_FREQ_MHZ 1600
+#define MIN_DCFCLK_FREQ_MHZ 200
 #define MEM_STROBE_MAX_DELIVERY_TIME_US 60.0
 
 struct display_mode_lib;