11 Commits

Author SHA1 Message Date
Chris Wilson
f3751d53bd benchmarks/gem_blt: Measure the throughput of synchronous copies
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-01 15:07:29 +00:00
Chris Wilson
e3b68bb666 lib: Share common __gem_execbuf()
An oft-repeated function to check EXECBUFFER2 for a particular fail
condition.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-27 14:45:18 +00:00
Chris Wilson
3d5b50b4f0 benchmarks/gem_blt: Estimate memory bandwidth to improve test runtime
If we autotune the workload to only take 0.1s and then repeat the
measurements over 2s, we can bound the benchmark runtime. (Roughly of
course! Sometimes the dispartity between main memory CPU bandwidth, and
GPU execution bandwidth throws off the runtime, but that's the purpose
of the benchmark!)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-12-31 22:10:11 +00:00
Chris Wilson
4c14aa18c1 benchmarks/gem_blt: Fixup a couple of non-llc foibles
When extending the batch for multiple copies, we need to remember to
flag it as being in the CPU write domain so that the new values get
flushed out to main memory before execution. We also have to be careful
not to specify NO_RELOC for the extended batch as the execobjects will
have been updated but we write the wrong presumed offsets. Subsequent
iterations will be correct and we can tell the kernel then to skip the
relocations entirely.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-11-12 10:54:11 +00:00
Chris Wilson
5cabb8c543 benchmarks/gem_blt: Report peak throughput
Report the highest throughput measured from a large set of runs to
improve sensitivity.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-11-10 14:04:58 +00:00
Derek Morton
0ab76a22d1 benchmarks/gem_blt: Include igt.h in gem_blt.c
To fix a build error on android

Signed-off-by: Derek Morton <derek.j.morton@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-10-15 16:59:59 +01:00
Ville Syrjälä
f52e7ec787 Replace __gem_mmap__{cpu,gtt,wc}() + igt_assert() with gem_mmap__{cpu,gtt,wc}()
gem_mmap__{cpu,gtt,wc}() already has the assert built in, so replace
 __gem_mmap__{cpu,gtt,wc}() + igt_assert() with it.

Mostly done with coccinelle, with some manual help:
@@
identifier I;
expression E1, E2, E3, E4, E5, E6;
@@
(
-  I = __gem_mmap__gtt(E1, E2, E3, E4);
+  I = gem_mmap__gtt(E1, E2, E3, E4);
...
-  igt_assert(I);
|
-  I = __gem_mmap__cpu(E1, E2, E3, E4, E5);
+  I = gem_mmap__cpu(E1, E2, E3, E4, E5);
...
-  igt_assert(I);
|
-  I = __gem_mmap__wc(E1, E2, E3, E4, E5);
+  I = gem_mmap__wc(E1, E2, E3, E4, E5);
...
-  igt_assert(I);
)

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Stochastically-reviwewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-10-12 19:57:58 +03:00
Ville Syrjälä
b8a77dd6c8 Make gem_mmap__{cpu,gtt,wc}() assert on failure
Rename the current gem_mmap__{cpu,gtt,wc}() functions into
__gem_mmap__{cpu,gtt,wc}(), and add back wrappers with the original name
that assert that the pointer is valid. Most callers will expect a valid
pointer and shouldn't have to bother with failures.

To avoid changing anything (yet), sed 's/gem_mmap__/__gem_mmap__/g'
over the entire codebase.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Stochastically-reviwewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-10-09 19:16:26 +03:00
Ville Syrjälä
7eaae3c201 Sprinkle igt_assert(ptr) after gem_mmap__{cpu,gtt,wc}
Do the following
 ptr = gem_mmap__{cpu,gtt,wc}()
+igt_assert(ptr);

whenever the code doesn't handle the NULL ptr in any kind of
specific way.

Makes it easier to move the assert into gem_mmap__{cpu,gtt,wc}() itself.

Mostly done with coccinelle, with some manual cleanups:
@@
identifier I;
@@
<... when != igt_assert(I)
     when != igt_require(I)
     when != igt_require_f(I, ...)
     when != I != NULL
     when != I == NULL
(
  I = gem_mmap__gtt(...);
+ igt_assert(I);
|
  I = gem_mmap__cpu(...);
+ igt_assert(I);
|
  I = gem_mmap__wc(...);
+ igt_assert(I);
)
...>

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Stochastically-reviwewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-10-09 18:33:30 +03:00
Chris Wilson
d878e18dfd benchmarks/gem_blt: Fix compilation after rebase and add batch-size
Add an option to do more than one copy per batch.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-10-06 17:04:31 +01:00
Chris Wilson
8253e7dc84 benchmarks: Measure BLT performance
Execute N blits and time how long they complete to measure both GPU
limited bandwidth and submission overhead.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-10-06 10:24:07 +01:00