Skip to content

Commit 27a6c49

Browse files
Swapnil Patelalexdeucher
authored andcommitted
drm/amd/display: fix input states translation error for dcn35 & dcn351
[Why] Currently there is an error while translating input clock sates into output clock states. The highest fclk setting from output sates is being dropped because of this error. [How] For dcn35 and dcn351, make output_states equal to input states. Reviewed-by: Charlene Liu <[email protected]> Acked-by: Rodrigo Siqueira <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Swapnil Patel <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent d2b48f3 commit 27a6c49

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,6 @@ void dml2_init_soc_states(struct dml2_context *dml2, const struct dc *in_dc,
398398
/* Copy clocks tables entries, if available */
399399
if (dml2->config.bbox_overrides.clks_table.num_states) {
400400
p->in_states->num_states = dml2->config.bbox_overrides.clks_table.num_states;
401-
402401
for (i = 0; i < dml2->config.bbox_overrides.clks_table.num_entries_per_clk.num_dcfclk_levels; i++) {
403402
p->in_states->state_array[i].dcfclk_mhz = dml2->config.bbox_overrides.clks_table.clk_entries[i].dcfclk_mhz;
404403
}
@@ -437,6 +436,14 @@ void dml2_init_soc_states(struct dml2_context *dml2, const struct dc *in_dc,
437436
}
438437

439438
dml2_policy_build_synthetic_soc_states(s, p);
439+
if (dml2->v20.dml_core_ctx.project == dml_project_dcn35 ||
440+
dml2->v20.dml_core_ctx.project == dml_project_dcn351) {
441+
// Override last out_state with data from last in_state
442+
// This will ensure that out_state contains max fclk
443+
memcpy(&p->out_states->state_array[p->out_states->num_states - 1],
444+
&p->in_states->state_array[p->in_states->num_states - 1],
445+
sizeof(struct soc_state_bounding_box_st));
446+
}
440447
}
441448

442449
void dml2_translate_ip_params(const struct dc *in, struct ip_params_st *out)

0 commit comments

Comments
 (0)