All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chenyu Chen <chen-yu.chen@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>,
	Dan Wheeler <daniel.wheeler@amd.com>, Ray Wu <Ray.Wu@amd.com>,
	Ivan Lipski <ivan.lipski@amd.com>, Alex Hung <alex.hung@amd.com>,
	James Lin <PingLei.Lin@amd.com>,
	Chenyu Chen <Chen-Yu.Chen@amd.com>,
	Tony Cheng <tony.cheng@amd.com>, Jun Lei <jun.lei@amd.com>,
	Chenyu Chen <chen-yu.chen@amd.com>
Subject: [PATCH 18/27] drm/amd/display: Add the immediate flip to the DC2 seamless update
Date: Wed, 25 Nov 2026 14:55:07 +0800	[thread overview]
Message-ID: <20261125065631.3889665-19-chen-yu.chen@amd.com> (raw)
In-Reply-To: <20261125065631.3889665-1-chen-yu.chen@amd.com>

From: Tony Cheng <tony.cheng@amd.com>

[Why]
With DC2 selected, Core2 rejects an immediate flip. The flip falls
back to DC1, although DC1 programs it in the same order as the vsync
flip.

[How]
Let the flip on the kept context run when the plane flips
immediately. The order stays lock, GSL, triple buffer, the address,
unlock and the manual trigger. GSL now takes flip_immediate from the
plane, as the address already did.

After the flip, Core2 sets the current address of an immediate flip,
as dcn20_prepare_plane_addr_update does.

Reject an immediate flip of a DCC surface. For it, DC1 waits for the
DCC meta data to propagate, and the flip does not emit that wait.

Cc: Jun Lei <jun.lei@amd.com>
Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com>
---
 .../dc/bls_builder/dcn401_seamless_builder.c  | 22 ++++++++++++++++++-
 .../gpu/drm/amd/display/dc/core2/dc_core2.c   |  2 ++
 2 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/bls_builder/dcn401_seamless_builder.c b/drivers/gpu/drm/amd/display/dc/bls_builder/dcn401_seamless_builder.c
index 850b5d8c96d4..bc7dd933e35e 100644
--- a/drivers/gpu/drm/amd/display/dc/bls_builder/dcn401_seamless_builder.c
+++ b/drivers/gpu/drm/amd/display/dc/bls_builder/dcn401_seamless_builder.c
@@ -824,6 +824,24 @@ static bool check_no_immediate_flip(const struct dc *dc,
 			DC_TRAIT_MATCH(DC_PLANE_TRAIT_FLIP_IMMEDIATE, 0));
 }
 
+/*
+ * DC1 waits for the DCC meta data to propagate before an immediate flip of
+ * a DCC surface. The flip does not emit that wait.
+ */
+static bool check_no_immediate_dcc_flip(const struct dc *dc,
+		const struct dc_state *current_state,
+		const struct dc_state *new_state, unsigned int i)
+{
+	struct dc_state_facts facts;
+
+	(void)current_state;
+	(void)dc;
+	dc_state_facts_derive(new_state, &facts);
+	return !dc_state_facts_any_plane(&facts, (uint8_t)i,
+			DC_TRAIT_MATCH(DC_PLANE_TRAIT_FLIP_IMMEDIATE |
+			DC_PLANE_TRAIT_DCC, 0));
+}
+
 /*
  * DC1 translates a distributed-points curve into a LUT while it programs
  * the plane. The update programs only the predefined and bypass curves.
@@ -1081,7 +1099,7 @@ static enum bls_builder_result dcn401_check_flip(const struct dc *dc,
 	CHECK_UPDATE(one_address_only_plane,
 			"stream has odm, or not one plane with an address-only update");
 	CHECK_CONDITION(triple_buffer, "triple buffer is disabled");
-	CHECK_UPDATE(no_immediate_flip, "flip is immediate");
+	CHECK_UPDATE(no_immediate_dcc_flip, "immediate flip of a dcc surface");
 	CHECK_UPDATE(no_mcm_luts, "an mcm lut is enabled");
 	return BLS_BUILD_SUCCESS;
 }
@@ -2318,6 +2336,8 @@ static void dcn401_add_step(struct block_sequence_state *sequence,
 		break;
 	case HUBP_SET_FLIP_CONTROL_GSL:
 		p->set_flip_control_gsl_params.hubp = pipe->plane_res.hubp;
+		p->set_flip_control_gsl_params.flip_immediate =
+				plane->flip_immediate;
 		break;
 	case HUBP_CLK_CNTL:
 		p->hubp_clk_cntl_params.hubp = pipe->plane_res.hubp;
diff --git a/drivers/gpu/drm/amd/display/dc/core2/dc_core2.c b/drivers/gpu/drm/amd/display/dc/core2/dc_core2.c
index 245ebd8e01d0..ce2d4f0c89d6 100644
--- a/drivers/gpu/drm/amd/display/dc/core2/dc_core2.c
+++ b/drivers/gpu/drm/amd/display/dc/core2/dc_core2.c
@@ -417,6 +417,8 @@ static void core2_update_done(struct dc *dc, struct dc_state *context,
 		vm_helper_mark_vmid_used(dc->vm_helper, plane->address.vmid,
 				(uint8_t)hubp->inst);
 		plane->status.requested_address = plane->address;
+		if (plane->flip_immediate)
+			plane->status.current_address = plane->address;
 		hubp->opp_id = pipe->stream_res.opp->inst;
 		hubp->mpcc_id = hubp->inst;
 		hubp->power_gated = false;
-- 
2.43.0


  parent reply	other threads:[~2026-11-25  6:58 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25  6:54 [PATCH 00/27] DC Patches Nov 30 2026 Chenyu Chen
2026-11-25  6:54 ` [PATCH 01/27] drm/amd/display: Avoid per-entry long division in __drm_lut32_to_dc_gamma Chenyu Chen
2026-11-25  6:54 ` [PATCH 02/27] drm/amd/display: Capture more diagnostic register state Chenyu Chen
2026-11-25  6:54 ` [PATCH 03/27] drm/amd/display: Add debug option to force DP link rate Chenyu Chen
2026-11-25  6:54 ` [PATCH 04/27] drm/amd/display: Reject Replay activation on an inactive link Chenyu Chen
2026-11-25  6:54 ` [PATCH 05/27] drm/amd/display: Decouple PROGRAM_CURSOR_UPDATE_NOW from dc and pipe_ctx Chenyu Chen
2026-11-25  6:54 ` [PATCH 06/27] drm/amd/display: Add DPMS-v2 init Chenyu Chen
2026-11-25  6:54 ` [PATCH 07/27] drm/amd/display: Expose per-CRTC pstate method in connector debugfs Chenyu Chen
2026-11-25  6:54 ` [PATCH 08/27] drm/amd/display: Add DPMS-v2 tx init Chenyu Chen
2026-11-25  6:54 ` [PATCH 09/27] drm/amd/display: Derive DCN6 DSCCLK range from DISPCLK Chenyu Chen
2026-11-25  6:54 ` [PATCH 10/27] drm/amd/display: Carry the stream and plane update bits in update_flags Chenyu Chen
2026-11-25  6:55 ` [PATCH 11/27] drm/amd/display: Add the vsync flip to the DC2 seamless update Chenyu Chen
2026-11-25  6:55 ` [PATCH 12/27] drm/amd/display: Preserve bandwidth floors in overrides Chenyu Chen
2026-11-25  6:55 ` [PATCH 13/27] drm/amd/display: Set HDMI bypass earlier Chenyu Chen
2026-11-25  6:55 ` [PATCH 14/27] drm/amd/display: Add DMUB timer reference clock to ref_clocks Chenyu Chen
2026-11-25  6:55 ` [PATCH 15/27] drm/amd/display: Guard connector I2C transfer without DDC pin Chenyu Chen
2026-11-28  9:43   ` Eren Özen
2026-11-25  6:55 ` [PATCH 16/27] drm/amd/display: Refactor ABM_SET_PIPE and ABM_SET_IMMEDIATE_DISABLE Chenyu Chen
2026-11-25  6:55 ` [PATCH 17/27] drm/amd/display: Implement link_set_dpms_off_v2 Chenyu Chen
2026-11-25  6:55 ` Chenyu Chen [this message]
2026-11-25  6:55 ` [PATCH 19/27] drm/amd/display: Test amdgpu_dm_dmub alt-ch apertures Chenyu Chen
2026-11-25  6:55 ` [PATCH 20/27] drm/amd/display: Test amdgpu_dm_dmub SET_CONFIG sync wait Chenyu Chen
2026-11-25  6:55 ` [PATCH 21/27] drm/amd/display: Test amdgpu_dm_dmub AUX transfer timeout Chenyu Chen
2026-11-25  6:55 ` [PATCH 22/27] drm/amd/display: Test amdgpu_dm_dmub fused IO replies Chenyu Chen
2026-11-25  6:55 ` [PATCH 23/27] drm/amd/display: Use Z8 enter plus exit for vblank reserve Chenyu Chen
2026-11-25  6:55 ` [PATCH 24/27] drm/amd/display: Fix two streams sharing one OTG Chenyu Chen
2026-11-25  6:55 ` [PATCH 25/27] drm/amd/display: Count planes, not pipes, in the surface check Chenyu Chen
2026-11-25  6:55 ` [PATCH 26/27] drm/amd/display: [FW Promotion] Release 0.1.86.0 Chenyu Chen
2026-11-25  6:55 ` [PATCH 27/27] drm/amd/display: Promote DC to 3.2.409 Chenyu Chen
2026-11-27  5:44 ` [PATCH 00/27] DC Patches Nov 30 2026 Chung, ChiaHsuan (Tom)
2026-11-30 14:10 ` 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=20261125065631.3889665-19-chen-yu.chen@amd.com \
    --to=chen-yu.chen@amd.com \
    --cc=PingLei.Lin@amd.com \
    --cc=Ray.Wu@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=ivan.lipski@amd.com \
    --cc=jerry.zuo@amd.com \
    --cc=jun.lei@amd.com \
    --cc=roman.li@amd.com \
    --cc=sunpeng.li@amd.com \
    --cc=tony.cheng@amd.com \
    --cc=wayne.lin@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.