aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/mga_dma.c
diff options
context:
space:
mode:
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}