diff options
author | Owain Ainsworth <oga@cvs.openbsd.org> | 2008-11-23 21:35:02 +0000 |
---|---|---|
committer | Owain Ainsworth <oga@cvs.openbsd.org> | 2008-11-23 21:35:02 +0000 |
commit | ebcc0685bc5a51f710b5063c90f783646d4dbb53 (patch) | |
tree | 4bcfaa5f472f81112a5ee846adf18228e990ea42 /sys/dev/pci/drm/radeon_irq.c | |
parent | 17ac785bb3a684774ebdad9381363f2883fec44a (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/radeon_irq.c')
-rw-r--r-- | sys/dev/pci/drm/radeon_irq.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/sys/dev/pci/drm/radeon_irq.c b/sys/dev/pci/drm/radeon_irq.c index f0255e28017..5ca8abf1e74 100644 --- a/sys/dev/pci/drm/radeon_irq.c +++ b/sys/dev/pci/drm/radeon_irq.c @@ -320,7 +320,8 @@ int radeon_irq_wait(struct drm_device *dev, void *data, struct drm_file *file_pr /* drm_dma.h hooks */ -void radeon_driver_irq_preinstall(struct drm_device * dev) +int +radeon_driver_irq_install(struct drm_device * dev) { drm_radeon_private_t *dev_priv = (drm_radeon_private_t *) dev->dev_private; @@ -333,12 +334,11 @@ void radeon_driver_irq_preinstall(struct drm_device * dev) /* Clear bits if they're already high */ radeon_acknowledge_irqs(dev_priv, &dummy); -} -int radeon_driver_irq_postinstall(struct drm_device * dev) -{ - drm_radeon_private_t *dev_priv = - (drm_radeon_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); atomic_set(&dev_priv->swi_emitted, 0); @@ -349,7 +349,8 @@ int radeon_driver_irq_postinstall(struct drm_device * dev) return 0; } -void radeon_driver_irq_uninstall(struct drm_device * dev) +void +radeon_driver_irq_uninstall(struct drm_device * dev) { drm_radeon_private_t *dev_priv = (drm_radeon_private_t *) dev->dev_private; @@ -362,6 +363,8 @@ void radeon_driver_irq_uninstall(struct drm_device * dev) RADEON_WRITE(R500_DxMODE_INT_MASK, 0); /* Disable *all* interrupts */ RADEON_WRITE(RADEON_GEN_INT_CNTL, 0); + + pci_intr_disestablish(dev_priv->pc, dev_priv->irqh); } |