drm/amdgpu:fix uvd ring fini routine(v2)
authorMonk Liu <Monk.Liu@amd.com>
Fri, 15 Sep 2017 08:43:01 +0000 (16:43 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 26 Sep 2017 19:14:24 +0000 (15:14 -0400)
fix missing finish uvd enc_ring.
v2:
since the adev pointer check in already in ring_fini
so drop the check outsider

Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c

index 331e34ac61fda3743d09437d0afd4429430f4e5d..e8bd50cf97857ee5d4a0ea12f9bf033b902bf7d8 100644 (file)
@@ -269,6 +269,7 @@ int amdgpu_uvd_sw_init(struct amdgpu_device *adev)
 
 int amdgpu_uvd_sw_fini(struct amdgpu_device *adev)
 {
+       int i;
        kfree(adev->uvd.saved_bo);
 
        amd_sched_entity_fini(&adev->uvd.ring.sched, &adev->uvd.entity);
@@ -279,6 +280,9 @@ int amdgpu_uvd_sw_fini(struct amdgpu_device *adev)
 
        amdgpu_ring_fini(&adev->uvd.ring);
 
+       for (i = 0; i < AMDGPU_MAX_UVD_ENC_RINGS; ++i)
+               amdgpu_ring_fini(&adev->uvd.ring_enc[i]);
+
        release_firmware(adev->uvd.fw);
 
        return 0;