drm/amd/display: Limit minimum DPPCLK to 100MHz.
authorYongqiang Sun <yongqiang.sun@amd.com>
Thu, 23 Jan 2020 21:30:15 +0000 (16:30 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 6 Feb 2020 20:04:38 +0000 (15:04 -0500)
[Why]
Underflow is observed when plug in a 4K@60 monitor with
1366x768 eDP due to DPPCLK is too low.

[How]
Limit minimum DPPCLK to 100MHz.

Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com>
Reviewed-by: Eric Yang <eric.yang2@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/clk_mgr/dcn21/rn_clk_mgr.c

index 8ecb98c29eb93ddb24b739592b94f26708fe3efa..5d82ec1f1ce54824694c8ef9bbb78add5a5ced48 100644 (file)
@@ -151,6 +151,12 @@ void rn_update_clocks(struct clk_mgr *clk_mgr_base,
                rn_vbios_smu_set_min_deep_sleep_dcfclk(clk_mgr, clk_mgr_base->clks.dcfclk_deep_sleep_khz);
        }
 
+       // workaround: Limit dppclk to 100Mhz to avoid lower eDP panel switch to plus 4K monitor underflow.
+       if (!IS_DIAG_DC(dc->ctx->dce_environment)) {
+               if (new_clocks->dppclk_khz < 100000)
+                       new_clocks->dppclk_khz = 100000;
+       }
+
        if (should_set_clock(safe_to_lower, new_clocks->dppclk_khz, clk_mgr->base.clks.dppclk_khz)) {
                if (clk_mgr->base.clks.dppclk_khz > new_clocks->dppclk_khz)
                        dpp_clock_lowered = true;