Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu/vce3: don't forget to tear down some rings

We can use .num_rings for that.

Fixes: 6f0359ff7307 ("vce3: add support for third vce ring")
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Grazvydas Ignotas and committed by
Alex Deucher
4cd00d37 44f9d7b3

+4 -2
+4 -2
drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
··· 210 210 */ 211 211 int amdgpu_vce_sw_fini(struct amdgpu_device *adev) 212 212 { 213 + unsigned i; 214 + 213 215 if (adev->vce.vcpu_bo == NULL) 214 216 return 0; 215 217 ··· 219 217 220 218 amdgpu_bo_unref(&adev->vce.vcpu_bo); 221 219 222 - amdgpu_ring_fini(&adev->vce.ring[0]); 223 - amdgpu_ring_fini(&adev->vce.ring[1]); 220 + for (i = 0; i < adev->vce.num_rings; i++) 221 + amdgpu_ring_fini(&adev->vce.ring[i]); 224 222 225 223 release_firmware(adev->vce.fw); 226 224 mutex_destroy(&adev->vce.idle_mutex);