From 45f1db8db9d1280dff51cdfb680bff2754195483 Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Sat, 28 May 2005 00:00:08 +0000 Subject: Re-implement the power management. There's two choices when fb is or isn't loaded as we treat ourselves as a PCI driver in the latter case. If we are a PCI driver, then register the suspend/resume functions directly. If not, then we register as a sysdev and pick up the suspend/resume actions and pump them down into a generic *power function. It'll be nice when this little mess is sorted out with regard to being a real PCI driver ;-/ --- linux-core/drm_drv.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'linux-core/drm_drv.c') diff --git a/linux-core/drm_drv.c b/linux-core/drm_drv.c index 069ecd3e..192b05cd 100644 --- a/linux-core/drm_drv.c +++ b/linux-core/drm_drv.c @@ -265,6 +265,8 @@ int drm_takedown(drm_device_t * dev) if (drm_core_check_feature(dev, DRIVER_HAVE_DMA)) drm_dma_takedown(dev); + drm_pm_takedown(dev); + if (dev->lock.hw_lock) { dev->sigdata.lock = dev->lock.hw_lock = NULL; /* SHM removed */ dev->lock.filp = NULL; @@ -310,6 +312,8 @@ int drm_init(struct drm_driver *driver, drm_mem_init(); + drm_pm_init(); + for (i = 0; (pciidlist[i].vendor != 0) && !drm_fb_loaded; i++) { pid = &pciidlist[i]; @@ -439,6 +443,8 @@ static void __exit drm_cleanup(drm_device_t * dev) if (dev->driver->postcleanup) dev->driver->postcleanup(dev); + drm_pm_cleanup(); + drm_put_head(&dev->primary); if (drm_put_dev(dev)) DRM_ERROR("Cannot unload module\n"); -- cgit v1.2.3