drm/i915: Assert that we always complete a submission to guc/execlists
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 15 Feb 2018 16:25:53 +0000 (16:25 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 16 Feb 2018 14:14:14 +0000 (14:14 +0000)
The continual resubmission model for execlists (and emulated over guc)
requires that we keep feeding requests into the HW in order to generate
more CS interrupts to drain the rest of the queue. Add a couple of
asserts to ensure that we don't skip a cycle and come to a grinding
halt.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: MichaƂ Winiarski <michal.winiarski@intel.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180215162553.23348-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/intel_guc_submission.c
drivers/gpu/drm/i915/intel_lrc.c

index b43b58cc599b44f2158d1b67a6e1e1b7f0bd8cd7..946766b62459d37930a2ce850899e7bba1eb11b2 100644 (file)
@@ -747,6 +747,12 @@ done:
                execlists_set_active(execlists, EXECLISTS_ACTIVE_USER);
                guc_submit(engine);
        }
+
+       /* We must always keep the beast fed if we have work piled up */
+       GEM_BUG_ON(port_isset(execlists->port) &&
+                  !execlists_is_active(execlists, EXECLISTS_ACTIVE_USER));
+       GEM_BUG_ON(execlists->first && !port_isset(execlists->port));
+
 unlock:
        spin_unlock_irq(&engine->timeline->lock);
 }
index c2c8380a0121c874bcbfcc62af72218498087ac8..6fbe1a8a37add6dd1ef00cfb4fbdaac07fb7ccfc 100644 (file)
@@ -642,6 +642,12 @@ done:
        execlists->first = rb;
        if (submit)
                port_assign(port, last);
+
+       /* We must always keep the beast fed if we have work piled up */
+       GEM_BUG_ON(port_isset(execlists->port) &&
+                  !execlists_is_active(execlists, EXECLISTS_ACTIVE_USER));
+       GEM_BUG_ON(execlists->first && !port_isset(execlists->port));
+
 unlock:
        spin_unlock_irq(&engine->timeline->lock);