All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wayne Lin <Wayne.Lin@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: Harry Wentland <harry.wentland@amd.com>,
	Leo Li <sunpeng.li@amd.com>,
	Aurabindo Pillai <aurabindo.pillai@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>,
	Daniel Wheeler <daniel.wheeler@amd.com>, Ray Wu <Ray.Wu@amd.com>,
	Alex Hung <alex.hung@amd.com>,
	Zhongwei Zhang <Zhongwei.Zhang@amd.com>,
	Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Subject: [PATCH 20/24] drm/amd/display: Avoid calling blank_stream() twice
Date: Wed, 28 May 2025 10:49:15 +0800	[thread overview]
Message-ID: <20250528025204.79578-21-Wayne.Lin@amd.com> (raw)
In-Reply-To: <20250528025204.79578-1-Wayne.Lin@amd.com>

From: Zhongwei Zhang <Zhongwei.Zhang@amd.com>

[Why]
We've made fix for garbage in dcn31_reset_back_end_for_pipe(), adding
blank_stream() before disable_crtc(). And set_dpms_off() will call
blank_stream() again.

[How]
Add flag to avoid calling blank_stream() twice.

Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Zhongwei Zhang <Zhongwei.Zhang@amd.com>
Signed-off-by: Wayne Lin <wayne.lin@amd.com>
---
 .../gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c |  3 +++
 .../gpu/drm/amd/display/dc/hwss/dcn31/dcn31_hwseq.c   | 11 +++++++++--
 .../drm/amd/display/dc/hwss/hw_sequencer_private.h    |  1 +
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c
index a8174669bc49..b96b189e4a41 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c
@@ -1222,6 +1222,9 @@ void dce110_blank_stream(struct pipe_ctx *pipe_ctx)
 	struct dc_link *link = stream->link;
 	struct dce_hwseq *hws = link->dc->hwseq;
 
+	if (hws && hws->wa_state.skip_blank_stream)
+		return;
+
 	if (link->local_sink && link->local_sink->sink_signal == SIGNAL_TYPE_EDP) {
 		if (!link->skip_implict_edp_power_control)
 			hws->funcs.edp_backlight_control(link, false);
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn31/dcn31_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn31/dcn31_hwseq.c
index f38340aa3f15..5ba3999991b0 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn31/dcn31_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn31/dcn31_hwseq.c
@@ -526,9 +526,15 @@ static void dcn31_reset_back_end_for_pipe(
 
 	link = pipe_ctx->stream->link;
 
+	if (dc->hwseq)
+		dc->hwseq->wa_state.skip_blank_stream = false;
+
 	if ((!pipe_ctx->stream->dpms_off || link->link_status.link_active) &&
-		(link->connector_signal == SIGNAL_TYPE_EDP))
+		(link->connector_signal == SIGNAL_TYPE_EDP)) {
 		dc->hwss.blank_stream(pipe_ctx);
+		if (dc->hwseq)
+			dc->hwseq->wa_state.skip_blank_stream = true;
+	}
 
 	pipe_ctx->stream_res.tg->funcs->set_dsc_config(
 			pipe_ctx->stream_res.tg,
@@ -570,7 +576,8 @@ static void dcn31_reset_back_end_for_pipe(
 			pipe_ctx->stream_res.audio = NULL;
 		}
 	}
-
+	if (dc->hwseq)
+		dc->hwseq->wa_state.skip_blank_stream = false;
 	pipe_ctx->stream = NULL;
 	DC_LOG_DEBUG("Reset back end for pipe %d, tg:%d\n",
 					pipe_ctx->pipe_idx, pipe_ctx->stream_res.tg->inst);
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer_private.h b/drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer_private.h
index 09bc65c2fa23..1e2d247fbbac 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer_private.h
+++ b/drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer_private.h
@@ -49,6 +49,7 @@ struct hwseq_wa_state {
 	bool DEGVIDCN10_253_applied;
 	bool disallow_self_refresh_during_multi_plane_transition_applied;
 	unsigned int disallow_self_refresh_during_multi_plane_transition_applied_on_frame;
+	bool skip_blank_stream;
 };
 
 struct pipe_ctx;
-- 
2.43.0


  parent reply	other threads:[~2025-05-28  2:54 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-28  2:48 [PATCH 00/24] DC Patches June 2nd, 2025 Wayne Lin
2025-05-28  2:48 ` [PATCH 01/24] drm/amd/display: [FW Promotion] Release 0.1.11.0 Wayne Lin
2025-05-28  2:48 ` [PATCH 02/24] drm/amd/display: Re-order FAMS2 sub commands Wayne Lin
2025-05-28  2:48 ` [PATCH 03/24] drm/amd/display: DML21 Fixes Wayne Lin
2025-05-28  2:48 ` [PATCH 04/24] drm/amd/display: Support OLED SDR with AMD ABC Wayne Lin
2025-05-28  2:49 ` [PATCH 05/24] drm/amd/display: move RMCM programming Wayne Lin
2025-05-28  2:49 ` [PATCH 06/24] drm/amd/display: Indirect buffer transport for FAMS2 commands Wayne Lin
2025-05-28  2:49 ` [PATCH 07/24] drm/amd/display: Drop unnecessary `amdgpu` prefix Wayne Lin
2025-05-28  2:49 ` [PATCH 08/24] drm/amd/display: Call setup_stream_attribute after stream enc clk is ungated Wayne Lin
2025-05-28  2:49 ` [PATCH 09/24] drm/amd/display: Correct non-OLED pre_T11_delay Wayne Lin
2025-05-28  2:49 ` [PATCH 10/24] drm/amd/display: Avoid trying AUX transactions on disconnected ports Wayne Lin
2025-05-28  2:49 ` [PATCH 11/24] drm/amd/display: Add disconnect case on dongle check Wayne Lin
2025-05-28  2:49 ` [PATCH 12/24] drm/amd/display: Add DML path for FAMS methods Wayne Lin
2025-05-28  2:49 ` [PATCH 13/24] drm/amd/display: Do not bypass chroma scaling in 1:1 case Wayne Lin
2025-05-28  2:49 ` [PATCH 14/24] drm/amd/display: Add support for 2nd sharpening range Wayne Lin
2025-05-28  2:49 ` [PATCH 15/24] drm/amd/display: Move vmalloc include to header file Wayne Lin
2025-05-28  2:49 ` [PATCH 16/24] drm/amd/display: [FW Promotion] Release 0.1.12.0 Wayne Lin
2025-05-28  2:49 ` [PATCH 17/24] drm/amd/display: Promote DAL to 3.2.335 Wayne Lin
2025-05-28  2:49 ` [PATCH 18/24] drm/amd/display: Update DMCUB loading sequence for DCN3.5 Wayne Lin
2025-05-28  2:49 ` [PATCH 19/24] drm/amd/display: replace fast_validate with enum dc_validate_mode Wayne Lin
2025-05-28  2:49 ` Wayne Lin [this message]
2025-05-28  2:49 ` [PATCH 21/24] drm/amd/display: Use DC log instead of using DM error msg Wayne Lin
2025-05-28  2:49 ` [PATCH 22/24] drm/amd/display: Add debugging message for brightness caps Wayne Lin
2025-05-28  2:49 ` [PATCH 23/24] drm/amd/display: Fix default DC and AC levels Wayne Lin
2025-05-28  2:49 ` [PATCH 24/24] drm/amd/display: Promote DAL to 3.2.336 Wayne Lin
2025-06-02 13:24 ` [PATCH 00/24] DC Patches June 2nd, 2025 Wheeler, Daniel

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=20250528025204.79578-21-Wayne.Lin@amd.com \
    --to=wayne.lin@amd.com \
    --cc=Ray.Wu@amd.com \
    --cc=Zhongwei.Zhang@amd.com \
    --cc=alex.hung@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=roman.li@amd.com \
    --cc=sunpeng.li@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.