summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2015-12-19 10:31:49 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2015-12-19 10:32:38 +0000
commit2f74892ebd4d23b352e2e089e9b74c950f3864b8 (patch)
tree21f766354018356a6eec78e3b3f04c13cb1db5d9
parent39bad606c5e24dbb144f01e5d889f8a31c294d22 (diff)
benchmarks/gem_latency: Fix for !LLC
Late last night I forgot I had only added the llc CPU mmaping and not the !llc GTT mapping for byt/bsw. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-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 539cf55d..e8ed9a8b 100644
--- a/benchmarks/gem_latency.c
+++ b/benchmarks/gem_latency.c
@@ -91,7 +91,10 @@ static void setup_batch(struct producer *p, int gen, uint32_t scratch)
p->exec[1].relocation_count = 3;
p->exec[1].relocs_ptr = (uintptr_t)p->reloc;
p->exec[1].handle = gem_create(fd, 4096);
- map = gem_mmap__cpu(fd, p->exec[1].handle, 0, 4096, PROT_WRITE);
+ if (gem_has_llc(fd))
+ map = gem_mmap__cpu(fd, p->exec[1].handle, 0, 4096, PROT_WRITE);
+ else
+ map = gem_mmap__gtt(fd, p->exec[1].handle, 4096, PROT_WRITE);
/* XY_SRC_COPY */
map[i++] = COPY_BLT_CMD | BLT_WRITE_ALPHA | BLT_WRITE_RGB;
@@ -152,7 +155,8 @@ static void setup_batch(struct producer *p, int gen, uint32_t scratch)
static void measure_latency(struct producer *p, igt_stats_t *stats)
{
gem_sync(fd, p->exec[1].handle);
- igt_stats_push(stats, INREG(BCS_TIMESTAMP) - *p->last_timestamp);
+#define READ(x) *(volatile uint32_t *)((volatile char *)igt_global_mmio + x)
+ igt_stats_push(stats, READ(BCS_TIMESTAMP) - *p->last_timestamp);
}
static void *producer(void *arg)