summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorJames Lin <pinglei.lin@amd.com>2026-08-28 10:13:33 +0800
committerAlex Deucher <alexander.deucher@amd.com>2026-09-17 11:38:26 -0400
commit555641725f214e2a2a230338f282cdebfd9fcbf3 (patch)
treeb2c70f29af8adf74b5b192d07b5f135f44c88daa /drivers/gpu
parent123f78c8fa9c16d58c19c6f74152026addfc021b (diff)
drm/amd/display: Request DMUB HW cursor offload
[Why & How] Request cursor offload in dc_config and initialize it after DMUB is up (dc_dmub_srv_cursor_offload_init), which self-gates on the firmware cursor_offload_v1_support capability, so cursor programming no longer takes the inbox0 lock on alt-in-use streams. Reviewed-by: Leo Li <sunpeng.li@amd.com> Signed-off-by: James Lin <pinglei.lin@amd.com> Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c10
-rw-r--r--drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c9
2 files changed, 18 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 3f601a3d2d7d..6f71c63b973a 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -607,6 +607,13 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
init_data.flags.enable_mipi_converter_optimization = true;
+ /*
+ * Request HW cursor offload so DMUB programs the cursor; cursor
+ * updates then avoid the DMUB inbox0 HW lock during mclk switches.
+ * dc_dmub_srv_cursor_offload_init() self-gates on FW capability.
+ */
+ init_data.flags.enable_cursor_offload = true;
+
init_data.dcn_reg_offsets = adev->reg_offset[DCE_HWIP][0];
init_data.nbio_reg_offsets = adev->reg_offset[NBIO_HWIP][0];
init_data.clk_reg_offsets = adev->reg_offset[CLK_HWIP][0];
@@ -724,6 +731,9 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
dc_hardware_init(adev->dm.dc);
+ /* Enable cursor offload if the DMUB firmware supports it. */
+ dc_dmub_srv_cursor_offload_init(adev->dm.dc);
+
/* GOP/vBIOS may leave an OPTC enabled for a display present at power-on
* but no longer driven (e.g. an external DP unplugged at boot). Such a
* dangling pipe keeps DCN out of idle and blocks s0i3. Power it down
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 e23137034130..1e7071f8d53f 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
+++ b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
@@ -1211,9 +1211,16 @@ void dc_dmub_srv_subvp_save_surf_addr(const struct dc_dmub_srv *dc_dmub_srv, con
void dc_dmub_srv_cursor_offload_init(struct dc *dc)
{
struct dmub_rb_cmd_cursor_offload_init *init;
- struct dc_dmub_srv *dc_dmub_srv = dc->ctx->dmub_srv;
+ struct dc_dmub_srv *dc_dmub_srv;
union dmub_rb_cmd cmd;
+ if (!dc || !dc->ctx)
+ return;
+
+ dc_dmub_srv = dc->ctx->dmub_srv;
+ if (!dc_dmub_srv || !dc_dmub_srv->dmub)
+ return;
+
if (!dc->config.enable_cursor_offload)
return;