From: Leo Liu Date: Fri, 15 Nov 2019 22:10:34 +0000 (-0500) Subject: drm/amdgpu/vcn2.5: fix the enc loop with hw fini X-Git-Tag: v5.15~4520^2~25^2~266 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4effa8dbc11780de2a9f8c756d1c133fb862c697;p=platform%2Fkernel%2Flinux-starfive.git drm/amdgpu/vcn2.5: fix the enc loop with hw fini Signed-off-by: Leo Liu Reviewed-by: James Zhu Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c b/drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c index 451dc81..42d6b9f 100644 --- a/drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c @@ -268,7 +268,7 @@ static int vcn_v2_5_hw_fini(void *handle) { struct amdgpu_device *adev = (struct amdgpu_device *)handle; struct amdgpu_ring *ring; - int i; + int i, j; for (i = 0; i < adev->vcn.num_vcn_inst; ++i) { if (adev->vcn.harvest_config & (1 << i)) @@ -280,8 +280,8 @@ static int vcn_v2_5_hw_fini(void *handle) ring->sched.ready = false; - for (i = 0; i < adev->vcn.num_enc_rings; ++i) { - ring = &adev->vcn.inst[i].ring_enc[i]; + for (j = 0; j < adev->vcn.num_enc_rings; ++j) { + ring = &adev->vcn.inst[i].ring_enc[j]; ring->sched.ready = false; } }