summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2015-08-08 21:31:08 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2015-08-08 21:31:54 +0100
commit74a806808618dad614d7ffb61d4562915695bbf8 (patch)
tree6c1aae5697835204dc47cec21f83b859eca791f8
parent06aed34d384fc348c4bb52f302bbcf2c6c68bb3c (diff)
overlay: Handle execlists not setting the rings as active
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--overlay/gpu-top.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/overlay/gpu-top.c b/overlay/gpu-top.c
index 77166953..d1f5ec80 100644
--- a/overlay/gpu-top.c
+++ b/overlay/gpu-top.c
@@ -116,6 +116,23 @@ static uint32_t mmio_ring_read(struct mmio_ring *ring, uint32_t reg)
return igfx_read(ring->mmio, ring->base + reg);
}
+static int has_execlists(void)
+{
+ int detected = 0;
+ FILE *file;
+
+ file = fopen("/sys/module/i915/parameters/enable_execlists", "r");
+ if (file) {
+ int value;
+ if (fscanf(file, "%d", &value) == 1)
+ detected = value != 0;
+ fclose(file);
+ }
+
+ return detected;
+
+}
+
static void mmio_ring_init(struct mmio_ring *ring, void *mmio)
{
uint32_t ctl;
@@ -123,7 +140,7 @@ static void mmio_ring_init(struct mmio_ring *ring, void *mmio)
ring->mmio = mmio;
ctl = mmio_ring_read(ring, RING_CTL);
- if ((ctl & 1) == 0)
+ if ((ctl & 1) == 0 && !has_execlists())
ring->id = -1;
}
@@ -239,10 +256,10 @@ static void mmio_init(struct gpu_top *gt)
usleep(1000);
}
+ memset(payload, 0, sizeof(payload));
mmio_ring_emit(&render_ring, 1000, payload);
mmio_ring_emit(&bsd_ring, 1000, payload);
mmio_ring_emit(&blt_ring, 1000, payload);
-
write(fd[1], payload, sizeof(payload));
}
}