[PATCH 15/19] drm/amd/display: Fix DML2 out_states to match in_states for DCN35/DCN351

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Nicholas Kazlauskas <nicholas.kazlauskas@xxxxxxx>

[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.teeger@xxxxxxx>
Reviewed-by: Yihan Zhu <yihan.zhu@xxxxxxx>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@xxxxxxx>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@xxxxxxx>
---
 .../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




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux