summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPekka Paalanen <pekka.paalanen@collabora.co.uk>2015-06-10 12:02:17 +0300
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>2015-07-06 12:04:18 +0300
commit9e8f2bcaf5fabd3729ee0ecc90009fd6cea9e8e9 (patch)
treeccef685b07dbdaf2c4135ca6852799e119dcf247
parenta33c2e6853fe0a76da42a43ed7ed9095e2dbe6a2 (diff)
lowlevel-blt-bench: move speed and scaling printing
Move the printing of the memory speed and scaling mode into 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>
-rw-r--r--test/lowlevel-blt-bench.c37
1 files changed, 22 insertions, 15 deletions
diff --git a/test/lowlevel-blt-bench.c b/test/lowlevel-blt-bench.c
index aca1819..8ad4ebb 100644
--- a/test/lowlevel-blt-bench.c
+++ b/test/lowlevel-blt-bench.c
@@ -1031,6 +1031,26 @@ print_explanation (void)
}
static void
+print_speed_scaling (double bw)
+{
+ printf ("reference memcpy speed = %.1fMB/s (%.1fMP/s for 32bpp fills)\n",
+ bw / 1000000., bw / 4000000);
+
+ if (use_scaling)
+ {
+ printf ("---\n");
+ if (filter == PIXMAN_FILTER_BILINEAR)
+ printf ("BILINEAR scaling\n");
+ else if (filter == PIXMAN_FILTER_NEAREST)
+ printf ("NEAREST scaling\n");
+ else
+ printf ("UNKNOWN scaling\n");
+ }
+
+ printf ("---\n");
+}
+
+static void
usage (const char *progname)
{
printf ("Usage: %s [-b] [-n] pattern\n", progname);
@@ -1041,7 +1061,6 @@ usage (const char *progname)
int
main (int argc, char *argv[])
{
- double x;
int i;
const char *pattern = NULL;
for (i = 1; i < argc; i++)
@@ -1079,20 +1098,8 @@ main (int argc, char *argv[])
mask = dst + (BUFSIZE / 4);
print_explanation ();
- bandwidth = x = bench_memcpy ();
- printf ("reference memcpy speed = %.1fMB/s (%.1fMP/s for 32bpp fills)\n",
- x / 1000000., x / 4000000);
- if (use_scaling)
- {
- printf ("---\n");
- if (filter == PIXMAN_FILTER_BILINEAR)
- printf ("BILINEAR scaling\n");
- else if (filter == PIXMAN_FILTER_NEAREST)
- printf ("NEAREST scaling\n");
- else
- printf ("UNKNOWN scaling\n");
- }
- printf ("---\n");
+ bandwidth = bench_memcpy ();
+ print_speed_scaling (bandwidth);
if (strcmp (pattern, "all") == 0)
{