diff options
author | Eric Anholt <anholt@freebsd.org> | 2005-08-05 03:50:23 +0000 |
---|---|---|
committer | Eric Anholt <anholt@freebsd.org> | 2005-08-05 03:50:23 +0000 |
commit | c789ea1521ac9e935f2a1c6c043619d89bae9c16 (patch) | |
tree | bb8bcecf000f78f71db8dc70484d7ea82cc0b260 /linux-core/mga_drv.c | |
parent | 143622a987745ca2084f7a188e9993ffd5f28fe3 (diff) |
Rename the driver hooks in the DRM to something a little more
understandable: preinit -> load postinit -> (removed) presetup ->
firstopen postsetup -> (removed) open_helper -> open prerelease ->
preclose free_filp_priv -> postclose pretakedown -> lastclose
postcleanup -> unload release -> reclaim_buffers_locked version ->
(removed)
postinit and version were replaced with generic code in the Linux DRM
(drivers now set their version numbers and description in the driver
structure, like on BSD). postsetup wasn't used at all. Fixes the savage
hooks for initializing and tearing down mappings at the right times.
Testing involved at least starting X, running glxgears, killing
glxgears, exiting X, and repeating.
Tested on: FreeBSD (g200, g400, r200, r128) Linux (r200, savage4)
Diffstat (limited to 'linux-core/mga_drv.c')
-rw-r--r-- | linux-core/mga_drv.c | 52 |
1 files changed, 11 insertions, 41 deletions
diff --git a/linux-core/mga_drv.c b/linux-core/mga_drv.c index 61c3ea06..4dc56031 100644 --- a/linux-core/mga_drv.c +++ b/linux-core/mga_drv.c @@ -38,41 +38,6 @@ #include "drm_pciids.h" static int mga_driver_device_is_agp(drm_device_t * dev); -static int postinit(struct drm_device *dev, unsigned long flags) -{ - drm_mga_private_t * const dev_priv = - (drm_mga_private_t *) dev->dev_private; - - dev_priv->mmio_base = pci_resource_start(dev->pdev, 1); - dev_priv->mmio_size = pci_resource_len(dev->pdev, 1); - - dev->counters += 3; - dev->types[6] = _DRM_STAT_IRQ; - dev->types[7] = _DRM_STAT_PRIMARY; - dev->types[8] = _DRM_STAT_SECONDARY; - - DRM_INFO("Initialized %s %d.%d.%d %s on minor %d: %s\n", - DRIVER_NAME, - DRIVER_MAJOR, - DRIVER_MINOR, - DRIVER_PATCHLEVEL, - DRIVER_DATE, dev->primary.minor, pci_pretty_name(dev->pdev) - ); - return 0; -} - -static int version(drm_version_t * version) -{ - int len; - - version->version_major = DRIVER_MAJOR; - version->version_minor = DRIVER_MINOR; - version->version_patchlevel = DRIVER_PATCHLEVEL; - DRM_COPY(version->name, DRIVER_NAME); - DRM_COPY(version->date, DRIVER_DATE); - DRM_COPY(version->desc, DRIVER_DESC); - return 0; -} static struct pci_device_id pciidlist[] = { mga_PCI_IDS @@ -87,9 +52,9 @@ static struct drm_driver driver = { DRIVER_USE_AGP | DRIVER_USE_MTRR | DRIVER_PCI_DMA | DRIVER_HAVE_DMA | DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_IRQ_VBL, - .preinit = mga_driver_preinit, - .postcleanup = mga_driver_postcleanup, - .pretakedown = mga_driver_pretakedown, + .load = mga_driver_load, + .unload = mga_driver_unload, + .lastclose = mga_driver_lastclose, .dma_quiescent = mga_driver_dma_quiescent, .device_is_agp = mga_driver_device_is_agp, .vblank_wait = mga_driver_vblank_wait, @@ -100,8 +65,6 @@ static struct drm_driver driver = { .reclaim_buffers = drm_core_reclaim_buffers, .get_map_ofs = drm_core_get_map_ofs, .get_reg_ofs = drm_core_get_reg_ofs, - .postinit = postinit, - .version = version, .ioctls = mga_ioctls, .dma_ioctl = mga_dma_buffers, .fops = { @@ -121,7 +84,14 @@ static struct drm_driver driver = { .id_table = pciidlist, .probe = probe, .remove = __devexit_p(drm_cleanup_pci), - } + }, + + .name = DRIVER_NAME, + .desc = DRIVER_DESC, + .date = DRIVER_DATE, + .major = DRIVER_MAJOR, + .minor = DRIVER_MINOR, + .patchlevel = DRIVER_PATCHLEVEL, }; static int probe(struct pci_dev *pdev, const struct pci_device_id *ent) |