igt/gem_evict_alignment: Fix the memory limits checking
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 6 Jun 2014 07:43:08 +0000 (08:43 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 6 Jun 2014 07:44:18 +0000 (08:44 +0100)
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75138
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
tests/gem_evict_alignment.c

index 2bf3305..41c9f17 100644 (file)
@@ -134,7 +134,7 @@ static void minor_evictions(int fd, int size, int count)
        uint32_t *bo, *sel;
        int n, m, alignment, pass, fail;
 
-       igt_require((uint64_t)count * size / (1024 * 1024) < intel_get_total_ram_mb() * 9 / 10);
+       igt_require(intel_check_memory(count, size, CHECK_RAM));
 
        bo = malloc(3*count*sizeof(*bo));
        igt_assert(bo);
@@ -164,7 +164,7 @@ static void major_evictions(int fd, int size, int count)
        int n, m, loop, alignment, max;
        uint32_t *bo;
 
-       igt_require((uint64_t)count * size / (1024 * 1024) < intel_get_total_ram_mb() * 9 / 10);
+       igt_require(intel_check_memory(count, size, CHECK_RAM));
 
        bo = malloc(count*sizeof(*bo));
        igt_assert(bo);