gfx_disp.c revision f29dbc25
1/* Copyright (c) 2005 Advanced Micro Devices, Inc.
2 *
3 * Permission is hereby granted, free of charge, to any person obtaining a copy
4 * of this software and associated documentation files (the "Software"), to
5 * deal in the Software without restriction, including without limitation the
6 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7 * sell copies of the Software, and to permit persons to whom the Software is
8 * furnished to do so, subject to the following conditions:
9 *
10 * The above copyright notice and this permission notice shall be included in
11 * all copies or substantial portions of the Software.
12 *
13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19 * IN THE SOFTWARE.
20 *
21 * Neither the name of the Advanced Micro Devices, Inc. nor the names of its
22 * contributors may be used to endorse or promote products derived from this
23 * software without specific prior written permission.
24 * */
25
26/*
27  *  This file contains routines to program the display controller.
28  *
29  *  The "disp_gu1.c" and "disp_gu2.c" files implement the following routines:
30  *
31  *     gfx_get_display_mode_count
32  *     gfx_get_display_mode
33  *     gfx_is_display_mode_supported
34  *     gfx_is_panel_mode_supported
35  *     gfx_get_display_details
36  *     gfx_set_display_mode
37  *     gfx_set_display_bpp
38  * 	gfx_set_display_timings
39  *     gfx_set_vtotal
40  *     gfx_get_display_pitch
41  *     gfx_set_display_pitch
42  *     gfx_set_display_offset
43  *     gfx_set_display_palette
44  *     gfx_set_display_palette_entry
45  *     gfx_set_cursor_enable
46  *     gfx_set_cursor_colors
47  *     gfx_set_cursor_position
48  * 	gfx_set_cursor_shape32
49  * 	gfx_set_cursor_shape64
50  *     gfx_set_compression_enable
51  *     gfx_set_compression_offset
52  *     gfx_set_compression_pitch
53  *     gfx_set_compression_size
54  *     gfx_set_display_priority_high
55  *     gfx_set_panel_present
56  *     gfx_test_timing_active
57  *     gfx_test_vertical_active
58  *     gfx_wait_vertical_blank
59  *     gfx_reset_timing_lock
60  *
61  *  And the following routines if GFX_READ_ROUTINES is set:
62  *
63  * 	gfx_get_hactive
64  *     gfx_get_hblank_start
65  *     gfx_get_hsync_start
66  *     gfx_get_hsync_end
67  *     gfx_get_hblank_end
68  *     gfx_get_htotal
69  *     gfx_get_vactive
70  *     gfx_get_vblank_start
71  *     gfx_get_vsync_start
72  *     gfx_get_vsync_end
73  *     gfx_get_vblank_end
74  *     gfx_get_vtotal
75  *     gfx_get_vline
76  *     gfx_get_display_bpp
77  *     gfx_get_display_offset
78  *     gfx_get_display_palette
79  *     gfx_get_cursor_enable
80  *     gfx_get_cursor_base
81  *     gfx_get_cursor_position
82  *     gfx_get_cursor_offset
83  *     gfx_get_cursor_color
84  *     gfx_get_compression_enable
85  *     gfx_get_compression_offset
86  *     gfx_get_compression_pitch
87  *     gfx_get_compression_size
88  *     gfx_get_display_priority_high
89  *     gfx_get_valid_bit
90  * */
91
92unsigned short PanelWidth = 0;
93unsigned short PanelHeight = 0;
94unsigned short PanelEnable = 0;
95unsigned short ModeWidth;
96unsigned short ModeHeight;
97
98int DeltaX = 0;
99int DeltaY = 0;
100unsigned long prevstartAddr = 0;
101unsigned long panelTop = 0;
102unsigned long panelLeft = 0;
103
104int gbpp = 8;
105
106int gfx_compression_enabled = 0;
107int gfx_compression_active = 0;
108int gfx_line_double = 0;
109int gfx_pixel_double = 0;
110int gfx_timing_lock = 0;
111DISPLAYMODE gfx_display_mode;
112
113/* DISPLAY MODE TIMINGS */
114
115DISPLAYMODE DisplayParams[] = {
116
117/* 320 x 200 */
118
119    {
120            GFX_MODE_70HZ |            /* refresh rate = 60  */
121            GFX_MODE_8BPP | GFX_MODE_16BPP |    /* 8 and 16 BPP valid */
122            GFX_MODE_NEG_HSYNC |       /* negative HSYNC     */
123            GFX_MODE_PIXEL_DOUBLE |    /* Double width       */
124            GFX_MODE_LINE_DOUBLE,      /* Double height      */
125            0x140, 0x288, 0x290, 0x2F0, 0x318, 0x320,   /* horizontal timings */
126            0x0C8, 0x197, 0x19C, 0x19E, 0x1BA, 0x1C1,   /* vertical timings   */
127            0x00192CCC,                /* freq = 25.175 MHz  */
128        },
129
130/* 320 x 240 */
131
132    {
133            GFX_MODE_75HZ |            /* refresh rate = 75  */
134            GFX_MODE_8BPP | GFX_MODE_16BPP |    /* 8 and 16 BPP valid */
135            GFX_MODE_NEG_HSYNC | GFX_MODE_NEG_VSYNC |   /* negative syncs     */
136            GFX_MODE_PIXEL_DOUBLE |    /* Double width       */
137            GFX_MODE_LINE_DOUBLE,      /* Double height      */
138            0x0140, 0x0280, 0x0290, 0x02D0, 0x0348, 0x0348,
139            /* horizontal timings */
140            0x00F0, 0x01E0, 0x01E1, 0x01E4, 0x01F4, 0x01F4,
141            /* vertical timings   */
142            0x001F8000,                /* freq = 31.5 MHz    */
143        },
144
145/* 400 x 300 */
146
147    {
148            GFX_MODE_75HZ |            /* refresh rate = 75  */
149            GFX_MODE_8BPP | GFX_MODE_16BPP |    /* 8 and 16 BPP valid */
150            GFX_MODE_PIXEL_DOUBLE |    /* Double width       */
151            GFX_MODE_LINE_DOUBLE,      /* Double height      */
152            0x0190, 0x0320, 0x0330, 0x0380, 0x0420, 0x0420,
153            /* horizontal timings */
154            0x012C, 0x0258, 0x0259, 0x025C, 0x0271, 0x0271,
155            /* vertical timings   */
156            0x00318000,                /* freq = 49.5 MHz    */
157        },
158
159/* 512 x 384 */
160
161    {
162            GFX_MODE_75HZ |            /* refresh rate = 75  */
163            GFX_MODE_8BPP | GFX_MODE_16BPP |    /* 8 and 16 BPP valid */
164            GFX_MODE_PIXEL_DOUBLE |    /* Double width       */
165            GFX_MODE_LINE_DOUBLE,      /* Double height      */
166            0x0200, 0x0400, 0x0410, 0x0470, 0x0520, 0x0520,
167            /* horizontal timings */
168            0x0180, 0x0300, 0x0301, 0x0304, 0x0320, 0x0320,
169            /* vertical timings   */
170            0x004EC000,                /* freq = 78.75 MHz   */
171        },
172
173/* 640 x 400 */
174
175    {
176            GFX_MODE_70HZ |            /* refresh rate = 60  */
177            GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
178            /* all BPP valid      */
179            GFX_MODE_16BPP | GFX_MODE_24BPP | GFX_MODE_NEG_HSYNC,
180            /* negative HSYNC     */
181            0x280, 0x288, 0x290, 0x2F0, 0x318, 0x320,   /* horizontal timings */
182            0x190, 0x197, 0x19C, 0x19E, 0x1BA, 0x1C1,   /* vertical timings   */
183            0x00192CCC,                /* freq = 25.175 MHz  */
184        },
185
186/* 640x480 */
187
188    {
189            GFX_MODE_60HZ |            /* refresh rate = 60  */
190            GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
191            /* all BPP valid      */
192            GFX_MODE_16BPP | GFX_MODE_24BPP | GFX_MODE_NEG_HSYNC | GFX_MODE_NEG_VSYNC,  /* negative syncs     */
193            0x0280, 0x0288, 0x0290, 0x02E8, 0x0318, 0x0320,
194            /* horizontal timings */
195            0x01E0, 0x01E8, 0x01EA, 0x01EC, 0x0205, 0x020D,
196            /* vertical timings   */
197            0x00192CCC,                /* freq = 25.175 MHz  */
198        },
199
200    {
201            GFX_MODE_70HZ |            /* refresh rate = 60  */
202            GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
203            /* all BPP valid      */
204            GFX_MODE_16BPP | GFX_MODE_24BPP,
205            0x0280, 0x0280, 0x0298, 0x02D8, 0x0330, 0x0330,
206            /* horizontal timings */
207            0x01E0, 0x01E0, 0x01E2, 0x01E5, 0x01F4, 0x01F4,
208            /* vertical timings   */
209            0x001C8F5C,                /* freq = 28.560 MHz  */
210        },
211
212    {
213            GFX_MODE_72HZ |            /* refresh rate = 72  */
214            GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
215            /* all BPP valid      */
216            GFX_MODE_16BPP | GFX_MODE_24BPP | GFX_MODE_NEG_HSYNC | GFX_MODE_NEG_VSYNC,  /* negative syncs     */
217            0x0280, 0x0288, 0x0298, 0x02c0, 0x0338, 0x0340,
218            /* horizontal timings */
219            0x01e0, 0x01e8, 0x01e9, 0x01ec, 0x0200, 0x0208,
220            /* vertical timings   */
221            0x001F8000,                /* freq = 31.5 MHz    */
222        },
223
224    {
225            GFX_MODE_75HZ |            /* refresh rate = 75  */
226            GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
227            /* all BPP valid      */
228            GFX_MODE_16BPP | GFX_MODE_24BPP | GFX_MODE_NEG_HSYNC | GFX_MODE_NEG_VSYNC,  /* negative syncs     */
229            0x0280, 0x0280, 0x0290, 0x02D0, 0x0348, 0x0348,
230            /* horizontal timings */
231            0x01E0, 0x01E0, 0x01E1, 0x01E4, 0x01F4, 0x01F4,
232            /* vertical timings   */
233            0x001F8000,                /* freq = 31.5 MHz    */
234        },
235
236    {
237            GFX_MODE_85HZ |            /* refresh rate = 85  */
238            GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
239            /* all BPP valid      */
240            GFX_MODE_16BPP | GFX_MODE_24BPP | GFX_MODE_NEG_HSYNC | GFX_MODE_NEG_VSYNC,  /* negative syncs     */
241            0x0280, 0x0280, 0x02B8, 0x02F0, 0x0340, 0x0340,
242            /* horizontal timings */
243            0x01E0, 0x01E0, 0x01E1, 0x01E4, 0x01FD, 0x01FD,
244            /* vertical timings   */
245            0x00240000,                /* freq = 36.0 MHz    */
246        },
247
248    {
249            GFX_MODE_90HZ |            /* refresh rate = 90  */
250            GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
251            /* all BPP valid      */
252            GFX_MODE_16BPP | GFX_MODE_24BPP,
253            0x0280, 0x0280, 0x02A0, 0x02E0, 0x0340, 0x0340,
254            /* horizontal timings */
255            0x01E0, 0x01E0, 0x01E1, 0x01E4, 0x01FA, 0x01FA,
256            /* vertical timings   */
257            0x0025E395,                /* freq = 37.889 MHz  */
258        },
259
260    {
261            GFX_MODE_100HZ |           /* refresh rate = 100 */
262            GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
263            /* all BPP valid      */
264            GFX_MODE_16BPP | GFX_MODE_24BPP,
265            0x0280, 0x0280, 0x02A8, 0x02E8, 0x0350, 0x0350,
266            /* horizontal timings */
267            0x01E0, 0x01E0, 0x01E1, 0x01E4, 0x01FD, 0x01FD,
268            /* vertical timings   */
269            0x002B29BA,                /* freq = 43.163 MHz  */
270        },
271
272/* 800x600 */
273
274    {
275            GFX_MODE_56HZ |            /* refresh rate = 56  */
276            GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
277            /* all BPP valid      */
278            GFX_MODE_16BPP | GFX_MODE_24BPP,
279            0x0320, 0x0320, 0x0338, 0x0380, 0x0400, 0x0400,
280            /* horizontal timings */
281            0x0258, 0x0258, 0x0259, 0x025B, 0x0271, 0x0271,
282            /* vertical timings   */
283            0x00240000,                /* freq = 36.00 MHz   */
284        },
285
286    {
287            GFX_MODE_60HZ |            /* refresh rate = 60  */
288            GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
289            /* all BPP valid      */
290            GFX_MODE_16BPP | GFX_MODE_24BPP,
291            0x0320, 0x0328, 0x0348, 0x03D0, 0x0418, 0x0420,
292            /* horizontal timings */
293            0x0258, 0x0258, 0x0259, 0x025D, 0x0274, 0x0274,
294            /* vertical timings   */
295            0x00280000,                /* freq = 40.00 MHz   */
296        },
297
298    {
299            GFX_MODE_70HZ |            /* refresh rate = 70  */
300            GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
301            /* all BPP valid      */
302            GFX_MODE_16BPP | GFX_MODE_24BPP,
303            0x0320, 0x0320, 0x0348, 0x0398, 0x0410, 0x0410,
304            /* horizontal timings */
305            0x0258, 0x0258, 0x025c, 0x025F, 0x0274, 0x0274,
306            /* vertical timings   */
307            0x002DB851,                /* freq = 45.72 MHz   */
308        },
309
310    {
311            GFX_MODE_72HZ |            /* refresh rate = 72  */
312            GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
313            /* all BPP valid      */
314            GFX_MODE_16BPP | GFX_MODE_24BPP,
315            0x0320, 0x0320, 0x0358, 0x03D0, 0x0410, 0x0410,
316            /* horizontal timings */
317            0x0258, 0x0258, 0x027D, 0x0283, 0x029A, 0x029A,
318            /* vertical timings   */
319            0x00320000,                /* freq = 49.5 MHz    */
320        },
321
322    {
323            GFX_MODE_75HZ |            /* refresh rate = 75  */
324            GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
325            /* all BPP valid      */
326            GFX_MODE_16BPP | GFX_MODE_24BPP,
327            0x0320, 0x0320, 0x0330, 0x0380, 0x0420, 0x0420,
328            /* horizontal timings */
329            0x0258, 0x0258, 0x0259, 0x025C, 0x0271, 0x0271,
330            /* vertical timings   */
331            0x00318000,                /* freq = 49.5 MHz    */
332        },
333
334    {
335            GFX_MODE_85HZ |            /* refresh rate = 85  */
336            GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
337            /* all BPP valid      */
338            GFX_MODE_16BPP | GFX_MODE_24BPP,
339            0x0320, 0x0320, 0x0340, 0x0380, 0x0418, 0x0418,
340            /* horizontal timings */
341            0x0258, 0x0258, 0x0259, 0x025C, 0x0277, 0x0277,
342            /* vertical timings   */
343            0x00384000,                /* freq = 56.25 MHz   */
344        },
345
346    {
347            GFX_MODE_90HZ |            /* refresh rate = 90  */
348            GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
349            /* all BPP valid      */
350            GFX_MODE_16BPP | GFX_MODE_24BPP,
351            0x0320, 0x0320, 0x0348, 0x03A0, 0x0420, 0x0420,
352            /* horizontal timings */
353            0x0258, 0x0258, 0x0259, 0x025C, 0x0278, 0x0278,
354            /* vertical timings   */
355            0x003C10A3,                /* freq = 60.065 MHz   */
356        },
357
358    {
359            GFX_MODE_100HZ |           /* refresh rate = 100 */
360            GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
361            /* all BPP valid      */
362            GFX_MODE_16BPP | GFX_MODE_24BPP,
363            0x0320, 0x0320, 0x0350, 0x03A8, 0x0430, 0x0430,
364            /* horizontal timings */
365            0x0258, 0x0258, 0x0259, 0x025C, 0x0277, 0x027C,
366            /* vertical timings   */
367            0x00442DD2,                /* freq = 68.179 MHz  */
368        },
369
370/* 1024x768 */
371
372    {
373            GFX_MODE_60HZ |            /* refresh rate = 60  */
374            GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
375            /* all BPP valid      */
376            GFX_MODE_16BPP | GFX_MODE_24BPP | GFX_MODE_NEG_HSYNC | GFX_MODE_NEG_VSYNC,  /* negative syncs     */
377            0x0400, 0x0400, 0x0418, 0x04A0, 0x0540, 0x0540,
378            /* horizontal timings */
379            0x0300, 0x0300, 0x0303, 0x0309, 0x0326, 0x0326,
380            /* vertical timings   */
381            0x00410000,                /* freq = 65.00 MHz   */
382        },
383
384    {
385            GFX_MODE_70HZ |            /* refresh rate = 70  */
386            GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
387            /* all BPP valid      */
388            GFX_MODE_16BPP | GFX_MODE_24BPP | GFX_MODE_NEG_HSYNC | GFX_MODE_NEG_VSYNC,  /* negative syncs     */
389            0x0400, 0x0400, 0x0418, 0x04A0, 0x0530, 0x0530,
390            /* horizontal timings */
391            0x0300, 0x0300, 0x0303, 0x0309, 0x0326, 0x0326,
392            /* vertical timings   */
393            0x004B0000,                /* freq = 75.00 MHz   */
394        },
395
396    {
397            GFX_MODE_72HZ |            /* refresh rate = 72  */
398            GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
399            /* all BPP valid      */
400            GFX_MODE_16BPP | GFX_MODE_24BPP,
401            0x0400, 0x0400, 0x0438, 0x04A8, 0x0550, 0x0550,
402            /* horizontal timings */
403            0x0300, 0x0300, 0x0304, 0x0307, 0x0324, 0x0324,
404            /* vertical timings   */
405            0x004EC000,                /* freq = 78.75 MHz   */
406        },
407
408    {
409            GFX_MODE_75HZ |            /* refresh rate = 75  */
410            GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
411            /* all BPP valid      */
412            GFX_MODE_16BPP | GFX_MODE_24BPP,
413            0x0400, 0x0400, 0x0410, 0x0470, 0x0520, 0x0520,
414            /* horizontal timings */
415            0x0300, 0x0300, 0x0301, 0x0304, 0x0320, 0x0320,
416            /* vertical timings   */
417            0x004EC000,                /* freq = 78.75 MHz   */
418        },
419
420    {
421            GFX_MODE_85HZ |            /* refresh rate = 85  */
422            GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
423            /* all BPP valid      */
424            GFX_MODE_16BPP | GFX_MODE_24BPP,
425            0x0400, 0x0400, 0x0430, 0x0490, 0x0560, 0x0560,
426            /* horizontal timings */
427            0x0300, 0x0300, 0x0301, 0x0304, 0x0328, 0x0328,
428            /* vertical timings   */
429            0x005E8000,                /* freq = 94.50 MHz   */
430        },
431
432    {
433            GFX_MODE_90HZ |            /* refresh rate = 90  */
434            GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
435            /* all BPP valid      */
436            GFX_MODE_16BPP | GFX_MODE_24BPP,
437            0x0400, 0x0400, 0x0440, 0x04B0, 0x0560, 0x0560,
438            /* horizontal timings */
439            0x0300, 0x0300, 0x0301, 0x0304, 0x0329, 0x0329,
440            /* vertical timings   */
441            0x00642FDF,                /* freq = 100.187 MHz */
442        },
443
444    {
445            GFX_MODE_100HZ |           /* refresh rate = 100 */
446            GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
447            /* all BPP valid      */
448            GFX_MODE_16BPP | GFX_MODE_24BPP,
449            0x0400, 0x0400, 0x0448, 0x04B8, 0x0570, 0x0570,
450            /* horizontal timings */
451            0x0300, 0x0300, 0x0301, 0x0304, 0x032E, 0x032E,
452            /* vertical timings   */
453            0x00714F1A,                /* freq = 113.309 MHz */
454        },
455
456/* 1152x864 */
457
458    {
459            GFX_MODE_60HZ |            /* refresh rate = 60  */
460            GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
461            /* all BPP valid      */
462            GFX_MODE_16BPP | GFX_MODE_24BPP,
463            0x0480, 0x0480, 0x04C0, 0x0538, 0x05F0, 0x05F0,
464            /* horizontal timings */
465            0x0360, 0x0360, 0x0361, 0x0364, 0x037F, 0x037F,
466            /* vertical timings   */
467            0x00519999,                /* freq = 81.60 MHz  */
468        },
469
470    {
471            GFX_MODE_70HZ |            /* refresh rate = 70  */
472            GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
473            /* all BPP valid      */
474            GFX_MODE_16BPP | GFX_MODE_24BPP,
475            0x0480, 0x0480, 0x04C8, 0x0540, 0x0600, 0x0600,
476            /* horizontal timings */
477            0x0360, 0x0360, 0x0368, 0x036B, 0x038B, 0x038B,
478            /* vertical timings   */
479            0x00618560,                /* freq = 97.521 MHz  */
480        },
481
482    {
483            GFX_MODE_72HZ |            /* refresh rate = 70  */
484            GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
485            /* all BPP valid      */
486            GFX_MODE_16BPP | GFX_MODE_24BPP,
487            0x0480, 0x0480, 0x04C8, 0x0548, 0x0610, 0x0610,
488            /* horizontal timings */
489            0x0360, 0x0360, 0x0367, 0x036A, 0x038B, 0x038B,
490            /* vertical timings   */
491            0x00656B85,                /* freq = 101.42 MHz  */
492        },
493
494    {
495            GFX_MODE_75HZ |            /* refresh rate = 75  */
496            GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
497            /* all BPP valid      */
498            GFX_MODE_16BPP | GFX_MODE_24BPP,
499            0x0480, 0x0480, 0x04C0, 0x0540, 0x0640, 0x0640,
500            /* horizontal timings */
501            0x0360, 0x0360, 0x0361, 0x0364, 0x0384, 0x0384,
502            /* vertical timings   */
503            0x006C0000,                /* freq = 108.00 MHz  */
504        },
505
506    {
507            GFX_MODE_85HZ |            /* refresh rate = 85  */
508            GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
509            /* all BPP valid      */
510            GFX_MODE_16BPP | GFX_MODE_24BPP,
511            0x0480, 0x0480, 0x04C8, 0x0548, 0x0610, 0x0610,
512            /* horizontal timings */
513            0x0360, 0x0360, 0x0363, 0x0366, 0x038B, 0x038B,
514            /* vertical timings   */
515            0x0077A666,                /* freq = 119.65 MHz  */
516        },
517
518    {
519            GFX_MODE_90HZ |            /* refresh rate = 90  */
520            GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
521            /* all BPP valid      */
522            GFX_MODE_16BPP | GFX_MODE_24BPP,
523            0x0480, 0x0480, 0x04D0, 0x0550, 0x0620, 0x0620,
524            /* horizontal timings */
525            0x0360, 0x0360, 0x0363, 0x0366, 0x038E, 0x038E,
526            /* vertical timings   */
527            0x00806666,                /* freq = 128.40 MHz  */
528        },
529
530    {
531            GFX_MODE_100HZ |           /* refresh rate = 100 */
532            GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
533            /* all BPP valid      */
534            GFX_MODE_16BPP | GFX_MODE_24BPP,
535            0x0480, 0x0480, 0x04D0, 0x0550, 0x0620, 0x0620,
536            /* horizontal timings */
537            0x0360, 0x0360, 0x0365, 0x0368, 0x0398, 0x0398,
538            /* vertical timings   */
539            0x00906147,                /* freq = 144.38 MHz  */
540        },
541
542/* 1280x1024 */
543
544    {
545            GFX_MODE_60HZ |            /* refresh rate = 60  */
546            GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
547            /* all BPP valid      */
548            GFX_MODE_16BPP | GFX_MODE_24BPP,
549            0x0500, 0x0500, 0x0530, 0x05A0, 0x0698, 0x0698,
550            /* horizontal timings */
551            0x0400, 0x0400, 0x0401, 0x0404, 0x042A, 0x042A,
552            /* vertical timings   */
553            0x006C0000,                /* freq = 108.0 MHz   */
554        },
555
556    {
557            GFX_MODE_70HZ |            /* refresh rate = 70  */
558            GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
559            /* all BPP valid      */
560            GFX_MODE_16BPP | GFX_MODE_24BPP,
561            0x0500, 0x0500, 0x0558, 0x05E0, 0x06C0, 0x06C0,
562            /* horizontal timings */
563            0x0400, 0x0400, 0x040A, 0x040D, 0x0433, 0x0433,
564            /* vertical timings   */
565            0x00821999,                /* freq = 130.1 MHz   */
566        },
567
568    {
569            GFX_MODE_72HZ |            /* refresh rate = 72  */
570            GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
571            /* all BPP valid      */
572            GFX_MODE_16BPP | GFX_MODE_24BPP,
573            0x0500, 0x0500, 0x0558, 0x05E0, 0x06C0, 0x06C0,
574            /* horizontal timings */
575            0x0400, 0x0400, 0x0407, 0x040A, 0x0431, 0x0431,
576            /* vertical timings   */
577            0x00858000,                /* freq = 133.5 MHz   */
578        },
579
580    {
581            GFX_MODE_75HZ |            /* refresh rate = 75  */
582            GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
583            /* all BPP valid      */
584            GFX_MODE_16BPP | GFX_MODE_24BPP,
585            0x0500, 0x0500, 0x0510, 0x05A0, 0x0698, 0x0698,
586            /* horizontal timings */
587            0x0400, 0x0400, 0x0401, 0x0404, 0x042A, 0x042A,
588            /* vertical timings   */
589            0x00870000,                /* freq = 135.0 MHz   */
590        },
591
592    {
593            GFX_MODE_85HZ |            /* refresh rate = 85  */
594            GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
595            /* all BPP valid      */
596            GFX_MODE_16BPP | GFX_MODE_24BPP,
597            0x0500, 0x0500, 0x0540, 0x05E0, 0x06C0, 0x06C0,
598            /* horizontal timings */
599            0x0400, 0x0400, 0x0401, 0x0404, 0x0430, 0x0430,
600            /* vertical timings   */
601            0x009D8000,                /* freq = 157.5 MHz   */
602        },
603
604    {
605            GFX_MODE_90HZ |            /* refresh rate = 90  */
606            GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
607            /* all BPP valid      */
608            GFX_MODE_16BPP | GFX_MODE_24BPP,
609            0x0500, 0x0500, 0x0560, 0x05E8, 0x06D0, 0x06D0,
610            /* horizontal timings */
611            0x0400, 0x0400, 0x0401, 0x0404, 0x0436, 0x0436,
612            /* vertical timings   */
613            0x00A933F7,                /* freq = 169.203 MHz */
614        },
615
616    {
617            GFX_MODE_100HZ |           /* refresh rate = 100 */
618            GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
619            /* all BPP valid      */
620            GFX_MODE_16BPP | GFX_MODE_24BPP,
621            0x0500, 0x0500, 0x0560, 0x05F0, 0x06E0, 0x06E0,
622            /* horizontal timings */
623            0x0400, 0x0400, 0x0401, 0x0404, 0x043D, 0x043D,
624            /* vertical timings   */
625            0x00BEF5C2,                /* freq = 190.96 MHz  */
626        },
627
628/*********************************/
629/* BEGIN REDCLOUD-SPECIFIC MODES */
630/*-------------------------------*/
631
632/* 1600 x 1200 */
633
634    {
635            GFX_MODE_60HZ |            /* refresh rate = 60  */
636            GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
637            /* all BPP valid      */
638            GFX_MODE_16BPP | GFX_MODE_24BPP,
639            0x0640, 0x0640, 0x0680, 0x0740, 0x0870, 0x0870,
640            /* horizontal timings */
641            0x04B0, 0x04B0, 0x04B1, 0x04B4, 0x04E2, 0x04E2,
642            /* vertical timings   */
643            0x00A20000,                /* freq = 162.0 MHz   */
644        },
645
646    {
647            GFX_MODE_70HZ |            /* refresh rate = 70  */
648            GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
649            /* all BPP valid      */
650            GFX_MODE_16BPP | GFX_MODE_24BPP,
651            0x0640, 0x0640, 0x0680, 0x0740, 0x0870, 0x0870,
652            /* horizontal timings */
653            0x04B0, 0x04B0, 0x04B1, 0x04B4, 0x04E2, 0x04E2,
654            /* vertical timings   */
655            0x00BD0000,                /* freq = 189.0 MHz   */
656        },
657
658    {
659            GFX_MODE_72HZ |            /* refresh rate = 72  */
660            GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
661            /* all BPP valid      */
662            GFX_MODE_16BPP | GFX_MODE_24BPP,
663            0x0640, 0x0640, 0x06B0, 0x0760, 0x0880, 0x0880,
664            /* horizontal timings */
665            0x04B0, 0x04B0, 0x04BD, 0x04C0, 0x04EF, 0x04EF,
666            /* vertical timings   */
667            0x00C60000,                /* freq = 198.0 MHz   */
668        },
669
670    {
671            GFX_MODE_75HZ |            /* refresh rate = 75  */
672            GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
673            /* all BPP valid      */
674            GFX_MODE_16BPP | GFX_MODE_24BPP,
675            0x0640, 0x0640, 0x0680, 0x0740, 0x0870, 0x0870,
676            /* horizontal timings */
677            0x04B0, 0x04B0, 0x04B1, 0x04B4, 0x04E2, 0x04E2,
678            /* vertical timings   */
679            0x00CA8000,                /* freq = 202.5 MHz   */
680        },
681
682    {
683            GFX_MODE_85HZ |            /* refresh rate = 85  */
684            GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
685            /* all BPP valid      */
686            GFX_MODE_16BPP | GFX_MODE_24BPP,
687            0x0640, 0x0640, 0x0680, 0x0740, 0x0870, 0x0870,
688            /* horizontal timings */
689            0x04B0, 0x04B0, 0x04B1, 0x04B4, 0x04E2, 0x04E2,
690            /* vertical timings   */
691            0x00E58000,                /* freq = 229.5 MHz   */
692        },
693};
694
695/* UPDATE THIS VARIABLE WHENEVER NEW REDCLOUD-SPECIFIC MODES ARE ADDED */
696
697#define REDCLOUD_SPECIFIC_MODES 4
698
699#define NUM_RC_DISPLAY_MODES sizeof(DisplayParams) / sizeof(DISPLAYMODE)
700#define NUM_GX_DISPLAY_MODES (NUM_RC_DISPLAY_MODES - REDCLOUD_SPECIFIC_MODES)
701
702FIXEDTIMINGS FixedParams[] = {
703/* 640x480 Panel */
704    {640, 480, 640, 480,
705            0x0280, 0x0280, 0x0290, 0x02E8, 0x0318, 0x0320,
706            0x01E0, 0x01E0, 0x01EA, 0x01EC, 0x0205, 0x020D,
707            0x00192CCC,
708        },
709
710    {640, 480, 800, 600,
711            0x0280, 0x0280, 0x0290, 0x02E8, 0x0318, 0x0320,
712            0x01E0, 0x01E0, 0x01EA, 0x01EC, 0x0205, 0x020D,
713            0x00192CCC,
714        },
715
716    {640, 480, 1024, 768,
717            0x0280, 0x0280, 0x0290, 0x02E8, 0x0318, 0x0320,
718            0x01E0, 0x01E0, 0x01EA, 0x01EC, 0x0205, 0x020D,
719            0x00192CCC,
720        },
721
722    {640, 480, 1152, 864,
723            0x0280, 0x0280, 0x0290, 0x02E8, 0x0318, 0x0320,
724            0x01E0, 0x01E0, 0x01EA, 0x01EC, 0x0205, 0x020D,
725            0x00192CCC,
726        },
727
728    {640, 480, 1280, 1024,
729            0x0280, 0x0280, 0x0290, 0x02E8, 0x0318, 0x0320,
730            0x01E0, 0x01E0, 0x01EA, 0x01EC, 0x0205, 0x020D,
731            0x00192CCC,
732        },
733
734    {640, 480, 1600, 1200,
735            0x0280, 0x0280, 0x0290, 0x02E8, 0x0318, 0x0320,
736            0x01E0, 0x01E0, 0x01EA, 0x01EC, 0x0205, 0x020D,
737            0x00192CCC,
738        },
739
740/* 800x600 Panel */
741    {800, 600, 640, 480,
742            0x0280, 0x2d0, 0x2f8, 0x378, 0x3d0, 0x420,
743            0x1e0, 0x21c, 0x21d, 0x221, 0x238, 0x274,
744            0x00280000,
745        },
746
747    {800, 600, 800, 600,
748            0x320, 0x320, 0x348, 0x3c8, 0x420, 0x420,
749            0x258, 0x258, 0x259, 0x25d, 0x274, 0x274,
750            0x00280000,
751        },
752
753    {800, 600, 1024, 768,
754            0x320, 0x320, 0x348, 0x3c8, 0x420, 0x420,
755            0x258, 0x258, 0x259, 0x25d, 0x274, 0x274,
756            0x00280000,
757        },
758
759    {800, 600, 1152, 864,
760            0x320, 0x320, 0x348, 0x3c8, 0x420, 0x420,
761            0x258, 0x258, 0x259, 0x25d, 0x274, 0x274,
762            0x00280000,
763        },
764
765    {800, 600, 1280, 1024,
766            0x320, 0x320, 0x348, 0x3c8, 0x420, 0x420,
767            0x258, 0x258, 0x259, 0x25d, 0x274, 0x274,
768            0x00280000,
769        },
770
771    {800, 600, 1600, 1200,
772            0x320, 0x320, 0x348, 0x3c8, 0x420, 0x420,
773            0x258, 0x258, 0x259, 0x25d, 0x274, 0x274,
774            0x00280000,
775        },
776
777/* 1024x768 panel */
778    {1024, 768, 640, 480,
779            0x0280, 0x340, 0x368, 0x3e8, 0x480, 0x540,
780            0x1e0, 0x270, 0x271, 0x275, 0x296, 0x326,
781            0x00410000,
782        },
783
784    {1024, 768, 800, 600,
785            0x0320, 0x390, 0x3b8, 0x438, 0x4D0, 0x540,
786            0x258, 0x2ac, 0x2ad, 0x2b1, 0x2D2, 0x326,
787            0x00410000,
788        },
789
790    {1024, 768, 1024, 768,
791            0x0400, 0x0400, 0x0418, 0x04A0, 0x0540, 0x0540,
792            0x0300, 0x0300, 0x0303, 0x0309, 0x0326, 0x0326,
793            0x00410000,
794        },
795
796    {1024, 768, 1152, 864,
797            0x0400, 0x0400, 0x0418, 0x04A0, 0x0540, 0x0540,
798            0x0300, 0x0300, 0x0303, 0x0309, 0x0326, 0x0326,
799            0x00410000,
800        },
801
802    {1024, 768, 1280, 1024,
803            0x0400, 0x0400, 0x0418, 0x04A0, 0x0540, 0x0540,
804            0x0300, 0x0300, 0x0303, 0x0309, 0x0326, 0x0326,
805            0x00410000,
806        },
807
808    {1024, 768, 1600, 1200,
809            0x0400, 0x0400, 0x0418, 0x04A0, 0x0540, 0x0540,
810            0x0300, 0x0300, 0x0303, 0x0309, 0x0326, 0x0326,
811            0x00410000,
812        },
813
814/* 1280x1024 panel */
815    {1280, 1024, 640, 480,
816            640, 960, 1008, 1120, 1368, 1688,
817            480, 752, 753, 756, 794, 1066,
818            0x006C0000,
819        },
820
821    {1280, 1024, 800, 600,
822            800, 1040, 1088, 1200, 1448, 1688,
823            600, 812, 813, 816, 854, 1066,
824            0x006C0000,
825        },
826
827    {1280, 1024, 1024, 768,
828            1024, 1152, 1200, 1312, 1560, 1688,
829            768, 896, 897, 900, 938, 1066,
830            0x006C0000,
831        },
832
833    {1280, 1024, 1152, 864,
834            1152, 1216, 1264, 1376, 1624, 1688,
835            864, 944, 945, 948, 986, 1066,
836            0x006C0000,
837        },
838
839    {1280, 1024, 1280, 1024,
840            1280, 1280, 1328, 1440, 1688, 1688,
841            1024, 1024, 1025, 1028, 1066, 1066,
842            0x006C0000,
843        },
844
845};
846
847#define NUM_FIXED_TIMINGS_MODES sizeof(FixedParams)/sizeof(FIXEDTIMINGS)
848
849/* INCLUDE SUPPORT FOR FIRST GENERATION, IF SPECIFIED. */
850
851#if GFX_DISPLAY_GU1
852#include "disp_gu1.c"
853#endif
854
855/* INCLUDE SUPPORT FOR SECOND GENERATION, IF SPECIFIED. */
856
857#if GFX_DISPLAY_GU2
858#include "disp_gu2.c"
859#endif
860
861/*---------------------------------------------------------------------------
862 * gfx_reset_timing_lock
863 *
864 * This routine resets the timing change lock. The lock can only be set by
865 * setting a flag when calling mode set.
866 *---------------------------------------------------------------------------
867 */
868void
869gfx_reset_timing_lock(void)
870{
871    gfx_timing_lock = 0;
872}
873
874/* WRAPPERS IF DYNAMIC SELECTION */
875/* Extra layer to call either first or second generation routines. */
876
877#if GFX_DISPLAY_DYNAMIC
878
879/*---------------------------------------------------------------------------
880 * gfx_set_display_bpp
881 *---------------------------------------------------------------------------
882 */
883int
884gfx_set_display_bpp(unsigned short bpp)
885{
886    int retval = 0;
887
888#if GFX_DISPLAY_GU1
889    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
890        retval = gu1_set_display_bpp(bpp);
891#endif
892#if GFX_DISPLAY_GU2
893    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
894        retval = gu2_set_display_bpp(bpp);
895#endif
896    return (retval);
897}
898
899/*---------------------------------------------------------------------------
900 * gfx_is_display_mode_supported
901 * check if given mode supported,
902 * return the supported mode on success, -1 on fail
903 *---------------------------------------------------------------------------
904 */
905int
906gfx_is_display_mode_supported(int xres, int yres, int bpp, int hz)
907{
908    int retval = -1;
909
910#if GFX_DISPLAY_GU1
911    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
912        retval = gu1_is_display_mode_supported(xres, yres, bpp, hz);
913#endif
914#if GFX_DISPLAY_GU2
915    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
916        retval = gu2_is_display_mode_supported(xres, yres, bpp, hz);
917#endif
918    return (retval);
919}
920
921/*---------------------------------------------------------------------------
922 * gfx_set_display_mode
923 *---------------------------------------------------------------------------
924 */
925int
926gfx_set_display_mode(int xres, int yres, int bpp, int hz)
927{
928    int retval = 0;
929
930#if GFX_DISPLAY_GU1
931    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
932        retval = gu1_set_display_mode(xres, yres, bpp, hz);
933#endif
934#if GFX_DISPLAY_GU2
935    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
936        retval = gu2_set_display_mode(xres, yres, bpp, hz);
937#endif
938    return (retval);
939}
940
941/*---------------------------------------------------------------------------
942 * gfx_set_display_timings
943 *---------------------------------------------------------------------------
944 */
945int
946gfx_set_display_timings(unsigned short bpp, unsigned short flags,
947    unsigned short hactive, unsigned short hblankstart,
948    unsigned short hsyncstart, unsigned short hsyncend,
949    unsigned short hblankend, unsigned short htotal,
950    unsigned short vactive, unsigned short vblankstart,
951    unsigned short vsyncstart, unsigned short vsyncend,
952    unsigned short vblankend, unsigned short vtotal, unsigned long frequency)
953{
954    int retval = 0;
955
956#if GFX_DISPLAY_GU1
957    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
958        retval = gu1_set_display_timings(bpp, flags,
959            hactive, hblankstart, hsyncstart, hsyncend, hblankend, htotal,
960            vactive, vblankstart, vsyncstart, vsyncend, vblankend, vtotal,
961            frequency);
962#endif
963#if GFX_DISPLAY_GU2
964    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
965        retval = gu2_set_display_timings(bpp, flags,
966            hactive, hblankstart, hsyncstart, hsyncend, hblankend, htotal,
967            vactive, vblankstart, vsyncstart, vsyncend, vblankend, vtotal,
968            frequency);
969#endif
970    return (retval);
971}
972
973/*---------------------------------------------------------------------------
974 * gfx_set_display_pitch
975 *---------------------------------------------------------------------------
976 */
977void
978gfx_set_display_pitch(unsigned short pitch)
979{
980#if GFX_DISPLAY_GU1
981    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
982        gu1_set_display_pitch(pitch);
983#endif
984#if GFX_DISPLAY_GU2
985    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
986        gu2_set_display_pitch(pitch);
987#endif
988}
989
990/*---------------------------------------------------------------------------
991 * gfx_set_display_offset
992 *---------------------------------------------------------------------------
993 */
994void
995gfx_set_display_offset(unsigned long offset)
996{
997#if GFX_DISPLAY_GU1
998    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
999        gu1_set_display_offset(offset);
1000#endif
1001#if GFX_DISPLAY_GU2
1002    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1003        gu2_set_display_offset(offset);
1004#endif
1005}
1006
1007/*---------------------------------------------------------------------------
1008 * gfx_set_display_palette_entry
1009 *---------------------------------------------------------------------------
1010 */
1011int
1012gfx_set_display_palette_entry(unsigned long index, unsigned long palette)
1013{
1014    int status = 0;
1015
1016#if GFX_DISPLAY_GU1
1017    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1018        status = gu1_set_display_palette_entry(index, palette);
1019#endif
1020#if GFX_DISPLAY_GU2
1021    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1022        status = gu2_set_display_palette_entry(index, palette);
1023#endif
1024    return (status);
1025}
1026
1027/*---------------------------------------------------------------------------
1028 * gfx_set_display_palette
1029 *---------------------------------------------------------------------------
1030 */
1031int
1032gfx_set_display_palette(unsigned long *palette)
1033{
1034    int status = 0;
1035
1036#if GFX_DISPLAY_GU1
1037    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1038        status = gu1_set_display_palette(palette);
1039#endif
1040#if GFX_DISPLAY_GU2
1041    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1042        status = gu2_set_display_palette(palette);
1043#endif
1044    return (status);
1045}
1046
1047/*---------------------------------------------------------------------------
1048 * gfx_set_cursor_enable
1049 *---------------------------------------------------------------------------
1050 */
1051void
1052gfx_set_cursor_enable(int enable)
1053{
1054#if GFX_DISPLAY_GU1
1055    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1056        gu1_set_cursor_enable(enable);
1057#endif
1058#if GFX_DISPLAY_GU2
1059    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1060        gu2_set_cursor_enable(enable);
1061#endif
1062}
1063
1064/*---------------------------------------------------------------------------
1065 * gfx_set_cursor_colors
1066 *---------------------------------------------------------------------------
1067 */
1068void
1069gfx_set_cursor_colors(unsigned long bkcolor, unsigned long fgcolor)
1070{
1071#if GFX_DISPLAY_GU1
1072    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1073        gu1_set_cursor_colors(bkcolor, fgcolor);
1074#endif
1075#if GFX_DISPLAY_GU2
1076    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1077        gu2_set_cursor_colors(bkcolor, fgcolor);
1078#endif
1079}
1080
1081/*---------------------------------------------------------------------------
1082 * gfx_set_cursor_position
1083 *---------------------------------------------------------------------------
1084 */
1085void
1086gfx_set_cursor_position(unsigned long memoffset,
1087    unsigned short xpos, unsigned short ypos,
1088    unsigned short xhotspot, unsigned short yhotspot)
1089{
1090#if GFX_DISPLAY_GU1
1091    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1092        gu1_set_cursor_position(memoffset, xpos, ypos, xhotspot, yhotspot);
1093#endif
1094#if GFX_DISPLAY_GU2
1095    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1096        gu2_set_cursor_position(memoffset, xpos, ypos, xhotspot, yhotspot);
1097#endif
1098}
1099
1100/*---------------------------------------------------------------------------
1101 * gfx_set_cursor_shape32
1102 *---------------------------------------------------------------------------
1103 */
1104void
1105gfx_set_cursor_shape32(unsigned long memoffset,
1106    unsigned long *andmask, unsigned long *xormask)
1107{
1108#if GFX_DISPLAY_GU1
1109    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1110        gu1_set_cursor_shape32(memoffset, andmask, xormask);
1111#endif
1112#if GFX_DISPLAY_GU2
1113    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1114        gu2_set_cursor_shape32(memoffset, andmask, xormask);
1115#endif
1116}
1117
1118/*---------------------------------------------------------------------------
1119 * gfx_set_cursor_shape64
1120 *---------------------------------------------------------------------------
1121 */
1122void
1123gfx_set_cursor_shape64(unsigned long memoffset,
1124    unsigned long *andmask, unsigned long *xormask)
1125{
1126#if GFX_DISPLAY_GU2
1127    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1128        gu2_set_cursor_shape64(memoffset, andmask, xormask);
1129#endif
1130}
1131
1132/*---------------------------------------------------------------------------
1133 * gfx_set_icon_enable
1134 *---------------------------------------------------------------------------
1135 */
1136void
1137gfx_set_icon_enable(int enable)
1138{
1139#if GFX_DISPLAY_GU2
1140    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1141        gu2_set_icon_enable(enable);
1142#endif
1143}
1144
1145/*---------------------------------------------------------------------------
1146 * gfx_set_icon_colors
1147 *---------------------------------------------------------------------------
1148 */
1149void
1150gfx_set_icon_colors(unsigned long color0, unsigned long color1,
1151    unsigned long color2)
1152{
1153#if GFX_DISPLAY_GU2
1154    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1155        gu2_set_icon_colors(color0, color1, color2);
1156#endif
1157}
1158
1159/*---------------------------------------------------------------------------
1160 * gfx_set_icon_position
1161 *---------------------------------------------------------------------------
1162 */
1163void
1164gfx_set_icon_position(unsigned long memoffset, unsigned short xpos)
1165{
1166#if GFX_DISPLAY_GU2
1167    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1168        gu2_set_icon_position(memoffset, xpos);
1169#endif
1170}
1171
1172/*---------------------------------------------------------------------------
1173 * gfx_set_icon_shape64
1174 *---------------------------------------------------------------------------
1175 */
1176void
1177gfx_set_icon_shape64(unsigned long memoffset,
1178    unsigned long *andmask, unsigned long *xormask, unsigned int lines)
1179{
1180#if GFX_DISPLAY_GU2
1181    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1182        gu2_set_icon_shape64(memoffset, andmask, xormask, lines);
1183#endif
1184}
1185
1186/*---------------------------------------------------------------------------
1187 * gfx_set_compression_enable
1188 *---------------------------------------------------------------------------
1189 */
1190int
1191gfx_set_compression_enable(int enable)
1192{
1193    int status = 0;
1194
1195#if GFX_DISPLAY_GU1
1196    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1197        status = gu1_set_compression_enable(enable);
1198#endif
1199#if GFX_DISPLAY_GU2
1200    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1201        status = gu2_set_compression_enable(enable);
1202#endif
1203    return (status);
1204}
1205
1206/*---------------------------------------------------------------------------
1207 * gfx_set_compression_offset
1208 *---------------------------------------------------------------------------
1209 */
1210int
1211gfx_set_compression_offset(unsigned long offset)
1212{
1213    int status = 0;
1214
1215#if GFX_DISPLAY_GU1
1216    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1217        status = gu1_set_compression_offset(offset);
1218#endif
1219#if GFX_DISPLAY_GU2
1220    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1221        status = gu2_set_compression_offset(offset);
1222#endif
1223    return (status);
1224}
1225
1226/*---------------------------------------------------------------------------
1227 * gfx_set_compression_pitch
1228 *---------------------------------------------------------------------------
1229 */
1230int
1231gfx_set_compression_pitch(unsigned short pitch)
1232{
1233    int status = 0;
1234
1235#if GFX_DISPLAY_GU1
1236    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1237        status = gu1_set_compression_pitch(pitch);
1238#endif
1239#if GFX_DISPLAY_GU2
1240    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1241        status = gu2_set_compression_pitch(pitch);
1242#endif
1243    return (status);
1244}
1245
1246/*---------------------------------------------------------------------------
1247 * gfx_set_compression_size
1248 *---------------------------------------------------------------------------
1249 */
1250int
1251gfx_set_compression_size(unsigned short size)
1252{
1253    int status = 0;
1254
1255#if GFX_DISPLAY_GU1
1256    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1257        status = gu1_set_compression_size(size);
1258#endif
1259#if GFX_DISPLAY_GU2
1260    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1261        status = gu2_set_compression_size(size);
1262#endif
1263    return (status);
1264}
1265
1266/*---------------------------------------------------------------------------
1267 * gfx_set_display_priority_high
1268 *---------------------------------------------------------------------------
1269 */
1270void
1271gfx_set_display_priority_high(int enable)
1272{
1273#if GFX_DISPLAY_GU1
1274    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1275        gu1_set_display_priority_high(enable);
1276#endif
1277}
1278
1279/*---------------------------------------------------------------------------
1280 * gfx_set_display_video_format (PRIVATE ROUTINE - NOT PART OF API)
1281 *
1282 * This routine is called by "gfx_set_video_format".  It abstracts the
1283 * version of the display controller from the video overlay routines.
1284 *---------------------------------------------------------------------------
1285 */
1286void
1287gfx_set_display_video_format(unsigned long format)
1288{
1289#if GFX_DISPLAY_GU2
1290    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1291        gu2_set_display_video_format(format);
1292#endif
1293}
1294
1295/*---------------------------------------------------------------------------
1296 * gfx_set_display_video_enable (PRIVATE ROUTINE - NOT PART OF API)
1297 *
1298 * This routine is called by "gfx_set_video_enable".  It abstracts the
1299 * version of the display controller from the video overlay routines.
1300 *---------------------------------------------------------------------------
1301 */
1302void
1303gfx_set_display_video_enable(int enable)
1304{
1305#if GFX_DISPLAY_GU1
1306    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1307        gu1_set_display_video_enable(enable);
1308#endif
1309#if GFX_DISPLAY_GU2
1310    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1311        gu2_set_display_video_enable(enable);
1312#endif
1313    return;
1314}
1315
1316/*---------------------------------------------------------------------------
1317 * gfx_set_display_video_size (PRIVATE ROUTINE - NOT PART OF API)
1318 *
1319 * This routine is called by "gfx_set_video_size".  It abstracts the
1320 * version of the display controller from the video overlay routines.
1321 *---------------------------------------------------------------------------
1322 */
1323void
1324gfx_set_display_video_size(unsigned short width, unsigned short height)
1325{
1326#if GFX_DISPLAY_GU1
1327    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1328        gu1_set_display_video_size(width, height);
1329#endif
1330#if GFX_DISPLAY_GU2
1331    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1332        gu2_set_display_video_size(width, height);
1333#endif
1334}
1335
1336/*---------------------------------------------------------------------------
1337 * gfx_set_display_video_offset (PRIVATE ROUTINE - NOT PART OF API)
1338 *
1339 * This routine is called by "gfx_set_video_offset".  It abstracts the
1340 * version of the display controller from the video overlay routines.
1341 *---------------------------------------------------------------------------
1342 */
1343void
1344gfx_set_display_video_offset(unsigned long offset)
1345{
1346#if GFX_DISPLAY_GU1
1347    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1348        gu1_set_display_video_offset(offset);
1349#endif
1350#if GFX_DISPLAY_GU2
1351    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1352        gu2_set_display_video_offset(offset);
1353#endif
1354}
1355
1356/*---------------------------------------------------------------------------
1357 * gfx_set_display_video_yuv_offsets (PRIVATE ROUTINE - NOT PART OF API)
1358 *
1359 * This routine is called by "gfx_set_video_yuv_offsets".  It abstracts the
1360 * version of the display controller from the video overlay routines.
1361 *---------------------------------------------------------------------------
1362 */
1363void
1364gfx_set_display_video_yuv_offsets(unsigned long yoffset,
1365    unsigned long uoffset, unsigned long voffset)
1366{
1367#if GFX_DISPLAY_GU2
1368    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1369        gu2_set_display_video_yuv_offsets(yoffset, uoffset, voffset);
1370#endif
1371}
1372
1373/*---------------------------------------------------------------------------
1374 * gfx_set_display_video_yuv_pitch (PRIVATE ROUTINE - NOT PART OF API)
1375 *
1376 * This routine is called by "gfx_set_video_yuv_pitch".  It abstracts the
1377 * version of the display controller from the video overlay routines.
1378 *---------------------------------------------------------------------------
1379 */
1380void
1381gfx_set_display_video_yuv_pitch(unsigned long ypitch, unsigned long uvpitch)
1382{
1383#if GFX_DISPLAY_GU2
1384    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1385        gu2_set_display_video_yuv_pitch(ypitch, uvpitch);
1386#endif
1387}
1388
1389/*---------------------------------------------------------------------------
1390 * gfx_set_display_video_downscale (PRIVATE ROUTINE - NOT PART OF API)
1391 *
1392 * This routine is called by "gfx_set_video_vertical_downscale".  It abstracts the
1393 * version of the display controller from the video overlay routines.
1394 *---------------------------------------------------------------------------
1395 */
1396void
1397gfx_set_display_video_downscale(unsigned short srch, unsigned short dsth)
1398{
1399#if GFX_DISPLAY_GU2
1400    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1401        gu2_set_display_video_downscale(srch, dsth);
1402#endif
1403}
1404
1405/*---------------------------------------------------------------------------
1406 * gfx_set_display_video_vertical_downscale_enable (PRIVATE ROUTINE - NOT PART OF API)
1407 *
1408 * This routine is called by "gfx_set_video_vertical_downscale_enable".  It abstracts the
1409 * version of the display controller from the video overlay routines.
1410 *---------------------------------------------------------------------------
1411 */
1412void
1413gfx_set_display_video_vertical_downscale_enable(int enable)
1414{
1415#if GFX_DISPLAY_GU2
1416    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1417        gu2_set_display_video_vertical_downscale_enable(enable);
1418#endif
1419}
1420
1421/*---------------------------------------------------------------------------
1422 * gfx_test_timing_active
1423 *---------------------------------------------------------------------------
1424 */
1425int
1426gfx_test_timing_active(void)
1427{
1428    int status = 0;
1429
1430#if GFX_DISPLAY_GU1
1431    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1432        status = gu1_test_timing_active();
1433#endif
1434#if GFX_DISPLAY_GU2
1435    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1436        status = gu2_test_timing_active();
1437#endif
1438    return (status);
1439}
1440
1441/*---------------------------------------------------------------------------
1442 * gfx_test_vertical_active
1443 *---------------------------------------------------------------------------
1444 */
1445int
1446gfx_test_vertical_active(void)
1447{
1448    int status = 0;
1449
1450#if GFX_DISPLAY_GU1
1451    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1452        status = gu1_test_vertical_active();
1453#endif
1454#if GFX_DISPLAY_GU2
1455    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1456        status = gu2_test_vertical_active();
1457#endif
1458    return (status);
1459}
1460
1461/*---------------------------------------------------------------------------
1462 * gfx_wait_vertical_blank
1463 *---------------------------------------------------------------------------
1464 */
1465int
1466gfx_wait_vertical_blank(void)
1467{
1468    int status = 0;
1469
1470#if GFX_DISPLAY_GU1
1471    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1472        status = gu1_wait_vertical_blank();
1473#endif
1474#if GFX_DISPLAY_GU2
1475    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1476        status = gu2_wait_vertical_blank();
1477#endif
1478    return (status);
1479}
1480
1481/*---------------------------------------------------------------------------
1482 * gfx_delay_milliseconds
1483 *---------------------------------------------------------------------------
1484 */
1485void
1486gfx_delay_milliseconds(unsigned long milliseconds)
1487{
1488#if GFX_DISPLAY_GU1
1489    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1490        gu1_delay_milliseconds(milliseconds);
1491#endif
1492#if GFX_DISPLAY_GU2
1493    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1494        gu2_delay_milliseconds(milliseconds);
1495#endif
1496}
1497
1498/*---------------------------------------------------------------------------
1499 * gfx_delay_microseconds
1500 *---------------------------------------------------------------------------
1501 */
1502void
1503gfx_delay_microseconds(unsigned long microseconds)
1504{
1505#if GFX_DISPLAY_GU1
1506    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1507        gu1_delay_microseconds(microseconds);
1508#endif
1509#if GFX_DISPLAY_GU2
1510    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1511        gu2_delay_microseconds(microseconds);
1512#endif
1513}
1514
1515/*---------------------------------------------------------------------------
1516 * gfx_enable_panning
1517 *
1518 * This routine  enables the panning when the Mode is bigger than the panel
1519 * size.
1520 *---------------------------------------------------------------------------
1521 */
1522void
1523gfx_enable_panning(int x, int y)
1524{
1525#if GFX_DISPLAY_GU1
1526    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1527        gu1_enable_panning(x, y);
1528#endif
1529#if GFX_DISPLAY_GU2
1530    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1531        gu2_enable_panning(x, y);
1532#endif
1533}
1534
1535/*---------------------------------------------------------------------------
1536 * gfx_is_panel_mode_supported
1537 *---------------------------------------------------------------------------
1538 */
1539int
1540gfx_is_panel_mode_supported(int panelResX, int panelResY,
1541    unsigned short width, unsigned short height, unsigned short bpp)
1542{
1543    int status = -1;
1544
1545#if GFX_DISPLAY_GU2
1546    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1547        status =
1548            gu2_is_panel_mode_supported(panelResX, panelResY, width, height,
1549            bpp);
1550#endif
1551
1552    return (status);
1553}
1554
1555/*---------------------------------------------------------------------------
1556 * gfx_set_fixed_timings
1557 *---------------------------------------------------------------------------
1558 */
1559int
1560gfx_set_fixed_timings(int panelResX, int panelResY, unsigned short width,
1561    unsigned short height, unsigned short bpp)
1562{
1563    int status = 0;
1564
1565#if GFX_DISPLAY_GU1
1566    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1567        status =
1568            gu1_set_fixed_timings(panelResX, panelResY, width, height, bpp);
1569#endif
1570#if GFX_DISPLAY_GU2
1571    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1572        status =
1573            gu2_set_fixed_timings(panelResX, panelResY, width, height, bpp);
1574#endif
1575    return (status);
1576}
1577
1578/*---------------------------------------------------------------------------
1579 * gfx_set_panel_present
1580 *---------------------------------------------------------------------------
1581 */
1582int
1583gfx_set_panel_present(int panelResX, int panelResY, unsigned short width,
1584    unsigned short height, unsigned short bpp)
1585{
1586    int status = 0;
1587
1588#if GFX_DISPLAY_GU1
1589    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1590        status =
1591            gu1_set_panel_present(panelResX, panelResY, width, height, bpp);
1592#endif
1593#if GFX_DISPLAY_GU2
1594    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1595        status =
1596            gu2_set_panel_present(panelResX, panelResY, width, height, bpp);
1597#endif
1598    return (status);
1599}
1600
1601/*---------------------------------------------------------------------------
1602 * gfx_set_vtotal
1603 *---------------------------------------------------------------------------
1604 */
1605int
1606gfx_set_vtotal(unsigned short vtotal)
1607{
1608    int retval = 0;
1609
1610#if GFX_DISPLAY_GU1
1611    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1612        retval = gu1_set_vtotal(vtotal);
1613#endif
1614#if GFX_DISPLAY_GU2
1615    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1616        retval = gu2_set_vtotal(vtotal);
1617#endif
1618    return (retval);
1619}
1620
1621/*-----------------------------------------------------------------------*
1622 * THE FOLLOWING READ ROUTINES ARE ALWAYS INCLUDED:                      *
1623 * gfx_get_hsync_end, gfx_get_htotal, gfx_get_vsync_end, gfx_get_vtotal  *
1624 * are used by the video overlay routines.                               *
1625 *                                                                       *
1626 * gfx_get_vline and gfx_vactive are used to prevent an issue for the    *
1627 * SC1200.                                                               *
1628 *                                                                       *
1629 * The others are part of the Durango API.                               *
1630 *-----------------------------------------------------------------------*/
1631
1632/*----------------------------------------------------------------------------
1633 * gfx_mode_frequency_supported
1634 *----------------------------------------------------------------------------
1635 */
1636int
1637gfx_mode_frequency_supported(int xres, int yres, int bpp,
1638    unsigned long frequency)
1639{
1640    int freq = 0;
1641
1642#if GFX_DISPLAY_GU1
1643    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1644        freq = gu1_mode_frequency_supported(xres, yres, bpp, frequency);
1645#endif
1646#if GFX_DISPLAY_GU2
1647    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1648        freq = gu2_mode_frequency_supported(xres, yres, bpp, frequency);
1649#endif
1650    return (freq);
1651}
1652
1653/*----------------------------------------------------------------------------
1654 * gfx_refreshrate_from_frequency
1655 *----------------------------------------------------------------------------
1656 */
1657int
1658gfx_get_refreshrate_from_frequency(int xres, int yres, int bpp, int *hz,
1659    unsigned long frequency)
1660{
1661#if GFX_DISPLAY_GU1
1662    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1663        gu1_get_refreshrate_from_frequency(xres, yres, bpp, hz, frequency);
1664#endif
1665#if GFX_DISPLAY_GU2
1666    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1667        gu2_get_refreshrate_from_frequency(xres, yres, bpp, hz, frequency);
1668#endif
1669
1670    return (1);
1671}
1672
1673/*----------------------------------------------------------------------------
1674 * gfx_refreshrate_from_mode
1675 *----------------------------------------------------------------------------
1676 */
1677int
1678gfx_get_refreshrate_from_mode(int xres, int yres, int bpp, int *hz,
1679    unsigned long frequency)
1680{
1681#if GFX_DISPLAY_GU1
1682    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1683        gu1_get_refreshrate_from_mode(xres, yres, bpp, hz, frequency);
1684#endif
1685#if GFX_DISPLAY_GU2
1686    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1687        gu2_get_refreshrate_from_mode(xres, yres, bpp, hz, frequency);
1688#endif
1689
1690    return (1);
1691}
1692
1693/*----------------------------------------------------------------------------
1694 * gfx_get_frequency_from_refreshrate
1695 *----------------------------------------------------------------------------
1696 */
1697int
1698gfx_get_frequency_from_refreshrate(int xres, int yres, int bpp, int hz,
1699    int *frequency)
1700{
1701    int retval = -1;
1702
1703#if GFX_DISPLAY_GU1
1704    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1705        retval =
1706            gu1_get_frequency_from_refreshrate(xres, yres, bpp, hz,
1707            frequency);
1708#endif
1709#if GFX_DISPLAY_GU2
1710    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1711        retval =
1712            gu2_get_frequency_from_refreshrate(xres, yres, bpp, hz,
1713            frequency);
1714#endif
1715
1716    return retval;
1717}
1718
1719/*---------------------------------------------------------------------------
1720 * gfx_get_max_supported_pixel_clock
1721 *---------------------------------------------------------------------------
1722 */
1723unsigned long
1724gfx_get_max_supported_pixel_clock(void)
1725{
1726    unsigned long status = 0;
1727
1728#if GFX_DISPLAY_GU1
1729    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1730        status = gu1_get_max_supported_pixel_clock();
1731#endif
1732#if GFX_DISPLAY_GU2
1733    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1734        status = gu2_get_max_supported_pixel_clock();
1735#endif
1736    return (status);
1737}
1738
1739/*---------------------------------------------------------------------------
1740 * gfx_get_display_pitch
1741 *---------------------------------------------------------------------------
1742 */
1743unsigned short
1744gfx_get_display_pitch(void)
1745{
1746    unsigned short pitch = 0;
1747
1748#if GFX_DISPLAY_GU1
1749    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1750        pitch = gu1_get_display_pitch();
1751#endif
1752#if GFX_DISPLAY_GU2
1753    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1754        pitch = gu2_get_display_pitch();
1755#endif
1756    return (pitch);
1757}
1758
1759/*---------------------------------------------------------------------------
1760 * gfx_get_display_mode_count
1761 * return # of modes supported.
1762 *---------------------------------------------------------------------------
1763 */
1764int
1765gfx_get_display_mode_count(void)
1766{
1767    int retval = 0;
1768
1769#if GFX_DISPLAY_GU1
1770    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1771        retval = gu1_get_display_mode_count();
1772#endif
1773#if GFX_DISPLAY_GU2
1774    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1775        retval = gu2_get_display_mode_count();
1776#endif
1777    return (retval);
1778}
1779
1780/*---------------------------------------------------------------------------
1781 * gfx_get_frame_buffer_line_size
1782 *---------------------------------------------------------------------------
1783 */
1784unsigned long
1785gfx_get_frame_buffer_line_size(void)
1786{
1787    unsigned long retval = 0;
1788
1789#if GFX_DISPLAY_GU1
1790    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1791        retval = gu1_get_frame_buffer_line_size();
1792#endif
1793#if GFX_DISPLAY_GU2
1794    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1795        retval = gu2_get_frame_buffer_line_size();
1796#endif
1797    return (retval);
1798}
1799
1800/*---------------------------------------------------------------------------
1801 * gfx_get_display_mode
1802 * get the curent mode set,
1803 * return the supported mode on success, -1 on fail
1804 *---------------------------------------------------------------------------
1805 */
1806int
1807gfx_get_display_mode(int *xres, int *yres, int *bpp, int *hz)
1808{
1809    int retval = -1;
1810
1811#if GFX_DISPLAY_GU1
1812    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1813        retval = gu1_get_display_mode(xres, yres, bpp, hz);
1814#endif
1815#if GFX_DISPLAY_GU2
1816    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1817        retval = gu2_get_display_mode(xres, yres, bpp, hz);
1818#endif
1819    return (retval);
1820}
1821
1822/*---------------------------------------------------------------------------
1823 * gfx_get_display_details
1824 * given the mode get's the resoultion details, width, height, freq
1825 *---------------------------------------------------------------------------
1826 */
1827int
1828gfx_get_display_details(unsigned int mode, int *xres, int *yres, int *hz)
1829{
1830    int retval = -1;
1831
1832#if GFX_DISPLAY_GU1
1833    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1834        retval = gu1_get_display_details(mode, xres, yres, hz);
1835#endif
1836#if GFX_DISPLAY_GU2
1837    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1838        retval = gu2_get_display_details(mode, xres, yres, hz);
1839#endif
1840    return (retval);
1841}
1842
1843/*---------------------------------------------------------------------------
1844 * gfx_get_hactive
1845 *---------------------------------------------------------------------------
1846 */
1847unsigned short
1848gfx_get_hactive(void)
1849{
1850    unsigned short hactive = 0;
1851
1852#if GFX_DISPLAY_GU1
1853    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1854        hactive = gu1_get_hactive();
1855#endif
1856#if GFX_DISPLAY_GU2
1857    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1858        hactive = gu2_get_hactive();
1859#endif
1860    return (hactive);
1861}
1862
1863/*---------------------------------------------------------------------------
1864 * gfx_get_hsync_start
1865 *---------------------------------------------------------------------------
1866 */
1867unsigned short
1868gfx_get_hsync_start(void)
1869{
1870    unsigned short hsync_start = 0;
1871
1872#if GFX_DISPLAY_GU1
1873    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1874        hsync_start = gu1_get_hsync_start();
1875#endif
1876#if GFX_DISPLAY_GU2
1877    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1878        hsync_start = gu2_get_hsync_start();
1879#endif
1880    return (hsync_start);
1881}
1882
1883/*---------------------------------------------------------------------------
1884 * gfx_get_hsync_end
1885 *---------------------------------------------------------------------------
1886 */
1887unsigned short
1888gfx_get_hsync_end(void)
1889{
1890    unsigned short hsync_end = 0;
1891
1892#if GFX_DISPLAY_GU1
1893    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1894        hsync_end = gu1_get_hsync_end();
1895#endif
1896#if GFX_DISPLAY_GU2
1897    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1898        hsync_end = gu2_get_hsync_end();
1899#endif
1900    return (hsync_end);
1901}
1902
1903/*---------------------------------------------------------------------------
1904 * gfx_get_htotal
1905 *---------------------------------------------------------------------------
1906 */
1907unsigned short
1908gfx_get_htotal(void)
1909{
1910    unsigned short htotal = 0;
1911
1912#if GFX_DISPLAY_GU1
1913    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1914        htotal = gu1_get_htotal();
1915#endif
1916#if GFX_DISPLAY_GU2
1917    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1918        htotal = gu2_get_htotal();
1919#endif
1920    return (htotal);
1921}
1922
1923/*---------------------------------------------------------------------------
1924 * gfx_get_vactive
1925 *---------------------------------------------------------------------------
1926 */
1927unsigned short
1928gfx_get_vactive(void)
1929{
1930    unsigned short vactive = 0;
1931
1932#if GFX_DISPLAY_GU1
1933    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1934        vactive = gu1_get_vactive();
1935#endif
1936#if GFX_DISPLAY_GU2
1937    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1938        vactive = gu2_get_vactive();
1939#endif
1940    return (vactive);
1941}
1942
1943/*---------------------------------------------------------------------------
1944 * gfx_get_vsync_end
1945 *---------------------------------------------------------------------------
1946 */
1947unsigned short
1948gfx_get_vsync_end(void)
1949{
1950    unsigned short vsync_end = 0;
1951
1952#if GFX_DISPLAY_GU1
1953    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1954        vsync_end = gu1_get_vsync_end();
1955#endif
1956#if GFX_DISPLAY_GU2
1957    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1958        vsync_end = gu2_get_vsync_end();
1959#endif
1960    return (vsync_end);
1961}
1962
1963/*---------------------------------------------------------------------------
1964 * gfx_get_vtotal
1965 *---------------------------------------------------------------------------
1966 */
1967unsigned short
1968gfx_get_vtotal(void)
1969{
1970    unsigned short vtotal = 0;
1971
1972#if GFX_DISPLAY_GU1
1973    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1974        vtotal = gu1_get_vtotal();
1975#endif
1976#if GFX_DISPLAY_GU2
1977    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1978        vtotal = gu2_get_vtotal();
1979#endif
1980    return (vtotal);
1981}
1982
1983/*---------------------------------------------------------------------------
1984 *  gfx_get_display_bpp
1985 *---------------------------------------------------------------------------
1986 */
1987unsigned short
1988gfx_get_display_bpp(void)
1989{
1990    unsigned short bpp = 0;
1991
1992#if GFX_DISPLAY_GU1
1993    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1994        bpp = gu1_get_display_bpp();
1995#endif
1996#if GFX_DISPLAY_GU2
1997    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1998        bpp = gu2_get_display_bpp();
1999#endif
2000    return (bpp);
2001}
2002
2003/*---------------------------------------------------------------------------
2004 * gfx_get_vline
2005 *---------------------------------------------------------------------------
2006 */
2007unsigned short
2008gfx_get_vline(void)
2009{
2010    unsigned short vline = 0;
2011
2012#if GFX_DISPLAY_GU1
2013    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
2014        vline = gu1_get_vline();
2015#endif
2016#if GFX_DISPLAY_GU2
2017    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2018        vline = gu2_get_vline();
2019#endif
2020    return (vline);
2021}
2022
2023/*---------------------------------------------------------------------------
2024 *  gfx_get_display_offset
2025 *---------------------------------------------------------------------------
2026 */
2027unsigned long
2028gfx_get_display_offset(void)
2029{
2030    unsigned long offset = 0;
2031
2032#if GFX_DISPLAY_GU1
2033    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
2034        offset = gu1_get_display_offset();
2035#endif
2036#if GFX_DISPLAY_GU2
2037    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2038        offset = gu2_get_display_offset();
2039#endif
2040    return (offset);
2041}
2042
2043/*---------------------------------------------------------------------------
2044 *  gfx_get_cursor_offset
2045 *---------------------------------------------------------------------------
2046 */
2047unsigned long
2048gfx_get_cursor_offset(void)
2049{
2050    unsigned long base = 0;
2051
2052#if GFX_DISPLAY_GU1
2053    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
2054        base = gu1_get_cursor_offset();
2055#endif
2056#if GFX_DISPLAY_GU2
2057    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2058        base = gu2_get_cursor_offset();
2059#endif
2060    return (base);
2061}
2062
2063/*************************************************************/
2064/*  READ ROUTINES  |  INCLUDED FOR DIAGNOSTIC PURPOSES ONLY  */
2065/*************************************************************/
2066
2067#if GFX_READ_ROUTINES
2068
2069/*---------------------------------------------------------------------------
2070 * gfx_get_hblank_start
2071 *---------------------------------------------------------------------------
2072 */
2073unsigned short
2074gfx_get_hblank_start(void)
2075{
2076    unsigned short hblank_start = 0;
2077
2078#if GFX_DISPLAY_GU1
2079    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
2080        hblank_start = gu1_get_hblank_start();
2081#endif
2082#if GFX_DISPLAY_GU2
2083    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2084        hblank_start = gu2_get_hblank_start();
2085#endif
2086    return (hblank_start);
2087}
2088
2089/*---------------------------------------------------------------------------
2090 * gfx_get_hblank_end
2091 *---------------------------------------------------------------------------
2092 */
2093unsigned short
2094gfx_get_hblank_end(void)
2095{
2096    unsigned short hblank_end = 0;
2097
2098#if GFX_DISPLAY_GU1
2099    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
2100        hblank_end = gu1_get_hblank_end();
2101#endif
2102#if GFX_DISPLAY_GU2
2103    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2104        hblank_end = gu2_get_hblank_end();
2105#endif
2106    return (hblank_end);
2107}
2108
2109/*---------------------------------------------------------------------------
2110 * gfx_get_vblank_start
2111 *---------------------------------------------------------------------------
2112 */
2113unsigned short
2114gfx_get_vblank_start(void)
2115{
2116    unsigned short vblank_start = 0;
2117
2118#if GFX_DISPLAY_GU1
2119    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
2120        vblank_start = gu1_get_vblank_start();
2121#endif
2122#if GFX_DISPLAY_GU2
2123    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2124        vblank_start = gu2_get_vblank_start();
2125#endif
2126    return (vblank_start);
2127}
2128
2129/*---------------------------------------------------------------------------
2130 * gfx_get_vsync_start
2131 *---------------------------------------------------------------------------
2132 */
2133unsigned short
2134gfx_get_vsync_start(void)
2135{
2136    unsigned short vsync_start = 0;
2137
2138#if GFX_DISPLAY_GU1
2139    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
2140        vsync_start = gu1_get_vsync_start();
2141#endif
2142#if GFX_DISPLAY_GU2
2143    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2144        vsync_start = gu2_get_vsync_start();
2145#endif
2146    return (vsync_start);
2147}
2148
2149/*---------------------------------------------------------------------------
2150 * gfx_get_vblank_end
2151 *---------------------------------------------------------------------------
2152 */
2153unsigned short
2154gfx_get_vblank_end(void)
2155{
2156    unsigned short vblank_end = 0;
2157
2158#if GFX_DISPLAY_GU1
2159    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
2160        vblank_end = gu1_get_vblank_end();
2161#endif
2162#if GFX_DISPLAY_GU2
2163    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2164        vblank_end = gu2_get_vblank_end();
2165#endif
2166    return (vblank_end);
2167}
2168
2169/*---------------------------------------------------------------------------
2170 *  gfx_get_display_palette_entry
2171 *---------------------------------------------------------------------------
2172 */
2173int
2174gfx_get_display_palette_entry(unsigned long index, unsigned long *palette)
2175{
2176    int status = 0;
2177
2178#if GFX_DISPLAY_GU1
2179    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
2180        status = gu1_get_display_palette_entry(index, palette);
2181#endif
2182#if GFX_DISPLAY_GU2
2183    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2184        status = gu2_get_display_palette_entry(index, palette);
2185#endif
2186
2187    return status;
2188}
2189
2190/*---------------------------------------------------------------------------
2191 *  gfx_get_display_palette
2192 *---------------------------------------------------------------------------
2193 */
2194void
2195gfx_get_display_palette(unsigned long *palette)
2196{
2197#if GFX_DISPLAY_GU1
2198    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
2199        gu1_get_display_palette(palette);
2200#endif
2201#if GFX_DISPLAY_GU2
2202    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2203        gu2_get_display_palette(palette);
2204#endif
2205}
2206
2207/*---------------------------------------------------------------------------
2208 *  gfx_get_cursor_enable
2209 *---------------------------------------------------------------------------
2210 */
2211unsigned long
2212gfx_get_cursor_enable(void)
2213{
2214    unsigned long enable = 0;
2215
2216#if GFX_DISPLAY_GU1
2217    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
2218        enable = gu1_get_cursor_enable();
2219#endif
2220#if GFX_DISPLAY_GU2
2221    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2222        enable = gu2_get_cursor_enable();
2223#endif
2224    return (enable);
2225}
2226
2227/*---------------------------------------------------------------------------
2228 *  gfx_get_cursor_position
2229 *---------------------------------------------------------------------------
2230 */
2231unsigned long
2232gfx_get_cursor_position(void)
2233{
2234    unsigned long position = 0;
2235
2236#if GFX_DISPLAY_GU1
2237    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
2238        position = gu1_get_cursor_position();
2239#endif
2240#if GFX_DISPLAY_GU2
2241    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2242        position = gu2_get_cursor_position();
2243#endif
2244    return (position);
2245}
2246
2247/*---------------------------------------------------------------------------
2248 *  gfx_get_cursor_clip
2249 *---------------------------------------------------------------------------
2250 */
2251unsigned long
2252gfx_get_cursor_clip(void)
2253{
2254    unsigned long offset = 0;
2255
2256#if GFX_DISPLAY_GU1
2257    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
2258        offset = gu1_get_cursor_clip();
2259#endif
2260#if GFX_DISPLAY_GU2
2261    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2262        offset = gu2_get_cursor_clip();
2263#endif
2264    return (offset);
2265}
2266
2267/*---------------------------------------------------------------------------
2268 *  gfx_get_cursor_color
2269 *---------------------------------------------------------------------------
2270 */
2271unsigned long
2272gfx_get_cursor_color(int index)
2273{
2274    unsigned long color = 0;
2275
2276#if GFX_DISPLAY_GU1
2277    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
2278        color = gu1_get_cursor_color(index);
2279#endif
2280#if GFX_DISPLAY_GU2
2281    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2282        color = gu2_get_cursor_color(index);
2283#endif
2284    return (color);
2285}
2286
2287/*---------------------------------------------------------------------------
2288 *  gfx_get_icon_enable
2289 *---------------------------------------------------------------------------
2290 */
2291unsigned long
2292gfx_get_icon_enable(void)
2293{
2294    unsigned long enable = 0;
2295
2296#if GFX_DISPLAY_GU2
2297    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2298        enable = gu2_get_icon_enable();
2299#endif
2300    return (enable);
2301}
2302
2303/*---------------------------------------------------------------------------
2304 *  gfx_get_icon_offset
2305 *---------------------------------------------------------------------------
2306 */
2307unsigned long
2308gfx_get_icon_offset(void)
2309{
2310    unsigned long base = 0;
2311
2312#if GFX_DISPLAY_GU2
2313    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2314        base = gu2_get_icon_offset();
2315#endif
2316
2317    return (base);
2318}
2319
2320/*---------------------------------------------------------------------------
2321 *  gfx_get_icon_position
2322 *---------------------------------------------------------------------------
2323 */
2324unsigned long
2325gfx_get_icon_position(void)
2326{
2327    unsigned long position = 0;
2328
2329#if GFX_DISPLAY_GU2
2330    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2331        position = gu2_get_icon_position();
2332#endif
2333
2334    return (position);
2335}
2336
2337/*---------------------------------------------------------------------------
2338 *  gfx_get_icon_color
2339 *---------------------------------------------------------------------------
2340 */
2341unsigned long
2342gfx_get_icon_color(int index)
2343{
2344    unsigned long color = 0;
2345
2346#if GFX_DISPLAY_GU2
2347    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2348        color = gu2_get_icon_color(index);
2349#endif
2350
2351    return (color);
2352}
2353
2354/*---------------------------------------------------------------------------
2355 *  gfx_get_compression_enable
2356 *---------------------------------------------------------------------------
2357 */
2358int
2359gfx_get_compression_enable(void)
2360{
2361    int enable = 0;
2362
2363#if GFX_DISPLAY_GU1
2364    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
2365        enable = gu1_get_compression_enable();
2366#endif
2367#if GFX_DISPLAY_GU2
2368    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2369        enable = gu2_get_compression_enable();
2370#endif
2371    return (enable);
2372}
2373
2374/*---------------------------------------------------------------------------
2375 *  gfx_get_compression_offset
2376 *---------------------------------------------------------------------------
2377 */
2378unsigned long
2379gfx_get_compression_offset(void)
2380{
2381    unsigned long offset = 0;
2382
2383#if GFX_DISPLAY_GU1
2384    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
2385        offset = gu1_get_compression_offset();
2386#endif
2387#if GFX_DISPLAY_GU2
2388    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2389        offset = gu2_get_compression_offset();
2390#endif
2391    return (offset);
2392}
2393
2394/*---------------------------------------------------------------------------
2395 * gfx_get_compression_pitch
2396 *---------------------------------------------------------------------------
2397 */
2398unsigned short
2399gfx_get_compression_pitch(void)
2400{
2401    unsigned short pitch = 0;
2402
2403#if GFX_DISPLAY_GU1
2404    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
2405        pitch = gu1_get_compression_pitch();
2406#endif
2407#if GFX_DISPLAY_GU2
2408    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2409        pitch = gu2_get_compression_pitch();
2410#endif
2411    return (pitch);
2412}
2413
2414/*---------------------------------------------------------------------------
2415 * gfx_get_compression_size
2416 *---------------------------------------------------------------------------
2417 */
2418unsigned short
2419gfx_get_compression_size(void)
2420{
2421    unsigned short size = 0;
2422
2423#if GFX_DISPLAY_GU1
2424    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
2425        size = gu1_get_compression_size();
2426#endif
2427#if GFX_DISPLAY_GU2
2428    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2429        size = gu2_get_compression_size();
2430#endif
2431    return (size);
2432}
2433
2434/*---------------------------------------------------------------------------
2435 * gfx_get_display_priority_high
2436 *---------------------------------------------------------------------------
2437 */
2438int
2439gfx_get_display_priority_high(void)
2440{
2441    int high = GFX_STATUS_UNSUPPORTED;
2442
2443#if GFX_DISPLAY_GU1
2444    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
2445        high = gu1_get_display_priority_high();
2446#endif
2447    return (high);
2448}
2449
2450/*---------------------------------------------------------------------------
2451 * gfx_get_valid_bit
2452 *---------------------------------------------------------------------------
2453 */
2454int
2455gfx_get_valid_bit(int line)
2456{
2457    int valid = 0;
2458
2459#if GFX_DISPLAY_GU1
2460    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
2461        valid = gu1_get_valid_bit(line);
2462#endif
2463#if GFX_DISPLAY_GU2
2464    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2465        valid = gu2_get_valid_bit(line);
2466#endif
2467    return (valid);
2468}
2469
2470/*---------------------------------------------------------------------------
2471 * gfx_get_display_video_color_key
2472 *---------------------------------------------------------------------------
2473 */
2474unsigned long
2475gfx_get_display_video_color_key(void)
2476{
2477    unsigned long value = 0;
2478    return (value);
2479}
2480
2481/*---------------------------------------------------------------------------
2482 * gfx_get_display_video_offset
2483 *---------------------------------------------------------------------------
2484 */
2485unsigned long
2486gfx_get_display_video_offset(void)
2487{
2488    unsigned long offset = 0;
2489
2490#if GFX_DISPLAY_GU1
2491    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
2492        offset = gu1_get_display_video_offset();
2493#endif
2494#if GFX_DISPLAY_GU2
2495    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2496        offset = gu2_get_display_video_offset();
2497#endif
2498    return (offset);
2499}
2500
2501/*---------------------------------------------------------------------------
2502 * gfx_get_display_video_yuv_offsets
2503 *---------------------------------------------------------------------------
2504 */
2505void
2506gfx_get_display_video_yuv_offsets(unsigned long *yoffset,
2507    unsigned long *uoffset, unsigned long *voffset)
2508{
2509#if GFX_DISPLAY_GU2
2510    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2511        gu2_get_display_video_yuv_offsets(yoffset, uoffset, voffset);
2512#endif
2513}
2514
2515/*---------------------------------------------------------------------------
2516 * gfx_get_display_video_yuv_offsets
2517 *---------------------------------------------------------------------------
2518 */
2519void
2520gfx_get_display_video_yuv_pitch(unsigned long *ypitch, unsigned long *uvpitch)
2521{
2522#if GFX_DISPLAY_GU2
2523    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2524        gu2_get_display_video_yuv_pitch(ypitch, uvpitch);
2525#endif
2526}
2527
2528/*---------------------------------------------------------------------------
2529 * gfx_get_display_video_downscale_delta
2530 *---------------------------------------------------------------------------
2531 */
2532unsigned long
2533gfx_get_display_video_downscale_delta(void)
2534{
2535    unsigned long ret_value = 0;
2536
2537#if GFX_DISPLAY_GU2
2538    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2539        ret_value = gu2_get_display_video_downscale_delta();
2540#endif
2541
2542    return ret_value;
2543}
2544
2545/*---------------------------------------------------------------------------
2546 * gfx_get_display_video_downscale_delta
2547 *---------------------------------------------------------------------------
2548 */
2549int
2550gfx_get_display_video_downscale_enable(void)
2551{
2552    int ret_value = 0;
2553
2554#if GFX_DISPLAY_GU2
2555    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2556        ret_value = gu2_get_display_video_downscale_enable();
2557#endif
2558
2559    return ret_value;
2560}
2561
2562/*---------------------------------------------------------------------------
2563 * gfx_get_display_video_size
2564 *---------------------------------------------------------------------------
2565 */
2566unsigned long
2567gfx_get_display_video_size(void)
2568{
2569    unsigned long size = 0;
2570
2571#if GFX_DISPLAY_GU1
2572    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
2573        size = gu1_get_display_video_size();
2574#endif
2575#if GFX_DISPLAY_GU2
2576    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2577        size = gu2_get_display_video_size();
2578#endif
2579    return (size);
2580}
2581
2582/*---------------------------------------------------------------------------
2583 * gfx_get_display_video_color_key_mask
2584 *---------------------------------------------------------------------------
2585 */
2586unsigned long
2587gfx_get_display_video_color_key_mask(void)
2588{
2589    unsigned long mask = 0;
2590    return (mask);
2591}
2592
2593#endif /* GFX_READ_ROUTINES */
2594
2595#endif /* GFX_DISPLAY_DYNAMIC */
2596