[PATCH 18/28] drm/amdgpu/jpeg4.0.5: add queue reset
Rodrigo Siqueira
siqueira at igalia.com
Sun Jul 6 15:02:27 UTC 2025
On 07/01, Alex Deucher wrote:
> Add queue reset support for jpeg 4.0.5.
> Use the new helpers to re-emit the unprocessed state
> after resetting the queue.
>
> Reviewed-by: Sathishkumar S <sathishkumar.sundararaju at amd.com>
> Tested-by: Sathishkumar S <sathishkumar.sundararaju at amd.com>
> Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c
> index 974030a5c03c9..e6e90496135b6 100644
> --- a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c
> +++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c
> @@ -767,6 +767,16 @@ static int jpeg_v4_0_5_process_interrupt(struct amdgpu_device *adev,
> return 0;
> }
>
> +static int jpeg_v4_0_5_ring_reset(struct amdgpu_ring *ring,
> + unsigned int vmid,
> + struct amdgpu_fence *timedout_fence)
> +{
> + amdgpu_ring_reset_helper_begin(ring, timedout_fence);
> + jpeg_v4_0_5_stop(ring->adev);
> + jpeg_v4_0_5_start(ring->adev);
Stop and start return values in case of errors. Maybe you can add a
check here? If something goes wrong, you can add a log message.
Thanks
> + return amdgpu_ring_reset_helper_end(ring, timedout_fence);
> +}
> +
> static const struct amd_ip_funcs jpeg_v4_0_5_ip_funcs = {
> .name = "jpeg_v4_0_5",
> .early_init = jpeg_v4_0_5_early_init,
> @@ -812,6 +822,7 @@ static const struct amdgpu_ring_funcs jpeg_v4_0_5_dec_ring_vm_funcs = {
> .emit_wreg = jpeg_v2_0_dec_ring_emit_wreg,
> .emit_reg_wait = jpeg_v2_0_dec_ring_emit_reg_wait,
> .emit_reg_write_reg_wait = amdgpu_ring_emit_reg_write_reg_wait_helper,
> + .reset = jpeg_v4_0_5_ring_reset,
> };
>
> static void jpeg_v4_0_5_set_dec_ring_funcs(struct amdgpu_device *adev)
> --
> 2.50.0
>
--
Rodrigo Siqueira
More information about the amd-gfx
mailing list