2 Haiku S3 Virge driver adapted from the X.org Virge driver.
4 Copyright (C) 1994-1999 The XFree86 Project, Inc. All Rights Reserved.
6 Copyright 2007-2008 Haiku, Inc. All rights reserved.
7 Distributed under the terms of the MIT license.
10 Gerald Zajac 2007-2008
20 Virge_DPMSCapabilities(void)
22 // Return DPMS modes supported by this device.
24 return B_DPMS_ON
| B_DPMS_STAND_BY
| B_DPMS_SUSPEND
| B_DPMS_OFF
;
29 Virge_GetDPMSMode(void)
31 // Return the current DPMS mode.
33 // Note: I do not know whether the following code is correctly reading
34 // the current DPMS mode. I'm assuming that reading back the bits that
35 // were set by function Virge_SetDPMSMode will give the current DPMS mode.
37 uint32 mode
= B_DPMS_ON
;
39 switch (ReadSeqReg(0x0d) & 0x70) {
44 mode
= B_DPMS_STAND_BY
;
47 mode
= B_DPMS_SUSPEND
;
53 TRACE("Unknown DPMS mode, reg sr0D: 0x%X\n", ReadSeqReg(0x0d));
56 TRACE("Virge_GetDPMSMode() mode: %d\n", mode
);
62 Virge_SetDPMSMode(uint32 dpmsMode
)
64 // Set the display into one of the Display Power Management modes,
65 // and return B_OK if successful, else return B_ERROR.
67 TRACE("Virge_SetDPMSMode() mode: %d\n", dpmsMode
);
69 WriteSeqReg(0x08, 0x06); // unlock extended sequencer regs
71 uint8 sr0D
= ReadSeqReg(0x0d) & 0x03;
86 TRACE("Invalid DPMS mode %d\n", dpmsMode
);
90 WriteSeqReg(0x0d, sr0D
);