Skip to content

Commit 2641c7b

Browse files
Dmytro Laktyushkinalexdeucher
authored andcommitted
drm/amd/display: use low clocks for no plane configs
Stream only configurations do not require DCFCLK, SOCCLK, DPPCLK or FCLK. They also always allow pstate change. Reviewed-by: Charlene Liu <[email protected]> Acked-by: Tom Chung <[email protected]> Signed-off-by: Dmytro Laktyushkin <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent e4c1b01 commit 2641c7b

File tree

2 files changed

+27
-5
lines changed

2 files changed

+27
-5
lines changed

drivers/gpu/drm/amd/display/dc/dml/dcn31/dcn31_fpu.c

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ void dcn31_calculate_wm_and_dlg_fp(
483483
int pipe_cnt,
484484
int vlevel)
485485
{
486-
int i, pipe_idx, active_dpp_count = 0;
486+
int i, pipe_idx, active_hubp_count = 0;
487487
double dcfclk = context->bw_ctx.dml.vba.DCFCLKState[vlevel][context->bw_ctx.dml.vba.maxMpcComb];
488488

489489
dc_assert_fp_enabled();
@@ -529,7 +529,7 @@ void dcn31_calculate_wm_and_dlg_fp(
529529
continue;
530530

531531
if (context->res_ctx.pipe_ctx[i].plane_state)
532-
active_dpp_count++;
532+
active_hubp_count++;
533533

534534
pipes[pipe_idx].clks_cfg.dispclk_mhz = get_dispclk_calculated(&context->bw_ctx.dml, pipes, pipe_cnt);
535535
pipes[pipe_idx].clks_cfg.dppclk_mhz = get_dppclk_calculated(&context->bw_ctx.dml, pipes, pipe_cnt, pipe_idx);
@@ -547,9 +547,19 @@ void dcn31_calculate_wm_and_dlg_fp(
547547
}
548548

549549
dcn20_calculate_dlg_params(dc, context, pipes, pipe_cnt, vlevel);
550-
/* For 31x apu pstate change is only supported if possible in vactive or if there are no active dpps */
550+
/* For 31x apu pstate change is only supported if possible in vactive*/
551551
context->bw_ctx.bw.dcn.clk.p_state_change_support =
552-
context->bw_ctx.dml.vba.DRAMClockChangeSupport[vlevel][context->bw_ctx.dml.vba.maxMpcComb] == dm_dram_clock_change_vactive || !active_dpp_count;
552+
context->bw_ctx.dml.vba.DRAMClockChangeSupport[vlevel][context->bw_ctx.dml.vba.maxMpcComb] == dm_dram_clock_change_vactive;
553+
/* If DCN isn't making memory requests we can allow pstate change and lower clocks */
554+
if (!active_hubp_count) {
555+
context->bw_ctx.bw.dcn.clk.socclk_khz = 0;
556+
context->bw_ctx.bw.dcn.clk.dppclk_khz = 0;
557+
context->bw_ctx.bw.dcn.clk.dcfclk_khz = 0;
558+
context->bw_ctx.bw.dcn.clk.dcfclk_deep_sleep_khz = 0;
559+
context->bw_ctx.bw.dcn.clk.dramclk_khz = 0;
560+
context->bw_ctx.bw.dcn.clk.fclk_khz = 0;
561+
context->bw_ctx.bw.dcn.clk.p_state_change_support = true;
562+
}
553563
}
554564

555565
void dcn31_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_params)

drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1228,7 +1228,7 @@ static void dcn32_calculate_dlg_params(struct dc *dc, struct dc_state *context,
12281228
display_e2e_pipe_params_st *pipes,
12291229
int pipe_cnt, int vlevel)
12301230
{
1231-
int i, pipe_idx;
1231+
int i, pipe_idx, active_hubp_count = 0;
12321232
bool usr_retraining_support = false;
12331233
bool unbounded_req_enabled = false;
12341234

@@ -1273,6 +1273,8 @@ static void dcn32_calculate_dlg_params(struct dc *dc, struct dc_state *context,
12731273
for (i = 0, pipe_idx = 0; i < dc->res_pool->pipe_count; i++) {
12741274
if (!context->res_ctx.pipe_ctx[i].stream)
12751275
continue;
1276+
if (context->res_ctx.pipe_ctx[i].plane_state)
1277+
active_hubp_count++;
12761278
pipes[pipe_idx].pipe.dest.vstartup_start = get_vstartup(&context->bw_ctx.dml, pipes, pipe_cnt,
12771279
pipe_idx);
12781280
pipes[pipe_idx].pipe.dest.vupdate_offset = get_vupdate_offset(&context->bw_ctx.dml, pipes, pipe_cnt,
@@ -1298,6 +1300,16 @@ static void dcn32_calculate_dlg_params(struct dc *dc, struct dc_state *context,
12981300
context->res_ctx.pipe_ctx[i].pipe_dlg_param = pipes[pipe_idx].pipe.dest;
12991301
pipe_idx++;
13001302
}
1303+
/* If DCN isn't making memory requests we can allow pstate change and lower clocks */
1304+
if (!active_hubp_count) {
1305+
context->bw_ctx.bw.dcn.clk.socclk_khz = 0;
1306+
context->bw_ctx.bw.dcn.clk.dppclk_khz = 0;
1307+
context->bw_ctx.bw.dcn.clk.dcfclk_khz = 0;
1308+
context->bw_ctx.bw.dcn.clk.dcfclk_deep_sleep_khz = 0;
1309+
context->bw_ctx.bw.dcn.clk.dramclk_khz = 0;
1310+
context->bw_ctx.bw.dcn.clk.fclk_khz = 0;
1311+
context->bw_ctx.bw.dcn.clk.p_state_change_support = true;
1312+
}
13011313
/*save a original dppclock copy*/
13021314
context->bw_ctx.bw.dcn.clk.bw_dppclk_khz = context->bw_ctx.bw.dcn.clk.dppclk_khz;
13031315
context->bw_ctx.bw.dcn.clk.bw_dispclk_khz = context->bw_ctx.bw.dcn.clk.dispclk_khz;

0 commit comments

Comments
 (0)