i915: Only initialize IRQ fields in postinstall, not the PIPE_SET ioctl.

Some other minor changes in preparation for actually disabling user interrupts.
main
Michel Dänzer 2006-09-28 19:13:59 +02:00
parent 3620a3ec85
commit 48367fdfe6
1 changed files with 9 additions and 9 deletions

View File

@ -227,7 +227,7 @@ void i915_user_irq_off(drm_i915_private_t *dev_priv)
{ {
spin_lock(&dev_priv->user_irq_lock); spin_lock(&dev_priv->user_irq_lock);
if (dev_priv->irq_enabled && (--dev_priv->user_irq_refcount == 0)) { if (dev_priv->irq_enabled && (--dev_priv->user_irq_refcount == 0)) {
dev_priv->irq_enable_reg &= ~USER_INT_FLAG; // dev_priv->irq_enable_reg &= ~USER_INT_FLAG;
// I915_WRITE16(I915REG_INT_ENABLE_R, dev_priv->irq_enable_reg); // I915_WRITE16(I915REG_INT_ENABLE_R, dev_priv->irq_enable_reg);
} }
spin_unlock(&dev_priv->user_irq_lock); spin_unlock(&dev_priv->user_irq_lock);
@ -344,17 +344,14 @@ int i915_irq_wait(DRM_IOCTL_ARGS)
static void i915_enable_interrupt (drm_device_t *dev) static void i915_enable_interrupt (drm_device_t *dev)
{ {
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
u16 flag;
flag = 0; dev_priv->irq_enable_reg = USER_INT_FLAG; //&= ~(VSYNC_PIPEA_FLAG | VSYNC_PIPEB_FLAG);
if (dev_priv->vblank_pipe & DRM_I915_VBLANK_PIPE_A) if (dev_priv->vblank_pipe & DRM_I915_VBLANK_PIPE_A)
flag |= VSYNC_PIPEA_FLAG; dev_priv->irq_enable_reg |= VSYNC_PIPEA_FLAG;
if (dev_priv->vblank_pipe & DRM_I915_VBLANK_PIPE_B) if (dev_priv->vblank_pipe & DRM_I915_VBLANK_PIPE_B)
flag |= VSYNC_PIPEB_FLAG; dev_priv->irq_enable_reg |= VSYNC_PIPEB_FLAG;
dev_priv->user_irq_lock = SPIN_LOCK_UNLOCKED;
dev_priv->user_irq_refcount = 0; I915_WRITE16(I915REG_INT_ENABLE_R, dev_priv->irq_enable_reg);
dev_priv->irq_enable_reg = flag;
I915_WRITE16(I915REG_INT_ENABLE_R, flag);
dev_priv->irq_enabled = 1; dev_priv->irq_enabled = 1;
} }
@ -540,6 +537,9 @@ void i915_driver_irq_postinstall(drm_device_t * dev)
INIT_LIST_HEAD(&dev_priv->vbl_swaps.head); INIT_LIST_HEAD(&dev_priv->vbl_swaps.head);
dev_priv->swaps_pending = 0; dev_priv->swaps_pending = 0;
dev_priv->user_irq_lock = SPIN_LOCK_UNLOCKED;
dev_priv->user_irq_refcount = 0;
if (!dev_priv->vblank_pipe) if (!dev_priv->vblank_pipe)
dev_priv->vblank_pipe = DRM_I915_VBLANK_PIPE_A; dev_priv->vblank_pipe = DRM_I915_VBLANK_PIPE_A;
i915_enable_interrupt(dev); i915_enable_interrupt(dev);