@@ -4634,7 +4634,7 @@ void intel_irq_init(struct drm_i915_private *dev_priv)
if (INTEL_GEN(dev_priv) <= 7)
rps->pm_intrmsk_mbz |= GEN6_PM_RP_UP_EI_EXPIRED;
- if (INTEL_GEN(dev_priv) >= 8)
+ if (INTEL_GEN(dev_priv) >= 8 && INTEL_GEN(dev_priv) < 11)
rps->pm_intrmsk_mbz |= GEN8_PMINTR_DISABLE_REDIRECT_TO_GUC;
if (INTEL_GEN(dev_priv) >= 5 || IS_G4X(dev_priv))
@@ -1263,7 +1263,7 @@ void intel_guc_submission_fini(struct intel_guc *guc)
guc_stage_desc_pool_destroy(guc);
}
-static void guc_interrupts_capture(struct drm_i915_private *dev_priv)
+static void gen8_guc_interrupts_capture(struct drm_i915_private *dev_priv)
{
struct intel_rps *rps = &dev_priv->gt_pm.rps;
struct intel_engine_cs *engine;
@@ -1308,7 +1308,7 @@ static void guc_interrupts_capture(struct drm_i915_private *dev_priv)
rps->pm_intrmsk_mbz &= ~GEN8_PMINTR_DISABLE_REDIRECT_TO_GUC;
}
-static void guc_interrupts_release(struct drm_i915_private *dev_priv)
+static void gen8_guc_interrupts_release(struct drm_i915_private *dev_priv)
{
struct intel_rps *rps = &dev_priv->gt_pm.rps;
struct intel_engine_cs *engine;
@@ -1333,6 +1333,59 @@ static void guc_interrupts_release(struct drm_i915_private *dev_priv)
rps->pm_intrmsk_mbz &= ~ARAT_EXPIRED_INTRMSK;
}
+static void gen11_guc_interrupts_capture(struct drm_i915_private *dev_priv)
+{
+ struct intel_rps *rps = &dev_priv->gt_pm.rps;
+ u32 tmp;
+ u32 irqs = GT_CONTEXT_SWITCH_INTERRUPT;
+
+ /* Don't handle ctx switch interrupt in GuC submission mode */
+ tmp = I915_READ(GEN11_RENDER_COPY_INTR_ENABLE);
+ tmp &= ~(irqs << 16 | irqs);
+ I915_WRITE(GEN11_RENDER_COPY_INTR_ENABLE, tmp);
+
+ tmp = I915_READ(GEN11_VCS_VECS_INTR_ENABLE);
+ tmp &= ~(irqs << 16 | irqs);
+ I915_WRITE(GEN11_VCS_VECS_INTR_ENABLE, tmp);
+
+ /* GuC needs ARAT expired interrupt unmasked */
+ rps->pm_intrmsk_mbz |= ARAT_EXPIRED_INTRMSK;
+}
+
+static void gen11_guc_interrupts_release(struct drm_i915_private *dev_priv)
+{
+ struct intel_rps *rps = &dev_priv->gt_pm.rps;
+ u32 tmp;
+ u32 irqs = GT_CONTEXT_SWITCH_INTERRUPT;
+
+ /* Handle ctx switch interrupts again */
+ tmp = I915_READ(GEN11_RENDER_COPY_INTR_ENABLE);
+ tmp |= (irqs << 16 | irqs);
+ I915_WRITE(GEN11_RENDER_COPY_INTR_ENABLE, tmp);
+
+ tmp = I915_READ(GEN11_VCS_VECS_INTR_ENABLE);
+ tmp |= (irqs << 16 | irqs);
+ I915_WRITE(GEN11_VCS_VECS_INTR_ENABLE, tmp);
+
+ rps->pm_intrmsk_mbz &= ~ARAT_EXPIRED_INTRMSK;
+}
+
+static void guc_interrupts_capture(struct drm_i915_private *i915)
+{
+ if (INTEL_GEN(i915) >= 11)
+ gen11_guc_interrupts_capture(i915);
+ else
+ gen8_guc_interrupts_capture(i915);
+}
+
+static void guc_interrupts_release(struct drm_i915_private *i915)
+{
+ if (INTEL_GEN(i915) >= 11)
+ gen11_guc_interrupts_release(i915);
+ else
+ gen8_guc_interrupts_release(i915);
+}
+
static void guc_submission_park(struct intel_engine_cs *engine)
{
intel_engine_unpin_breadcrumbs_irq(engine);