Skip to contentSkip to conversation

drm/amdgpu: Fix jpeg ring test order in vcn_v4_0_3

PATCH In review Jesse.Zhang 2 participants 2 messages Jan 27

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

PATCH 1/1 drm/amdgpu: Fix jpeg ring test order in vcn_v4_0_3

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 c50beca39115 ("drm/amdgpu/vcn4.0.3: rework reset handling")
---
 drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c +1 -1
index dd247abce1ab..e78526a4e521 100644
@@ -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);
Signature · 1 line
2.49.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 16 lines · Jesse.Zhang

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 c50beca39115 ("drm/amdgpu/vcn4.0.3: rework reset handling")
---
  drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c +0 -0
index dd247abce1ab..e78526a4e521 100644

drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c static int vcn_v4_0_3_ring_reset(struct amdgpu_ring *ring, · line 1748

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c +0 -1
@@ -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);

Probably, we can revisit this later since ring test logic will make sure that jpeg will get eventually power gated if not in use.

Thanks,
Lijo

Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c +1 -0
+	r = vcn_v4_0_3_reset_jpeg_post_helper(adev, ring->me);
 
  unlock:
  	mutex_unlock(&vinst->engine_reset_mutex);