aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2014-07-17 12:20:32 -0400
committerAlex Deucher <alexander.deucher@amd.com>2014-08-05 08:53:35 -0400
commit2c6316cbcd724adaea123a64a939b0ec4c39d009 (patch)
tree671ee24cc9e1da0625940bba752b88bf3a572d3e
parentccbe0060aabb097bdb96510dc0390ed8f79326ea (diff)
drm/radeon: use vram/gart pinned size in radeon_do_test_moves
Gives more accurate count and prevents failures when we can't allocate memory for the tests. Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
-rw-r--r--drivers/gpu/drm/radeon/radeon_test.c8
1 files changed, 1 insertions, 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)
56 /* Number of tests = 56 /* Number of tests =
57 * (Total GTT - IB pool - writeback page - ring buffers) / test size 57 * (Total GTT - IB pool - writeback page - ring buffers) / test size
58 */ 58 */
59 n = rdev->mc.gtt_size - RADEON_IB_POOL_SIZE*64*1024; 59 n = rdev->mc.gtt_size - rdev->gart_pin_size;
60 for (i = 0; i < RADEON_NUM_RINGS; ++i)
61 n -= rdev->ring[i].ring_size;
62 if (rdev->wb.wb_obj)
63 n -= RADEON_GPU_PAGE_SIZE;
64 if (rdev->ih.ring_obj)
65 n -= rdev->ih.ring_size;
66 n /= size; 60 n /= size;
67 61
68 gtt_obj = kzalloc(n * sizeof(*gtt_obj), GFP_KERNEL); 62 gtt_obj = kzalloc(n * sizeof(*gtt_obj), GFP_KERNEL);