summaryrefslogtreecommitdiff
path: root/benchmarks
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-05-08 20:58:26 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2016-05-09 08:29:18 +0100
commitf942e42815ad81901dbccd984d0f8a4775826be7 (patch)
tree4e031a34d0055237dbed9a81cb2c0e860d358efd /benchmarks
parent049150307889a1870cf961e18b964ffa70ae1b59 (diff)
benchmarks/gem_latency: Revert to unsafe mmio access on gen7
In theory, we need to only worry about concurrent mmio writes to the same cacheline. So far, disabling the spinlock hasn't hung the machine. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'benchmarks')
-rw-r--r--benchmarks/gem_latency.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/benchmarks/gem_latency.c b/benchmarks/gem_latency.c
index d9cb44e3..4b36d5ae 100644
--- a/benchmarks/gem_latency.c
+++ b/benchmarks/gem_latency.c
@@ -55,14 +55,9 @@ static volatile uint32_t *timestamp_reg;
#define REG(x) (volatile uint32_t *)((volatile char *)igt_global_mmio + x)
#define REG_OFFSET(x) ((volatile char *)(x) - (volatile char *)igt_global_mmio)
-static uint32_t read_timestamp_unlocked(void)
-{
- return *timestamp_reg;
-}
-static uint32_t (*read_timestamp)(void) = read_timestamp_unlocked;
-
-#ifdef __USE_XOPEN2K
+#if defined(__USE_XOPEN2K) && defined(gen7_safe_mmio)
static pthread_spinlock_t timestamp_lock;
+
static uint32_t read_timestamp_locked(void)
{
uint32_t t;
@@ -81,10 +76,23 @@ static int setup_timestamp_locked(void)
read_timestamp = read_timestamp_locked;
return 1;
}
+
+static uint32_t read_timestamp_unlocked(void)
+{
+ return *timestamp_reg;
+}
+
+static uint32_t (*read_timestamp)(void) = read_timestamp_unlocked;
+
#else
static int setup_timestamp_locked(void)
{
- return 0;
+ return 1;
+}
+
+inline static uint32_t read_timestamp(void)
+{
+ return *timestamp_reg;
}
#endif