Skip to content

Commit 99e25e4

Browse files
Ivan Lipskialexdeucher
authored andcommitted
drm/amd/display: Add DPP & HUBP reset if power gate enabled on DCN314
[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>
1 parent 9c6669c commit 99e25e4

File tree

3 files changed

+37
-4
lines changed

3 files changed

+37
-4
lines changed

drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_hwseq.c

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,15 @@
5555
#include "dcn20/dcn20_optc.h"
5656
#include "dcn30/dcn30_cm_common.h"
5757

58-
#define DC_LOGGER_INIT(logger)
58+
#define DC_LOGGER_INIT(logger) \
59+
struct dal_logger *dc_logger = logger
5960

6061
#define CTX \
6162
hws->ctx
6263
#define REG(reg)\
6364
hws->regs->reg
6465
#define DC_LOGGER \
65-
stream->ctx->logger
66-
66+
dc_logger
6767

6868
#undef FN
6969
#define FN(reg_name, field_name) \
@@ -76,6 +76,8 @@ static void update_dsc_on_stream(struct pipe_ctx *pipe_ctx, bool enable)
7676
struct pipe_ctx *odm_pipe;
7777
int opp_cnt = 1;
7878

79+
DC_LOGGER_INIT(stream->ctx->logger);
80+
7981
ASSERT(dsc);
8082
for (odm_pipe = pipe_ctx->next_odm_pipe; odm_pipe; odm_pipe = odm_pipe->next_odm_pipe)
8183
opp_cnt++;
@@ -528,3 +530,32 @@ void dcn314_disable_link_output(struct dc_link *link,
528530

529531
apply_symclk_on_tx_off_wa(link);
530532
}
533+
534+
535+
void dcn314_plane_atomic_power_down(struct dc *dc,
536+
struct dpp *dpp,
537+
struct hubp *hubp)
538+
{
539+
struct dce_hwseq *hws = dc->hwseq;
540+
DC_LOGGER_INIT(dc->ctx->logger);
541+
542+
if (REG(DC_IP_REQUEST_CNTL)) {
543+
REG_SET(DC_IP_REQUEST_CNTL, 0, IP_REQUEST_EN, 1);
544+
545+
if (hws->funcs.dpp_pg_control) {
546+
hws->funcs.dpp_pg_control(hws, dpp->inst, false);
547+
dpp->funcs->dpp_reset(dpp);
548+
}
549+
550+
if (hws->funcs.hubp_pg_control) {
551+
hws->funcs.hubp_pg_control(hws, hubp->inst, false);
552+
hubp->funcs->hubp_reset(hubp);
553+
}
554+
555+
REG_SET(DC_IP_REQUEST_CNTL, 0, IP_REQUEST_EN, 0);
556+
DC_LOG_DEBUG("Power gated front end %d\n", hubp->inst);
557+
}
558+
559+
if (hws->funcs.dpp_root_clock_control)
560+
hws->funcs.dpp_root_clock_control(hws, dpp->inst, false);
561+
}

drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_hwseq.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,6 @@ void dcn314_dpp_root_clock_control(struct dce_hwseq *hws, unsigned int dpp_inst,
4747

4848
void dcn314_disable_link_output(struct dc_link *link, const struct link_resource *link_res, enum signal_type signal);
4949

50+
void dcn314_plane_atomic_power_down(struct dc *dc, struct dpp *dpp, struct hubp *hubp);
51+
5052
#endif /* __DC_HWSS_DCN314_H__ */

drivers/gpu/drm/amd/display/dc/hwss/dcn314/dcn314_init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ static const struct hwseq_private_funcs dcn314_private_funcs = {
137137
.disable_vga = dcn20_disable_vga,
138138
.bios_golden_init = dcn10_bios_golden_init,
139139
.plane_atomic_disable = dcn20_plane_atomic_disable,
140-
.plane_atomic_power_down = dcn10_plane_atomic_power_down,
140+
.plane_atomic_power_down = dcn314_plane_atomic_power_down,
141141
.enable_power_gating_plane = dcn314_enable_power_gating_plane,
142142
.dpp_root_clock_control = dcn314_dpp_root_clock_control,
143143
.hubp_pg_control = dcn31_hubp_pg_control,

0 commit comments

Comments
 (0)