lowlevel-blt-bench: move explanation printing
authorPekka Paalanen <pekka.paalanen@collabora.co.uk>
Wed, 10 Jun 2015 08:21:14 +0000 (11:21 +0300)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Mon, 6 Jul 2015 09:04:03 +0000 (12:04 +0300)
Move explanation printing to a new function. This will help with
implementing a machine-readable output option.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Ben Avison <bavison@riscosopen.org>
test/lowlevel-blt-bench.c

index 69202eef4131afa1424cc2bb049cdd868529709a..993f5dbd2ea3e0ff92110213c4e525952583be77 100644 (file)
@@ -976,6 +976,38 @@ run_default_tests (double bandwidth_)
         run_one_test (tests_tbl[i].testname, bandwidth_);
 }
 
+static void
+print_explanation (void)
+{
+    printf ("Benchmark for a set of most commonly used functions\n");
+    printf ("---\n");
+    printf ("All results are presented in millions of pixels per second\n");
+    printf ("L1  - small Xx1 rectangle (fitting L1 cache), always blitted at the same\n");
+    printf ("      memory location with small drift in horizontal direction\n");
+    printf ("L2  - small XxY rectangle (fitting L2 cache), always blitted at the same\n");
+    printf ("      memory location with small drift in horizontal direction\n");
+    printf ("M   - large %dx%d rectangle, always blitted at the same\n",
+            WIDTH - 64, HEIGHT);
+    printf ("      memory location with small drift in horizontal direction\n");
+    printf ("HT  - random rectangles with %dx%d average size are copied from\n",
+            TILEWIDTH, TILEWIDTH);
+    printf ("      one %dx%d buffer to another, traversing from left to right\n",
+            WIDTH, HEIGHT);
+    printf ("      and from top to bottom\n");
+    printf ("VT  - random rectangles with %dx%d average size are copied from\n",
+            TILEWIDTH, TILEWIDTH);
+    printf ("      one %dx%d buffer to another, traversing from top to bottom\n",
+            WIDTH, HEIGHT);
+    printf ("      and from left to right\n");
+    printf ("R   - random rectangles with %dx%d average size are copied from\n",
+            TILEWIDTH, TILEWIDTH);
+    printf ("      random locations of one %dx%d buffer to another\n",
+            WIDTH, HEIGHT);
+    printf ("RT  - as R, but %dx%d average sized rectangles are copied\n",
+            TINYWIDTH, TINYWIDTH);
+    printf ("---\n");
+}
+
 static void
 usage (const char *progname)
 {
@@ -1024,33 +1056,7 @@ main (int argc, char *argv[])
     dst = src + (BUFSIZE / 4);
     mask = dst + (BUFSIZE / 4);
 
-    printf ("Benchmark for a set of most commonly used functions\n");
-    printf ("---\n");
-    printf ("All results are presented in millions of pixels per second\n");
-    printf ("L1  - small Xx1 rectangle (fitting L1 cache), always blitted at the same\n");
-    printf ("      memory location with small drift in horizontal direction\n");
-    printf ("L2  - small XxY rectangle (fitting L2 cache), always blitted at the same\n");
-    printf ("      memory location with small drift in horizontal direction\n");
-    printf ("M   - large %dx%d rectangle, always blitted at the same\n",
-            WIDTH - 64, HEIGHT);
-    printf ("      memory location with small drift in horizontal direction\n");
-    printf ("HT  - random rectangles with %dx%d average size are copied from\n",
-            TILEWIDTH, TILEWIDTH);
-    printf ("      one %dx%d buffer to another, traversing from left to right\n",
-            WIDTH, HEIGHT);
-    printf ("      and from top to bottom\n");
-    printf ("VT  - random rectangles with %dx%d average size are copied from\n",
-            TILEWIDTH, TILEWIDTH);
-    printf ("      one %dx%d buffer to another, traversing from top to bottom\n",
-            WIDTH, HEIGHT);
-    printf ("      and from left to right\n");
-    printf ("R   - random rectangles with %dx%d average size are copied from\n",
-            TILEWIDTH, TILEWIDTH);
-    printf ("      random locations of one %dx%d buffer to another\n",
-            WIDTH, HEIGHT);
-    printf ("RT  - as R, but %dx%d average sized rectangles are copied\n",
-            TINYWIDTH, TINYWIDTH);
-    printf ("---\n");
+    print_explanation ();
     bandwidth = x = bench_memcpy ();
     printf ("reference memcpy speed = %.1fMB/s (%.1fMP/s for 32bpp fills)\n",
             x / 1000000., x / 4000000);