From 2f74892ebd4d23b352e2e089e9b74c950f3864b8 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 19 Dec 2015 10:31:49 +0000 Subject: 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 --- benchmarks/gem_latency.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'benchmarks/gem_latency.c') 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) -- cgit v1.2.3