gem_cpu_reloc: Use the mappable aperture size!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2012-10-02 21:04:36 +01:00
parent 217511012a
commit 99a0824669

View File

@ -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);