2 Copyright 2010 Haiku, Inc. All rights reserved.
3 Distributed under the terms of the MIT license.
10 #include "accelerant.h"
15 #define H_SYNC_OFF BIT(3)
16 #define V_SYNC_OFF BIT(1)
20 TDFX_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 TDFX_GetDPMSMode(void)
31 // Return the current DPMS mode.
33 uint32 tmp
= INREG32(DAC_MODE
) & (H_SYNC_OFF
| V_SYNC_OFF
);
38 else if (tmp
== H_SYNC_OFF
)
39 mode
= B_DPMS_STAND_BY
;
40 else if (tmp
== V_SYNC_OFF
)
41 mode
= B_DPMS_SUSPEND
;
45 TRACE("TDFX_DPMSMode() mode: %d\n", mode
);
51 TDFX_SetDPMSMode(uint32 dpmsMode
)
53 // Set the display into one of the Display Power Management modes,
54 // and return B_OK if successful, else return B_ERROR.
56 TRACE("TDFX_SetDPMSMode() mode: %d\n", dpmsMode
);
58 uint32 dacMode
= INREG32(DAC_MODE
) & ~(H_SYNC_OFF
| V_SYNC_OFF
);
62 // Screen: On; HSync: On, VSync: On.
66 // Screen: Off; HSync: Off, VSync: On.
67 dacMode
|= H_SYNC_OFF
;
71 // Screen: Off; HSync: On, VSync: Off.
72 dacMode
|= V_SYNC_OFF
;
76 // Screen: Off; HSync: Off, VSync: Off.
77 dacMode
|= H_SYNC_OFF
| V_SYNC_OFF
;
81 TRACE("Invalid DPMS mode %d\n", dpmsMode
);
85 OUTREG32(DAC_MODE
, dacMode
);