diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-04-10 19:41:43 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-04-10 19:41:43 +0100 |
commit | b78243fc61bd46624931f149d00e4a78242e9c92 (patch) | |
tree | 5c284040e8cf85aa90d2e1efd9bbb8947e1ed2a2 | |
parent | da026d8bfef1a76a60ae4a46a738ce153e9fe0b7 (diff) |
test/gem_cpu_concurrent_blit: Limit memory usage to half aperture
So that we don't cause needless thrashing on older devices and spoil the
test.
-rw-r--r-- | tests/gem_cpu_concurrent_blit.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/gem_cpu_concurrent_blit.c b/tests/gem_cpu_concurrent_blit.c index e1ff8313..ff18f150 100644 --- a/tests/gem_cpu_concurrent_blit.c +++ b/tests/gem_cpu_concurrent_blit.c @@ -92,7 +92,7 @@ main(int argc, char **argv) { drm_intel_bufmgr *bufmgr; struct intel_batchbuffer *batch; - int num_buffers = 128; + int num_buffers = 128, max; drm_intel_bo *src[128], *dst[128]; int width = 512, height = 512; int fd; @@ -100,6 +100,10 @@ main(int argc, char **argv) fd = drm_open_any(); + max = gem_aperture_size (fd) / (1024 * 1024) / 2; + if (num_buffers > max) + num_buffers = max; + bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); drm_intel_bufmgr_gem_enable_reuse(bufmgr); batch = intel_batchbuffer_alloc(bufmgr, intel_get_drm_devid(fd)); |