summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2018-09-14 14:34:08 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2018-09-14 17:00:27 +0100
commit0f3944de6f58544eef83643b31fd772ce8d6ae48 (patch)
tree6bf6978c8ef77d18d3451be2b710bb6a744c5f38 /tests
parent7b3ea4efb9713cd67e17e33202fa9d0681a284d1 (diff)
igt/gen3_*_blits: Add memory requirement checks
Check we have sufficient memory to run the tests before getting trapped in the swap of despair. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107935 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/gen3_mixed_blits.c1
-rw-r--r--tests/gen3_render_linear_blits.c1
-rw-r--r--tests/gen3_render_mixed_blits.c1
-rw-r--r--tests/gen3_render_tiledx_blits.c1
-rw-r--r--tests/gen3_render_tiledy_blits.c1
5 files changed, 5 insertions, 0 deletions
diff --git a/tests/gen3_mixed_blits.c b/tests/gen3_mixed_blits.c
index fa64598a..948f4e6a 100644
--- a/tests/gen3_mixed_blits.c
+++ b/tests/gen3_mixed_blits.c
@@ -458,6 +458,7 @@ int main(int argc, char **argv)
if (count == 0)
count = 3 * gem_aperture_size(fd) / (1024*1024) / 2;
igt_info("Using %d 1MiB buffers\n", count);
+ intel_require_memory(count, 1024*1024, CHECK_RAM);
handle = malloc(sizeof(uint32_t)*count*3);
tiling = handle + count;
diff --git a/tests/gen3_render_linear_blits.c b/tests/gen3_render_linear_blits.c
index a03d7fc0..9d1499a5 100644
--- a/tests/gen3_render_linear_blits.c
+++ b/tests/gen3_render_linear_blits.c
@@ -333,6 +333,7 @@ int main(int argc, char **argv)
if (count == 0)
count = 3 * gem_aperture_size(fd) / (1024*1024) / 2;
igt_info("Using %d 1MiB buffers\n", count);
+ intel_require_memory(count, 1024*1024, CHECK_RAM);
handle = malloc(sizeof(uint32_t)*count*2);
start_val = handle + count;
diff --git a/tests/gen3_render_mixed_blits.c b/tests/gen3_render_mixed_blits.c
index 2f127d99..afb53a59 100644
--- a/tests/gen3_render_mixed_blits.c
+++ b/tests/gen3_render_mixed_blits.c
@@ -352,6 +352,7 @@ int main(int argc, char **argv)
if (count == 0)
count = 3 * gem_aperture_size(fd) / (1024*1024) / 2;
igt_info("Using %d 1MiB buffers\n", count);
+ intel_require_memory(count, 1024*1024, CHECK_RAM);
handle = malloc(sizeof(uint32_t)*count*3);
tiling = handle + count;
diff --git a/tests/gen3_render_tiledx_blits.c b/tests/gen3_render_tiledx_blits.c
index 06cdda38..e6246f2b 100644
--- a/tests/gen3_render_tiledx_blits.c
+++ b/tests/gen3_render_tiledx_blits.c
@@ -339,6 +339,7 @@ int main(int argc, char **argv)
if (count == 0)
count = 3 * gem_aperture_size(fd) / (1024*1024) / 2;
igt_info("Using %d 1MiB buffers\n", count);
+ intel_require_memory(count, 1024*1024, CHECK_RAM);
handle = malloc(sizeof(uint32_t)*count*2);
start_val = handle + count;
diff --git a/tests/gen3_render_tiledy_blits.c b/tests/gen3_render_tiledy_blits.c
index 9e4f4b77..17502ccb 100644
--- a/tests/gen3_render_tiledy_blits.c
+++ b/tests/gen3_render_tiledy_blits.c
@@ -339,6 +339,7 @@ int main(int argc, char **argv)
if (count == 0)
count = 3 * gem_aperture_size(fd) / (1024*1024) / 2;
igt_info("Using %d 1MiB buffers\n", count);
+ intel_require_memory(count, 1024*1024, CHECK_RAM);
handle = malloc(sizeof(uint32_t)*count*2);
start_val = handle + count;