提交 27b9188e 编写于 作者: P Paulo Zanoni 提交者: Daniel Vetter

drm/i915: reorganize ironlake_irq_handler

The ironlake_irq_handler and ivybridge_irq_handler functions do
basically the same thing, but they have different implementation
styles. With this patch we reorganize ironlake_irq_handler in a way
that makes it look very similar to ivybridge_irq_handler.

One of the advantages of this new function style is that we don't
write 0 to the IIR registers anymore.

v2: - Rebase due to changes on previous patches
    - Move pm_iir to a tighter scope (Chris)
Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: NMika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
上级 221ab43e
...@@ -1384,7 +1384,7 @@ static irqreturn_t ironlake_irq_handler(int irq, void *arg) ...@@ -1384,7 +1384,7 @@ static irqreturn_t ironlake_irq_handler(int irq, void *arg)
struct drm_device *dev = (struct drm_device *) arg; struct drm_device *dev = (struct drm_device *) arg;
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
int ret = IRQ_NONE; int ret = IRQ_NONE;
u32 de_iir, gt_iir, de_ier, pm_iir = 0, sde_ier; u32 de_iir, gt_iir, de_ier, sde_ier;
atomic_inc(&dev_priv->irq_received); atomic_inc(&dev_priv->irq_received);
...@@ -1402,33 +1402,33 @@ static irqreturn_t ironlake_irq_handler(int irq, void *arg) ...@@ -1402,33 +1402,33 @@ static irqreturn_t ironlake_irq_handler(int irq, void *arg)
I915_WRITE(SDEIER, 0); I915_WRITE(SDEIER, 0);
POSTING_READ(SDEIER); POSTING_READ(SDEIER);
de_iir = I915_READ(DEIIR);
gt_iir = I915_READ(GTIIR); gt_iir = I915_READ(GTIIR);
if (IS_GEN6(dev)) if (gt_iir) {
pm_iir = I915_READ(GEN6_PMIIR); if (IS_GEN5(dev))
ilk_gt_irq_handler(dev, dev_priv, gt_iir);
if (de_iir == 0 && gt_iir == 0 && pm_iir == 0) else
goto done; snb_gt_irq_handler(dev, dev_priv, gt_iir);
I915_WRITE(GTIIR, gt_iir);
ret = IRQ_HANDLED; ret = IRQ_HANDLED;
}
if (IS_GEN5(dev))
ilk_gt_irq_handler(dev, dev_priv, gt_iir);
else
snb_gt_irq_handler(dev, dev_priv, gt_iir);
if (de_iir) de_iir = I915_READ(DEIIR);
if (de_iir) {
ilk_display_irq_handler(dev, de_iir); ilk_display_irq_handler(dev, de_iir);
I915_WRITE(DEIIR, de_iir);
ret = IRQ_HANDLED;
}
if (pm_iir & GEN6_PM_RPS_EVENTS) if (IS_GEN6(dev)) {
gen6_rps_irq_handler(dev_priv, pm_iir); u32 pm_iir = I915_READ(GEN6_PMIIR);
if (pm_iir) {
I915_WRITE(GTIIR, gt_iir); if (pm_iir & GEN6_PM_RPS_EVENTS)
I915_WRITE(DEIIR, de_iir); gen6_rps_irq_handler(dev_priv, pm_iir);
if (pm_iir) I915_WRITE(GEN6_PMIIR, pm_iir);
I915_WRITE(GEN6_PMIIR, pm_iir); ret = IRQ_HANDLED;
}
}
done:
I915_WRITE(DEIER, de_ier); I915_WRITE(DEIER, de_ier);
POSTING_READ(DEIER); POSTING_READ(DEIER);
I915_WRITE(SDEIER, sde_ier); I915_WRITE(SDEIER, sde_ier);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册