AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Hamza Mahfooz <hamza.mahfooz@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: Harry Wentland <harry.wentland@amd.com>,
	Leo Li <sunpeng.li@amd.com>,
	Rodrigo Siqueira <rodrigo.siqueira@amd.com>,
	"Aurabindo . Pillai" <aurabindo.pillai@amd.com>,
	Hamza Mahfooz <hamza.mahfooz@amd.com>,
	Roman Li <roman.li@amd.com>, Wayne Lin <wayne.lin@amd.com>,
	Tom Chung <chiahsuan.chung@amd.com>,
	Fangzhi Zuo <jerry.zuo@amd.com>,
	Zaeem Mohamed <zaeem.mohamed@amd.com>,
	Daniel Wheeler <daniel.wheeler@amd.com>,
	"Nicholas Susanto" <Nicholas.Susanto@amd.com>,
	Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Subject: [PATCH 01/14] drm/amd/display: Fix DCN35 set min dispclk logic
Date: Tue, 27 Aug 2024 12:37:21 -0400	[thread overview]
Message-ID: <20240827164045.167557-2-hamza.mahfooz@amd.com> (raw)
In-Reply-To: <20240827164045.167557-1-hamza.mahfooz@amd.com>

From: Nicholas Susanto <Nicholas.Susanto@amd.com>

[Why]

Setting min dispclk to 50Mhz outside clock lowering function causes
unnecessary calls to SMU to lower dispclk and causes dentist hangs when
there is no stream on the pipes.

[How]

Move the set minimum dispclk logic inside the lowering dispclk if
statement.

Fixes: 2dd29403b206 ("DCN35 set min dispclk to 50Mhz")
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Nicholas Susanto <Nicholas.Susanto@amd.com>
Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
---
 .../gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c    | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c
index f50054089da7..97164b5585a8 100644
--- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c
+++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c
@@ -305,9 +305,6 @@ void dcn35_update_clocks(struct clk_mgr *clk_mgr_base,
 	if (new_clocks->dtbclk_en && !new_clocks->ref_dtbclk_khz)
 		new_clocks->ref_dtbclk_khz = 600000;
 
-	if (dc->debug.min_disp_clk_khz > 0 && new_clocks->dispclk_khz < dc->debug.min_disp_clk_khz)
-		new_clocks->dispclk_khz = dc->debug.min_disp_clk_khz;
-
 	/*
 	 * if it is safe to lower, but we are already in the lower state, we don't have to do anything
 	 * also if safe to lower is false, we just go in the higher state
@@ -385,6 +382,9 @@ void dcn35_update_clocks(struct clk_mgr *clk_mgr_base,
 	if (should_set_clock(safe_to_lower, new_clocks->dispclk_khz, clk_mgr_base->clks.dispclk_khz)) {
 		dcn35_disable_otg_wa(clk_mgr_base, context, safe_to_lower, true);
 
+		if (dc->debug.min_disp_clk_khz > 0 && new_clocks->dispclk_khz < dc->debug.min_disp_clk_khz)
+			new_clocks->dispclk_khz = dc->debug.min_disp_clk_khz;
+
 		clk_mgr_base->clks.dispclk_khz = new_clocks->dispclk_khz;
 		dcn35_smu_set_dispclk(clk_mgr, clk_mgr_base->clks.dispclk_khz);
 		dcn35_disable_otg_wa(clk_mgr_base, context, safe_to_lower, false);
-- 
2.46.0


  reply	other threads:[~2024-08-27 16:41 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-27 16:37 [PATCH 00/14] DC Patches August 27, 2024 Hamza Mahfooz
2024-08-27 16:37 ` Hamza Mahfooz [this message]
2024-08-27 16:37 ` [PATCH 02/14] drm/amd/display: only trigger BIOS related assert for older ASICs Hamza Mahfooz
2024-08-27 16:37 ` [PATCH 03/14] drm/amd/display: Lock DC and exit IPS when changing backlight Hamza Mahfooz
2024-08-27 16:37 ` [PATCH 04/14] drm/amd/display: re-enable Dynamic ODM policy Hamza Mahfooz
2024-08-27 16:37 ` [PATCH 05/14] drm/amd/display: Add dpia debug option to control power management Hamza Mahfooz
2024-08-27 16:37 ` [PATCH 06/14] drm/amd/display: disable sharpness if HDR Multiplier is too large Hamza Mahfooz
2024-08-27 16:37 ` [PATCH 07/14] drm/amd/display: Refactor dccg35_get_other_enabled_symclk_fe Hamza Mahfooz
2024-08-27 16:37 ` [PATCH 08/14] drm/amd/display: fix dccg root clock optimization related hang Hamza Mahfooz
2024-08-27 16:37 ` [PATCH 09/14] Revert "drm/amd/display: Wait for all pending cleared before full update" Hamza Mahfooz
2024-08-27 16:37 ` [PATCH 10/14] drm/amd/display: Add sharpness control interface Hamza Mahfooz
2024-08-27 16:37 ` [PATCH 11/14] drm/amd/display: fix graphics hang in multi-display mst case Hamza Mahfooz
2024-08-27 16:37 ` [PATCH 12/14] drm/amd/display: Block timing sync for different signals in PMO Hamza Mahfooz
2024-08-27 16:37 ` [PATCH 13/14] drm/amd/display: Fix flickering caused by dccg Hamza Mahfooz
2024-08-27 16:37 ` [PATCH 14/14] drm/amd/display: 3.2.299 Hamza Mahfooz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240827164045.167557-2-hamza.mahfooz@amd.com \
    --to=hamza.mahfooz@amd.com \
    --cc=Nicholas.Susanto@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=aurabindo.pillai@amd.com \
    --cc=chiahsuan.chung@amd.com \
    --cc=daniel.wheeler@amd.com \
    --cc=harry.wentland@amd.com \
    --cc=jerry.zuo@amd.com \
    --cc=nicholas.kazlauskas@amd.com \
    --cc=rodrigo.siqueira@amd.com \
    --cc=roman.li@amd.com \
    --cc=sunpeng.li@amd.com \
    --cc=wayne.lin@amd.com \
    --cc=zaeem.mohamed@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox