Skip to contentSkip to conversation

drm/amdgpu: fix ring space allocation for IB scheduling

PATCH In review Alex Deucher 2 participants 2 messages Sep 15, 2016 1 message not in the archive

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

PATCH 1/1 drm/amdgpu: fix ring space allocation for IB scheduling

GFX IB frame is much bigger than other ring, so set the limit larger.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +5 -1
index 2aa741c..e11e4cf 100644
@@ -152,7 +152,11 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
 		return -EINVAL;
 	}
 
-	r = amdgpu_ring_alloc(ring, 256 * num_ibs);
+	/* GFX DMA frame is much bigger than other rings */
+	if (ring->type == AMDGPU_RING_TYPE_GFX)
+		r = amdgpu_ring_alloc(ring, 512 + num_ibs * 16);
+	else
+		r = amdgpu_ring_alloc(ring, 256 + num_ibs * 16);
 	if (r) {
 		dev_err(adev->dev, "scheduling IB failed (%d).\n", r);
 		return r;
Signature · 6 lines
2.5.5

_______________________________________________
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): 1473962938-2562-1-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org

#2 lore raw

Am 15.09.2016 um 20:08 schrieb Alex Deucher:

Quoted 4 lines

GFX IB frame is much bigger than other ring, so set the limit larger.

Could we rather add some fields to the ring structure to indicate how many base + per IB dw we need to allocate?

Probably better than having engine specific code here.

Christian.

Quoted 11 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 6 +++++-
  1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +0 -0
index 2aa741c..e11e4cf 100644
@@ -152,7 +152,11 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
  		return -EINVAL;
  	}

drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs, · line 162

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +5 -1
 
-	r = amdgpu_ring_alloc(ring, 256 * num_ibs);
+	/* GFX DMA frame is much bigger than other rings */
+	if (ring->type == AMDGPU_RING_TYPE_GFX)
+		r = amdgpu_ring_alloc(ring, 512 + num_ibs * 16);
+	else
+		r = amdgpu_ring_alloc(ring, 256 + num_ibs * 16);
  	if (r) {
  		dev_err(adev->dev, "scheduling IB failed (%d).\n", r);
  		return r;

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