From 6e9c48c579e3325506234fa2ee7635f08f2c5a33 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Wed, 10 Jun 2015 12:53:09 +0300 Subject: [PATCH] lowlevel-blt-bench: all bench funcs to return pix_cnt The bench_* functions, that did not already do it, are modified to return the number of pixels processed during the benchmark. This moves the computation to the site that actually determines the number, and simplifies bench_composite() a bit. Signed-off-by: Pekka Paalanen Reviewed-by: Ben Avison --- test/lowlevel-blt-bench.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/test/lowlevel-blt-bench.c b/test/lowlevel-blt-bench.c index 8ad4ebb..99f8352 100644 --- a/test/lowlevel-blt-bench.c +++ b/test/lowlevel-blt-bench.c @@ -165,7 +165,7 @@ call_func (pixman_composite_func_t func, func (0, &info); } -void +double noinline bench_L (pixman_op_t op, pixman_image_t * src_img, @@ -204,9 +204,11 @@ bench_L (pixman_op_t op, call_func (func, op, src_img, mask_img, dst_img, x, 0, x, 0, 63 - x, 0, width, lines_count); } qx = q; + + return (double)n * lines_count * width; } -void +double noinline bench_M (pixman_op_t op, pixman_image_t * src_img, @@ -224,6 +226,8 @@ bench_M (pixman_op_t op, x = 0; call_func (func, op, src_img, mask_img, dst_img, x, 0, x, 0, 1, 0, WIDTH - 64, HEIGHT); } + + return (double)n * (WIDTH - 64) * HEIGHT; } double @@ -476,13 +480,12 @@ bench_composite (const char *testname, n = 1 + npix / (l1test_width * 8); t1 = gettime (); #if EXCLUDE_OVERHEAD - bench_L (op, src_img, mask_img, dst_img, n, pixman_image_composite_empty, l1test_width, 1); + pix_cnt = bench_L (op, src_img, mask_img, dst_img, n, pixman_image_composite_empty, l1test_width, 1); #endif t2 = gettime (); - bench_L (op, src_img, mask_img, dst_img, n, func, l1test_width, 1); + pix_cnt = bench_L (op, src_img, mask_img, dst_img, n, func, l1test_width, 1); t3 = gettime (); - printf (" L1:%7.2f", (double)n * l1test_width * 1 / - ((t3 - t2) - (t2 - t1)) / 1000000.); + printf (" L1:%7.2f", pix_cnt / ((t3 - t2) - (t2 - t1)) / 1000000.); fflush (stdout); memcpy (dst, src, BUFSIZE); @@ -495,13 +498,12 @@ bench_composite (const char *testname, n = 1 + npix / (l1test_width * nlines); t1 = gettime (); #if EXCLUDE_OVERHEAD - bench_L (op, src_img, mask_img, dst_img, n, pixman_image_composite_empty, l1test_width, nlines); + pix_cnt = bench_L (op, src_img, mask_img, dst_img, n, pixman_image_composite_empty, l1test_width, nlines); #endif t2 = gettime (); - bench_L (op, src_img, mask_img, dst_img, n, func, l1test_width, nlines); + pix_cnt = bench_L (op, src_img, mask_img, dst_img, n, func, l1test_width, nlines); t3 = gettime (); - printf (" L2:%7.2f", (double)n * l1test_width * nlines / - ((t3 - t2) - (t2 - t1)) / 1000000.); + printf (" L2:%7.2f", pix_cnt / ((t3 - t2) - (t2 - t1)) / 1000000.); fflush (stdout); memcpy (dst, src, BUFSIZE); @@ -510,14 +512,14 @@ bench_composite (const char *testname, n = 1 + npix / (WIDTH * HEIGHT); t1 = gettime (); #if EXCLUDE_OVERHEAD - bench_M (op, src_img, mask_img, dst_img, n, pixman_image_composite_empty); + pix_cnt = bench_M (op, src_img, mask_img, dst_img, n, pixman_image_composite_empty); #endif t2 = gettime (); - bench_M (op, src_img, mask_img, dst_img, n, func); + pix_cnt = bench_M (op, src_img, mask_img, dst_img, n, func); t3 = gettime (); printf (" M:%6.2f (%6.2f%%)", - ((double)n * (WIDTH - 64) * HEIGHT / ((t3 - t2) - (t2 - t1))) / 1000000., - ((double)n * (WIDTH - 64) * HEIGHT / ((t3 - t2) - (t2 - t1)) * bytes_per_pix) * (100.0 / bandwidth) ); + (pix_cnt / ((t3 - t2) - (t2 - t1))) / 1000000., + (pix_cnt / ((t3 - t2) - (t2 - t1)) * bytes_per_pix) * (100.0 / bandwidth) ); fflush (stdout); memcpy (dst, src, BUFSIZE); -- 2.7.4