]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amdgpu: Fix jpeg ring test order in vcn_v4_0_3
authorJesse.Zhang <Jesse.Zhang@amd.com>
Tue, 27 Jan 2026 07:01:27 +0000 (15:01 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 27 Jan 2026 23:12:10 +0000 (18:12 -0500)
Fix the vcn reset sequence in vcn_v4_0_3_ring_reset() to restore
JPEG power state and unlock the JPEG powergating mutex before
running the JPEG ring post-reset helper.

Fixes: d25c67fd9d6f ("drm/amdgpu/vcn4.0.3: rework reset handling")
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Jesse Zhang <jesse.zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c

index dd247abce1ab0d2b1f257ff0cc55db4c3f6c48b2..e78526a4e521e2951af6545c269b1e1a1b9e85e5 100644 (file)
@@ -1742,11 +1742,11 @@ static int vcn_v4_0_3_ring_reset(struct amdgpu_ring *ring,
                goto unlock;
        }
 
-       r = vcn_v4_0_3_reset_jpeg_post_helper(adev, ring->me);
        if (pg_state)
                amdgpu_device_ip_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_JPEG,
                                                       AMD_PG_STATE_GATE);
        mutex_unlock(&adev->jpeg.jpeg_pg_lock);
+       r = vcn_v4_0_3_reset_jpeg_post_helper(adev, ring->me);
 
 unlock:
        mutex_unlock(&vinst->engine_reset_mutex);