From 4550a18a571611197d3958ab3c1071ef69ec3838 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 24 Feb 2014 08:52:28 +0000 Subject: [PATCH] gem_render_linear_blits: Trim usage to fit within RAM This is a render correctness test, the intention is not to exercise the swapper (but preferrably some eviction code). Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75247 Signed-off-by: Chris Wilson --- tests/gem_render_linear_blits.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/gem_render_linear_blits.c b/tests/gem_render_linear_blits.c index c63b0914..5ba7c98f 100644 --- a/tests/gem_render_linear_blits.c +++ b/tests/gem_render_linear_blits.c @@ -99,7 +99,10 @@ int main(int argc, char **argv) return 1; } - printf("Using %d 1MiB buffers\n", count); + if (count > intel_get_total_ram_mb() * 9 / 10) { + count = intel_get_total_ram_mb() * 9 / 10; + printf("not enough RAM to run test, reducing buffer count\n"); + } bo = malloc(sizeof(*bo)*count); start_val = malloc(sizeof(*start_val)*count);