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/drmP.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'linux-core/drmP.h') diff --git a/linux-core/drmP.h b/linux-core/drmP.h index 24d8a23b..d7a19a2a 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -80,6 +80,7 @@ #endif #include #include +#include #include "drm.h" #define __OS_HAS_AGP (defined(CONFIG_AGP) || (defined(CONFIG_AGP_MODULE) && defined(MODULE))) @@ -541,6 +542,7 @@ struct drm_driver { int new); int (*kernel_context_switch_unlock) (struct drm_device * dev); int (*vblank_wait) (struct drm_device * dev, unsigned int *sequence); + int (*power) (struct drm_device * dev, unsigned int state); /** * Called by \c drm_device_is_agp. Typically used to determine if a @@ -720,6 +722,9 @@ typedef struct drm_device { struct drm_driver *driver; drm_local_map_t *agp_buffer_map; drm_head_t primary; /**< primary screen head */ + + struct sys_device sysdev; /**< Power Management device structure */ + int sysdev_registered; /**< Whether the device has been registered */ } drm_device_t; static __inline__ int drm_core_check_feature(struct drm_device *dev, @@ -896,6 +901,12 @@ extern unsigned long drm_get_resource_start(drm_device_t *dev, extern unsigned long drm_get_resource_len(drm_device_t *dev, unsigned int resource); + /* Power Management (drm_pm.h) */ +extern int drm_pm_setup(drm_device_t *dev); +extern void drm_pm_takedown(drm_device_t *dev); +extern int drm_pm_init(void); +extern void drm_pm_cleanup(void); + /* DMA support (drm_dma.h) */ extern int drm_dma_setup(drm_device_t * dev); extern void drm_dma_takedown(drm_device_t * dev); -- cgit v1.2.3