Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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.

[ Without this patch, my 965GM drops vblank interrupts - Jesse ]

Signed-off-by: Dave Airlie <airlied@linux.ie>
Acked-by: Jesse Barnes <jesse.barnes@intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Dave Airlie and committed by
Linus Torvalds
e4a7b1d1 ff0ce684

+18
+6
drivers/char/drm/i915_drv.h
··· 210 210 #define I915REG_INT_MASK_R 0x020a8 211 211 #define I915REG_INT_ENABLE_R 0x020a0 212 212 213 + #define I915REG_PIPEASTAT 0x70024 214 + #define I915REG_PIPEBSTAT 0x71024 215 + 216 + #define I915_VBLANK_INTERRUPT_ENABLE (1UL<<17) 217 + #define I915_VBLANK_CLEAR (1UL<<1) 218 + 213 219 #define SRX_INDEX 0x3c4 214 220 #define SRX_DATA 0x3c5 215 221 #define SR01 1
+12
drivers/char/drm/i915_irq.c
··· 214 214 struct drm_device *dev = (struct drm_device *) arg; 215 215 drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; 216 216 u16 temp; 217 + u32 pipea_stats, pipeb_stats; 218 + 219 + pipea_stats = I915_READ(I915REG_PIPEASTAT); 220 + pipeb_stats = I915_READ(I915REG_PIPEBSTAT); 217 221 218 222 temp = I915_READ16(I915REG_INT_IDENTITY_R); 219 223 ··· 229 225 return IRQ_NONE; 230 226 231 227 I915_WRITE16(I915REG_INT_IDENTITY_R, temp); 228 + (void) I915_READ16(I915REG_INT_IDENTITY_R); 229 + DRM_READMEMORYBARRIER(); 232 230 233 231 dev_priv->sarea_priv->last_dispatch = READ_BREADCRUMB(dev_priv); 234 232 ··· 258 252 259 253 if (dev_priv->swaps_pending > 0) 260 254 drm_locked_tasklet(dev, i915_vblank_tasklet); 255 + I915_WRITE(I915REG_PIPEASTAT, 256 + pipea_stats|I915_VBLANK_INTERRUPT_ENABLE| 257 + I915_VBLANK_CLEAR); 258 + I915_WRITE(I915REG_PIPEBSTAT, 259 + pipeb_stats|I915_VBLANK_INTERRUPT_ENABLE| 260 + I915_VBLANK_CLEAR); 261 261 } 262 262 263 263 return IRQ_HANDLED;