On 01.09.25 12:00, Timur Kristóf wrote:
> Technically not necessary, but clear the extra dwords too,
> so that the command processors don't read uninitialized memory.

That is most likely a really bad idea.

The extra DWs are filled with a specific pattern for a HW workaround.

Clearing them to NOPs makes no sense at all and potentially even breaks the HW 
workaround.

Regards,
Christian.

> 
> Fixes: c8c1a1d2ef04 ("drm/amdgpu: define and add extra dword for jpeg ring")
> Signed-off-by: Timur Kristóf <[email protected]>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h
> index 7670f5d82b9e..6a55a85744a9 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h
> @@ -474,6 +474,11 @@ static inline void amdgpu_ring_clear_ring(struct 
> amdgpu_ring *ring)
>       while (i <= ring->buf_mask)
>               ring->ring[i++] = ring->funcs->nop;
>  
> +     /* Technically not necessary, but clear the extra dwords too,
> +      * so that the command processors don't read uninitialized memory.
> +      */
> +     for (i = 0; i < ring->funcs->extra_dw; i++)
> +             ring->ring[ring->ring_size / 4 + i] = ring->funcs->nop;
>  }
>  
>  static inline void amdgpu_ring_write(struct amdgpu_ring *ring, uint32_t v)

Reply via email to