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. :( --- linux-core/mga_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'linux-core/mga_drv.c') diff --git a/linux-core/mga_drv.c b/linux-core/mga_drv.c index e0f1ab31..c04de5a3 100644 --- a/linux-core/mga_drv.c +++ b/linux-core/mga_drv.c @@ -81,7 +81,8 @@ static struct drm_driver driver = { DRIVER_USE_AGP | DRIVER_REQUIRE_AGP | DRIVER_USE_MTRR | DRIVER_HAVE_DMA | DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_IRQ_VBL, - .pretakedown = mga_driver_pretakedown, + .preinit = mga_driver_preinit, + .postcleanup = mga_driver_postcleanup, .dma_quiescent = mga_driver_dma_quiescent, .device_is_agp = mga_driver_device_is_agp, .vblank_wait = mga_driver_vblank_wait, -- cgit v1.2.3