From 99a0824669374144d2c644c3a5d9bb7cf65ef716 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 2 Oct 2012 21:04:36 +0100 Subject: [PATCH] gem_cpu_reloc: Use the mappable aperture size! Signed-off-by: Chris Wilson --- tests/gem_cpu_reloc.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/gem_cpu_reloc.c b/tests/gem_cpu_reloc.c index ceb64054..a83eea6d 100644 --- a/tests/gem_cpu_reloc.c +++ b/tests/gem_cpu_reloc.c @@ -146,9 +146,13 @@ int main(int argc, char **argv) if (intel_gen(noop) >= 6) use_blt = I915_EXEC_BLT; - aper_size = gem_aperture_size(fd); - count = aper_size / 4096 * 2; + aper_size = gem_mappable_aperture_size(); + if (intel_get_total_ram_mb() < aper_size / (1024*1024) * 2) { + fprintf(stderr, "not enough mem to run test\n"); + return 77; + } + count = aper_size / 4096 * 2; handles = malloc (count * sizeof(uint32_t)); assert(handles);