diff options
author | Keith Whitwell <keith@tungstengraphics.com> | 2003-07-07 09:32:02 +0000 |
---|---|---|
committer | Keith Whitwell <keith@tungstengraphics.com> | 2003-07-07 09:32:02 +0000 |
commit | 736e2a96857d03c698865f140bd7c61500cad5a2 (patch) | |
tree | 46ef8271e655b025404a43e631cf425d2aaac1e0 | |
parent | d208d0b561473651b5296558f09eb7d4bcd269b6 (diff) |
Temporary changes to work with i865 agp patch - will break other drivers
-rw-r--r-- | bsd-core/drm_dma.c | 15 | ||||
-rw-r--r-- | bsd-core/drm_drv.c | 2 | ||||
-rw-r--r-- | bsd/drm_dma.h | 15 | ||||
-rw-r--r-- | bsd/drm_drv.h | 2 | ||||
-rw-r--r-- | bsd/i830_drv.c | 5 |
5 files changed, 17 insertions, 22 deletions
diff --git a/bsd-core/drm_dma.c b/bsd-core/drm_dma.c index 10c26e37..9bc0b5d4 100644 --- a/bsd-core/drm_dma.c +++ b/bsd-core/drm_dma.c @@ -157,10 +157,8 @@ int DRM(irq_install)( drm_device_t *dev, int irq ) { int retcode; - if ( !irq ) - return DRM_ERR(EINVAL); - if (dev->dev_private == NULL) + if ( !irq || !dev->dev_private ) return DRM_ERR(EINVAL); DRM_LOCK; @@ -171,7 +169,6 @@ int DRM(irq_install)( drm_device_t *dev, int irq ) dev->irq = irq; DRM_UNLOCK; - DRM_DEBUG( "%s: irq=%d\n", __FUNCTION__, irq ); dev->context_flag = 0; @@ -193,7 +190,7 @@ int DRM(irq_install)( drm_device_t *dev, int irq ) /* Install handler */ dev->irqrid = 0; #ifdef __FreeBSD__ - dev->irqr = bus_alloc_resource(dev->device, SYS_RES_IRQ, &dev->irqrid, + dev->irqr = bus_alloc_resource(device_get_parent(dev->device), SYS_RES_IRQ, &dev->irqrid, 0, ~0, 1, RF_SHAREABLE); if (!dev->irqr) { #elif defined(__NetBSD__) @@ -208,7 +205,7 @@ int DRM(irq_install)( drm_device_t *dev, int irq ) #ifdef __FreeBSD__ #if __FreeBSD_version < 500000 - retcode = bus_setup_intr(dev->device, dev->irqr, INTR_TYPE_TTY, + retcode = bus_setup_intr(device_get_parent(dev->device), dev->irqr, INTR_TYPE_TTY, DRM(dma_service), dev, &dev->irqh); #else retcode = bus_setup_intr(dev->device, dev->irqr, INTR_TYPE_TTY | INTR_MPSAFE, @@ -222,7 +219,7 @@ int DRM(irq_install)( drm_device_t *dev, int irq ) #endif DRM_LOCK; #ifdef __FreeBSD__ - bus_release_resource(dev->device, SYS_RES_IRQ, dev->irqrid, dev->irqr); + bus_release_resource(device_get_parent(dev->device), SYS_RES_IRQ, dev->irqrid, dev->irqr); #endif dev->irq = 0; dev->irqrid = 0; @@ -256,8 +253,8 @@ int DRM(irq_uninstall)( drm_device_t *dev ) DRM(driver_irq_uninstall)( dev ); #ifdef __FreeBSD__ - bus_teardown_intr(dev->device, dev->irqr, dev->irqh); - bus_release_resource(dev->device, SYS_RES_IRQ, irqrid, dev->irqr); + bus_teardown_intr(device_get_parent(dev->device), dev->irqr, dev->irqh); + bus_release_resource(device_get_parent(dev->device), SYS_RES_IRQ, irqrid, dev->irqr); #elif defined(__NetBSD__) pci_intr_disestablish(&dev->pa.pa_pc, dev->irqh); #endif diff --git a/bsd-core/drm_drv.c b/bsd-core/drm_drv.c index d88e1852..e8d1baa8 100644 --- a/bsd-core/drm_drv.c +++ b/bsd-core/drm_drv.c @@ -224,7 +224,7 @@ static int DRM(probe)(device_t dev) { const char *s = NULL; - int pciid=pci_get_devid(dev); + int pciid=pci_get_devid(device_get_parent(dev)); int vendor = (pciid & 0x0000ffff); int device = (pciid & 0xffff0000) >> 16; diff --git a/bsd/drm_dma.h b/bsd/drm_dma.h index 10c26e37..9bc0b5d4 100644 --- a/bsd/drm_dma.h +++ b/bsd/drm_dma.h @@ -157,10 +157,8 @@ int DRM(irq_install)( drm_device_t *dev, int irq ) { int retcode; - if ( !irq ) - return DRM_ERR(EINVAL); - if (dev->dev_private == NULL) + if ( !irq || !dev->dev_private ) return DRM_ERR(EINVAL); DRM_LOCK; @@ -171,7 +169,6 @@ int DRM(irq_install)( drm_device_t *dev, int irq ) dev->irq = irq; DRM_UNLOCK; - DRM_DEBUG( "%s: irq=%d\n", __FUNCTION__, irq ); dev->context_flag = 0; @@ -193,7 +190,7 @@ int DRM(irq_install)( drm_device_t *dev, int irq ) /* Install handler */ dev->irqrid = 0; #ifdef __FreeBSD__ - dev->irqr = bus_alloc_resource(dev->device, SYS_RES_IRQ, &dev->irqrid, + dev->irqr = bus_alloc_resource(device_get_parent(dev->device), SYS_RES_IRQ, &dev->irqrid, 0, ~0, 1, RF_SHAREABLE); if (!dev->irqr) { #elif defined(__NetBSD__) @@ -208,7 +205,7 @@ int DRM(irq_install)( drm_device_t *dev, int irq ) #ifdef __FreeBSD__ #if __FreeBSD_version < 500000 - retcode = bus_setup_intr(dev->device, dev->irqr, INTR_TYPE_TTY, + retcode = bus_setup_intr(device_get_parent(dev->device), dev->irqr, INTR_TYPE_TTY, DRM(dma_service), dev, &dev->irqh); #else retcode = bus_setup_intr(dev->device, dev->irqr, INTR_TYPE_TTY | INTR_MPSAFE, @@ -222,7 +219,7 @@ int DRM(irq_install)( drm_device_t *dev, int irq ) #endif DRM_LOCK; #ifdef __FreeBSD__ - bus_release_resource(dev->device, SYS_RES_IRQ, dev->irqrid, dev->irqr); + bus_release_resource(device_get_parent(dev->device), SYS_RES_IRQ, dev->irqrid, dev->irqr); #endif dev->irq = 0; dev->irqrid = 0; @@ -256,8 +253,8 @@ int DRM(irq_uninstall)( drm_device_t *dev ) DRM(driver_irq_uninstall)( dev ); #ifdef __FreeBSD__ - bus_teardown_intr(dev->device, dev->irqr, dev->irqh); - bus_release_resource(dev->device, SYS_RES_IRQ, irqrid, dev->irqr); + bus_teardown_intr(device_get_parent(dev->device), dev->irqr, dev->irqh); + bus_release_resource(device_get_parent(dev->device), SYS_RES_IRQ, irqrid, dev->irqr); #elif defined(__NetBSD__) pci_intr_disestablish(&dev->pa.pa_pc, dev->irqh); #endif diff --git a/bsd/drm_drv.h b/bsd/drm_drv.h index d88e1852..e8d1baa8 100644 --- a/bsd/drm_drv.h +++ b/bsd/drm_drv.h @@ -224,7 +224,7 @@ static int DRM(probe)(device_t dev) { const char *s = NULL; - int pciid=pci_get_devid(dev); + int pciid=pci_get_devid(device_get_parent(dev)); int vendor = (pciid & 0x0000ffff); int device = (pciid & 0xffff0000) >> 16; diff --git a/bsd/i830_drv.c b/bsd/i830_drv.c index d4b2d961..468a276e 100644 --- a/bsd/i830_drv.c +++ b/bsd/i830_drv.c @@ -36,7 +36,8 @@ #include "i830_drv.h" drm_chipinfo_t DRM(devicelist)[] = { - {0x1002, 0x4242, 1, "Intel i865G"}, + {0x8086, 0x3582, 1, "Intel i865G"}, + {0x8086, 0x2572, 1, "Intel i865G"}, {0, 0, 0, NULL} }; @@ -57,7 +58,7 @@ drm_chipinfo_t DRM(devicelist)[] = { #include "drm_scatter.h" #ifdef __FreeBSD__ -DRIVER_MODULE(DRIVER_NAME, pci, DRM(driver), DRM(devclass), 0, 0); +DRIVER_MODULE(DRIVER_NAME, agp, DRM(driver), DRM(devclass), 0, 0); #elif defined(__NetBSD__) CFDRIVER_DECL(i830, DV_TTY, NULL); #endif /* __FreeBSD__ */ |