summaryrefslogtreecommitdiff
path: root/benchmarks/gem_blt.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-03-01 15:06:43 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2016-03-01 15:07:29 +0000
commitf3751d53bda785810acf85692e809627360252bf (patch)
treeeb54b61aa1a98d1633434fedb2e877c63e93f477 /benchmarks/gem_blt.c
parentb59bcb811a402c716302f61ca8d4d9af6a967807 (diff)
benchmarks/gem_blt: Measure the throughput of synchronous copies
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'benchmarks/gem_blt.c')
-rw-r--r--benchmarks/gem_blt.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/benchmarks/gem_blt.c b/benchmarks/gem_blt.c
index 0d1c54d4..cfd3e124 100644
--- a/benchmarks/gem_blt.c
+++ b/benchmarks/gem_blt.c
@@ -178,7 +178,9 @@ static int gem_linear_blt(int fd,
return (b+2 - batch) * sizeof(uint32_t);
}
-static int run(int object, int batch, int time, int reps)
+#define SYNC 0x1
+
+static int run(int object, int batch, int time, int reps, unsigned flags)
{
struct drm_i915_gem_execbuffer2 execbuf;
struct drm_i915_gem_exec_object2 exec[3];
@@ -257,6 +259,10 @@ static int run(int object, int batch, int time, int reps)
/* Guess how many loops we need for 0.1s */
count = baseline((uint64_t)object * batch, 100);
+ if (flags & SYNC) {
+ time *= count / 2;
+ count = 1;
+ }
while (reps--) {
double min = HUGE_VAL;
@@ -289,9 +295,10 @@ int main(int argc, char **argv)
int reps = 13;
int time = 2000;
int batch = 1;
+ unsigned flags = 0;
int c;
- while ((c = getopt (argc, argv, "s:b:r:t:")) != -1) {
+ while ((c = getopt (argc, argv, "Ss:b:r:t:")) != -1) {
switch (c) {
case 's':
size = atoi(optarg);
@@ -299,6 +306,10 @@ int main(int argc, char **argv)
size = 4096;
break;
+ case 'S':
+ flags |= SYNC;
+ break;
+
case 't':
time = atoi(optarg);
if (time < 1)
@@ -322,5 +333,5 @@ int main(int argc, char **argv)
}
}
- return run(size, batch, time, reps);
+ return run(size, batch, time, reps, flags);
}