Skip to contentSkip to conversation

drm/radeon: Disable dma rings for bo moves on r6xx

PATCH In review [email protected] 4 participants 10 messages Jul 11, 2013 – Jul 18, 2013

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

PATCH 1/3 drm/radeon: Disable dma rings for bo moves on r6xx

From: Alex Deucher <[email protected]>

They still seem to cause instability on some r6xx parts. As a follow up, we can switch to using CP DMA for bo moves on r6xx as a lighter weight alternative to using the 3D engine.

A version of this patch should also go to stable kernels.

---
 drivers/gpu/drm/radeon/radeon_asic.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/radeon/radeon_asic.c +6 -6
index 0970774..ea5c52b 100644
@@ -1026,8 +1026,8 @@ static struct radeon_asic r600_asic = {
 		.blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
 		.dma = &r600_copy_dma,
 		.dma_ring_index = R600_RING_TYPE_DMA_INDEX,
-		.copy = &r600_copy_dma,
-		.copy_ring_index = R600_RING_TYPE_DMA_INDEX,
+		.copy = &r600_copy_blit,
+		.copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
 	},
 	.surface = {
 		.set_reg = r600_set_surface_reg,
@@ -1119,8 +1119,8 @@ static struct radeon_asic rv6xx_asic = {
 		.blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
 		.dma = &r600_copy_dma,
 		.dma_ring_index = R600_RING_TYPE_DMA_INDEX,
-		.copy = &r600_copy_dma,
-		.copy_ring_index = R600_RING_TYPE_DMA_INDEX,
+		.copy = &r600_copy_blit,
+		.copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
 	},
 	.surface = {
 		.set_reg = r600_set_surface_reg,
@@ -1229,8 +1229,8 @@ static struct radeon_asic rs780_asic = {
 		.blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
 		.dma = &r600_copy_dma,
 		.dma_ring_index = R600_RING_TYPE_DMA_INDEX,
-		.copy = &r600_copy_dma,
-		.copy_ring_index = R600_RING_TYPE_DMA_INDEX,
+		.copy = &r600_copy_blit,
+		.copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
 	},
 	.surface = {
 		.set_reg = r600_set_surface_reg,
Signature · 1 line
1.7.7.5
#1 lore raw

PATCH 2/3 drm/radeon: implement bo copy callback using CP DMA (v2)

From: Alex Deucher <[email protected]>

Lighter weight than using the 3D engine.

v2: fix ring count

---
 drivers/gpu/drm/radeon/r600.c        |   81 ++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/radeon/r600d.h       |    1 +
 drivers/gpu/drm/radeon/radeon_asic.h |    3 +
 3 files changed, 85 insertions(+), 0 deletions(-)
drivers/gpu/drm/radeon/r600.c +81 -0
index 2d3655f..f7d494f 100644
@@ -3145,6 +3145,87 @@ int r600_copy_blit(struct radeon_device *rdev,
 }
 
 /**
+ * r600_copy_cpdma - copy pages using the CP DMA engine
+ *
+ * @rdev: radeon_device pointer
+ * @src_offset: src GPU address
+ * @dst_offset: dst GPU address
+ * @num_gpu_pages: number of GPU pages to xfer
+ * @fence: radeon fence object
+ *
+ * Copy GPU paging using the CP DMA engine (r6xx+).
+ * Used by the radeon ttm implementation to move pages if
+ * registered as the asic copy callback.
+ */
+int r600_copy_cpdma(struct radeon_device *rdev,
+		    uint64_t src_offset, uint64_t dst_offset,
+		    unsigned num_gpu_pages,
+		    struct radeon_fence **fence)
+{
+	struct radeon_semaphore *sem = NULL;
+	int ring_index = rdev->asic->copy.blit_ring_index;
+	struct radeon_ring *ring = &rdev->ring[ring_index];
+	u32 size_in_bytes, cur_size_in_bytes, tmp;
+	int i, num_loops;
+	int r = 0;
+
+	r = radeon_semaphore_create(rdev, &sem);
+	if (r) {
+		DRM_ERROR("radeon: moving bo (%d).\n", r);
+		return r;
+	}
+
+	size_in_bytes = (num_gpu_pages << RADEON_GPU_PAGE_SHIFT);
+	num_loops = DIV_ROUND_UP(size_in_bytes, 0x1fffff);
+	r = radeon_ring_lock(rdev, ring, num_loops * 6 + 21);
+	if (r) {
+		DRM_ERROR("radeon: moving bo (%d).\n", r);
+		radeon_semaphore_free(rdev, &sem, NULL);
+		return r;
+	}
+
+	if (radeon_fence_need_sync(*fence, ring->idx)) {
+		radeon_semaphore_sync_rings(rdev, sem, (*fence)->ring,
+					    ring->idx);
+		radeon_fence_note_sync(*fence, ring->idx);
+	} else {
+		radeon_semaphore_free(rdev, &sem, NULL);
+	}
+
+	for (i = 0; i < num_loops; i++) {
+		cur_size_in_bytes = size_in_bytes;
+		if (cur_size_in_bytes > 0x1fffff)
+			cur_size_in_bytes = 0x1fffff;
+		size_in_bytes -= cur_size_in_bytes;
+		tmp = upper_32_bits(src_offset) & 0xff;
+		if (size_in_bytes == 0)
+			tmp |= PACKET3_CP_DMA_CP_SYNC;
+		radeon_ring_write(ring, PACKET3(PACKET3_CP_DMA, 4));
+		radeon_ring_write(ring, src_offset & 0xffffffff);
+		radeon_ring_write(ring, tmp);
+		radeon_ring_write(ring, dst_offset & 0xffffffff);
+		radeon_ring_write(ring, upper_32_bits(dst_offset) & 0xff);
+		radeon_ring_write(ring, cur_size_in_bytes);
+		src_offset += cur_size_in_bytes;
+		dst_offset += cur_size_in_bytes;
+	}
+	radeon_ring_write(ring, PACKET3(PACKET3_SET_CONFIG_REG, 1));
+	radeon_ring_write(ring, (WAIT_UNTIL - PACKET3_SET_CONFIG_REG_OFFSET) >> 2);
+	radeon_ring_write(ring, WAIT_CP_DMA_IDLE_bit);
+
+	r = radeon_fence_emit(rdev, fence, ring->idx);
+	if (r) {
+		radeon_ring_unlock_undo(rdev, ring);
+		return r;
+	}
+
+	radeon_ring_unlock_commit(rdev, ring);
+	radeon_semaphore_free(rdev, &sem, *fence);
+
+	return r;
+}
+
+/**
  * r600_copy_dma - copy pages using the DMA engine
  *
  * @rdev: radeon_device pointer
drivers/gpu/drm/radeon/r600d.h +1 -0
index f1b3084..8e3fe81 100644
@@ -602,6 +602,7 @@
 #define		L2_BUSY						(1 << 0)
 
 #define	WAIT_UNTIL					0x8040
+#define         WAIT_CP_DMA_IDLE_bit                            (1 << 8)
 #define         WAIT_2D_IDLE_bit                                (1 << 14)
 #define         WAIT_3D_IDLE_bit                                (1 << 15)
 #define         WAIT_2D_IDLECLEAN_bit                           (1 << 16)
drivers/gpu/drm/radeon/radeon_asic.h +3 -0
index 45d0693..b04b578 100644
@@ -340,6 +340,9 @@ int r600_uvd_ring_test(struct radeon_device *rdev, struct radeon_ring *ring);
 int r600_copy_blit(struct radeon_device *rdev,
 		   uint64_t src_offset, uint64_t dst_offset,
 		   unsigned num_gpu_pages, struct radeon_fence **fence);
+int r600_copy_cpdma(struct radeon_device *rdev,
+		    uint64_t src_offset, uint64_t dst_offset,
+		    unsigned num_gpu_pages, struct radeon_fence **fence);
 int r600_copy_dma(struct radeon_device *rdev,
 		  uint64_t src_offset, uint64_t dst_offset,
 		  unsigned num_gpu_pages, struct radeon_fence **fence);
Signature · 1 line
1.7.7.5
#2 lore raw

Re: [PATCH 2/3] drm/radeon: implement bo copy callback using CP DMA (v2)

I have just discovered that WAIT_UNTIL=WAIT_3D_IDLE must be set before using CP DMA.

Marek

Quoted 138 lines · On Thu, Jul 11, 2013 at 9:35 PM, <[email protected]> wrote:

From: Alex Deucher <[email protected]>

Lighter weight than using the 3D engine.

v2: fix ring count

---
 drivers/gpu/drm/radeon/r600.c        |   81 ++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/radeon/r600d.h       |    1 +
 drivers/gpu/drm/radeon/radeon_asic.h |    3 +
 3 files changed, 85 insertions(+), 0 deletions(-)
drivers/gpu/drm/radeon/r600.c +81 -0
index 2d3655f..f7d494f 100644
@@ -3145,6 +3145,87 @@ int r600_copy_blit(struct radeon_device *rdev,
 }
 
 /**
+ * r600_copy_cpdma - copy pages using the CP DMA engine
+ *
+ * @rdev: radeon_device pointer
+ * @src_offset: src GPU address
+ * @dst_offset: dst GPU address
+ * @num_gpu_pages: number of GPU pages to xfer
+ * @fence: radeon fence object
+ *
+ * Copy GPU paging using the CP DMA engine (r6xx+).
+ * Used by the radeon ttm implementation to move pages if
+ * registered as the asic copy callback.
+ */
+int r600_copy_cpdma(struct radeon_device *rdev,
+                   uint64_t src_offset, uint64_t dst_offset,
+                   unsigned num_gpu_pages,
+                   struct radeon_fence **fence)
+{
+       struct radeon_semaphore *sem = NULL;
+       int ring_index = rdev->asic->copy.blit_ring_index;
+       struct radeon_ring *ring = &rdev->ring[ring_index];
+       u32 size_in_bytes, cur_size_in_bytes, tmp;
+       int i, num_loops;
+       int r = 0;
+
+       r = radeon_semaphore_create(rdev, &sem);
+       if (r) {
+               DRM_ERROR("radeon: moving bo (%d).\n", r);
+               return r;
+       }
+
+       size_in_bytes = (num_gpu_pages << RADEON_GPU_PAGE_SHIFT);
+       num_loops = DIV_ROUND_UP(size_in_bytes, 0x1fffff);
+       r = radeon_ring_lock(rdev, ring, num_loops * 6 + 21);
+       if (r) {
+               DRM_ERROR("radeon: moving bo (%d).\n", r);
+               radeon_semaphore_free(rdev, &sem, NULL);
+               return r;
+       }
+
+       if (radeon_fence_need_sync(*fence, ring->idx)) {
+               radeon_semaphore_sync_rings(rdev, sem, (*fence)->ring,
+                                           ring->idx);
+               radeon_fence_note_sync(*fence, ring->idx);
+       } else {
+               radeon_semaphore_free(rdev, &sem, NULL);
+       }
+
+       for (i = 0; i < num_loops; i++) {
+               cur_size_in_bytes = size_in_bytes;
+               if (cur_size_in_bytes > 0x1fffff)
+                       cur_size_in_bytes = 0x1fffff;
+               size_in_bytes -= cur_size_in_bytes;
+               tmp = upper_32_bits(src_offset) & 0xff;
+               if (size_in_bytes == 0)
+                       tmp |= PACKET3_CP_DMA_CP_SYNC;
+               radeon_ring_write(ring, PACKET3(PACKET3_CP_DMA, 4));
+               radeon_ring_write(ring, src_offset & 0xffffffff);
+               radeon_ring_write(ring, tmp);
+               radeon_ring_write(ring, dst_offset & 0xffffffff);
+               radeon_ring_write(ring, upper_32_bits(dst_offset) & 0xff);
+               radeon_ring_write(ring, cur_size_in_bytes);
+               src_offset += cur_size_in_bytes;
+               dst_offset += cur_size_in_bytes;
+       }
+       radeon_ring_write(ring, PACKET3(PACKET3_SET_CONFIG_REG, 1));
+       radeon_ring_write(ring, (WAIT_UNTIL - PACKET3_SET_CONFIG_REG_OFFSET) >> 2);
+       radeon_ring_write(ring, WAIT_CP_DMA_IDLE_bit);
+
+       r = radeon_fence_emit(rdev, fence, ring->idx);
+       if (r) {
+               radeon_ring_unlock_undo(rdev, ring);
+               return r;
+       }
+
+       radeon_ring_unlock_commit(rdev, ring);
+       radeon_semaphore_free(rdev, &sem, *fence);
+
+       return r;
+}
+
+/**
  * r600_copy_dma - copy pages using the DMA engine
  *
  * @rdev: radeon_device pointer
drivers/gpu/drm/radeon/r600d.h +1 -0
index f1b3084..8e3fe81 100644
@@ -602,6 +602,7 @@
 #define                L2_BUSY                                         (1 << 0)
 
 #define        WAIT_UNTIL                                      0x8040
+#define         WAIT_CP_DMA_IDLE_bit                            (1 << 8)
 #define         WAIT_2D_IDLE_bit                                (1 << 14)
 #define         WAIT_3D_IDLE_bit                                (1 << 15)
 #define         WAIT_2D_IDLECLEAN_bit                           (1 << 16)
drivers/gpu/drm/radeon/radeon_asic.h +3 -1
index 45d0693..b04b578 100644
@@ -340,6 +340,9 @@ int r600_uvd_ring_test(struct radeon_device *rdev, struct radeon_ring *ring);
 int r600_copy_blit(struct radeon_device *rdev,
                   uint64_t src_offset, uint64_t dst_offset,
                   unsigned num_gpu_pages, struct radeon_fence **fence);
+int r600_copy_cpdma(struct radeon_device *rdev,
+                   uint64_t src_offset, uint64_t dst_offset,
+                   unsigned num_gpu_pages, struct radeon_fence **fence);
 int r600_copy_dma(struct radeon_device *rdev,
                  uint64_t src_offset, uint64_t dst_offset,
                  unsigned num_gpu_pages, struct radeon_fence **fence);
--

1.7.7.5

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw

PATCH 3/3 drm/radeon: use CP DMA on r6xx for bo moves

In reply to [email protected]

From: Alex Deucher <[email protected]>

Lighter weight than using the 3D engine.

---
 drivers/gpu/drm/radeon/radeon_asic.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/radeon/radeon_asic.c +3 -3
index ea5c52b..fea997e 100644
@@ -1026,7 +1026,7 @@ static struct radeon_asic r600_asic = {
 		.blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
 		.dma = &r600_copy_dma,
 		.dma_ring_index = R600_RING_TYPE_DMA_INDEX,
-		.copy = &r600_copy_blit,
+		.copy = &r600_copy_cpdma,
 		.copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
 	},
 	.surface = {
@@ -1119,7 +1119,7 @@ static struct radeon_asic rv6xx_asic = {
 		.blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
 		.dma = &r600_copy_dma,
 		.dma_ring_index = R600_RING_TYPE_DMA_INDEX,
-		.copy = &r600_copy_blit,
+		.copy = &r600_copy_cpdma,
 		.copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
 	},
 	.surface = {
@@ -1229,7 +1229,7 @@ static struct radeon_asic rs780_asic = {
 		.blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
 		.dma = &r600_copy_dma,
 		.dma_ring_index = R600_RING_TYPE_DMA_INDEX,
-		.copy = &r600_copy_blit,
+		.copy = &r600_copy_cpdma,
 		.copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
 	},
 	.surface = {
Signature · 1 line
1.7.7.5
#4 lore raw
In reply to [email protected]

Alex,

Can you please share some details about the nature or symptom of the "instability". One problem that I have been seeing on my end is that when I use the DMA ring intensively (by intensively I mean, calling the copy function every frame), combined with some 3D rendering that causes a lot of cs_ioctl calls, that I can provoke a corruption of the olist field in radeon_sa_bo structure, consequently causing an oops in radeon_sa_bo_try_free(). I have also found that I can suppress the problem if I add some padding fields at the beginnig of the radeon_sa_bo structure (essentially moving the olist field down).

So I speculate that the use of DMA somehow results in corrupting that structure, but I have not yet done enough experiments to prove or disprove that theory (so I have not spoke up yet). Also my kernel is full of my own internal hacks, and I have not yet taken the time to reproduce the problem with the "stock" kernel. However, after seeing your patch series, I am wondering if the instability you are referring to may be of the same or similar nature.

thanks,

Ilija

Quoted 60 lines · On Thu, 11 Jul 2013, [email protected] wrote:

From: Alex Deucher <[email protected]>

They still seem to cause instability on some r6xx parts. As a follow up, we can switch to using CP DMA for bo moves on r6xx as a lighter weight alternative to using the 3D engine.

A version of this patch should also go to stable kernels.

---
drivers/gpu/drm/radeon/radeon_asic.c | 12 ++++++------

1 files changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/radeon/radeon_asic.c +6 -6
index 0970774..ea5c52b 100644
@@ -1026,8 +1026,8 @@ static struct radeon_asic r600_asic = {
 		.blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
 		.dma = &r600_copy_dma,
 		.dma_ring_index = R600_RING_TYPE_DMA_INDEX,
-		.copy = &r600_copy_dma,
-		.copy_ring_index = R600_RING_TYPE_DMA_INDEX,
+		.copy = &r600_copy_blit,
+		.copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
 	},
 	.surface = {
 		.set_reg = r600_set_surface_reg,
@@ -1119,8 +1119,8 @@ static struct radeon_asic rv6xx_asic = {
 		.blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
 		.dma = &r600_copy_dma,
 		.dma_ring_index = R600_RING_TYPE_DMA_INDEX,
-		.copy = &r600_copy_dma,
-		.copy_ring_index = R600_RING_TYPE_DMA_INDEX,
+		.copy = &r600_copy_blit,
+		.copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
 	},
 	.surface = {
 		.set_reg = r600_set_surface_reg,
@@ -1229,8 +1229,8 @@ static struct radeon_asic rs780_asic = {
 		.blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
 		.dma = &r600_copy_dma,
 		.dma_ring_index = R600_RING_TYPE_DMA_INDEX,
-		.copy = &r600_copy_dma,
-		.copy_ring_index = R600_RING_TYPE_DMA_INDEX,
+		.copy = &r600_copy_blit,
+		.copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
 	},
 	.surface = {
 		.set_reg = r600_set_surface_reg,
Signature · 6 lines
1.7.7.5

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#5 lore raw
Quoted 13 lines · Ilija Hadzic

Alex,

Can you please share some details about the nature or symptom of the "instability". One problem that I have been seeing on my end is that when I use the DMA ring intensively (by intensively I mean, calling the copy function every frame), combined with some 3D rendering that causes a lot of cs_ioctl calls, that I can provoke a corruption of the olist field in radeon_sa_bo structure, consequently causing an oops in radeon_sa_bo_try_free(). I have also found that I can suppress the problem if I add some padding fields at the beginnig of the radeon_sa_bo structure (essentially moving the olist field down).

Quoted 7 lines

So I speculate that the use of DMA somehow results in corrupting that structure, but I have not yet done enough experiments to prove or disprove that theory (so I have not spoke up yet). Also my kernel is full of my own internal hacks, and I have not yet taken the time to reproduce the problem with the "stock" kernel. However, after seeing your patch series, I am wondering if the instability you are referring to may be of the same or similar nature.

Basically using the DMA engine on r6xx seems to lead to hangs on certain chips when the bo copy callback gets triggered a lot (e.g., a web page with lots of images, etc.). Switching back to the 3D engine fixes the issue. R6xx was the first asic family with the async dma engines, so there are likely some hw bugs at play. Unfortunately, the hw guys haven't looked at 6xx in probably 8 years, so I don't hold out much chance of getting to the root of the problem at this point.

Alex

Quoted 71 lines

thanks,

Ilija

Quoted 61 lines · On Thu, 11 Jul 2013, [email protected] wrote:

From: Alex Deucher <[email protected]>

They still seem to cause instability on some r6xx parts. As a follow up, we can switch to using CP DMA for bo moves on r6xx as a lighter weight alternative to using the 3D engine.

A version of this patch should also go to stable kernels.

---
drivers/gpu/drm/radeon/radeon_asic.c | 12 ++++++------

1 files changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/radeon/radeon_asic.c +6 -7
index 0970774..ea5c52b 100644
@@ -1026,8 +1026,8 @@ static struct radeon_asic r600_asic = {
                .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
                .dma = &r600_copy_dma,
                .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
-               .copy = &r600_copy_dma,
-               .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
+               .copy = &r600_copy_blit,
+               .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
        },
        .surface = {
                .set_reg = r600_set_surface_reg,
@@ -1119,8 +1119,8 @@ static struct radeon_asic rv6xx_asic = {
                .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
                .dma = &r600_copy_dma,
                .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
-               .copy = &r600_copy_dma,
-               .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
+               .copy = &r600_copy_blit,
+               .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
        },
        .surface = {
                .set_reg = r600_set_surface_reg,
@@ -1229,8 +1229,8 @@ static struct radeon_asic rs780_asic = {
                .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
                .dma = &r600_copy_dma,
                .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
-               .copy = &r600_copy_dma,
-               .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
+               .copy = &r600_copy_blit,
+               .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
        },
        .surface = {
                .set_reg = r600_set_surface_reg,
--

1.7.7.5

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#6 lore raw
In reply to Ilija Hadzic

Am 11.07.2013 21:59, schrieb Ilija Hadzic:

Quoted 7 lines

Alex,

Can you please share some details about the nature or symptom of the "instability". One problem that I have been seeing on my end is that when I use the DMA ring intensively (by intensively I mean, calling the copy function every frame), combined with some 3D rendering that causes a lot of cs_ioctl calls, that I can provoke a corruption of the olist field in radeon_sa_bo structure, consequently causing an oops in radeon_sa_bo_try_free(). I have also found that I can suppress the problem if I add some padding fields at the beginnig of the radeon_sa_bo structure (essentially moving the olist field down).

So I speculate that the use of DMA somehow results in corrupting that structure, but I have not yet done enough experiments to prove or disprove that theory (so I have not spoke up yet). Also my kernel is full of my own internal hacks, and I have not yet taken the time to reproduce the problem with the "stock" kernel. However, after seeing your patch series, I am wondering if the instability you are referring to may be of the same or similar nature.

Hi Ilija,

well that's very interesting and no it's quite unlikely that this is cause by the DMA ring because the radeon_sa_bo structure should be allocated on system memory and the GPU can usually only access it if you map it through GART.

Is that easily reproducible for you? Is there already an open bugreport?

Thanks,
Christian.

Quoted 72 lines

thanks,

Ilija

Quoted 60 lines · On Thu, 11 Jul 2013, [email protected] wrote:

From: Alex Deucher <[email protected]>

They still seem to cause instability on some r6xx parts. As a follow up, we can switch to using CP DMA for bo moves on r6xx as a lighter weight alternative to using the 3D engine.

A version of this patch should also go to stable kernels.

---
drivers/gpu/drm/radeon/radeon_asic.c | 12 ++++++------

1 files changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/radeon/radeon_asic.c +6 -6
index 0970774..ea5c52b 100644
@@ -1026,8 +1026,8 @@ static struct radeon_asic r600_asic = {
        .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
        .dma = &r600_copy_dma,
        .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
-        .copy = &r600_copy_dma,
-        .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
+        .copy = &r600_copy_blit,
+        .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
    },
    .surface = {
        .set_reg = r600_set_surface_reg,
@@ -1119,8 +1119,8 @@ static struct radeon_asic rv6xx_asic = {
        .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
        .dma = &r600_copy_dma,
        .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
-        .copy = &r600_copy_dma,
-        .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
+        .copy = &r600_copy_blit,
+        .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
    },
    .surface = {
        .set_reg = r600_set_surface_reg,
@@ -1229,8 +1229,8 @@ static struct radeon_asic rs780_asic = {
        .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
        .dma = &r600_copy_dma,
        .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
-        .copy = &r600_copy_dma,
-        .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
+        .copy = &r600_copy_blit,
+        .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
    },
    .surface = {
        .set_reg = r600_set_surface_reg,
Signature · 6 lines
1.7.7.5

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#7 lore raw
Quoted 4 lines · Christian König

Hi Ilija,

well that's very interesting and no it's quite unlikely that this is cause by the DMA ring because the radeon_sa_bo structure should be allocated on system memory and the GPU can usually only access it if you map it through GART.

OK that's good information to know. I'll do some more investigation on my end.

Quoted 2 lines

Is that easily reproducible for you? Is there already an open bugreport?

It typically happens out of the blue after several days of running, but it happens consistently (just like padding the radeon_sa_bo structure consistently suppresses the problem).

However, like I said, my kernel is full of my own patches that don't live in the upstream tree, so I am not excluding the possibility that one of my hacks introduced the problem (though, I find it unlikely).

I have not yet opened the bug report, because I first want to reproduce the problem with the upstream kernel that is free of my hacks. As soon as I do that, I'll write the ticket.

-- Ilija

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

Reviewed-by on v1 1/3
#8 lore raw
In reply to [email protected]

Am 11.07.2013 21:35, schrieb [email protected]:

Quoted 11 lines

From: Alex Deucher <[email protected]>

They still seem to cause instability on some r6xx parts. As a follow up, we can switch to using CP DMA for bo moves on r6xx as a lighter weight alternative to using the 3D engine.

A version of this patch should also go to stable kernels.

Well since we have an easy to use alternative, isn't it time to kill off all the blitter code?

Anyway this patch series is:

Quoted 41 lines
---
  drivers/gpu/drm/radeon/radeon_asic.c |   12 ++++++------
  1 files changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/radeon/radeon_asic.c +6 -6
index 0970774..ea5c52b 100644
@@ -1026,8 +1026,8 @@ static struct radeon_asic r600_asic = {
  		.blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  		.dma = &r600_copy_dma,
  		.dma_ring_index = R600_RING_TYPE_DMA_INDEX,
-		.copy = &r600_copy_dma,
-		.copy_ring_index = R600_RING_TYPE_DMA_INDEX,
+		.copy = &r600_copy_blit,
+		.copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  	},
  	.surface = {
  		.set_reg = r600_set_surface_reg,
@@ -1119,8 +1119,8 @@ static struct radeon_asic rv6xx_asic = {
  		.blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  		.dma = &r600_copy_dma,
  		.dma_ring_index = R600_RING_TYPE_DMA_INDEX,
-		.copy = &r600_copy_dma,
-		.copy_ring_index = R600_RING_TYPE_DMA_INDEX,
+		.copy = &r600_copy_blit,
+		.copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  	},
  	.surface = {
  		.set_reg = r600_set_surface_reg,
@@ -1229,8 +1229,8 @@ static struct radeon_asic rs780_asic = {
  		.blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  		.dma = &r600_copy_dma,
  		.dma_ring_index = R600_RING_TYPE_DMA_INDEX,
-		.copy = &r600_copy_dma,
-		.copy_ring_index = R600_RING_TYPE_DMA_INDEX,
+		.copy = &r600_copy_blit,
+		.copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  	},
  	.surface = {
  		.set_reg = r600_set_surface_reg,
#9 lore raw
Quoted 9 lines · Christian König

Am 11.07.2013 21:35, schrieb [email protected]:

Quoted 7 lines

From: Alex Deucher <[email protected]>

They still seem to cause instability on some r6xx parts. As a follow up, we can switch to using CP DMA for bo moves on r6xx as a lighter weight alternative to using the 3D engine.

Quoted 8 lines
Quoted 4 lines

A version of this patch should also go to stable kernels.

Well since we have an easy to use alternative, isn't it time to kill off all the blitter code?

I was thinking that could be done as a clean-up in 3.12.

Alex

Quoted 50 lines

Anyway this patch series is:

Quoted 42 lines
---
  drivers/gpu/drm/radeon/radeon_asic.c |   12 ++++++------
  1 files changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/radeon/radeon_asic.c +6 -6
index 0970774..ea5c52b 100644
@@ -1026,8 +1026,8 @@ static struct radeon_asic r600_asic = {
                .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
                .dma = &r600_copy_dma,
                .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
-               .copy = &r600_copy_dma,
-               .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
+               .copy = &r600_copy_blit,
+               .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
        },
        .surface = {
                .set_reg = r600_set_surface_reg,
@@ -1119,8 +1119,8 @@ static struct radeon_asic rv6xx_asic = {
                .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
                .dma = &r600_copy_dma,
                .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
-               .copy = &r600_copy_dma,
-               .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
+               .copy = &r600_copy_blit,
+               .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
        },
        .surface = {
                .set_reg = r600_set_surface_reg,
@@ -1229,8 +1229,8 @@ static struct radeon_asic rs780_asic = {
                .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
                .dma = &r600_copy_dma,
                .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
-               .copy = &r600_copy_dma,
-               .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
+               .copy = &r600_copy_blit,
+               .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
        },
        .surface = {
                .set_reg = r600_set_surface_reg,