[PATCH 14/28] drm/amd/display: Update driver and IPS interop

Rodrigo Siqueira Rodrigo.Siqueira at amd.com
Thu Sep 14 02:00:07 UTC 2023


From: Duncan Ma <duncan.ma at amd.com>

[Why]
Two issues fixed:

1. Currently, driver does not allow idle prior to PSR entry. Once
   PSR1+IPS is enabled, there is intermittent hang due to DCN access
from IrqMgr during IPS2.

2. Driver is sending multiple commands to PMFW and dmcub to exit IPS
   even during IPS0.

[How]
1. Set driver allow optimization prior to entering PSR mode with the
   condition for eDP display only.  Unregister all interrupts before
   allowing driver idle and re-register interrupts when exiting from
   idle. This will prevent IrqMgr to access DCN during IPS2.

2. Block sending PMFW and dmcub exit low power state commands when
   driver is not in idle state.

Reviewed-by: Charlene Liu <charlene.liu at amd.com>
Reviewed-by: Jun Lei <jun.lei at amd.com>
Reviewed-by: Aric Cyr <aric.cyr at amd.com>
Acked-by: Qingqing Zhuo <qingqing.zhuo at amd.com>
Signed-off-by: Duncan Ma <duncan.ma at amd.com>
---
 drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c       | 4 ++++
 drivers/gpu/drm/amd/display/dc/dcn35/dcn35_hwseq.c | 2 ++
 2 files changed, 6 insertions(+)

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 2f98dfa06dad..91b3a4610957 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
+++ b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
@@ -1110,6 +1110,10 @@ void dc_dmub_srv_exit_low_power_state(const struct dc *dc)
 {
 	if (dc->debug.dmcub_emulation)
 		return;
+
+	if (!dc->idle_optimizations_allowed)
+		return;
+
 	// Tell PMFW to exit low power state
 	if (dc->clk_mgr->funcs->exit_low_power_state)
 		dc->clk_mgr->funcs->exit_low_power_state(dc->clk_mgr);
diff --git a/drivers/gpu/drm/amd/display/dc/dcn35/dcn35_hwseq.c b/drivers/gpu/drm/amd/display/dc/dcn35/dcn35_hwseq.c
index 025849143254..06960fada059 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn35/dcn35_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn35/dcn35_hwseq.c
@@ -651,6 +651,8 @@ bool dcn35_apply_idle_power_optimizations(struct dc *dc, bool enable)
 		// Tell PMFW to exit low power state
 		if (dc->clk_mgr->funcs->exit_low_power_state)
 			dc->clk_mgr->funcs->exit_low_power_state(dc->clk_mgr);
+
+		dc_dmub_srv_is_hw_pwr_up(dc->ctx->dmub_srv, true);
 	}
 
 	dc_dmub_srv_notify_idle(dc, enable);
-- 
2.40.1



More information about the amd-gfx mailing list