2 * Copyright 2012 Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT license.
10 Haiku Intel-810 video driver was adapted from the X.org intel driver which
11 has the following copyright.
13 Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
18 #include "accelerant.h"
19 #include "i810_regs.h"
22 #define DPMS_SYNC_SELECT 0x5002
23 #define H_SYNC_OFF 0x02
24 #define V_SYNC_OFF 0x08
28 I810_DPMSCapabilities(void)
30 // Return DPMS modes supported by this device.
32 return B_DPMS_ON
| B_DPMS_STAND_BY
| B_DPMS_SUSPEND
| B_DPMS_OFF
;
37 I810_GetDPMSMode(void)
39 // Return the current DPMS mode.
41 uint32 tmp
= INREG8(DPMS_SYNC_SELECT
) & (H_SYNC_OFF
| V_SYNC_OFF
);
46 else if (tmp
== H_SYNC_OFF
)
47 mode
= B_DPMS_STAND_BY
;
48 else if (tmp
== V_SYNC_OFF
)
49 mode
= B_DPMS_SUSPEND
;
53 TRACE("I810_DPMSMode() mode: %d\n", mode
);
59 I810_SetDPMSMode(uint32 dpmsMode
)
61 // Set the display into one of the Display Power Management modes,
62 // and return B_OK if successful, else return B_ERROR.
64 TRACE("I810_SetDPMSMode() mode: %d\n", dpmsMode
);
66 uint8 seq01
= ReadSeqReg(1) & ~0x20;
67 uint8 dpmsSyncSelect
= 0;
71 // Screen: On; HSync: On, VSync: On.
75 // Screen: Off; HSync: Off, VSync: On.
77 dpmsSyncSelect
= H_SYNC_OFF
;
81 // Screen: Off; HSync: On, VSync: Off.
83 dpmsSyncSelect
= V_SYNC_OFF
;
87 // Screen: Off; HSync: Off, VSync: Off.
89 dpmsSyncSelect
= H_SYNC_OFF
| V_SYNC_OFF
;
93 TRACE("Invalid DPMS mode %d\n", dpmsMode
);
97 WriteSeqReg(1, seq01
); // turn the screen on/off
98 OUTREG8(DPMS_SYNC_SELECT
, dpmsSyncSelect
); // set DPMS mode