[PATCH 17/18] drm/amdgpu:fix uvd ring fini routine

Monk Liu Monk.Liu at amd.com
Mon Sep 18 06:12:01 UTC 2017


fix missing finish uvd enc_ring and wrongly finish uvd ring

Change-Id: Ib74237ca5adcb3b128c9b751fced0b7db7b09e86
Signed-off-by: Monk Liu <Monk.Liu at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
index 331e34a..63b00eb 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
@@ -269,6 +269,8 @@ int amdgpu_uvd_sw_init(struct amdgpu_device *adev)
 
 int amdgpu_uvd_sw_fini(struct amdgpu_device *adev)
 {
+	struct amdgpu_ring *ring;
+	int i;
 	kfree(adev->uvd.saved_bo);
 
 	amd_sched_entity_fini(&adev->uvd.ring.sched, &adev->uvd.entity);
@@ -277,7 +279,15 @@ int amdgpu_uvd_sw_fini(struct amdgpu_device *adev)
 			      &adev->uvd.gpu_addr,
 			      (void **)&adev->uvd.cpu_addr);
 
-	amdgpu_ring_fini(&adev->uvd.ring);
+	ring = &adev->uvd.ring;
+	if (ring->adev)
+		amdgpu_ring_fini(ring);
+
+	for (i = 0; i < AMDGPU_MAX_UVD_ENC_RINGS; ++i) {
+		ring = &adev->uvd.ring_enc[i];
+		if (ring->adev)
+			amdgpu_ring_fini(ring);
+	}
 
 	release_firmware(adev->uvd.fw);
 
-- 
2.7.4



More information about the amd-gfx mailing list