summaryrefslogtreecommitdiff
path: root/tests/gem_cs_prefetch.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2015-11-20 16:38:52 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2015-11-27 10:03:55 +0000
commit26507f3e21fe14b0fe5b3daec73c26f37bb2189a (patch)
treebf3b553af09cd787a95c293f4f08bc159fc3f2a7 /tests/gem_cs_prefetch.c
parente10ba6b51c028ce945605d1f720c598c93e8ad8f (diff)
igt/gem_cs_prefetch: Convert to intel_require_memory()
Replace the open-coded memory check with intel_require_memory. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests/gem_cs_prefetch.c')
-rw-r--r--tests/gem_cs_prefetch.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/tests/gem_cs_prefetch.c b/tests/gem_cs_prefetch.c
index a9918de9..687a764b 100644
--- a/tests/gem_cs_prefetch.c
+++ b/tests/gem_cs_prefetch.c
@@ -76,7 +76,6 @@ igt_simple_main
{
uint32_t batch_end[4] = {MI_BATCH_BUFFER_END, 0, 0, 0};
int fd, i, ret;
- uint64_t aper_size;
int count;
drm_intel_bo *sample_batch_bo;
@@ -89,13 +88,8 @@ igt_simple_main
drm_intel_bufmgr_gem_enable_reuse(bufmgr);
- aper_size = gem_aperture_size(fd);
-
- /* presume a big per-bo overhead */
- igt_skip_on_f(intel_get_total_ram_mb() < (aper_size / (1024*1024)) * 3 / 2,
- "not enough mem to run test\n");
-
- count = aper_size / 4096;
+ count = gem_aperture_size(fd) / 4096;
+ intel_require_memory(count, 4096, CHECK_RAM);
batch = intel_batchbuffer_alloc(bufmgr, intel_get_drm_devid(fd));
igt_assert(batch);