]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
drm/i915: Add gen8_de_pipe_fault_mask()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 26 Jun 2019 18:03:40 +0000 (21:03 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 18 Jul 2019 12:47:05 +0000 (15:47 +0300)
Reduce the clutter a bit by introducing gen8_de_pipe_fault_mask().

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20190626180344.26314-2-ville.syrjala@linux.intel.com
drivers/gpu/drm/i915/i915_irq.c

index 91f8c81028c3c6c74fc738fcae15bef400601456..11c73af92597d85b27ed7e99d2905ebfe871eb9c 100644 (file)
@@ -2844,6 +2844,14 @@ static u32 gen8_de_port_aux_mask(struct drm_i915_private *dev_priv)
        return mask;
 }
 
+static u32 gen8_de_pipe_fault_mask(struct drm_i915_private *dev_priv)
+{
+       if (INTEL_GEN(dev_priv) >= 9)
+               return GEN9_DE_PIPE_IRQ_FAULT_ERRORS;
+       else
+               return GEN8_DE_PIPE_IRQ_FAULT_ERRORS;
+}
+
 static irqreturn_t
 gen8_de_irq_handler(struct drm_i915_private *dev_priv, u32 master_ctl)
 {
@@ -2956,12 +2964,7 @@ gen8_de_irq_handler(struct drm_i915_private *dev_priv, u32 master_ctl)
                if (iir & GEN8_PIPE_FIFO_UNDERRUN)
                        intel_cpu_fifo_underrun_irq_handler(dev_priv, pipe);
 
-               fault_errors = iir;
-               if (INTEL_GEN(dev_priv) >= 9)
-                       fault_errors &= GEN9_DE_PIPE_IRQ_FAULT_ERRORS;
-               else
-                       fault_errors &= GEN8_DE_PIPE_IRQ_FAULT_ERRORS;
-
+               fault_errors = iir & gen8_de_pipe_fault_mask(dev_priv);
                if (fault_errors)
                        DRM_ERROR("Fault errors on pipe %c: 0x%08x\n",
                                  pipe_name(pipe),