1 /*****************************************************************************\
2 * Tseng Labs ET6000, ET6100 and ET6300 graphics driver for BeOS 5.
3 * Copyright (c) 2003-2004, Evgeniy Vladimirovich Bobkov.
4 \*****************************************************************************/
6 #include "GlobalData.h"
10 /*****************************************************************************/
12 * Return the current display mode. The only time you
13 * might return an error is if a mode hasn't been set.
15 status_t
GET_DISPLAY_MODE(display_mode
*current_mode
) {
16 /* easy for us, we return the last mode we set */
17 *current_mode
= si
->dm
;
20 /*****************************************************************************/
22 * Return the frame buffer configuration information.
24 status_t
GET_FRAME_BUFFER_CONFIG(frame_buffer_config
*afb
) {
25 /* easy again, as the last mode set stored the info in a convienient form */
29 /*****************************************************************************/
31 * Return the maximum and minium pixel clock limits for the specified mode.
32 * Note that we're not making any guarantees about the ability of the
33 * attached display to handle pixel clocks within the limits we return.
34 * A future monitor capablilities database will post-process this
37 status_t
GET_PIXEL_CLOCK_LIMITS(display_mode
*dm
, uint32
*low
, uint32
*high
) {
39 uint32 totalPix
= (uint32
)dm
->timing
.h_total
* (uint32
)dm
->timing
.v_total
;
41 /* max pixel clock is pixel depth dependant */
42 switch (dm
->space
& ~0x3000) {
43 case B_RGB24
: clockLimit
= si
->pixelClockMax24
; break;
45 case B_RGB16
: clockLimit
= si
->pixelClockMax16
; break;
50 /* lower limit of about 48Hz vertical refresh */
51 *low
= (totalPix
* 48L) / 1000L;
52 if (*low
> clockLimit
) return B_ERROR
;
57 /*****************************************************************************/