drm/i915: Move the decision to use the breadcrumb tasklet to the backend
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 29 Mar 2019 15:49:12 +0000 (15:49 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 3 Apr 2019 13:16:53 +0000 (14:16 +0100)
Use the engine->flags to store whether we want to kick the submission
tasklet on receipt of a breadcrumb interrupt, so that this decision can
be made by the submission backend and not dependent on a limited feature
test within the interrupt handler. This should make it easier to adapt to
different submission backends.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Xiaolin Zhang <xiaolin.zhang@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190329154912.13781-1-chris@chris-wilson.co.uk
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
drivers/gpu/drm/i915/i915_irq.c
drivers/gpu/drm/i915/intel_engine_types.h
drivers/gpu/drm/i915/intel_guc_submission.c

index 455b2bf691b5ca3322c9dcc5da29b634b554bf13..aa107a78cb3638d41b0f4cf49993dd8fe11b9597 100644 (file)
@@ -1470,7 +1470,7 @@ gen8_cs_irq_handler(struct intel_engine_cs *engine, u32 iir)
 
        if (iir & GT_RENDER_USER_INTERRUPT) {
                intel_engine_breadcrumbs_irq(engine);
-               tasklet |= USES_GUC_SUBMISSION(engine->i915);
+               tasklet |= intel_engine_needs_breadcrumb_tasklet(engine);
        }
 
        if (tasklet)
index 14ad5263ea1e9b21cbe9cccf19f55401c7d8328d..6c6d8a9aca94e5021cd85475abe2035b530547b2 100644 (file)
@@ -432,6 +432,7 @@ struct intel_engine_cs {
 #define I915_ENGINE_SUPPORTS_STATS   BIT(1)
 #define I915_ENGINE_HAS_PREEMPTION   BIT(2)
 #define I915_ENGINE_HAS_SEMAPHORES   BIT(3)
+#define I915_ENGINE_NEEDS_BREADCRUMB_TASKLET BIT(4)
        unsigned int flags;
 
        /*
@@ -515,6 +516,12 @@ intel_engine_has_semaphores(const struct intel_engine_cs *engine)
        return engine->flags & I915_ENGINE_HAS_SEMAPHORES;
 }
 
+static inline bool
+intel_engine_needs_breadcrumb_tasklet(const struct intel_engine_cs *engine)
+{
+       return engine->flags & I915_ENGINE_NEEDS_BREADCRUMB_TASKLET;
+}
+
 #define instdone_slice_mask(dev_priv__) \
        (IS_GEN(dev_priv__, 7) ? \
         1 : RUNTIME_INFO(dev_priv__)->sseu.slice_mask)
index c4ad73980988165e4e0d6d57e4353a32c946ed02..c58922226d47d9d1b4a67545fcd9adc7585dd8e1 100644 (file)
@@ -1262,10 +1262,12 @@ static void guc_interrupts_release(struct drm_i915_private *dev_priv)
 static void guc_submission_park(struct intel_engine_cs *engine)
 {
        intel_engine_unpin_breadcrumbs_irq(engine);
+       engine->flags &= ~I915_ENGINE_NEEDS_BREADCRUMB_TASKLET;
 }
 
 static void guc_submission_unpark(struct intel_engine_cs *engine)
 {
+       engine->flags |= I915_ENGINE_NEEDS_BREADCRUMB_TASKLET;
        intel_engine_pin_breadcrumbs_irq(engine);
 }