All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 06/12] drm/i915: Remove gen3 irq code from gen4 irq routine
Date: Tue, 24 Apr 2012 22:59:46 +0100	[thread overview]
Message-ID: <1335304792-17636-6-git-send-email-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <1335304792-17636-1-git-send-email-chris@chris-wilson.co.uk>

And a couple of miscellaneous cleanups to the main body of the IRQ loop;
move per-loop condition variables within the scope of the loop and move
the old DRI1 breadcrumb to the tail of the function and so only execute
it once.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_irq.c |   27 ++++++++++-----------------
 1 file changed, 10 insertions(+), 17 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 2adc27a..2e84020 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -2651,23 +2651,17 @@ static irqreturn_t i965_irq_handler(DRM_IRQ_ARGS)
 	struct drm_i915_master_private *master_priv;
 	u32 iir, new_iir;
 	u32 pipe_stats[I915_MAX_PIPES];
-	u32 vblank_status;
-	int vblank = 0;
 	unsigned long irqflags;
 	int irq_received;
 	int ret = IRQ_NONE, pipe;
-	bool blc_event = false;
 
 	atomic_inc(&dev_priv->irq_received);
 
 	iir = I915_READ(IIR);
 
-	if (INTEL_INFO(dev)->gen >= 4)
-		vblank_status = PIPE_START_VBLANK_INTERRUPT_STATUS;
-	else
-		vblank_status = PIPE_VBLANK_INTERRUPT_STATUS;
-
 	for (;;) {
+		bool blc_event = false;
+
 		irq_received = iir != 0;
 
 		/* Can't rely on pipestat interrupt bit in iir as it might
@@ -2719,13 +2713,6 @@ static irqreturn_t i965_irq_handler(DRM_IRQ_ARGS)
 		I915_WRITE(IIR, iir);
 		new_iir = I915_READ(IIR); /* Flush posted writes */
 
-		if (dev->primary->master) {
-			master_priv = dev->primary->master->driver_priv;
-			if (master_priv->sarea_priv)
-				master_priv->sarea_priv->last_dispatch =
-					READ_BREADCRUMB(dev_priv);
-		}
-
 		if (iir & I915_USER_INTERRUPT)
 			notify_ring(dev, &dev_priv->ring[RCS]);
 		if (iir & I915_BSD_USER_INTERRUPT)
@@ -2738,9 +2725,8 @@ static irqreturn_t i965_irq_handler(DRM_IRQ_ARGS)
 			intel_prepare_page_flip(dev, 1);
 
 		for_each_pipe(pipe) {
-			if (pipe_stats[pipe] & vblank_status &&
+			if (pipe_stats[pipe] & PIPE_START_VBLANK_INTERRUPT_STATUS &&
 			    drm_handle_vblank(dev, pipe)) {
-				vblank++;
 				i915_pageflip_stall_check(dev, pipe);
 				intel_finish_page_flip(dev, pipe);
 			}
@@ -2771,6 +2757,13 @@ static irqreturn_t i965_irq_handler(DRM_IRQ_ARGS)
 		iir = new_iir;
 	}
 
+	if (dev->primary->master) {
+		master_priv = dev->primary->master->driver_priv;
+		if (master_priv->sarea_priv)
+			master_priv->sarea_priv->last_dispatch =
+				READ_BREADCRUMB(dev_priv);
+	}
+
 	return ret;
 }
 
-- 
1.7.10

  parent reply	other threads:[~2012-04-24 22:01 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-24 21:59 [PATCH 01/12] drm/i915: Unconditionally initialise the interrupt workers Chris Wilson
2012-04-24 21:59 ` [PATCH 02/12] drm/i915: Remove redundant initialisation of per-ring IRQ waitqueues Chris Wilson
2012-04-24 21:59 ` [PATCH 03/12] drm/i915: pending_flip_is_done is gen3, name it so Chris Wilson
2012-04-24 21:59 ` [PATCH 04/12] drm/i915: Duplicate and split the gen3/4 irq handler Chris Wilson
2012-04-24 21:59 ` [PATCH 05/12] drm/i915: Clear FlipDone semantics change for pageflipping on gen3 Chris Wilson
2012-04-25 20:48   ` Jesse Barnes
2012-04-24 21:59 ` Chris Wilson [this message]
2012-04-25 20:49   ` [PATCH 06/12] drm/i915: Remove gen3 irq code from gen4 irq routine Jesse Barnes
2012-04-24 21:59 ` [PATCH 07/12] drm/i915: Remove gen4 irq code from gen3 " Chris Wilson
2012-04-25 20:50   ` Jesse Barnes
2012-04-24 21:59 ` [PATCH 08/12] drm/i915: HWSTAM is only 16-bit on gen3 Chris Wilson
2012-04-25 20:50   ` Jesse Barnes
2012-04-24 21:59 ` [PATCH 09/12] drm/i915: Cleanup gen3 irq uninstall Chris Wilson
2012-04-25 20:51   ` Jesse Barnes
2012-04-24 21:59 ` [PATCH 10/12] drm/i915: Handle PendingFlip on gen3 robustly Chris Wilson
2012-04-25 20:52   ` Jesse Barnes
2012-04-24 21:59 ` [PATCH 11/12] drm/i915: Inline I915_INTERRUPT_ENABLE_FIX Chris Wilson
2012-04-25 20:55   ` Jesse Barnes
2012-04-25 21:28     ` Chris Wilson
2012-04-24 21:59 ` [PATCH 12/12] drm/i915: Remove unused and unloved vblank macros Chris Wilson
2012-04-25 20:55   ` Jesse Barnes
2012-04-26 20:58     ` 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=1335304792-17636-6-git-send-email-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.