summaryrefslogtreecommitdiff
path: root/benchmarks/gem_latency.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2015-12-21 09:57:52 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2015-12-21 10:00:21 +0000
commit3ebce37b65ddb292161498ac4f6a07e3667c9b03 (patch)
tree1c296fca6730af895bb97c11304fd32191d4a4bb /benchmarks/gem_latency.c
parent3cc8f957f1c443f012b292dbb5d81acb59dffb25 (diff)
benchmarks/gem_latency: Guard against inferior pthreads.h
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'benchmarks/gem_latency.c')
-rw-r--r--benchmarks/gem_latency.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/benchmarks/gem_latency.c b/benchmarks/gem_latency.c
index 65065b16..12513974 100644
--- a/benchmarks/gem_latency.c
+++ b/benchmarks/gem_latency.c
@@ -102,7 +102,7 @@ struct producer {
#define CYCLES_TO_NS(x) (80.*(x))
#define CYCLES_TO_US(x) (CYCLES_TO_NS(x)/1000.)
-static uint32_t create_workload(int gen, uint32_t scratch, int factor)
+static uint32_t create_workload(int gen, int factor)
{
const int has_64bit_reloc = gen >= 8;
uint32_t handle = gem_create(fd, 4096);
@@ -398,7 +398,7 @@ static int run(int seconds,
scratch = gem_create(fd, 4*WIDTH*HEIGHT);
nop_batch = create_nop();
- workload_batch = create_workload(gen, scratch, workload);
+ workload_batch = create_workload(gen, workload);
p = calloc(nproducers, sizeof(*p));
for (n = 0; n < nproducers; n++) {
@@ -433,10 +433,14 @@ static int run(int seconds,
pthread_attr_init(&attr);
if (flags & REALTIME) {
+#ifdef PTHREAD_EXPLICIT_SCHED
struct sched_param param = { .sched_priority = 99 };
pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);
pthread_attr_setschedpolicy(&attr, SCHED_FIFO);
pthread_attr_setschedparam(&attr, &param);
+#else
+ return 77;
+#endif
}
for (n = 0; n < nproducers; n++)
pthread_create(&p[n].thread, &attr, producer, &p[n]);