2 Copyright 1999, Be Incorporated. All Rights Reserved.
3 This file may be used under the terms of the Be Sample Code License.
7 Rudolf Cornelissen 9/2002-10/2005
10 #define MODULE_BIT 0x02000000
15 Return the current display mode. The only time you might return an
16 error is if a mode hasn't been set. Or if the system hands you a NULL pointer.
18 status_t
GET_DISPLAY_MODE(display_mode
*current_mode
)
20 /* check for NULL pointer */
21 if (current_mode
== NULL
) return B_ERROR
;
23 *current_mode
= si
->dm
;
27 /* Return the frame buffer configuration information. */
28 status_t
GET_FRAME_BUFFER_CONFIG(frame_buffer_config
*afb
)
30 /* check for NULL pointer */
31 if (afb
== NULL
) return B_ERROR
;
37 /* Return the maximum and minium pixelclock limits for the specified mode. */
39 * Due to BeOS constraints output for all heads will be limited to the head with
40 * the least capabilities. */
41 status_t
GET_PIXEL_CLOCK_LIMITS(display_mode
*dm
, uint32
*low
, uint32
*high
)
46 /* check for NULL pointers */
47 if ((dm
== NULL
) || (low
== NULL
) || (high
== NULL
)) return B_ERROR
;
49 /* specify requested info */
50 if (dm
->flags
& DUALHEAD_BITS
)
54 switch (si
->ps
.card_type
)
57 *low
= ((si
->ps
.min_video_vco
* 1000) / 16);
61 * using decondary DAC specs because they could be narrower (twinview) */
65 max_pclk
= si
->ps
.max_dac2_clock_8
;
69 max_pclk
= si
->ps
.max_dac2_clock_16
;
72 max_pclk
= si
->ps
.max_dac2_clock_24
;
75 /* specially noted because of RAM speed constraints! */
76 max_pclk
= si
->ps
.max_dac2_clock_32dh
;
79 /* use fail-safe value */
80 max_pclk
= si
->ps
.max_dac2_clock_32dh
;
83 /* return values in kHz */
84 *high
= max_pclk
* 1000;
90 switch (si
->ps
.card_type
)
93 *low
= ((si
->ps
.min_pixel_vco
* 1000) / 16);
96 /* find max. value: depends on which head is used as primary head */
97 if (!si
->ps
.crtc2_prim
)
102 max_pclk
= si
->ps
.max_dac1_clock_8
;
106 max_pclk
= si
->ps
.max_dac1_clock_16
;
109 max_pclk
= si
->ps
.max_dac1_clock_24
;
112 max_pclk
= si
->ps
.max_dac1_clock_32
;
115 /* use fail-safe value */
116 max_pclk
= si
->ps
.max_dac1_clock_32
;
125 max_pclk
= si
->ps
.max_dac2_clock_8
;
129 max_pclk
= si
->ps
.max_dac2_clock_16
;
132 max_pclk
= si
->ps
.max_dac2_clock_24
;
135 max_pclk
= si
->ps
.max_dac2_clock_32
;
138 /* use fail-safe value */
139 max_pclk
= si
->ps
.max_dac2_clock_32
;
143 /* return values in kHz */
144 *high
= max_pclk
* 1000;
147 /* clamp lower limit to 48Hz vertical refresh for now.
148 * Apparantly the BeOS screenprefs app does limit the upper refreshrate to 90Hz,
149 * while it does not limit the lower refreshrate. */
150 min_pclk
= ((uint32
)dm
->timing
.h_total
* (uint32
)dm
->timing
.v_total
* 48) / 1000;
151 if (min_pclk
> *low
) *low
= min_pclk
;
156 /* Return the semaphore id that will be used to signal a vertical sync occured. */
157 sem_id
ACCELERANT_RETRACE_SEMAPHORE(void)
159 if (si
->ps
.int_assigned
)