aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/mga_dma.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@starflyer.(none)>2005-11-10 06:16:34 -0500
committerDave Airlie <airlied@linux.ie>2005-11-10 06:16:34 -0500
commit22eae947bf76e236ba972f2f11cfd1b083b736ad (patch)
treee18a2cdfef9ac0f606eb249df4924fef5e7daebd /drivers/char/drm/mga_dma.c
parent3b44f137b9a846c5452d9e6e1271b79b1dbcc942 (diff)
drm: rename driver hooks more understandably
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) From: Eric Anholt <anholt@freebsd.org> Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/char/drm/mga_dma.c')
-rw-r--r--drivers/char/drm/mga_dma.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/char/drm/mga_dma.c b/drivers/char/drm/mga_dma.c
index 70dc7f64b7b9..9b09d786b158 100644
--- a/drivers/char/drm/mga_dma.c
+++ b/drivers/char/drm/mga_dma.c
@@ -391,7 +391,7 @@ int mga_freelist_put(drm_device_t * dev, drm_buf_t * buf)
391 * DMA initialization, cleanup 391 * DMA initialization, cleanup
392 */ 392 */
393 393
394int mga_driver_preinit(drm_device_t * dev, unsigned long flags) 394int mga_driver_load(drm_device_t * dev, unsigned long flags)
395{ 395{
396 drm_mga_private_t *dev_priv; 396 drm_mga_private_t *dev_priv;
397 397
@@ -405,6 +405,14 @@ int mga_driver_preinit(drm_device_t * dev, unsigned long flags)
405 dev_priv->usec_timeout = MGA_DEFAULT_USEC_TIMEOUT; 405 dev_priv->usec_timeout = MGA_DEFAULT_USEC_TIMEOUT;
406 dev_priv->chipset = flags; 406 dev_priv->chipset = flags;
407 407
408 dev_priv->mmio_base = drm_get_resource_start(dev, 1);
409 dev_priv->mmio_size = drm_get_resource_len(dev, 1);
410
411 dev->counters += 3;
412 dev->types[6] = _DRM_STAT_IRQ;
413 dev->types[7] = _DRM_STAT_PRIMARY;
414 dev->types[8] = _DRM_STAT_SECONDARY;
415
408 return 0; 416 return 0;
409} 417}
410 418
@@ -1118,7 +1126,7 @@ int mga_dma_buffers(DRM_IOCTL_ARGS)
1118/** 1126/**
1119 * Called just before the module is unloaded. 1127 * Called just before the module is unloaded.
1120 */ 1128 */
1121int mga_driver_postcleanup(drm_device_t * dev) 1129int mga_driver_unload(drm_device_t * dev)
1122{ 1130{
1123 drm_free(dev->dev_private, sizeof(drm_mga_private_t), DRM_MEM_DRIVER); 1131 drm_free(dev->dev_private, sizeof(drm_mga_private_t), DRM_MEM_DRIVER);
1124 dev->dev_private = NULL; 1132 dev->dev_private = NULL;
@@ -1129,7 +1137,7 @@ int mga_driver_postcleanup(drm_device_t * dev)
1129/** 1137/**
1130 * Called when the last opener of the device is closed. 1138 * Called when the last opener of the device is closed.
1131 */ 1139 */
1132void mga_driver_pretakedown(drm_device_t * dev) 1140void mga_driver_lastclose(drm_device_t * dev)
1133{ 1141{
1134 mga_do_cleanup_dma(dev); 1142 mga_do_cleanup_dma(dev);
1135} 1143}