Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/amdgpu: Mask rptr as well in ring debugfs

The read/write pointers on sdma4 devices increment
beyond the ring size and should be masked. Tested
on my Ryzen 2400G.

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Tom St Denis and committed by
Alex Deucher
a8d0fb2f 93dfdf9f

+1 -1
+1 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
··· 481 481 result = 0; 482 482 483 483 if (*pos < 12) { 484 - early[0] = amdgpu_ring_get_rptr(ring); 484 + early[0] = amdgpu_ring_get_rptr(ring) & ring->buf_mask; 485 485 early[1] = amdgpu_ring_get_wptr(ring) & ring->buf_mask; 486 486 early[2] = ring->wptr & ring->buf_mask; 487 487 for (i = *pos / 4; i < 3 && size; i++) {