On Tue, 2007-01-30 at 00:59 -0500, Dominik Brodowski wrote: 
> 
> On Mon, Jan 29, 2007 at 01:00:39PM +0100, Michel Dänzer wrote:
> > On Sun, 2007-01-28 at 22:14 -0500, Dominik Brodowski wrote: 
> > > 
> > > [...] I was able to "git bisect" it down to the drm patches which went in
> > > after 2.6.19 and before 2.6.19-rc1 got released.
> > 
> > Can you bisect it down to a single commit? If that's not possible with
> > the kernel tree, you can try the drm git tree from
> > git://git.freedesktop.org/git/mesa/drm .
> 
> The culprit is one of these (kernel git tree):
> 2228ed67223f3f22ea09df8854e6a31ea06d5619 - drm: i915 updates
> a0b136bb696cfa744a79c4dbbbbd0c8f9f30fe3f - drm: i915: fix up irqflags arg
> 21fa60ed4eab5b3b28d05930bb086615ecc191b1 - drm: i915: Only return EBUSY...
> 2dbb232c4d6b6c89fc367f7566c7c87dd3b56cd7 - drm: i915: Fix 'sequence has...
> 376642cf2eb0f32d8502b0a2c4efd96a3f13a8b8 - drm: i915: Add SAREA fileds...
> 5b51694aff705c465ef5941a99073036f3e444d9 - drm: Make handling of...
> 
> 2228ed72... has the issue, while 
> 541f29aad766b6c7b911a7d900d952744369bf53 - drm: DRM_I915_VBLANK_SWAP
> doesn't have it 

[...]

> > > Any ideas? Any debugging you want me to do?
> > 
> > echo 1 >/sys/module/drm/parameters/debug
> > 
> > before switching to console might provide something interesting in the
> > kernel output.
> 
> this is with 2.6.19-rc6-latest:
> 
> [ 1320.571000] [drm:drm_irq_uninstall] drm_irq_uninstall: irq=10
> [ 1322.474000] irq 10: nobody cared (try booting with the "irqpoll" option)

Hmm, so it looks like the driver tries to disable interrupts on the card
and removes the handler, then the card still generates an interrupt,
which is rejected by the remaining handlers. My best guess is that it's
a vertical blank interrupt, which wasn't enabled before commit
5b51694aff705c465ef5941a99073036f3e444d9 because dev_priv->vblank_pipe
didn't get initialized. Would this patch happen to make a difference?


-- 
Earthling Michel Dänzer           |          http://tungstengraphics.com
Libre software enthusiast         |          Debian, X and DRI developer
diff --git a/shared-core/i915_drv.h b/shared-core/i915_drv.h
index 98f5894..ef9f363 100644
--- a/shared-core/i915_drv.h
+++ b/shared-core/i915_drv.h
@@ -254,6 +254,12 @@ extern int i915_wait_ring(drm_device_t * dev, int n, const char *caller);
 #define I915REG_INT_ENABLE_R	0x020a0
 #define I915REG_INSTPM	        0x020c0
 
+#define I915REG_PIPEASTAT	0x70024
+#define I915REG_PIPEBSTAT	0x71024
+
+#define I915_VBLANK_INTERRUPT_ENABLE	(1UL<<17)
+#define I915_VBLANK_CLEAR		(1UL<<1)
+
 #define SRX_INDEX		0x3c4
 #define SRX_DATA		0x3c5
 #define SR01			1
diff --git a/shared-core/i915_irq.c b/shared-core/i915_irq.c
index 9772365..d2d2dd8 100644
--- a/shared-core/i915_irq.c
+++ b/shared-core/i915_irq.c
@@ -214,9 +214,12 @@ irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS)
 	drm_device_t *dev = (drm_device_t *) arg;
 	drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
 	u16 temp;
+	u32 pipea_stats, pipeb_stats;
 
+	pipea_stats = I915_READ(I915REG_PIPEASTAT);
+	pipeb_stats = I915_READ(I915REG_PIPEBSTAT);
+		
 	temp = I915_READ16(I915REG_INT_IDENTITY_R);
-
 	temp &= (dev_priv->irq_enable_reg | USER_INT_FLAG);
 
 #if 0
@@ -257,6 +260,12 @@ irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS)
 
 		if (dev_priv->swaps_pending > 0)
 			drm_locked_tasklet(dev, i915_vblank_tasklet);
+		I915_WRITE(I915REG_PIPEASTAT, 
+			pipea_stats|I915_VBLANK_INTERRUPT_ENABLE|
+			I915_VBLANK_CLEAR);
+		I915_WRITE(I915REG_PIPEBSTAT,
+			pipeb_stats|I915_VBLANK_INTERRUPT_ENABLE|
+			I915_VBLANK_CLEAR);
 	}
 
 	return IRQ_HANDLED;
@@ -652,6 +661,13 @@ void i915_driver_irq_uninstall(drm_device_t * dev)
 	I915_WRITE16(I915REG_INT_MASK_R, 0xffff);
 	I915_WRITE16(I915REG_INT_ENABLE_R, 0x0);
 
+	I915_WRITE(I915REG_PIPEASTAT,
+		   (I915_READ(I915REG_PIPEASTAT) & ~I915_VBLANK_INTERRUPT_ENABLE)
+		   | I915_VBLANK_CLEAR);
+	I915_WRITE(I915REG_PIPEBSTAT,
+		   (I915_READ(I915REG_PIPEBSTAT) & ~I915_VBLANK_INTERRUPT_ENABLE)
+		   | I915_VBLANK_CLEAR);
+
 	temp = I915_READ16(I915REG_INT_IDENTITY_R);
 	I915_WRITE16(I915REG_INT_IDENTITY_R, temp);
 }
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to