AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: properly powergate Polaris12 UVD/VCE on suspend
@ 2021-08-17  6:40 Evan Quan
  2021-08-17  7:27 ` Lazar, Lijo
  0 siblings, 1 reply; 7+ messages in thread
From: Evan Quan @ 2021-08-17  6:40 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alexander.Deucher, Guchun.Chen, Evan Quan, xinhui pan

If the powergating of UVD/VCE is in process, wait for its completion
before proceeding(suspending). This can fix some hangs observed on
suspending when UVD/VCE still using(e.g. issue "pm-suspend" when video
is still playing).

Change-Id: I36f39d9731e0a9638b52d5d92558b0ee9c23a9ed
Signed-off-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: xinhui pan <xinhui.pan@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 5 +++++
 drivers/gpu/drm/amd/amdgpu/vce_v3_0.c | 5 +++++
 2 files changed, 10 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
index 4eebf973a065..2fdce572baeb 100644
--- a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
@@ -554,6 +554,11 @@ static int uvd_v6_0_suspend(void *handle)
 	int r;
 	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
+	/*
+	 * If the powergating is in process, wait for its completion.
+	 */
+	flush_delayed_work(&adev->uvd.idle_work);
+
 	r = uvd_v6_0_hw_fini(adev);
 	if (r)
 		return r;
diff --git a/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c b/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c
index 6d9108fa22e0..f0adecd5ec0b 100644
--- a/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c
@@ -503,6 +503,11 @@ static int vce_v3_0_suspend(void *handle)
 	int r;
 	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
+	/*
+	 * If the powergating is in process, wait for its completion.
+	 */
+	flush_delayed_work(&adev->vce.idle_work);
+
 	r = vce_v3_0_hw_fini(adev);
 	if (r)
 		return r;
-- 
2.29.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-08-19  3:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-17  6:40 [PATCH] drm/amdgpu: properly powergate Polaris12 UVD/VCE on suspend Evan Quan
2021-08-17  7:27 ` Lazar, Lijo
2021-08-17  9:43   ` Quan, Evan
2021-08-17 10:08     ` Lazar, Lijo
2021-08-18  8:45       ` Quan, Evan
2021-08-18  9:34         ` Lazar, Lijo
2021-08-19  3:02           ` Quan, Evan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox