Commit a37951ac authored by Chris Wilson's avatar Chris Wilson

drm/i915: Skip the execlists CSB scan and rewrite if the ring is untouched

If the CSB head/tail pointers are unchanged, we can skip the update of
the CSB register afterwards.
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170124110009.28947-5-chris@chris-wilson.co.uk
parent f747026c
...@@ -574,9 +574,12 @@ static void intel_lrc_irq_handler(unsigned long data) ...@@ -574,9 +574,12 @@ static void intel_lrc_irq_handler(unsigned long data)
csb = readl(csb_mmio); csb = readl(csb_mmio);
head = GEN8_CSB_READ_PTR(csb); head = GEN8_CSB_READ_PTR(csb);
tail = GEN8_CSB_WRITE_PTR(csb); tail = GEN8_CSB_WRITE_PTR(csb);
if (head == tail)
break;
if (tail < head) if (tail < head)
tail += GEN8_CSB_ENTRIES; tail += GEN8_CSB_ENTRIES;
while (head < tail) { do {
unsigned int idx = ++head % GEN8_CSB_ENTRIES; unsigned int idx = ++head % GEN8_CSB_ENTRIES;
unsigned int status = readl(buf + 2 * idx); unsigned int status = readl(buf + 2 * idx);
...@@ -601,7 +604,7 @@ static void intel_lrc_irq_handler(unsigned long data) ...@@ -601,7 +604,7 @@ static void intel_lrc_irq_handler(unsigned long data)
GEM_BUG_ON(port[0].count == 0 && GEM_BUG_ON(port[0].count == 0 &&
!(status & GEN8_CTX_STATUS_ACTIVE_IDLE)); !(status & GEN8_CTX_STATUS_ACTIVE_IDLE));
} } while (head < tail);
writel(_MASKED_FIELD(GEN8_CSB_READ_PTR_MASK, writel(_MASKED_FIELD(GEN8_CSB_READ_PTR_MASK,
GEN8_CSB_WRITE_PTR(csb) << 8), GEN8_CSB_WRITE_PTR(csb) << 8),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment