summaryrefslogtreecommitdiff
path: root/sys/dev/pci/drm/mga_irq.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/pci/drm/mga_irq.c')
-rw-r--r--sys/dev/pci/drm/mga_irq.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/sys/dev/pci/drm/mga_irq.c b/sys/dev/pci/drm/mga_irq.c
index a4ed2b18546..df1c68664e9 100644
--- a/sys/dev/pci/drm/mga_irq.c
+++ b/sys/dev/pci/drm/mga_irq.c
@@ -141,7 +141,8 @@ int mga_driver_fence_wait(struct drm_device * dev, unsigned int *sequence)
return ret;
}
-void mga_driver_irq_preinstall(struct drm_device * dev)
+int
+mga_driver_irq_install(struct drm_device * dev)
{
drm_mga_private_t *dev_priv = (drm_mga_private_t *) dev->dev_private;
@@ -149,11 +150,11 @@ void mga_driver_irq_preinstall(struct drm_device * dev)
MGA_WRITE(MGA_IEN, 0);
/* Clear bits if they're already high */
MGA_WRITE(MGA_ICLEAR, ~0);
-}
-int mga_driver_irq_postinstall(struct drm_device * dev)
-{
- drm_mga_private_t *dev_priv = (drm_mga_private_t *) dev->dev_private;
+ dev_priv->irqh = pci_intr_establish(dev_priv->pc, dev_priv->ih, IPL_BIO,
+ drm_irq_handler_wrap, dev, dev_priv->dev.dv_xname);
+ if (dev_priv->irqh == NULL)
+ return (ENOENT);
/* Turn on soft trap interrupt. Vertical blank interrupts are enabled
* in mga_enable_vblank.
@@ -162,14 +163,13 @@ int mga_driver_irq_postinstall(struct drm_device * dev)
return 0;
}
-void mga_driver_irq_uninstall(struct drm_device * dev)
+void
+mga_driver_irq_uninstall(struct drm_device * dev)
{
drm_mga_private_t *dev_priv = (drm_mga_private_t *) dev->dev_private;
- if (!dev_priv)
- return;
/* Disable *all* interrupts */
MGA_WRITE(MGA_IEN, 0);
- dev->irq_enabled = 0;
+ pci_intr_disestablish(dev_priv->pc, dev_priv->irqh);
}