All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jesse Barnes <jbarnes@virtuousgeek.org>
To: intel-gfx@lists.freedesktop.org, dri-devel@lists.sourceforge.net
Cc: airlied@linux.ie, Jesse Barnes <jbarnes@virtuousgeek.org>
Subject: [PATCH 4/7] drm/i915: only check for enabled PIPE*STAT interrupts
Date: Fri, 26 Mar 2010 11:07:18 -0700	[thread overview]
Message-ID: <1269626841-10852-4-git-send-email-jbarnes@virtuousgeek.org> (raw)
In-Reply-To: <1269626841-10852-1-git-send-email-jbarnes@virtuousgeek.org>

Most of the PIPE*STAT status bits will continue to flip even if they're
not generating interrupts.  So only check for those that can cause
interrupts when we reach the i915_irq_handler, since it might be shared
and we don't want to process spurious events.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
---
 drivers/gpu/drm/i915/i915_drv.h |    1 +
 drivers/gpu/drm/i915/i915_irq.c |    6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index aba8260..abf2713 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -260,6 +260,7 @@ typedef struct drm_i915_private {
 	/** Cached value of IMR to avoid reads in updating the bitfield */
 	u32 irq_mask_reg;
 	u32 pipestat[2];
+	u32 pipe_mask[2];
 	/** splitted irq regs for graphics and display engine on Ironlake,
 	    irq_mask_reg is still used for display irq. */
 	u32 gt_irq_mask_reg;
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index eca0e5b..9519346 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -141,6 +141,7 @@ i915_enable_pipestat(drm_i915_private_t *dev_priv, int pipe, u32 mask)
 		u32 reg = i915_pipestat(pipe);
 
 		dev_priv->pipestat[pipe] |= mask;
+		dev_priv->pipe_mask[pipe] |= (mask >> 16);
 		/* Enable the interrupt, clear any pending status */
 		I915_WRITE(reg, dev_priv->pipestat[pipe] | (mask >> 16));
 		(void) I915_READ(reg);
@@ -154,6 +155,7 @@ i915_disable_pipestat(drm_i915_private_t *dev_priv, int pipe, u32 mask)
 		u32 reg = i915_pipestat(pipe);
 
 		dev_priv->pipestat[pipe] &= ~mask;
+		dev_priv->pipe_mask[pipe] &= ~(mask >> 16);
 		I915_WRITE(reg, dev_priv->pipestat[pipe]);
 		(void) I915_READ(reg);
 	}
@@ -868,14 +870,14 @@ irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS)
 		/*
 		 * Clear the PIPE(A|B)STAT regs before the IIR
 		 */
-		if (pipea_stats & 0x8000ffff) {
+		if (pipea_stats & dev_priv->pipe_mask[0]) {
 			if (pipea_stats &  PIPE_FIFO_UNDERRUN_STATUS)
 				DRM_DEBUG_DRIVER("pipe a underrun\n");
 			I915_WRITE(PIPEASTAT, pipea_stats);
 			irq_received = 1;
 		}
 
-		if (pipeb_stats & 0x8000ffff) {
+		if (pipeb_stats & dev_priv->pipe_mask[1]) {
 			if (pipeb_stats &  PIPE_FIFO_UNDERRUN_STATUS)
 				DRM_DEBUG_DRIVER("pipe b underrun\n");
 			I915_WRITE(PIPEBSTAT, pipeb_stats);
-- 
1.6.1.3


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--

  parent reply	other threads:[~2010-03-26 18:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-26 18:07 [PATCH 1/7] drm: make sure vblank interrupts are disabled at DPMS time Jesse Barnes
2010-03-26 18:07 ` [PATCH 2/7] drm: delay vblank cleanup until after driver unload Jesse Barnes
2010-03-28 22:30   ` [Intel-gfx] " Kristian Høgsberg
2010-03-29  0:02     ` Dave Airlie
2010-03-29  0:09       ` Dave Airlie
2010-03-29 16:05       ` Jesse Barnes
2010-03-26 18:07 ` [PATCH 3/7] drm/i915: remove duplicate PIPE*STAT bit definitions Jesse Barnes
2010-03-26 18:07 ` Jesse Barnes [this message]
2010-03-26 18:12   ` [PATCH 4/7] drm/i915: only check for enabled PIPE*STAT interrupts Jesse Barnes
2010-03-26 18:07 ` [PATCH 5/7] drm/i915: use vblank and vsync interrupts on 945 Jesse Barnes
2010-04-27 17:27   ` Jesse Barnes
2010-03-26 18:07 ` [PATCH 6/7] drm/i915: fix page flipping on gen3 Jesse Barnes
2010-03-26 20:41   ` Jesse Barnes
2010-04-05 21:07     ` Jesse Barnes
2010-03-26 18:07 ` [PATCH 7/7] drm/i915: cleanup mode setting before unmapping registers Jesse Barnes

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=1269626841-10852-4-git-send-email-jbarnes@virtuousgeek.org \
    --to=jbarnes@virtuousgeek.org \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.sourceforge.net \
    --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.