]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/amd/display: DPP DTO isn't update properly.
authorYongqiang Sun <yongqiang.sun@amd.com>
Thu, 5 Mar 2020 18:47:26 +0000 (13:47 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 19 Mar 2020 04:03:04 +0000 (00:03 -0400)
[Why]
before update dpp DTO, we check dppclks in context to determine it is
changed or not, but dppclks in context will be updated anyways after
flip is done, so compare dppclks in context will always get an equal
result.

[How]
Add pipe dpp clks in dccg and compare values between dccg and context.

Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com>
Reviewed-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dccg.c
drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h

index 368d497bc64b2f5e219a6a603029faa757524917..55d09adbf0d99f534fb1e2913ba457dcc759b9d3 100644 (file)
@@ -115,12 +115,11 @@ void dcn20_update_clocks_update_dpp_dto(struct clk_mgr_internal *clk_mgr,
                dpp_inst = i;
                dppclk_khz = context->res_ctx.pipe_ctx[i].plane_res.bw.dppclk_khz;
 
-               prev_dppclk_khz = clk_mgr->base.ctx->dc->current_state->res_ctx.pipe_ctx[i].plane_res.bw.dppclk_khz;
+               prev_dppclk_khz = clk_mgr->dccg->pipe_dppclk_khz[i];
 
-               if (safe_to_lower || prev_dppclk_khz < dppclk_khz) {
+               if (safe_to_lower || prev_dppclk_khz < dppclk_khz)
                        clk_mgr->dccg->funcs->update_dpp_dto(
                                                        clk_mgr->dccg, dpp_inst, dppclk_khz);
-               }
        }
 }
 
index 50bffbfdd3947b8fecca4c522e033cea299859ac..62cc2651e00c1a1fea1876b09780053d453520a2 100644 (file)
@@ -70,6 +70,8 @@ void dccg2_update_dpp_dto(struct dccg *dccg, int dpp_inst, int req_dppclk)
                REG_UPDATE(DPPCLK_DTO_CTRL,
                                DPPCLK_DTO_ENABLE[dpp_inst], 0);
        }
+
+       dccg->pipe_dppclk_khz[dpp_inst] = req_dppclk;
 }
 
 void dccg2_get_dccg_ref_freq(struct dccg *dccg,
index 05ee5295d2c15935f2cef0f9f3cb292c98db2445..336c80a18175754114dda81996ed80c861f126c0 100644 (file)
 #define __DAL_DCCG_H__
 
 #include "dc_types.h"
+#include "hw_shared.h"
 
 struct dccg {
        struct dc_context *ctx;
        const struct dccg_funcs *funcs;
-
+       int pipe_dppclk_khz[MAX_PIPES];
        int ref_dppclk;
 };