diff mbox series

[04/10] drm/i915/icl: Add helper to enable/disable master irq

Message ID 20180920143350.29249-5-mika.kuoppala@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series ICL interrupt handling improvements | expand

Commit Message

Mika Kuoppala Sept. 20, 2018, 2:33 p.m. UTC
Add static inline helpers to master irq control. Related
comments become superfluous and can be removed.

Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_irq.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

Comments

Chris Wilson Sept. 20, 2018, 2:57 p.m. UTC | #1
Quoting Mika Kuoppala (2018-09-20 15:33:44)
> Add static inline helpers to master irq control. Related
> comments become superfluous and can be removed.
> 
> Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>

Hmm, need a little more convincing as it breaks the pattern. Does it
make sense to apply this back to gen6 (excluding the atoms) where we
have the same master ctl?
-Chris
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 27395a90bbef..89d76e7f4d00 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -3120,6 +3120,16 @@  gen11_gu_misc_irq_handler(struct drm_i915_private *dev_priv,
 		DRM_ERROR("Unexpected GU_MISC interrupt 0x%x\n", iir);
 }
 
+static inline void gen11_master_irq_enable(void __iomem * const regs)
+{
+	raw_reg_write(regs, GEN11_GFX_MSTR_IRQ, GEN11_MASTER_IRQ);
+}
+
+static inline void gen11_master_irq_disable(void __iomem * const regs)
+{
+	raw_reg_write(regs, GEN11_GFX_MSTR_IRQ, 0);
+}
+
 static irqreturn_t gen11_irq_handler(int irq, void *arg)
 {
 	struct drm_i915_private * const i915 = to_i915(arg);
@@ -3130,9 +3140,7 @@  static irqreturn_t gen11_irq_handler(int irq, void *arg)
 	if (!intel_irqs_enabled(i915))
 		return IRQ_NONE;
 
-	/* Disable interrupts. */
-	raw_reg_write(regs, GEN11_GFX_MSTR_IRQ, 0);
-
+	gen11_master_irq_disable(regs);
 	master_ctl = raw_reg_read(regs, GEN11_GFX_MSTR_IRQ) & ~GEN11_MASTER_IRQ;
 
 	/* Find, clear, then process each source of interrupt. */
@@ -3153,8 +3161,7 @@  static irqreturn_t gen11_irq_handler(int irq, void *arg)
 
 	gen11_gu_misc_irq_ack(i915, master_ctl, &gu_misc_iir);
 
-	/* Enable interrupts. */
-	raw_reg_write(regs, GEN11_GFX_MSTR_IRQ, GEN11_MASTER_IRQ);
+	gen11_master_irq_enable(regs);
 
 	gen11_gu_misc_irq_handler(i915, master_ctl, gu_misc_iir);