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>,
Piotr Maziarz <piotr.maziarz@amd.com>,
Alvin Lee <alvin.lee2@amd.com>,
Chenyu Chen <chen-yu.chen@amd.com>
Subject: [PATCH 05/27] drm/amd/display: Decouple PROGRAM_CURSOR_UPDATE_NOW from dc and pipe_ctx
Date: Wed, 25 Nov 2026 14:54:54 +0800 [thread overview]
Message-ID: <20261125065631.3889665-6-chen-yu.chen@amd.com> (raw)
In-Reply-To: <20261125065631.3889665-1-chen-yu.chen@amd.com>
From: Piotr Maziarz <piotr.maziarz@amd.com>
[WHY]
PROGRAM_CURSOR_UPDATE_NOW carried dc and pipe_ctx, and its executor
read the OTG instance and the cursor offload state through them at run
time, against the BLS contract.
[HOW]
Carry the DMUB service handle and the OTG instance instead, filled by
the new hwss_add_program_cursor_update_now(). The executor passes them
through the program_cursor_offload_now hook to
dc_dmub_srv_program_cursor_now(), which checks the service itself for
cursor offload. The non-BLS path in commit_planes_for_stream uses the
same hook signature.
Cc: Alvin Lee <alvin.lee2@amd.com>
Signed-off-by: Piotr Maziarz <piotr.maziarz@amd.com>
Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com>
---
drivers/gpu/drm/amd/display/dc/core/dc.c | 3 +-
.../drm/amd/display/dc/core/dc_hw_sequencer.c | 28 +++++++++++++------
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 11 +++-----
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 8 +++---
.../amd/display/dc/hwss/dcn35/dcn35_hwseq.c | 4 +--
.../amd/display/dc/hwss/dcn35/dcn35_hwseq.h | 2 +-
.../drm/amd/display/dc/hwss/hw_sequencer.h | 10 +++++--
7 files changed, 40 insertions(+), 26 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 92cb123e459b..584eb3e0f4c6 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -5435,7 +5435,8 @@ static void commit_planes_for_stream(struct dc *dc,
continue;
if (dc->hwss.program_cursor_offload_now)
- dc->hwss.program_cursor_offload_now(dc, pipe_ctx);
+ dc->hwss.program_cursor_offload_now(dc->ctx->dmub_srv,
+ pipe_ctx->stream_res.tg->inst);
if (pipe_ctx->stream_res.tg->funcs->program_manual_trigger)
pipe_ctx->stream_res.tg->funcs->program_manual_trigger(pipe_ctx->stream_res.tg);
}
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c
index 241cbe19056d..079a9ee8c5f5 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c
@@ -1715,12 +1715,9 @@ void hwss_build_fast_sequence(struct dc *dc,
current_mpc_pipe->stream && current_mpc_pipe->plane_state &&
current_mpc_pipe->plane_state->update_bits.addr_update &&
!current_mpc_pipe->plane_state->skip_manual_trigger) {
- if (dc->hwss.program_cursor_offload_now) {
- block_sequence[*num_steps].params.program_cursor_update_now_params.dc = dc;
- block_sequence[*num_steps].params.program_cursor_update_now_params.pipe_ctx = current_mpc_pipe;
- block_sequence[*num_steps].func = PROGRAM_CURSOR_UPDATE_NOW;
- (*num_steps)++;
- }
+ if (dc->hwss.program_cursor_offload_now)
+ hwss_add_program_cursor_update_now(&seq_state, dc->ctx->dmub_srv,
+ current_mpc_pipe->stream_res.tg->inst);
hwss_add_optc_program_manual_trigger(&seq_state, current_mpc_pipe->stream_res.tg);
}
@@ -1849,8 +1846,8 @@ void hwss_execute_sequence(struct dc *dc,
break;
case PROGRAM_CURSOR_UPDATE_NOW:
dc->hwss.program_cursor_offload_now(
- params->program_cursor_update_now_params.dc,
- params->program_cursor_update_now_params.pipe_ctx);
+ params->program_cursor_update_now_params.dmub_srv,
+ params->program_cursor_update_now_params.otg_inst);
break;
case HUBP_WAIT_PIPE_READ_START:
params->hubp_wait_pipe_read_start_params.hubp->funcs->hubp_wait_pipe_read_start(
@@ -6439,6 +6436,21 @@ void hwss_add_abort_cursor_offload_update(struct block_sequence_state *seq_state
}
}
+void hwss_add_program_cursor_update_now(struct block_sequence_state *seq_state,
+ struct dc_dmub_srv *dmub_srv,
+ uint32_t otg_inst)
+{
+ struct program_cursor_update_now_params *p;
+
+ if (*seq_state->num_steps < MAX_HWSS_BLOCK_SEQUENCE_SIZE) {
+ seq_state->steps[*seq_state->num_steps].func = PROGRAM_CURSOR_UPDATE_NOW;
+ p = &seq_state->steps[*seq_state->num_steps].params.program_cursor_update_now_params;
+ p->dmub_srv = dmub_srv;
+ p->otg_inst = otg_inst;
+ (*seq_state->num_steps)++;
+ }
+}
+
void hwss_add_stream_enc_update_hdmi_info_packets(struct block_sequence_state *seq_state,
struct pipe_ctx *pipe_ctx)
{
diff --git a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
index 323e8bec23dc..220e3fc34f3f 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
+++ b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
@@ -1328,15 +1328,12 @@ void dc_dmub_srv_control_cursor_offload(struct dc *dc, struct dc_state *context,
enable ? DM_DMUB_WAIT_TYPE_NO_WAIT : DM_DMUB_WAIT_TYPE_WAIT);
}
-void dc_dmub_srv_program_cursor_now(struct dc *dc, const struct pipe_ctx *pipe)
+void dc_dmub_srv_program_cursor_now(struct dc_dmub_srv *dc_dmub_srv, uint32_t otg_inst)
{
struct dmub_rb_cmd_cursor_offload_stream_cntl *cntl;
union dmub_rb_cmd cmd;
- if (!dc_dmub_srv_is_cursor_offload_enabled(dc))
- return;
-
- if (!pipe || !pipe->stream || !pipe->stream_res.tg)
+ if (!dc_dmub_srv || !dc_dmub_srv->cursor_offload_enabled)
return;
memset(&cmd, 0, sizeof(cmd));
@@ -1345,9 +1342,9 @@ void dc_dmub_srv_program_cursor_now(struct dc *dc, const struct pipe_ctx *pipe)
cntl->header.type = DMUB_CMD__CURSOR_OFFLOAD;
cntl->header.sub_type = DMUB_CMD__CURSOR_OFFLOAD_STREAM_PROGRAM;
cntl->header.payload_bytes = sizeof(cntl->data);
- cntl->data.otg_inst = pipe->stream_res.tg->inst;
+ cntl->data.otg_inst = otg_inst;
- dc_wake_and_execute_dmub_cmd(dc->ctx, &cmd, DM_DMUB_WAIT_TYPE_NO_WAIT);
+ dc_wake_and_execute_dmub_cmd(dc_dmub_srv->ctx, &cmd, DM_DMUB_WAIT_TYPE_NO_WAIT);
}
bool dc_dmub_srv_is_hw_pwr_up(struct dc_dmub_srv *dc_dmub_srv, bool wait)
diff --git a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h
index b3d6279cbc15..6c1e1b8f6d9b 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h
+++ b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h
@@ -397,12 +397,12 @@ void dc_dmub_srv_control_cursor_offload(struct dc *dc, struct dc_state *context,
const struct dc_stream_state *stream, bool enable);
/**
- * dc_dmub_srv_program_cursor_now() - Requests immediate cursor programming for a given pipe.
+ * dc_dmub_srv_program_cursor_now() - Requests immediate cursor programming for a given OTG.
*
- * @dc: pointer to DC object
- * @pipe: top-most pipe for a stream.
+ * @dc_dmub_srv: DMUB service handle
+ * @otg_inst: OTG instance of the stream
*/
-void dc_dmub_srv_program_cursor_now(struct dc *dc, const struct pipe_ctx *pipe);
+void dc_dmub_srv_program_cursor_now(struct dc_dmub_srv *dc_dmub_srv, uint32_t otg_inst);
/**
* dc_dmub_srv_is_cursor_offload_enabled() - Checks if cursor offload is supported.
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c
index aa047b5b4939..564ffd61f391 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c
@@ -1806,9 +1806,9 @@ void dcn35_notify_cursor_offload_drr_update(struct dc *dc, struct dc_state *cont
dc_dmub_srv_control_cursor_offload(dc, context, stream, true);
}
-void dcn35_program_cursor_offload_now(struct dc *dc, const struct pipe_ctx *pipe)
+void dcn35_program_cursor_offload_now(struct dc_dmub_srv *dc_dmub_srv, uint32_t otg_inst)
{
- dc_dmub_srv_program_cursor_now(dc, pipe);
+ dc_dmub_srv_program_cursor_now(dc_dmub_srv, otg_inst);
}
static void disable_link_output_symclk_on_tx_off(struct dc_link *link, enum dp_link_encoding link_encoding)
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.h b/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.h
index 0ae2f44cfb9f..2bc210d5fcc4 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.h
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.h
@@ -117,7 +117,7 @@ void dcn35_update_cursor_offload_pipe(struct dmub_srv *dmub, uint32_t stream_idx
uint8_t pipe_idx, const struct dpp *dpp, const struct hubp *hubp);
void dcn35_notify_cursor_offload_drr_update(struct dc *dc, struct dc_state *context,
const struct dc_stream_state *stream);
-void dcn35_program_cursor_offload_now(struct dc *dc, const struct pipe_ctx *pipe);
+void dcn35_program_cursor_offload_now(struct dc_dmub_srv *dc_dmub_srv, uint32_t otg_inst);
void dcn35_disable_link_output(struct dc_link *link,
const struct link_resource *link_res,
enum signal_type signal);
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer.h b/drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer.h
index 6e009ba37ff9..4769c71f05fb 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer.h
+++ b/drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer.h
@@ -597,8 +597,8 @@ struct control_cm_hist_params {
};
struct program_cursor_update_now_params {
- struct dc *dc;
- struct pipe_ctx *pipe_ctx;
+ struct dc_dmub_srv *dmub_srv;
+ uint32_t otg_inst;
};
struct hubp_wait_pipe_read_start_params {
@@ -2050,7 +2050,7 @@ struct hw_sequencer_funcs {
const struct hubp *hubp);
void (*notify_cursor_offload_drr_update)(struct dc *dc, struct dc_state *context,
const struct dc_stream_state *stream);
- void (*program_cursor_offload_now)(struct dc *dc, const struct pipe_ctx *pipe);
+ void (*program_cursor_offload_now)(struct dc_dmub_srv *dc_dmub_srv, uint32_t otg_inst);
/* Colour Related */
void (*program_gamut_remap)(struct program_gamut_remap_params *params);
@@ -3226,6 +3226,10 @@ void hwss_add_commit_cursor_offload_update(struct block_sequence_state *seq_stat
struct dc *dc,
struct pipe_ctx *pipe_ctx);
+void hwss_add_program_cursor_update_now(struct block_sequence_state *seq_state,
+ struct dc_dmub_srv *dmub_srv,
+ uint32_t otg_inst);
+
void hwss_add_stream_enc_update_hdmi_info_packets(struct block_sequence_state *seq_state,
struct pipe_ctx *pipe_ctx);
--
2.43.0
next prev parent reply other threads:[~2026-11-25 6:57 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 ` Chenyu Chen [this message]
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 ` [PATCH 18/27] drm/amd/display: Add the immediate flip to the DC2 seamless update Chenyu Chen
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-6-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=alvin.lee2@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=piotr.maziarz@amd.com \
--cc=roman.li@amd.com \
--cc=sunpeng.li@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.