Skip to contentSkip to conversation

drm/radeon: Take IH ring into account for test size calculation.

PATCH In review Michel Dänzer 2 participants 3 messages Aug 19, 2011 – Aug 23, 2011

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

PATCH 1/1 drm/radeon: Take IH ring into account for test size calculation.

From: Michel Dänzer <[email protected]>

---
 drivers/gpu/drm/radeon/radeon_test.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
drivers/gpu/drm/radeon/radeon_test.c +7 -3
index dee4a0c..1ebd0fe 100644
@@ -40,10 +40,14 @@ void radeon_test_moves(struct radeon_device *rdev)
 	size = 1024 * 1024;
 
 	/* Number of tests =
-	 * (Total GTT - IB pool - writeback page - ring buffer) / test size
+	 * (Total GTT - IB pool - writeback page - ring buffers) / test size
 	 */
-	n = ((u32)(rdev->mc.gtt_size - RADEON_IB_POOL_SIZE*64*1024 - RADEON_GPU_PAGE_SIZE -
-	     rdev->cp.ring_size)) / size;
+	n = rdev->mc.gtt_size - RADEON_IB_POOL_SIZE*64*1024 - rdev->cp.ring_size;
+	if (rdev->wb.wb_obj)
+		n -= RADEON_GPU_PAGE_SIZE;
+	if (rdev->ih.ring_obj)
+		n -= rdev->ih.ring_size;
+	n /= size;
 
 	gtt_obj = kzalloc(n * sizeof(*gtt_obj), GFP_KERNEL);
 	if (!gtt_obj) {
Signature · 7 lines
1.7.5.4


_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw

2011/8/19 Michel Dänzer <[email protected]>:

Quoted 3 lines

From: Michel Dänzer <[email protected]>

Should probably also take into account the additional CP rings we allocate on cayman.

Quoted 35 lines

---
 drivers/gpu/drm/radeon/radeon_test.c |   10 +++++++---

 1 files changed, 7 insertions(+), 3 deletions(-)
drivers/gpu/drm/radeon/radeon_test.c +7 -4
index dee4a0c..1ebd0fe 100644
@@ -40,10 +40,14 @@ void radeon_test_moves(struct radeon_device *rdev)
        size = 1024 * 1024;
 
        /* Number of tests =
-        * (Total GTT - IB pool - writeback page - ring buffer) / test size
+        * (Total GTT - IB pool - writeback page - ring buffers) / test size
         */
-       n = ((u32)(rdev->mc.gtt_size - RADEON_IB_POOL_SIZE*64*1024 - RADEON_GPU_PAGE_SIZE -
-            rdev->cp.ring_size)) / size;
+       n = rdev->mc.gtt_size - RADEON_IB_POOL_SIZE*64*1024 - rdev->cp.ring_size;
+       if (rdev->wb.wb_obj)
+               n -= RADEON_GPU_PAGE_SIZE;
+       if (rdev->ih.ring_obj)
+               n -= rdev->ih.ring_size;
+       n /= size;
 
        gtt_obj = kzalloc(n * sizeof(*gtt_obj), GFP_KERNEL);
        if (!gtt_obj) {
--

1.7.5.4

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

#2 lore raw
Quoted 7 lines · Alex Deucher

2011/8/19 Michel Dänzer <[email protected]>:

Quoted 3 lines

From: Michel Dänzer <[email protected]>

Should probably also take into account the additional CP rings we allocate on cayman.

Thanks for the heads up.

As we'd probably keep missing new additions like that, I'll post a followup patch to just silently abort on BO allocation/pinning failure instead.

Signature · 6 lines
Earthling Michel Dänzer           |                   http://www.amd.com
Libre software enthusiast         |          Debian, X and DRI developer
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel