diff options
author | Aaron Plattner <aplattner@nvidia.com> | 2007-04-13 22:29:57 -0700 |
---|---|---|
committer | Aaron Plattner <aplattner@nvidia.com> | 2007-04-13 22:29:57 -0700 |
commit | f1cda5eaba9cbbfeb913d249d014586a6e8fd7a6 (patch) | |
tree | a3c57764e7a3a3ea380a78432b16d32c5df5ae6f /src/g80_sor.c | |
parent | 550af781bd9f7cb7256b298281c2c27febfc4722 (diff) |
G80: Get DPMS working with RandR 1.2.
Work around xf86DisableUnusedFunctions lameness by forcing DPMSModeOn at modeset
time.
Diffstat (limited to 'src/g80_sor.c')
-rw-r--r-- | src/g80_sor.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/g80_sor.c b/src/g80_sor.c index 74bccb0..5187d1f 100644 --- a/src/g80_sor.c +++ b/src/g80_sor.c @@ -25,6 +25,9 @@ #include "config.h" #endif +#define DPMS_SERVER +#include <X11/extensions/dpms.h> + #include "g80_type.h" #include "g80_display.h" #include "g80_output.h" @@ -42,7 +45,22 @@ G80SorSetPClk(xf86OutputPtr output, int pclk) static void G80SorDPMSSet(xf86OutputPtr output, int mode) { - ErrorF("SOR dpms unimplemented\n"); + G80Ptr pNv = G80PTR(output->scrn); + G80OutputPrivPtr pPriv = output->driver_private; + const int off = 0x800 * pPriv->or; + CARD32 tmp; + + while(pNv->reg[(0x0061C004+off)/4] & 0x80000000); + + tmp = pNv->reg[(0x0061C004+off)/4]; + tmp |= 0x80000000; + + if(mode == DPMSModeOn) + tmp |= 1; + else + tmp &= ~1; + + pNv->reg[(0x0061C004+off)/4] = tmp; } static void @@ -62,6 +80,11 @@ G80SorModeSet(xf86OutputPtr output, DisplayModePtr mode, return; } + // This wouldn't be necessary, but the server is stupid and calls + // G80SorDPMSSet after the output is disconnected, even though the hardware + // turns it off automatically. + G80SorDPMSSet(output, DPMSModeOn); + C(0x00000600 + sorOff, (G80CrtcGetHead(output->crtc) == HEAD0 ? 1 : 2) | (adjusted_mode->Clock > 165000 ? 0x500 : 0x100) | |