From 2c6316cbcd724adaea123a64a939b0ec4c39d009 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Thu, 17 Jul 2014 12:20:32 -0400 Subject: drm/radeon: use vram/gart pinned size in radeon_do_test_moves MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Gives more accurate count and prevents failures when we can't allocate memory for the tests. Signed-off-by: Alex Deucher Reviewed-by: Christian König Reviewed-by: Michel Dänzer --- drivers/gpu/drm/radeon/radeon_test.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_test.c b/drivers/gpu/drm/radeon/radeon_test.c index 9c5b66cb32ae..5adf4207453d 100644 --- a/drivers/gpu/drm/radeon/radeon_test.c +++ b/drivers/gpu/drm/radeon/radeon_test.c @@ -56,13 +56,7 @@ static void radeon_do_test_moves(struct radeon_device *rdev, int flag) /* Number of tests = * (Total GTT - IB pool - writeback page - ring buffers) / test size */ - n = rdev->mc.gtt_size - RADEON_IB_POOL_SIZE*64*1024; - for (i = 0; i < RADEON_NUM_RINGS; ++i) - n -= rdev->ring[i].ring_size; - if (rdev->wb.wb_obj) - n -= RADEON_GPU_PAGE_SIZE; - if (rdev->ih.ring_obj) - n -= rdev->ih.ring_size; + n = rdev->mc.gtt_size - rdev->gart_pin_size; n /= size; gtt_obj = kzalloc(n * sizeof(*gtt_obj), GFP_KERNEL); -- cgit v1.2.2