Technically not necessary, but clear the extra dwords too,
so that the command processors don't read uninitialized memory.
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)
--
2.51.0