]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amd/display: Add DPP & HUBP reset if power gate enabled on DCN314
authorIvan Lipski <ivlipski@amd.com>
Thu, 19 Jun 2025 22:14:52 +0000 (18:14 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 30 Jun 2025 15:59:29 +0000 (11:59 -0400)
[WHY]
On DCN314, using full screen application with enabled scaling like 150%,
175%, with overlay cursor, causes a second cursor to appear when changing
planes. Dpp cache is used to track the HW cursor enable. Since power gate
is disabled for hubp & dpp in DCN314, dpp_reset() zero'ed the dpp struct,
while the dpp hardware was not power gated.

So, when plane is changed in a full screen app, and the overlay cursor is
enabled, the cache is cleared, so the cache does not represent the actual
cursor state.

[HOW]
Added conditionals for dpp & hubp reset and their pg_control functions
only if according power_gate flags are enabled.

Reviewed-by: Sun peng Li <sunpeng.li@amd.com>
Signed-off-by: Ivan Lipski <ivlipski@amd.com>
Signed-off-by: Ray Wu <ray.wu@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_hwseq.c
drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_hwseq.h
drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_init.c

index e68f21fd5f0fb498699d8ecd688fb552e1577a86..a40e119d8582e6f932e6c86794d793e7c517efcf 100644 (file)
 #include "dcn20/dcn20_optc.h"
 #include "dcn30/dcn30_cm_common.h"
 
-#define DC_LOGGER_INIT(logger)
+#define DC_LOGGER_INIT(logger) \
+       struct dal_logger *dc_logger = logger
 
 #define CTX \
        hws->ctx
 #define REG(reg)\
        hws->regs->reg
 #define DC_LOGGER \
-       stream->ctx->logger
-
+       dc_logger
 
 #undef FN
 #define FN(reg_name, field_name) \
@@ -76,6 +76,8 @@ static void update_dsc_on_stream(struct pipe_ctx *pipe_ctx, bool enable)
        struct pipe_ctx *odm_pipe;
        int opp_cnt = 1;
 
+       DC_LOGGER_INIT(stream->ctx->logger);
+
        ASSERT(dsc);
        for (odm_pipe = pipe_ctx->next_odm_pipe; odm_pipe; odm_pipe = odm_pipe->next_odm_pipe)
                opp_cnt++;
@@ -528,3 +530,32 @@ void dcn314_disable_link_output(struct dc_link *link,
 
        apply_symclk_on_tx_off_wa(link);
 }
+
+
+void dcn314_plane_atomic_power_down(struct dc *dc,
+               struct dpp *dpp,
+               struct hubp *hubp)
+{
+       struct dce_hwseq *hws = dc->hwseq;
+       DC_LOGGER_INIT(dc->ctx->logger);
+
+       if (REG(DC_IP_REQUEST_CNTL)) {
+               REG_SET(DC_IP_REQUEST_CNTL, 0, IP_REQUEST_EN, 1);
+
+               if (hws->funcs.dpp_pg_control) {
+                       hws->funcs.dpp_pg_control(hws, dpp->inst, false);
+                       dpp->funcs->dpp_reset(dpp);
+               }
+
+               if (hws->funcs.hubp_pg_control) {
+                       hws->funcs.hubp_pg_control(hws, hubp->inst, false);
+                       hubp->funcs->hubp_reset(hubp);
+               }
+
+               REG_SET(DC_IP_REQUEST_CNTL, 0, IP_REQUEST_EN, 0);
+               DC_LOG_DEBUG("Power gated front end %d\n", hubp->inst);
+       }
+
+       if (hws->funcs.dpp_root_clock_control)
+               hws->funcs.dpp_root_clock_control(hws, dpp->inst, false);
+}
index 2305ad282f218b3d304ca92b0e5e7e2d61695d6a..12a57b79edfbb27a35f2418831f87b2078db5e80 100644 (file)
@@ -47,4 +47,6 @@ void dcn314_dpp_root_clock_control(struct dce_hwseq *hws, unsigned int dpp_inst,
 
 void dcn314_disable_link_output(struct dc_link *link, const struct link_resource *link_res, enum signal_type signal);
 
+void dcn314_plane_atomic_power_down(struct dc *dc, struct dpp *dpp, struct hubp *hubp);
+
 #endif /* __DC_HWSS_DCN314_H__ */
index f5112742edf9b4e7722bbbbb041e81551644e121..6963d25608ac0d0f2172fd2cf7643a53100b5774 100644 (file)
@@ -137,7 +137,7 @@ static const struct hwseq_private_funcs dcn314_private_funcs = {
        .disable_vga = dcn20_disable_vga,
        .bios_golden_init = dcn10_bios_golden_init,
        .plane_atomic_disable = dcn20_plane_atomic_disable,
-       .plane_atomic_power_down = dcn10_plane_atomic_power_down,
+       .plane_atomic_power_down = dcn314_plane_atomic_power_down,
        .enable_power_gating_plane = dcn314_enable_power_gating_plane,
        .dpp_root_clock_control = dcn314_dpp_root_clock_control,
        .hubp_pg_control = dcn31_hubp_pg_control,