Commit 51ba137e authored by Hugo Hu's avatar Hugo Hu Committed by Alex Deucher
Browse files

drm/amd/display: Add debug option to force fclk request



[Why]
So that we can adjust fclk for debugging purposes.

[How]
Add option to force adjust fclk request to pplib.

Signed-off-by: default avatarHugo Hu <hugo.hu@amd.com>
Reviewed-by: default avatarTony Cheng <Tony.Cheng@amd.com>
Acked-by: default avatarLeo Li <sunpeng.li@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 987741af
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -255,6 +255,7 @@ struct dc_debug_options {
	bool scl_reset_length10;
	bool hdmi20_disable;
	bool skip_detection_link_training;
	unsigned int force_fclk_khz;
};

struct dc_debug_data {
+4 −0
Original line number Diff line number Diff line
@@ -218,6 +218,7 @@ static void dcn1_update_clocks(struct clk_mgr *clk_mgr,
			bool safe_to_lower)
{
	struct dc *dc = clk_mgr->ctx->dc;
	struct dc_debug_options *debug = &dc->debug;
	struct dc_clocks *new_clocks = &context->bw.dcn.clk;
	struct pp_smu_display_requirement_rv *smu_req_cur =
			&dc->res_pool->pp_smu_req;
@@ -261,6 +262,9 @@ static void dcn1_update_clocks(struct clk_mgr *clk_mgr,
	}

	// F Clock
	if (debug->force_fclk_khz != 0)
		new_clocks->fclk_khz = debug->force_fclk_khz;

	if (should_set_clock(safe_to_lower, new_clocks->fclk_khz, clk_mgr->clks.fclk_khz)) {
		clk_mgr->clks.fclk_khz = new_clocks->fclk_khz;
		smu_req.hard_min_fclk_mhz = new_clocks->fclk_khz / 1000;