Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Paulo Zanoni <przanoni@gmail.com>
To: intel-gfx@lists.freedesktop.org
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Subject: [PATCH 9/9] drm/i915: kill ivybridge_irq_postinstall
Date: Fri, 12 Jul 2013 20:01:56 -0300	[thread overview]
Message-ID: <1373670116-3626-1-git-send-email-przanoni@gmail.com> (raw)
In-Reply-To: <20130712195234.GE23323@cantiga.alporthouse.com>

From: Paulo Zanoni <paulo.r.zanoni@intel.com>

It was very similar to ironlake_irq_postinstall, so IMHO merging both
functions results in a code that is easier to maintain.

With this change, all the irq handler vfuncs between ironlake and
ivybridge are now unified.

v2: Add "(" and ")" to make at least one vim user much happier (Chris)

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
 drivers/gpu/drm/i915/i915_irq.c | 69 ++++++++++++-----------------------------
 1 file changed, 20 insertions(+), 49 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index d084057..8b48a32 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -2161,21 +2161,33 @@ static void gen5_gt_irq_postinstall(struct drm_device *dev)
 static int ironlake_irq_postinstall(struct drm_device *dev)
 {
 	unsigned long irqflags;
-
 	drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
-	/* enable kind of interrupts always enabled */
-	u32 display_mask = DE_MASTER_IRQ_CONTROL | DE_GSE | DE_PCH_EVENT |
-			   DE_PLANEA_FLIP_DONE | DE_PLANEB_FLIP_DONE |
-			   DE_AUX_CHANNEL_A | DE_PIPEB_FIFO_UNDERRUN |
-			   DE_PIPEA_FIFO_UNDERRUN | DE_POISON;
+	u32 display_mask, extra_mask;
+
+	if (INTEL_INFO(dev)->gen >= 7) {
+		display_mask = (DE_MASTER_IRQ_CONTROL | DE_GSE_IVB |
+				DE_PCH_EVENT_IVB | DE_PLANEC_FLIP_DONE_IVB |
+				DE_PLANEB_FLIP_DONE_IVB |
+				DE_PLANEA_FLIP_DONE_IVB | DE_AUX_CHANNEL_A_IVB |
+				DE_ERR_INT_IVB);
+		extra_mask = (DE_PIPEC_VBLANK_IVB | DE_PIPEB_VBLANK_IVB |
+			      DE_PIPEA_VBLANK_IVB);
+
+		I915_WRITE(GEN7_ERR_INT, I915_READ(GEN7_ERR_INT));
+	} else {
+		display_mask = (DE_MASTER_IRQ_CONTROL | DE_GSE | DE_PCH_EVENT |
+				DE_PLANEA_FLIP_DONE | DE_PLANEB_FLIP_DONE |
+				DE_AUX_CHANNEL_A | DE_PIPEB_FIFO_UNDERRUN |
+				DE_PIPEA_FIFO_UNDERRUN | DE_POISON);
+		extra_mask = DE_PIPEA_VBLANK | DE_PIPEB_VBLANK | DE_PCU_EVENT;
+	}
 
 	dev_priv->irq_mask = ~display_mask;
 
 	/* should always can generate irq */
 	I915_WRITE(DEIIR, I915_READ(DEIIR));
 	I915_WRITE(DEIMR, dev_priv->irq_mask);
-	I915_WRITE(DEIER, display_mask |
-			  DE_PIPEA_VBLANK | DE_PIPEB_VBLANK | DE_PCU_EVENT);
+	I915_WRITE(DEIER, display_mask | extra_mask);
 	POSTING_READ(DEIER);
 
 	gen5_gt_irq_postinstall(dev);
@@ -2196,38 +2208,6 @@ static int ironlake_irq_postinstall(struct drm_device *dev)
 	return 0;
 }
 
-static int ivybridge_irq_postinstall(struct drm_device *dev)
-{
-	drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
-	/* enable kind of interrupts always enabled */
-	u32 display_mask =
-		DE_MASTER_IRQ_CONTROL | DE_GSE_IVB | DE_PCH_EVENT_IVB |
-		DE_PLANEC_FLIP_DONE_IVB |
-		DE_PLANEB_FLIP_DONE_IVB |
-		DE_PLANEA_FLIP_DONE_IVB |
-		DE_AUX_CHANNEL_A_IVB |
-		DE_ERR_INT_IVB;
-
-	dev_priv->irq_mask = ~display_mask;
-
-	/* should always can generate irq */
-	I915_WRITE(GEN7_ERR_INT, I915_READ(GEN7_ERR_INT));
-	I915_WRITE(DEIIR, I915_READ(DEIIR));
-	I915_WRITE(DEIMR, dev_priv->irq_mask);
-	I915_WRITE(DEIER,
-		   display_mask |
-		   DE_PIPEC_VBLANK_IVB |
-		   DE_PIPEB_VBLANK_IVB |
-		   DE_PIPEA_VBLANK_IVB);
-	POSTING_READ(DEIER);
-
-	gen5_gt_irq_postinstall(dev);
-
-	ibx_irq_postinstall(dev);
-
-	return 0;
-}
-
 static int valleyview_irq_postinstall(struct drm_device *dev)
 {
 	drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
@@ -3036,15 +3016,6 @@ void intel_irq_init(struct drm_device *dev)
 		dev->driver->enable_vblank = valleyview_enable_vblank;
 		dev->driver->disable_vblank = valleyview_disable_vblank;
 		dev_priv->display.hpd_irq_setup = i915_hpd_irq_setup;
-	} else if (IS_IVYBRIDGE(dev) || IS_HASWELL(dev)) {
-		/* Share uninstall handlers with ILK/SNB */
-		dev->driver->irq_handler = ironlake_irq_handler;
-		dev->driver->irq_preinstall = ironlake_irq_preinstall;
-		dev->driver->irq_postinstall = ivybridge_irq_postinstall;
-		dev->driver->irq_uninstall = ironlake_irq_uninstall;
-		dev->driver->enable_vblank = ironlake_enable_vblank;
-		dev->driver->disable_vblank = ironlake_disable_vblank;
-		dev_priv->display.hpd_irq_setup = ibx_hpd_irq_setup;
 	} else if (HAS_PCH_SPLIT(dev)) {
 		dev->driver->irq_handler = ironlake_irq_handler;
 		dev->driver->irq_preinstall = ironlake_irq_preinstall;
-- 
1.8.1.2

  reply	other threads:[~2013-07-12 23:02 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-12 19:35 [PATCH 00/10] Unify ILK/SNB/IVB/HSW IRQ vfuncs Paulo Zanoni
2013-07-12 19:35 ` [PATCH 01/10] drm/i915: kill ivybridge_irq_preinstall Paulo Zanoni
2013-07-19 12:02   ` Mika Kuoppala
2013-07-12 19:35 ` [PATCH 02/10] drm/i915: extract ilk_display_irq_handler Paulo Zanoni
2013-07-19 12:14   ` Mika Kuoppala
2013-07-19 14:24     ` Paulo Zanoni
2013-07-19 16:04       ` Daniel Vetter
2013-07-12 19:35 ` [PATCH 03/10] drm/i915: extract ivb_display_irq_handler Paulo Zanoni
2013-07-19 12:15   ` Mika Kuoppala
2013-07-12 19:35 ` [PATCH 04/10] drm/i915: don't read or write GEN6_PMIIR on Gen 5 Paulo Zanoni
2013-07-12 19:46   ` Chris Wilson
2013-07-12 22:52     ` [PATCH 4/9] " Paulo Zanoni
2013-07-19 12:18       ` Mika Kuoppala
2013-07-12 19:35 ` [PATCH 05/10] drm/i915: reorganize ironlake_irq_handler Paulo Zanoni
2013-07-12 19:48   ` Chris Wilson
2013-07-12 22:54     ` [PATCH 5/9] " Paulo Zanoni
2013-07-19 12:35       ` Mika Kuoppala
2013-07-12 19:35 ` [PATCH 06/10] drm/i915: POSTING_READ(DEIER) on ivybridge_irq_handler Paulo Zanoni
2013-07-19 12:54   ` Mika Kuoppala
2013-07-12 19:35 ` [PATCH 07/10] drm/i915: add ILK/SNB support to ivybridge_irq_handler Paulo Zanoni
2013-07-12 22:56   ` [PATCH 7/9] " Paulo Zanoni
2013-07-19 13:09     ` Mika Kuoppala
2013-07-12 19:35 ` [PATCH 08/10] drm/i915: kill ivybridge_enable_vblank Paulo Zanoni
2013-07-12 19:50   ` Chris Wilson
2013-07-12 23:00     ` [PATCH 8/9] drm/i915: kill Ivybridge vblank irq vfuncs Paulo Zanoni
2013-07-19 13:30       ` Mika Kuoppala
2013-07-12 19:35 ` [PATCH 09/10] drm/i915: kill ivybridge_disable_vblank Paulo Zanoni
2013-07-12 19:35 ` [PATCH 10/10] drm/i915: kill ivybridge_irq_postinstall Paulo Zanoni
2013-07-12 19:52   ` Chris Wilson
2013-07-12 23:01     ` Paulo Zanoni [this message]
2013-07-19 13:44       ` [PATCH 9/9] " Mika Kuoppala
2013-07-19 16:11         ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1373670116-3626-1-git-send-email-przanoni@gmail.com \
    --to=przanoni@gmail.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=paulo.r.zanoni@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox