summaryrefslogtreecommitdiff
path: root/src/radeon_driver.c
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2009-04-01 16:22:02 -0400
committerAlex Deucher <alexdeucher@gmail.com>2009-04-15 11:45:52 -0400
commit63cb57c5eb0d6bc083f54eb100cb972b0e7bca69 (patch)
treecccada8790b2cd91d4b2ab52c6450fad400d3a51 /src/radeon_driver.c
parenta34a8b37afbea6ed4bf8ca42364195e174250c48 (diff)
Add DynamicPM Option
Dyanmically switch between power states. Switch to a low power state when the system is idle (DPMS off).
Diffstat (limited to 'src/radeon_driver.c')
-rw-r--r--src/radeon_driver.c28
1 files changed, 25 insertions, 3 deletions
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 7c758f86..8e70e654 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -196,6 +196,7 @@ static const OptionInfoRec RADEONOptions[] = {
{ OPTION_ATOM_TVOUT, "ATOMTVOut", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_R4XX_ATOM, "R4xxATOM", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_FORCE_LOW_POWER, "ForceLowPowerMode", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_DYNAMIC_PM, "DynamicPM", OPTV_BOOLEAN, {0}, FALSE },
{ -1, NULL, OPTV_NONE, {0}, FALSE }
};
@@ -3219,6 +3220,9 @@ static void RADEONBlockHandler(int i, pointer blockData,
#ifdef USE_EXA
info->accel_state->engineMode = EXA_ENGINEMODE_UNKNOWN;
#endif
+
+ if (info->power_mode == POWER_MODE_DYNAMIC)
+ RADEONPMBlockHandler(pScrn);
}
static void
@@ -3357,8 +3361,17 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen,
else
RADEONSetClockGating(pScrn, FALSE);
- if (xf86ReturnOptValBool(info->Options, OPTION_FORCE_LOW_POWER, FALSE))
+ info->power_mode = POWER_MODE_NONE;
+ if (xf86ReturnOptValBool(info->Options, OPTION_DYNAMIC_PM, FALSE)) {
+ info->power_mode = POWER_MODE_DYNAMIC;
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Dynamic Power Management Enabled\n");
+ } else
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Dynamic Power Management Disabled\n");
+
+ if (xf86ReturnOptValBool(info->Options, OPTION_FORCE_LOW_POWER, FALSE)) {
+ info->power_mode = POWER_MODE_STATIC;
RADEONStaticLowPowerMode(pScrn, TRUE);
+ }
if (info->allowColorTiling && (pScrn->virtualX > info->MaxSurfaceWidth)) {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
@@ -5620,7 +5633,7 @@ Bool RADEONEnterVT(int scrnIndex, int flags)
else
RADEONSetClockGating(pScrn, FALSE);
- if (xf86ReturnOptValBool(info->Options, OPTION_FORCE_LOW_POWER, FALSE))
+ if (info->power_mode == POWER_MODE_STATIC)
RADEONStaticLowPowerMode(pScrn, TRUE);
for (i = 0; i < config->num_crtc; i++)
@@ -5783,8 +5796,17 @@ static Bool RADEONCloseScreen(int scrnIndex, ScreenPtr pScreen)
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
"RADEONCloseScreen\n");
- if (xf86ReturnOptValBool(info->Options, OPTION_FORCE_LOW_POWER, FALSE))
+ switch (info->power_mode) {
+ case POWER_MODE_STATIC:
RADEONStaticLowPowerMode(pScrn, FALSE);
+ break;
+ case POWER_MODE_DYNAMIC:
+ RADEONDynamicLowPowerMode(pScrn, FALSE);
+ break;
+ case POWER_MODE_NONE:
+ default:
+ break;
+ }
/* Mark acceleration as stopped or we might try to access the engine at
* wrong times, especially if we had DRI, after DRI has been stopped