Re: [PATCH] i915: make vbl interrupts work properly on i965g/gm

2007-09-28 Thread Jesse Barnes
On Friday, September 28, 2007 3:23 pm Roland Dreier wrote:
>  > I don't have a 945 to test with, but Dave might...
>
> Actually I'm not looking for testing (I can test fine on my own
> laptop :) I was just hoping someone with docs could tell me "MSI is
> documented to be broken on 945GM" or "Oh yeah, 945GM requires you to
> set SECRET_MSI_ENABLE_BIT in register FOO before it generates MSIs."
>
> As I said, it's not a big deal but I'd sort of like to know whether
> my MSI enable hack at least has a chance at working before I try too
> hard to get it working.

I don't see anything in the docs (either public or private) that would 
indicate that MSI is broken on those chips, so I'd expect it to work...

Jesse

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] i915: make vbl interrupts work properly on i965g/gm

2007-09-28 Thread Roland Dreier
 > I don't have a 945 to test with, but Dave might...

Actually I'm not looking for testing (I can test fine on my own laptop :)
I was just hoping someone with docs could tell me "MSI is documented to be
broken on 945GM" or "Oh yeah, 945GM requires you to set SECRET_MSI_ENABLE_BIT 
in register FOO before it generates MSIs."

As I said, it's not a big deal but I'd sort of like to know whether my
MSI enable hack at least has a chance at working before I try too hard
to get it working.

Thanks,
  Roland
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] i915: make vbl interrupts work properly on i965g/gm

2007-09-28 Thread Jesse Barnes
On Friday, September 28, 2007 1:02 pm Roland Dreier wrote:
> Sorry to hijack this thread, but I have a question about i915
> interrupts (945GM specifically) that I haven't gotten an answer to
> yet, and this thread reminded me of it so I thought I'd ask again:
> I hacked the kernel drm stuff on my laptop with 945GM graphics to do
> pci_enable_msi() on the graphics device, and I don't see any
> interrupts occur.
>
> So can someone with access to details of the 945GM tell me if MSI
> interrupts should work, and if so if there's some internal registers
> that need to be poked to enable it (beyond what pci_enable_msi()
> does).
>
> It's not super-urgent-- I just like using shiny things like MSI, and
> I already have ahci, iwl3945 and e1000 working with MSI on my laptop,
> so the graphics are the only thing left with an MSI capability that's
> not working.

I don't have a 945 to test with, but Dave might...

Jesse
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] i915: make vbl interrupts work properly on i965g/gm

2007-09-28 Thread Roland Dreier
Sorry to hijack this thread, but I have a question about i915
interrupts (945GM specifically) that I haven't gotten an answer to
yet, and this thread reminded me of it so I thought I'd ask again:
I hacked the kernel drm stuff on my laptop with 945GM graphics to do
pci_enable_msi() on the graphics device, and I don't see any
interrupts occur.

So can someone with access to details of the 945GM tell me if MSI
interrupts should work, and if so if there's some internal registers
that need to be poked to enable it (beyond what pci_enable_msi()
does).

It's not super-urgent-- I just like using shiny things like MSI, and I
already have ahci, iwl3945 and e1000 working with MSI on my laptop, so
the graphics are the only thing left with an MSI capability that's not
working.

Thanks!
  Roland
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] i915: make vbl interrupts work properly on i965g/gm

2007-09-28 Thread Roland Dreier
Sorry to hijack this thread, but I have a question about i915
interrupts (945GM specifically) that I haven't gotten an answer to
yet, and this thread reminded me of it so I thought I'd ask again:
I hacked the kernel drm stuff on my laptop with 945GM graphics to do
pci_enable_msi() on the graphics device, and I don't see any
interrupts occur.

So can someone with access to details of the 945GM tell me if MSI
interrupts should work, and if so if there's some internal registers
that need to be poked to enable it (beyond what pci_enable_msi()
does).

It's not super-urgent-- I just like using shiny things like MSI, and I
already have ahci, iwl3945 and e1000 working with MSI on my laptop, so
the graphics are the only thing left with an MSI capability that's not
working.

Thanks!
  Roland
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] i915: make vbl interrupts work properly on i965g/gm

2007-09-28 Thread Jesse Barnes
On Friday, September 28, 2007 1:02 pm Roland Dreier wrote:
 Sorry to hijack this thread, but I have a question about i915
 interrupts (945GM specifically) that I haven't gotten an answer to
 yet, and this thread reminded me of it so I thought I'd ask again:
 I hacked the kernel drm stuff on my laptop with 945GM graphics to do
 pci_enable_msi() on the graphics device, and I don't see any
 interrupts occur.

 So can someone with access to details of the 945GM tell me if MSI
 interrupts should work, and if so if there's some internal registers
 that need to be poked to enable it (beyond what pci_enable_msi()
 does).

 It's not super-urgent-- I just like using shiny things like MSI, and
 I already have ahci, iwl3945 and e1000 working with MSI on my laptop,
 so the graphics are the only thing left with an MSI capability that's
 not working.

I don't have a 945 to test with, but Dave might...

Jesse
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] i915: make vbl interrupts work properly on i965g/gm

2007-09-28 Thread Roland Dreier
  I don't have a 945 to test with, but Dave might...

Actually I'm not looking for testing (I can test fine on my own laptop :)
I was just hoping someone with docs could tell me MSI is documented to be
broken on 945GM or Oh yeah, 945GM requires you to set SECRET_MSI_ENABLE_BIT 
in register FOO before it generates MSIs.

As I said, it's not a big deal but I'd sort of like to know whether my
MSI enable hack at least has a chance at working before I try too hard
to get it working.

Thanks,
  Roland
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] i915: make vbl interrupts work properly on i965g/gm

2007-09-28 Thread Jesse Barnes
On Friday, September 28, 2007 3:23 pm Roland Dreier wrote:
   I don't have a 945 to test with, but Dave might...

 Actually I'm not looking for testing (I can test fine on my own
 laptop :) I was just hoping someone with docs could tell me MSI is
 documented to be broken on 945GM or Oh yeah, 945GM requires you to
 set SECRET_MSI_ENABLE_BIT in register FOO before it generates MSIs.

 As I said, it's not a big deal but I'd sort of like to know whether
 my MSI enable hack at least has a chance at working before I try too
 hard to get it working.

I don't see anything in the docs (either public or private) that would 
indicate that MSI is broken on those chips, so I'd expect it to work...

Jesse

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] i915: make vbl interrupts work properly on i965g/gm

2007-09-27 Thread Jesse Barnes
On Thursday, September 27, 2007 7:05:31 pm Dave Airlie wrote:
> Hi Linus,
>
> The attached patch is to fix a bug reported on 965gm chipsets (lots of new
> laptops), I think distros will all have to patch this in to fix it, so can
> we get it into the 2.6.23 final?
>
> (Otherwise I'll wait until stable..)

Without this patch, my 965GM drops vblank interrupts, so I'd really like to 
see it upstream ASAP too.

Acked-by:  Jesse Barnes <[EMAIL PROTECTED]>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] i915: make vbl interrupts work properly on i965g/gm

2007-09-27 Thread Dave Airlie


Hi Linus,

The attached patch is to fix a bug reported on 965gm chipsets (lots of new 
laptops), I think distros will all have to patch this in to fix it, so can 
we get it into the 2.6.23 final?


(Otherwise I'll wait until stable..)

Dave.From 14e53712e5e2ccc72dac1131de78e590e9a9d451 Mon Sep 17 00:00:00 2001
From: Dave Airlie <[EMAIL PROTECTED]>
Date: Fri, 28 Sep 2007 11:46:28 +1000
Subject: [PATCH] i915: make vbl interrupts work properly on i965g/gm hw.

This code is ported from the DRM git tree and allows the vblank interrupts
to function on the i965 hw. It also requires a change in Mesa's 965 driver
to actually use them.

Signed-off-by: Dave Airlie <[EMAIL PROTECTED]>
---
 drivers/char/drm/i915_drv.h |6 ++
 drivers/char/drm/i915_irq.c |   12 
 2 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/drivers/char/drm/i915_drv.h b/drivers/char/drm/i915_drv.h
index 737088b..28b9873 100644
--- a/drivers/char/drm/i915_drv.h
+++ b/drivers/char/drm/i915_drv.h
@@ -210,6 +210,12 @@ extern int i915_wait_ring(struct drm_device * dev, int n, const char *caller);
 #define I915REG_INT_MASK_R 	0x020a8
 #define I915REG_INT_ENABLE_R	0x020a0
 
+#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/drivers/char/drm/i915_irq.c b/drivers/char/drm/i915_irq.c
index 4b4b2ce..bb8e9e9 100644
--- a/drivers/char/drm/i915_irq.c
+++ b/drivers/char/drm/i915_irq.c
@@ -214,6 +214,10 @@ irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS)
 	struct drm_device *dev = (struct drm_device *) 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);
 
@@ -225,6 +229,8 @@ irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS)
 		return IRQ_NONE;
 
 	I915_WRITE16(I915REG_INT_IDENTITY_R, temp);
+	(void) I915_READ16(I915REG_INT_IDENTITY_R);
+	DRM_READMEMORYBARRIER();
 
 	dev_priv->sarea_priv->last_dispatch = READ_BREADCRUMB(dev_priv);
 
@@ -252,6 +258,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;
-- 
1.5.3.1



Re: [PATCH] i915: make vbl interrupts work properly on i965g/gm

2007-09-27 Thread Jesse Barnes
On Thursday, September 27, 2007 7:05:31 pm Dave Airlie wrote:
 Hi Linus,

 The attached patch is to fix a bug reported on 965gm chipsets (lots of new
 laptops), I think distros will all have to patch this in to fix it, so can
 we get it into the 2.6.23 final?

 (Otherwise I'll wait until stable..)

Without this patch, my 965GM drops vblank interrupts, so I'd really like to 
see it upstream ASAP too.

Acked-by:  Jesse Barnes [EMAIL PROTECTED]
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] i915: make vbl interrupts work properly on i965g/gm

2007-09-27 Thread Dave Airlie


Hi Linus,

The attached patch is to fix a bug reported on 965gm chipsets (lots of new 
laptops), I think distros will all have to patch this in to fix it, so can 
we get it into the 2.6.23 final?


(Otherwise I'll wait until stable..)

Dave.From 14e53712e5e2ccc72dac1131de78e590e9a9d451 Mon Sep 17 00:00:00 2001
From: Dave Airlie [EMAIL PROTECTED]
Date: Fri, 28 Sep 2007 11:46:28 +1000
Subject: [PATCH] i915: make vbl interrupts work properly on i965g/gm hw.

This code is ported from the DRM git tree and allows the vblank interrupts
to function on the i965 hw. It also requires a change in Mesa's 965 driver
to actually use them.

Signed-off-by: Dave Airlie [EMAIL PROTECTED]
---
 drivers/char/drm/i915_drv.h |6 ++
 drivers/char/drm/i915_irq.c |   12 
 2 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/drivers/char/drm/i915_drv.h b/drivers/char/drm/i915_drv.h
index 737088b..28b9873 100644
--- a/drivers/char/drm/i915_drv.h
+++ b/drivers/char/drm/i915_drv.h
@@ -210,6 +210,12 @@ extern int i915_wait_ring(struct drm_device * dev, int n, const char *caller);
 #define I915REG_INT_MASK_R 	0x020a8
 #define I915REG_INT_ENABLE_R	0x020a0
 
+#define I915REG_PIPEASTAT	0x70024
+#define I915REG_PIPEBSTAT	0x71024
+
+#define I915_VBLANK_INTERRUPT_ENABLE	(1UL17)
+#define I915_VBLANK_CLEAR		(1UL1)
+
 #define SRX_INDEX		0x3c4
 #define SRX_DATA		0x3c5
 #define SR01			1
diff --git a/drivers/char/drm/i915_irq.c b/drivers/char/drm/i915_irq.c
index 4b4b2ce..bb8e9e9 100644
--- a/drivers/char/drm/i915_irq.c
+++ b/drivers/char/drm/i915_irq.c
@@ -214,6 +214,10 @@ irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS)
 	struct drm_device *dev = (struct drm_device *) 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);
 
@@ -225,6 +229,8 @@ irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS)
 		return IRQ_NONE;
 
 	I915_WRITE16(I915REG_INT_IDENTITY_R, temp);
+	(void) I915_READ16(I915REG_INT_IDENTITY_R);
+	DRM_READMEMORYBARRIER();
 
 	dev_priv-sarea_priv-last_dispatch = READ_BREADCRUMB(dev_priv);
 
@@ -252,6 +258,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;
-- 
1.5.3.1