summaryrefslogtreecommitdiff
path: root/sys/dev/pci/drm/mach64_irq.c
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@cvs.openbsd.org>2008-11-23 21:35:02 +0000
committerOwain Ainsworth <oga@cvs.openbsd.org>2008-11-23 21:35:02 +0000
commitebcc0685bc5a51f710b5063c90f783646d4dbb53 (patch)
tree4bcfaa5f472f81112a5ee846adf18228e990ea42 /sys/dev/pci/drm/mach64_irq.c
parent17ac785bb3a684774ebdad9381363f2883fec44a (diff)
Map device interrupts in the attach routine. and remove more need for
dev->pa by doing the pci_intr_establish/disestablish dance in the driver function, not in drm. This removes the need for interrupt_{pre,post}install callbacks, instead just provide a interrupt_install() callback.
Diffstat (limited to 'sys/dev/pci/drm/mach64_irq.c')
-rw-r--r--sys/dev/pci/drm/mach64_irq.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/dev/pci/drm/mach64_irq.c b/sys/dev/pci/drm/mach64_irq.c
index 55c2cb14c57..9713f38cafe 100644
--- a/sys/dev/pci/drm/mach64_irq.c
+++ b/sys/dev/pci/drm/mach64_irq.c
@@ -130,7 +130,8 @@ static void mach64_disable_vblank_local(struct drm_device * dev, int crtc)
| MACH64_CRTC_VBLANK_INT);
}
-void mach64_driver_irq_preinstall(struct drm_device * dev)
+int
+mach64_driver_irq_install(struct drm_device * dev)
{
drm_mach64_private_t *dev_priv = dev->dev_private;
@@ -139,16 +140,21 @@ void mach64_driver_irq_preinstall(struct drm_device * dev)
DRM_DEBUG("before install CRTC_INT_CTNL: 0x%08x\n", status);
mach64_disable_vblank_local(dev, 0);
+
+ 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);
+ return (0);
}
void mach64_driver_irq_uninstall(struct drm_device * dev)
{
drm_mach64_private_t *dev_priv = dev->dev_private;
- if (!dev_priv)
- return;
mach64_disable_vblank_local(dev, 0);
DRM_DEBUG("after uninstall CRTC_INT_CTNL: 0x%08x\n",
MACH64_READ(MACH64_CRTC_INT_CNTL));
+ pci_intr_disestablish(dev_priv->pc, dev_priv->irqh);
}