drm/radeon: use vram/gart pinned size in radeon_do_test_moves
authorAlex Deucher <alexander.deucher@amd.com>
Thu, 17 Jul 2014 16:20:32 +0000 (12:20 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 5 Aug 2014 12:53:35 +0000 (08:53 -0400)
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>
drivers/gpu/drm/radeon/radeon_test.c

index 9c5b66cb32aeb4bc9c4d96202fd4d8e6717bb79b..5adf4207453d7eb041f6679722283a36ae5a0931 100644 (file)
@@ -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);