]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amd/display: Notify DMUB on HW Release
authorDuncan Ma <Duncan.Ma@amd.com>
Fri, 2 May 2025 16:40:48 +0000 (12:40 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 15 Jul 2025 18:07:52 +0000 (14:07 -0400)
[Why & How]
DMUB shall be notified on driver hardware
release. Implement notification.

Reviewed-by: Duncan Ma <duncan.ma@amd.com>
Signed-off-by: Duncan Ma <Duncan.Ma@amd.com>
Signed-off-by: Ivan Lipski <ivan.lipski@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h

index c10e603b54afe907e2bd64505c2bc0f88526255b..b4525b1fc11b0c29210441b07aec4fce1f651f02 100644 (file)
@@ -2176,3 +2176,20 @@ bool dmub_lsdma_send_poll_reg_write_command(struct dc_dmub_srv *dc_dmub_srv, uin
        return result;
 }
 
+void dc_dmub_srv_release_hw(const struct dc *dc)
+{
+       struct dc_dmub_srv *dc_dmub_srv = dc->ctx->dmub_srv;
+       union dmub_rb_cmd cmd = {0};
+
+       if (!dc_dmub_srv || !dc_dmub_srv->dmub)
+               return;
+
+       memset(&cmd, 0, sizeof(cmd));
+       cmd.idle_opt_notify_idle.header.type = DMUB_CMD__IDLE_OPT;
+       cmd.idle_opt_notify_idle.header.sub_type = DMUB_CMD__IDLE_OPT_RELEASE_HW;
+       cmd.idle_opt_notify_idle.header.payload_bytes =
+               sizeof(cmd.idle_opt_notify_idle) -
+               sizeof(cmd.idle_opt_notify_idle.header);
+
+       dm_execute_dmub_cmd(dc->ctx, &cmd,  DM_DMUB_WAIT_TYPE_WAIT);
+}
index 1f1c155be30e938af72b90e28d3f88598982d3e7..8ea320f2126994823430596dfcc506c8a33ad699 100644 (file)
@@ -291,4 +291,10 @@ bool dc_dmub_srv_ips_query_residency_info(const struct dc_context *ctx, uint8_t
                                          struct dmub_ips_residency_info *driver_info,
                                          enum ips_residency_mode ips_mode);
 
+/**
+ * dc_dmub_srv_release_hw() - Notifies DMUB service that HW access is no longer required.
+ *
+ * @dc - pointer to DC object
+ */
+void dc_dmub_srv_release_hw(const struct dc *dc);
 #endif /* _DMUB_DC_SRV_H_ */