2 Copyright 1999, Be Incorporated. All Rights Reserved.
3 This file may be used under the terms of the Be Sample Code License.
6 Rudolf Cornelissen 4/2003-1/2006
9 #define MODULE_BIT 0x02000000
14 Return the current display mode. The only time you might return an
15 error is if a mode hasn't been set. Or if the system hands you a NULL pointer.
17 status_t
GET_DISPLAY_MODE(display_mode
*current_mode
)
19 /* check for NULL pointer */
20 if (current_mode
== NULL
) return B_ERROR
;
22 *current_mode
= si
->dm
;
26 /* Return the frame buffer configuration information. */
27 status_t
GET_FRAME_BUFFER_CONFIG(frame_buffer_config
*afb
)
29 /* check for NULL pointer */
30 if (afb
== NULL
) return B_ERROR
;
36 /* Return the maximum and minium pixelclock limits for the specified mode. */
37 status_t
GET_PIXEL_CLOCK_LIMITS(display_mode
*dm
, uint32
*low
, uint32
*high
)
42 /* check for NULL pointers */
43 if ((dm
== NULL
) || (low
== NULL
) || (high
== NULL
)) return B_ERROR
;
45 /* specify requested info assuming CRT-only mode
46 * (if panel is active, CRTC and pixelclock are not programmed!) */
49 switch (si
->ps
.card_type
)
52 *low
= (si
->ps
.min_pixel_vco
* 1000);
59 max_pclk
= si
->ps
.max_dac1_clock_8
;
63 max_pclk
= si
->ps
.max_dac1_clock_16
;
66 max_pclk
= si
->ps
.max_dac1_clock_24
;
69 /* use fail-safe value */
70 max_pclk
= si
->ps
.max_dac1_clock_24
;
73 /* return values in kHz */
74 *high
= max_pclk
* 1000;
77 /* clamp lower limit to 48Hz vertical refresh for now.
78 * Apparantly the BeOS screenprefs app does limit the upper refreshrate to 90Hz,
79 * while it does not limit the lower refreshrate. */
80 min_pclk
= ((uint32
)dm
->timing
.h_total
* (uint32
)dm
->timing
.v_total
* 48) / 1000;
81 if (min_pclk
> *low
) *low
= min_pclk
;
86 /* Return the semaphore id that will be used to signal a vertical sync occured. */
87 sem_id
ACCELERANT_RETRACE_SEMAPHORE(void)
89 if (si
->ps
.int_assigned
)