]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amdgpu/jpeg: fix jpeg_v4_0_3_is_idle detection
authorBoyuan Zhang <boyuan.zhang@amd.com>
Fri, 26 Jun 2026 14:39:26 +0000 (10:39 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 1 Jul 2026 17:02:53 +0000 (13:02 -0400)
jpeg_v4_0_3_is_idle() initializes ret to false and then accumulates ring
idle status using &=. Since false & condition always remains false, the
function can never report the JPEG block as idle.

Initialize ret to true so the function returns true only when all JPEG
rings report RB_JOB_DONE.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit e9df8e9d04e0593d17ddb069f3b7958991cd18c9)
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c

index 0c746580de11303c8ea217e91a913c42c1a6814d..d8204fbc198d65ea64e75d74c529cef8d9b7d2a6 100644 (file)
@@ -1010,7 +1010,7 @@ void jpeg_v4_0_3_dec_ring_nop(struct amdgpu_ring *ring, uint32_t count)
 static bool jpeg_v4_0_3_is_idle(struct amdgpu_ip_block *ip_block)
 {
        struct amdgpu_device *adev = ip_block->adev;
-       bool ret = false;
+       bool ret = true;
        int i, j;
 
        for (i = 0; i < adev->jpeg.num_jpeg_inst; ++i) {