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

Christian König ckoenig.leichtzumerken at gmail.com
Thu Mar 1 15:20:16 UTC 2018


Am 01.03.2018 um 15:43 schrieb Tom St Denis:
> 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 at amd.com>

Reviewed-by: Christian König <christian.koenig at amd.com>

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
> index e223b0f6417b..d5f526f38e50 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
> @@ -484,7 +484,7 @@ static ssize_t amdgpu_debugfs_ring_read(struct file *f, char __user *buf,
>   	result = 0;
>   
>   	if (*pos < 12) {
> -		early[0] = amdgpu_ring_get_rptr(ring);
> +		early[0] = amdgpu_ring_get_rptr(ring) & ring->buf_mask;
>   		early[1] = amdgpu_ring_get_wptr(ring) & ring->buf_mask;
>   		early[2] = ring->wptr & ring->buf_mask;
>   		for (i = *pos / 4; i < 3 && size; i++) {



More information about the amd-gfx mailing list