summaryrefslogtreecommitdiff
path: root/tests/gem_cpu_reloc.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-10-02 21:04:36 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-10-02 21:05:29 +0100
commit99a0824669374144d2c644c3a5d9bb7cf65ef716 (patch)
tree642587a75c07540c6e1054badeaca0eadda38960 /tests/gem_cpu_reloc.c
parent217511012a80461d465df33f7760c1f5f77c270e (diff)
gem_cpu_reloc: Use the mappable aperture size!
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests/gem_cpu_reloc.c')
-rw-r--r--tests/gem_cpu_reloc.c8
1 files 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);