From a686be5bc8c5d8a260513b680f322e3b790aadf7 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Sat, 21 May 2005 02:27:51 +0000 Subject: Change the MGA initialization and cleanup a bit. The dev_private structure is now allocated (and partially filled in) by the new mga_driver_preinit function. This allows the driver to detect the type of card (i.e., G200 class vs. G400 class) on its own. The chipset value passed to mga_dma_init is now ignored. This same technique is used by the radeon DRM. As a result of this, mga_driver_pretakedown was converted to mga_driver_postcleanup. This routine gets called in some other places than might be expected, and it sets the dev_private pointer to NULL. That little gem took over an hour to track down. :( --- shared-core/mga_drv.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'shared-core/mga_drv.h') diff --git a/shared-core/mga_drv.h b/shared-core/mga_drv.h index f1c3cf3e..54373cc7 100644 --- a/shared-core/mga_drv.h +++ b/shared-core/mga_drv.h @@ -113,11 +113,12 @@ typedef struct drm_mga_private { } drm_mga_private_t; /* mga_dma.c */ +extern int mga_driver_preinit(drm_device_t * dev, unsigned long flags); extern int mga_dma_init(DRM_IOCTL_ARGS); extern int mga_dma_flush(DRM_IOCTL_ARGS); extern int mga_dma_reset(DRM_IOCTL_ARGS); extern int mga_dma_buffers(DRM_IOCTL_ARGS); -extern void mga_driver_pretakedown(drm_device_t * dev); +extern int mga_driver_postcleanup(drm_device_t * dev); extern int mga_driver_dma_quiescent(drm_device_t * dev); extern int mga_do_wait_for_idle(drm_mga_private_t * dev_priv); -- cgit v1.2.3