Skip to contentSkip to conversation

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

PATCH In review Tom St Denis 3 participants 3 messages Mar 1, 2018 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +1 -1
index e223b0f6417b..d5f526f38e50 100644
@@ -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++) {
Signature · 6 lines
2.14.3

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): [email protected]

Reviewed-by
#2 lore raw
Quoted 5 lines · Tom St Denis

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

Quoted 20 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +1 -2
index e223b0f6417b..d5f526f38e50 100644
@@ -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++) {
--

2.14.3

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reviewed-by
#3 lore raw
In reply to a message not in the archive

Am 01.03.2018 um 15:43 schrieb Tom St Denis:

Quoted 5 lines

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

Quoted 9 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +0 -0
index e223b0f6417b..d5f526f38e50 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c static ssize_t amdgpu_debugfs_ring_read(struct file *f, char __user *buf, · line 490

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +1 -1
@@ -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++) {

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx