Skip to contentSkip to conversation

drm/amdgpu/jpeg: fix jpeg_v5_0_1_is_idle detection

PATCH In review [email protected] 2 participants 4 messages Jun 26 – Jun 29

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 drm/amdgpu/jpeg: fix jpeg_v5_0_1_is_idle detection

From: Boyuan Zhang <[email protected]>

jpeg_v5_0_1_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.

---
 drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_1.c +1 -1
index a562369d2d81..01cafa6a4fed 100644
@@ -674,7 +674,7 @@ static void jpeg_v5_0_1_dec_ring_set_wptr(struct amdgpu_ring *ring)
 static bool jpeg_v5_0_1_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) {
Signature · 1 line
2.43.0
#1 lore raw

PATCH 2/2 drm/amdgpu/jpeg: fix jpeg_v4_0_3_is_idle detection

From: Boyuan Zhang <[email protected]>

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.

---
 drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c +1 -1
index b0bdb449538e..c7d40dfcb751 100644
@@ -1027,7 +1027,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) {
Signature · 1 line
2.43.0
#2 lore raw

Re: [PATCH 2/2] drm/amdgpu/jpeg: fix jpeg_v4_0_3_is_idle detection

AMD General

Gentle Ping...

Thanks,
Boyuan

________________________________
From: Zhang, Boyuan <[email protected]>
Sent: June 26, 2026 10:43 AM
To: [email protected] <[email protected]>
Cc: Liu, Leo <[email protected]>; Deucher, Alexander <[email protected]>; Wu, David <[email protected]>; Zhang, Boyuan <[email protected]>
Subject: [PATCH 2/2] drm/amdgpu/jpeg: fix jpeg_v4_0_3_is_idle detection

From: Boyuan Zhang <[email protected]>

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.

---
 drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c +1 -1
index b0bdb449538e..c7d40dfcb751 100644
@@ -1027,7 +1027,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) {

--
2.43.0

Reviewed-by on v1 1/2
#3 lore raw
In reply to [email protected]
Quoted 7 lines · On Fri, Jun 26, 2026 at 10:54 AM <[email protected]> wrote:

From: Boyuan Zhang <[email protected]>

jpeg_v5_0_1_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.

Quoted 5 lines

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

Series is:

Fixes tags would be nice.

Thanks,

Alex

Quoted 20 lines
---
 drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_1.c +1 -2
index a562369d2d81..01cafa6a4fed 100644
@@ -674,7 +674,7 @@ static void jpeg_v5_0_1_dec_ring_set_wptr(struct amdgpu_ring *ring)
 static bool jpeg_v5_0_1_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) {
--

2.43.0