From: Nicholas Kazlauskas <nicholas.kazlaus...@amd.com>

[Why]
The synthetic policy overrides the policy we already ran to formulate
this in dcn35_clk_mgr and causes some levels to be dropped along with
FCLK being lower than what can actually being supported per state.

[How]
Just copy in_states to out_states, the synthetic policy is not
applicable and causes many display states to run at max pstate
unexpectedly due to the only valid states being the first and last.

Reviewed-by: Gabe Teeger <gabe.tee...@amd.com>
Reviewed-by: Yihan Zhu <yihan....@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlaus...@amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pil...@amd.com>
---
 .../amd/display/dc/dml2/dml2_translation_helper.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c 
b/drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c
index bde4250853b1..4a34cfd334cb 100644
--- a/drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c
+++ b/drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c
@@ -553,13 +553,14 @@ void dml2_init_soc_states(struct dml2_context *dml2, 
const struct dc *in_dc,
                }
        }
 
-       dml2_policy_build_synthetic_soc_states(s, p);
-       if (dml2->v20.dml_core_ctx.project == dml_project_dcn35) {
-               // Override last out_state with data from last in_state
-               // This will ensure that out_state contains max fclk
-               memcpy(&p->out_states->state_array[p->out_states->num_states - 
1],
-                               
&p->in_states->state_array[p->in_states->num_states - 1],
-                               sizeof(struct soc_state_bounding_box_st));
+       if (dml2->v20.dml_core_ctx.project == dml_project_dcn35 ||
+           dml2->v20.dml_core_ctx.project == dml_project_dcn351) {
+               // Copy input states to output states - no synthetic policy 
applied.
+               p->out_states->num_states = p->in_states->num_states;
+               for (i = 0; i < p->in_states->num_states; ++i)
+                       p->out_states->state_array[i] = 
p->in_states->state_array[i];
+       } else {
+               dml2_policy_build_synthetic_soc_states(s, p);
        }
 }
 
-- 
2.47.1

Reply via email to