aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c
diff options
context:
space:
mode:
authorPaul Hsieh <paul.hsieh@amd.com>2019-05-07 17:58:58 +0800
committerAlex Deucher <alexander.deucher@amd.com>2019-05-31 10:39:30 -0500
commit70d9e8cb8b4439dcfd42bee08831ffb1c02a4805 (patch)
tree86d0fcfa00b05ab5c52405075da5f38b6fa80b5a /drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c
parentdrm/amd/display: Ensure DRR triggers in BP (diff)
downloadlinux-dev-70d9e8cb8b4439dcfd42bee08831ffb1c02a4805.tar.xz
linux-dev-70d9e8cb8b4439dcfd42bee08831ffb1c02a4805.zip
drm/amd/display: disable PSR/ABM before destroy DMCU struct
[Why] 1. DMCU is not running on some platform but driver still send ABM command. It may cause assert due to DMCU is not alive. 2. To make sure PSR disable when driver disable [How] 1. Add dmcu_is_running in ABM struct, driver can check this flag to determine driver should send ABM command or not. 2. Send PSR disable command when destroy PSR Signed-off-by: Paul Hsieh <paul.hsieh@amd.com> Reviewed-by: Anthony Koo <Anthony.Koo@amd.com> Acked-by: Leo Li <sunpeng.li@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c')
-rw-r--r--drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c b/drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c
index 818536eea00a..6504227ead9c 100644
--- a/drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c
+++ b/drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c
@@ -813,6 +813,9 @@ void dce_dmcu_destroy(struct dmcu **dmcu)
{
struct dce_dmcu *dmcu_dce = TO_DCE_DMCU(*dmcu);
+ if (dmcu_dce->base.dmcu_state == DMCU_RUNNING)
+ dmcu_dce->base.funcs->set_psr_enable(*dmcu, false, true);
+
kfree(dmcu_dce);
*dmcu = NULL;
}