summaryrefslogtreecommitdiff
path: root/bsd-core/savage_drv.c
diff options
context:
space:
mode:
Diffstat (limited to 'bsd-core/savage_drv.c')
-rw-r--r--bsd-core/savage_drv.c59
1 files changed, 36 insertions, 23 deletions
diff --git a/bsd-core/savage_drv.c b/bsd-core/savage_drv.c
index 6235bcd1..ee5166a3 100644
--- a/bsd-core/savage_drv.c
+++ b/bsd-core/savage_drv.c
@@ -39,28 +39,28 @@ static drm_pci_id_list_t savage_pciidlist[] = {
static void savage_configure(struct drm_device *dev)
{
- dev->driver.buf_priv_size = sizeof(drm_savage_buf_priv_t);
- dev->driver.load = savage_driver_load;
- dev->driver.firstopen = savage_driver_firstopen;
- dev->driver.lastclose = savage_driver_lastclose;
- dev->driver.unload = savage_driver_unload;
- dev->driver.reclaim_buffers_locked = savage_reclaim_buffers;
- dev->driver.dma_ioctl = savage_bci_buffers;
-
- dev->driver.ioctls = savage_ioctls;
- dev->driver.max_ioctl = savage_max_ioctl;
-
- dev->driver.name = DRIVER_NAME;
- dev->driver.desc = DRIVER_DESC;
- dev->driver.date = DRIVER_DATE;
- dev->driver.major = DRIVER_MAJOR;
- dev->driver.minor = DRIVER_MINOR;
- dev->driver.patchlevel = DRIVER_PATCHLEVEL;
-
- dev->driver.use_agp = 1;
- dev->driver.use_mtrr = 1;
- dev->driver.use_pci_dma = 1;
- dev->driver.use_dma = 1;
+ dev->driver->buf_priv_size = sizeof(drm_savage_buf_priv_t);
+ dev->driver->load = savage_driver_load;
+ dev->driver->firstopen = savage_driver_firstopen;
+ dev->driver->lastclose = savage_driver_lastclose;
+ dev->driver->unload = savage_driver_unload;
+ dev->driver->reclaim_buffers_locked = savage_reclaim_buffers;
+ dev->driver->dma_ioctl = savage_bci_buffers;
+
+ dev->driver->ioctls = savage_ioctls;
+ dev->driver->max_ioctl = savage_max_ioctl;
+
+ dev->driver->name = DRIVER_NAME;
+ dev->driver->desc = DRIVER_DESC;
+ dev->driver->date = DRIVER_DATE;
+ dev->driver->major = DRIVER_MAJOR;
+ dev->driver->minor = DRIVER_MINOR;
+ dev->driver->patchlevel = DRIVER_PATCHLEVEL;
+
+ dev->driver->use_agp = 1;
+ dev->driver->use_mtrr = 1;
+ dev->driver->use_pci_dma = 1;
+ dev->driver->use_dma = 1;
}
#ifdef __FreeBSD__
@@ -76,15 +76,28 @@ savage_attach(device_t nbdev)
struct drm_device *dev = device_get_softc(nbdev);
bzero(dev, sizeof(struct drm_device));
+
+ dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, M_ZERO);
savage_configure(dev);
+
return drm_attach(nbdev, savage_pciidlist);
}
+static int
+savage_detach(device_t nbdev)
+{
+ struct drm_device *dev = device_get_softc(nbdev);
+
+ free(dev->driver, M_DRM);
+
+ return drm_detach(nbdev);
+}
+
static device_method_t savage_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, savage_probe),
DEVMETHOD(device_attach, savage_attach),
- DEVMETHOD(device_detach, drm_detach),
+ DEVMETHOD(device_detach, savage_detach),
{ 0, 0 }
};