Skip to contentSkip to conversation

i915 vsync interrupt fix

PATCH Jeremy Fitzhardinge 2 participants 2 messages Jun 24, 2006 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

I need this patch from Alan Hourihane <mailto:[email protected]> to make direct rendering work properly on my 945GM-based laptop. It comes from https://bugs.freedesktop.org/show_bug.cgi?id=7233. This change is immediately useful to me now, but I don't know if the development DRM is going to be merged with the kernel any time soon (I notice CVS has a variant of this patch).

J
/

/

From: Alan Hourihane <[email protected]>

Look at vsync interrupts from pipe B as well as A.
https://bugs.freedesktop.org/show_bug.cgi?id=7233

drivers/char/drm/i915_irq.c +0 -0
diff -r 91a715ea44db drivers/char/drm/i915_irq.c
@@ -44,7 +44,7 @@ irqreturn_t i915_driver_irq_handler(DRM_
	u16 temp;

	temp = I915_READ16(I915REG_INT_IDENTITY_R);

- temp &= (USER_INT_FLAG | VSYNC_PIPEA_FLAG);
+ temp &= (USER_INT_FLAG | VSYNC_PIPEA_FLAG | VSYNC_PIPEB_FLAG);

	DRM_DEBUG("%s flag=%08x\n", __FUNCTION__, temp);

@@ -58,7 +58,7 @@ irqreturn_t i915_driver_irq_handler(DRM_

	if (temp & USER_INT_FLAG)
		DRM_WAKEUP(&dev_priv->irq_queue);

- if (temp & VSYNC_PIPEA_FLAG) {

+	if (temp & (VSYNC_PIPEA_FLAG | VSYNC_PIPEB_FLAG)) {
		atomic_inc(&dev->vbl_received);
		DRM_WAKEUP(&dev->vbl_queue);
		drm_vbl_send_signals(dev);
@@ -197,7 +197,7 @@ void i915_driver_irq_postinstall(drm_dev
{
	drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;

- I915_WRITE16(I915REG_INT_ENABLE_R, USER_INT_FLAG | VSYNC_PIPEA_FLAG);

+	I915_WRITE16(I915REG_INT_ENABLE_R, USER_INT_FLAG | VSYNC_PIPEA_FLAG | VSYNC_PIPEB_FLAG);
	DRM_INIT_WAITQUEUE(&dev_priv->irq_queue);
}
#1 lore raw
Quoted 7 lines · Jeremy Fitzhardinge

I need this patch from Alan Hourihane <mailto:[email protected]> to make direct rendering work properly on my 945GM-based laptop. It comes from
https://bugs.freedesktop.org/show_bug.cgi?id=7233. This change is immediately useful to me now, but I don't know if the development DRM is going to be merged with the kernel any time soon (I notice CVS has a variant of this patch).

CVS has a more comprehensive patch where the X server tells the DRI module which pipe it should use to signal vblank. With the patch posted, a dual-head environment will generate interrupts on *both* pipes, which will reduce performance while negating the desired synchronized behaviour.

The more complete fix requires updated DRI bits and an updated xf86-video-intel 2D driver, but no changes are needed in the Mesa GL driver. This bumps the i915 DRM version to 1.5.

When we start looking at mergedfb environments, we may want to consider an even more sophisticated fix where the vblank used depends on the dominant monitor displaying the window. The patch I made won't help with that, unfortunately.

Signature · 1 line
[email protected]