1f29dbc25Smrg/* Copyright (c) 2005 Advanced Micro Devices, Inc.
2f29dbc25Smrg *
3f29dbc25Smrg * Permission is hereby granted, free of charge, to any person obtaining a copy
4f29dbc25Smrg * of this software and associated documentation files (the "Software"), to
5f29dbc25Smrg * deal in the Software without restriction, including without limitation the
6f29dbc25Smrg * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7f29dbc25Smrg * sell copies of the Software, and to permit persons to whom the Software is
8f29dbc25Smrg * furnished to do so, subject to the following conditions:
9f29dbc25Smrg *
10f29dbc25Smrg * The above copyright notice and this permission notice shall be included in
11f29dbc25Smrg * all copies or substantial portions of the Software.
12f29dbc25Smrg *
13f29dbc25Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14f29dbc25Smrg * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15f29dbc25Smrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16f29dbc25Smrg * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17f29dbc25Smrg * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18f29dbc25Smrg * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19f29dbc25Smrg * IN THE SOFTWARE.
20f29dbc25Smrg *
21f29dbc25Smrg * Neither the name of the Advanced Micro Devices, Inc. nor the names of its
22f29dbc25Smrg * contributors may be used to endorse or promote products derived from this
23f29dbc25Smrg * software without specific prior written permission.
24f29dbc25Smrg * */
25f29dbc25Smrg
26f29dbc25Smrg/*
27f29dbc25Smrg  *  This file contains routines to program the display controller.
28f29dbc25Smrg  *
29f29dbc25Smrg  *  The "disp_gu1.c" and "disp_gu2.c" files implement the following routines:
30f29dbc25Smrg  *
31f29dbc25Smrg  *     gfx_get_display_mode_count
32f29dbc25Smrg  *     gfx_get_display_mode
33f29dbc25Smrg  *     gfx_is_display_mode_supported
34f29dbc25Smrg  *     gfx_is_panel_mode_supported
35f29dbc25Smrg  *     gfx_get_display_details
36f29dbc25Smrg  *     gfx_set_display_mode
37f29dbc25Smrg  *     gfx_set_display_bpp
38f29dbc25Smrg  * 	gfx_set_display_timings
39f29dbc25Smrg  *     gfx_set_vtotal
40f29dbc25Smrg  *     gfx_get_display_pitch
41f29dbc25Smrg  *     gfx_set_display_pitch
42f29dbc25Smrg  *     gfx_set_display_offset
43f29dbc25Smrg  *     gfx_set_display_palette
44f29dbc25Smrg  *     gfx_set_display_palette_entry
45f29dbc25Smrg  *     gfx_set_cursor_enable
46f29dbc25Smrg  *     gfx_set_cursor_colors
47f29dbc25Smrg  *     gfx_set_cursor_position
48f29dbc25Smrg  * 	gfx_set_cursor_shape32
49f29dbc25Smrg  * 	gfx_set_cursor_shape64
50f29dbc25Smrg  *     gfx_set_compression_enable
51f29dbc25Smrg  *     gfx_set_compression_offset
52f29dbc25Smrg  *     gfx_set_compression_pitch
53f29dbc25Smrg  *     gfx_set_compression_size
54f29dbc25Smrg  *     gfx_set_display_priority_high
55f29dbc25Smrg  *     gfx_set_panel_present
56f29dbc25Smrg  *     gfx_test_timing_active
57f29dbc25Smrg  *     gfx_test_vertical_active
58f29dbc25Smrg  *     gfx_wait_vertical_blank
59f29dbc25Smrg  *     gfx_reset_timing_lock
60f29dbc25Smrg  *
61f29dbc25Smrg  *  And the following routines if GFX_READ_ROUTINES is set:
62f29dbc25Smrg  *
63f29dbc25Smrg  * 	gfx_get_hactive
64f29dbc25Smrg  *     gfx_get_hblank_start
65f29dbc25Smrg  *     gfx_get_hsync_start
66f29dbc25Smrg  *     gfx_get_hsync_end
67f29dbc25Smrg  *     gfx_get_hblank_end
68f29dbc25Smrg  *     gfx_get_htotal
69f29dbc25Smrg  *     gfx_get_vactive
70f29dbc25Smrg  *     gfx_get_vblank_start
71f29dbc25Smrg  *     gfx_get_vsync_start
72f29dbc25Smrg  *     gfx_get_vsync_end
73f29dbc25Smrg  *     gfx_get_vblank_end
74f29dbc25Smrg  *     gfx_get_vtotal
75f29dbc25Smrg  *     gfx_get_vline
76f29dbc25Smrg  *     gfx_get_display_bpp
77f29dbc25Smrg  *     gfx_get_display_offset
78f29dbc25Smrg  *     gfx_get_display_palette
79f29dbc25Smrg  *     gfx_get_cursor_enable
80f29dbc25Smrg  *     gfx_get_cursor_base
81f29dbc25Smrg  *     gfx_get_cursor_position
82f29dbc25Smrg  *     gfx_get_cursor_offset
83f29dbc25Smrg  *     gfx_get_cursor_color
84f29dbc25Smrg  *     gfx_get_compression_enable
85f29dbc25Smrg  *     gfx_get_compression_offset
86f29dbc25Smrg  *     gfx_get_compression_pitch
87f29dbc25Smrg  *     gfx_get_compression_size
88f29dbc25Smrg  *     gfx_get_display_priority_high
89f29dbc25Smrg  *     gfx_get_valid_bit
90f29dbc25Smrg  * */
91f29dbc25Smrg
92f29dbc25Smrgunsigned short PanelWidth = 0;
93f29dbc25Smrgunsigned short PanelHeight = 0;
94f29dbc25Smrgunsigned short PanelEnable = 0;
95f29dbc25Smrgunsigned short ModeWidth;
96f29dbc25Smrgunsigned short ModeHeight;
97f29dbc25Smrg
98f29dbc25Smrgint DeltaX = 0;
99f29dbc25Smrgint DeltaY = 0;
100f29dbc25Smrgunsigned long prevstartAddr = 0;
101f29dbc25Smrgunsigned long panelTop = 0;
102f29dbc25Smrgunsigned long panelLeft = 0;
103f29dbc25Smrg
104f29dbc25Smrgint gbpp = 8;
105f29dbc25Smrg
106f29dbc25Smrgint gfx_compression_enabled = 0;
107f29dbc25Smrgint gfx_compression_active = 0;
108f29dbc25Smrgint gfx_line_double = 0;
109f29dbc25Smrgint gfx_pixel_double = 0;
110f29dbc25Smrgint gfx_timing_lock = 0;
111f29dbc25SmrgDISPLAYMODE gfx_display_mode;
112f29dbc25Smrg
113f29dbc25Smrg/* DISPLAY MODE TIMINGS */
114f29dbc25Smrg
115f29dbc25SmrgDISPLAYMODE DisplayParams[] = {
116f29dbc25Smrg
117f29dbc25Smrg/* 320 x 200 */
118f29dbc25Smrg
119f29dbc25Smrg    {
12004007ebaSmrg     GFX_MODE_70HZ |            /* refresh rate = 60  */
12104007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_16BPP |   /* 8 and 16 BPP valid */
12204007ebaSmrg     GFX_MODE_NEG_HSYNC |       /* negative HSYNC     */
12304007ebaSmrg     GFX_MODE_PIXEL_DOUBLE |    /* Double width       */
12404007ebaSmrg     GFX_MODE_LINE_DOUBLE,      /* Double height      */
12504007ebaSmrg     0x140, 0x288, 0x290, 0x2F0, 0x318, 0x320,  /* horizontal timings */
12604007ebaSmrg     0x0C8, 0x197, 0x19C, 0x19E, 0x1BA, 0x1C1,  /* vertical timings   */
12704007ebaSmrg     0x00192CCC,                /* freq = 25.175 MHz  */
12804007ebaSmrg     },
129f29dbc25Smrg
130f29dbc25Smrg/* 320 x 240 */
131f29dbc25Smrg
132f29dbc25Smrg    {
13304007ebaSmrg     GFX_MODE_75HZ |            /* refresh rate = 75  */
13404007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_16BPP |   /* 8 and 16 BPP valid */
13504007ebaSmrg     GFX_MODE_NEG_HSYNC | GFX_MODE_NEG_VSYNC |  /* negative syncs     */
13604007ebaSmrg     GFX_MODE_PIXEL_DOUBLE |    /* Double width       */
13704007ebaSmrg     GFX_MODE_LINE_DOUBLE,      /* Double height      */
13804007ebaSmrg     0x0140, 0x0280, 0x0290, 0x02D0, 0x0348, 0x0348,
13904007ebaSmrg     /* horizontal timings */
14004007ebaSmrg     0x00F0, 0x01E0, 0x01E1, 0x01E4, 0x01F4, 0x01F4,
14104007ebaSmrg     /* vertical timings   */
14204007ebaSmrg     0x001F8000,                /* freq = 31.5 MHz    */
14304007ebaSmrg     },
144f29dbc25Smrg
145f29dbc25Smrg/* 400 x 300 */
146f29dbc25Smrg
147f29dbc25Smrg    {
14804007ebaSmrg     GFX_MODE_75HZ |            /* refresh rate = 75  */
14904007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_16BPP |   /* 8 and 16 BPP valid */
15004007ebaSmrg     GFX_MODE_PIXEL_DOUBLE |    /* Double width       */
15104007ebaSmrg     GFX_MODE_LINE_DOUBLE,      /* Double height      */
15204007ebaSmrg     0x0190, 0x0320, 0x0330, 0x0380, 0x0420, 0x0420,
15304007ebaSmrg     /* horizontal timings */
15404007ebaSmrg     0x012C, 0x0258, 0x0259, 0x025C, 0x0271, 0x0271,
15504007ebaSmrg     /* vertical timings   */
15604007ebaSmrg     0x00318000,                /* freq = 49.5 MHz    */
15704007ebaSmrg     },
158f29dbc25Smrg
159f29dbc25Smrg/* 512 x 384 */
160f29dbc25Smrg
161f29dbc25Smrg    {
16204007ebaSmrg     GFX_MODE_75HZ |            /* refresh rate = 75  */
16304007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_16BPP |   /* 8 and 16 BPP valid */
16404007ebaSmrg     GFX_MODE_PIXEL_DOUBLE |    /* Double width       */
16504007ebaSmrg     GFX_MODE_LINE_DOUBLE,      /* Double height      */
16604007ebaSmrg     0x0200, 0x0400, 0x0410, 0x0470, 0x0520, 0x0520,
16704007ebaSmrg     /* horizontal timings */
16804007ebaSmrg     0x0180, 0x0300, 0x0301, 0x0304, 0x0320, 0x0320,
16904007ebaSmrg     /* vertical timings   */
17004007ebaSmrg     0x004EC000,                /* freq = 78.75 MHz   */
17104007ebaSmrg     },
172f29dbc25Smrg
173f29dbc25Smrg/* 640 x 400 */
174f29dbc25Smrg
175f29dbc25Smrg    {
17604007ebaSmrg     GFX_MODE_70HZ |            /* refresh rate = 60  */
17704007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
17804007ebaSmrg     /* all BPP valid      */
17904007ebaSmrg     GFX_MODE_16BPP | GFX_MODE_24BPP | GFX_MODE_NEG_HSYNC,
18004007ebaSmrg     /* negative HSYNC     */
18104007ebaSmrg     0x280, 0x288, 0x290, 0x2F0, 0x318, 0x320,  /* horizontal timings */
18204007ebaSmrg     0x190, 0x197, 0x19C, 0x19E, 0x1BA, 0x1C1,  /* vertical timings   */
18304007ebaSmrg     0x00192CCC,                /* freq = 25.175 MHz  */
18404007ebaSmrg     },
185f29dbc25Smrg
186f29dbc25Smrg/* 640x480 */
187f29dbc25Smrg
188f29dbc25Smrg    {
18904007ebaSmrg     GFX_MODE_60HZ |            /* refresh rate = 60  */
19004007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
19104007ebaSmrg     /* all BPP valid      */
19204007ebaSmrg     GFX_MODE_16BPP | GFX_MODE_24BPP | GFX_MODE_NEG_HSYNC | GFX_MODE_NEG_VSYNC, /* negative syncs     */
19304007ebaSmrg     0x0280, 0x0288, 0x0290, 0x02E8, 0x0318, 0x0320,
19404007ebaSmrg     /* horizontal timings */
19504007ebaSmrg     0x01E0, 0x01E8, 0x01EA, 0x01EC, 0x0205, 0x020D,
19604007ebaSmrg     /* vertical timings   */
19704007ebaSmrg     0x00192CCC,                /* freq = 25.175 MHz  */
19804007ebaSmrg     },
199f29dbc25Smrg
200f29dbc25Smrg    {
20104007ebaSmrg     GFX_MODE_70HZ |            /* refresh rate = 60  */
20204007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
20304007ebaSmrg     /* all BPP valid      */
20404007ebaSmrg     GFX_MODE_16BPP | GFX_MODE_24BPP,
20504007ebaSmrg     0x0280, 0x0280, 0x0298, 0x02D8, 0x0330, 0x0330,
20604007ebaSmrg     /* horizontal timings */
20704007ebaSmrg     0x01E0, 0x01E0, 0x01E2, 0x01E5, 0x01F4, 0x01F4,
20804007ebaSmrg     /* vertical timings   */
20904007ebaSmrg     0x001C8F5C,                /* freq = 28.560 MHz  */
21004007ebaSmrg     },
211f29dbc25Smrg
212f29dbc25Smrg    {
21304007ebaSmrg     GFX_MODE_72HZ |            /* refresh rate = 72  */
21404007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
21504007ebaSmrg     /* all BPP valid      */
21604007ebaSmrg     GFX_MODE_16BPP | GFX_MODE_24BPP | GFX_MODE_NEG_HSYNC | GFX_MODE_NEG_VSYNC, /* negative syncs     */
21704007ebaSmrg     0x0280, 0x0288, 0x0298, 0x02c0, 0x0338, 0x0340,
21804007ebaSmrg     /* horizontal timings */
21904007ebaSmrg     0x01e0, 0x01e8, 0x01e9, 0x01ec, 0x0200, 0x0208,
22004007ebaSmrg     /* vertical timings   */
22104007ebaSmrg     0x001F8000,                /* freq = 31.5 MHz    */
22204007ebaSmrg     },
223f29dbc25Smrg
224f29dbc25Smrg    {
22504007ebaSmrg     GFX_MODE_75HZ |            /* refresh rate = 75  */
22604007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
22704007ebaSmrg     /* all BPP valid      */
22804007ebaSmrg     GFX_MODE_16BPP | GFX_MODE_24BPP | GFX_MODE_NEG_HSYNC | GFX_MODE_NEG_VSYNC, /* negative syncs     */
22904007ebaSmrg     0x0280, 0x0280, 0x0290, 0x02D0, 0x0348, 0x0348,
23004007ebaSmrg     /* horizontal timings */
23104007ebaSmrg     0x01E0, 0x01E0, 0x01E1, 0x01E4, 0x01F4, 0x01F4,
23204007ebaSmrg     /* vertical timings   */
23304007ebaSmrg     0x001F8000,                /* freq = 31.5 MHz    */
23404007ebaSmrg     },
235f29dbc25Smrg
236f29dbc25Smrg    {
23704007ebaSmrg     GFX_MODE_85HZ |            /* refresh rate = 85  */
23804007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
23904007ebaSmrg     /* all BPP valid      */
24004007ebaSmrg     GFX_MODE_16BPP | GFX_MODE_24BPP | GFX_MODE_NEG_HSYNC | GFX_MODE_NEG_VSYNC, /* negative syncs     */
24104007ebaSmrg     0x0280, 0x0280, 0x02B8, 0x02F0, 0x0340, 0x0340,
24204007ebaSmrg     /* horizontal timings */
24304007ebaSmrg     0x01E0, 0x01E0, 0x01E1, 0x01E4, 0x01FD, 0x01FD,
24404007ebaSmrg     /* vertical timings   */
24504007ebaSmrg     0x00240000,                /* freq = 36.0 MHz    */
24604007ebaSmrg     },
247f29dbc25Smrg
248f29dbc25Smrg    {
24904007ebaSmrg     GFX_MODE_90HZ |            /* refresh rate = 90  */
25004007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
25104007ebaSmrg     /* all BPP valid      */
25204007ebaSmrg     GFX_MODE_16BPP | GFX_MODE_24BPP,
25304007ebaSmrg     0x0280, 0x0280, 0x02A0, 0x02E0, 0x0340, 0x0340,
25404007ebaSmrg     /* horizontal timings */
25504007ebaSmrg     0x01E0, 0x01E0, 0x01E1, 0x01E4, 0x01FA, 0x01FA,
25604007ebaSmrg     /* vertical timings   */
25704007ebaSmrg     0x0025E395,                /* freq = 37.889 MHz  */
25804007ebaSmrg     },
259f29dbc25Smrg
260f29dbc25Smrg    {
26104007ebaSmrg     GFX_MODE_100HZ |           /* refresh rate = 100 */
26204007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
26304007ebaSmrg     /* all BPP valid      */
26404007ebaSmrg     GFX_MODE_16BPP | GFX_MODE_24BPP,
26504007ebaSmrg     0x0280, 0x0280, 0x02A8, 0x02E8, 0x0350, 0x0350,
26604007ebaSmrg     /* horizontal timings */
26704007ebaSmrg     0x01E0, 0x01E0, 0x01E1, 0x01E4, 0x01FD, 0x01FD,
26804007ebaSmrg     /* vertical timings   */
26904007ebaSmrg     0x002B29BA,                /* freq = 43.163 MHz  */
27004007ebaSmrg     },
271f29dbc25Smrg
272f29dbc25Smrg/* 800x600 */
273f29dbc25Smrg
274f29dbc25Smrg    {
27504007ebaSmrg     GFX_MODE_56HZ |            /* refresh rate = 56  */
27604007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
27704007ebaSmrg     /* all BPP valid      */
27804007ebaSmrg     GFX_MODE_16BPP | GFX_MODE_24BPP,
27904007ebaSmrg     0x0320, 0x0320, 0x0338, 0x0380, 0x0400, 0x0400,
28004007ebaSmrg     /* horizontal timings */
28104007ebaSmrg     0x0258, 0x0258, 0x0259, 0x025B, 0x0271, 0x0271,
28204007ebaSmrg     /* vertical timings   */
28304007ebaSmrg     0x00240000,                /* freq = 36.00 MHz   */
28404007ebaSmrg     },
285f29dbc25Smrg
286f29dbc25Smrg    {
28704007ebaSmrg     GFX_MODE_60HZ |            /* refresh rate = 60  */
28804007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
28904007ebaSmrg     /* all BPP valid      */
29004007ebaSmrg     GFX_MODE_16BPP | GFX_MODE_24BPP,
29104007ebaSmrg     0x0320, 0x0328, 0x0348, 0x03D0, 0x0418, 0x0420,
29204007ebaSmrg     /* horizontal timings */
29304007ebaSmrg     0x0258, 0x0258, 0x0259, 0x025D, 0x0274, 0x0274,
29404007ebaSmrg     /* vertical timings   */
29504007ebaSmrg     0x00280000,                /* freq = 40.00 MHz   */
29604007ebaSmrg     },
297f29dbc25Smrg
298f29dbc25Smrg    {
29904007ebaSmrg     GFX_MODE_70HZ |            /* refresh rate = 70  */
30004007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
30104007ebaSmrg     /* all BPP valid      */
30204007ebaSmrg     GFX_MODE_16BPP | GFX_MODE_24BPP,
30304007ebaSmrg     0x0320, 0x0320, 0x0348, 0x0398, 0x0410, 0x0410,
30404007ebaSmrg     /* horizontal timings */
30504007ebaSmrg     0x0258, 0x0258, 0x025c, 0x025F, 0x0274, 0x0274,
30604007ebaSmrg     /* vertical timings   */
30704007ebaSmrg     0x002DB851,                /* freq = 45.72 MHz   */
30804007ebaSmrg     },
309f29dbc25Smrg
310f29dbc25Smrg    {
31104007ebaSmrg     GFX_MODE_72HZ |            /* refresh rate = 72  */
31204007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
31304007ebaSmrg     /* all BPP valid      */
31404007ebaSmrg     GFX_MODE_16BPP | GFX_MODE_24BPP,
31504007ebaSmrg     0x0320, 0x0320, 0x0358, 0x03D0, 0x0410, 0x0410,
31604007ebaSmrg     /* horizontal timings */
31704007ebaSmrg     0x0258, 0x0258, 0x027D, 0x0283, 0x029A, 0x029A,
31804007ebaSmrg     /* vertical timings   */
31904007ebaSmrg     0x00320000,                /* freq = 49.5 MHz    */
32004007ebaSmrg     },
321f29dbc25Smrg
322f29dbc25Smrg    {
32304007ebaSmrg     GFX_MODE_75HZ |            /* refresh rate = 75  */
32404007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
32504007ebaSmrg     /* all BPP valid      */
32604007ebaSmrg     GFX_MODE_16BPP | GFX_MODE_24BPP,
32704007ebaSmrg     0x0320, 0x0320, 0x0330, 0x0380, 0x0420, 0x0420,
32804007ebaSmrg     /* horizontal timings */
32904007ebaSmrg     0x0258, 0x0258, 0x0259, 0x025C, 0x0271, 0x0271,
33004007ebaSmrg     /* vertical timings   */
33104007ebaSmrg     0x00318000,                /* freq = 49.5 MHz    */
33204007ebaSmrg     },
333f29dbc25Smrg
334f29dbc25Smrg    {
33504007ebaSmrg     GFX_MODE_85HZ |            /* refresh rate = 85  */
33604007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
33704007ebaSmrg     /* all BPP valid      */
33804007ebaSmrg     GFX_MODE_16BPP | GFX_MODE_24BPP,
33904007ebaSmrg     0x0320, 0x0320, 0x0340, 0x0380, 0x0418, 0x0418,
34004007ebaSmrg     /* horizontal timings */
34104007ebaSmrg     0x0258, 0x0258, 0x0259, 0x025C, 0x0277, 0x0277,
34204007ebaSmrg     /* vertical timings   */
34304007ebaSmrg     0x00384000,                /* freq = 56.25 MHz   */
34404007ebaSmrg     },
345f29dbc25Smrg
346f29dbc25Smrg    {
34704007ebaSmrg     GFX_MODE_90HZ |            /* refresh rate = 90  */
34804007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
34904007ebaSmrg     /* all BPP valid      */
35004007ebaSmrg     GFX_MODE_16BPP | GFX_MODE_24BPP,
35104007ebaSmrg     0x0320, 0x0320, 0x0348, 0x03A0, 0x0420, 0x0420,
35204007ebaSmrg     /* horizontal timings */
35304007ebaSmrg     0x0258, 0x0258, 0x0259, 0x025C, 0x0278, 0x0278,
35404007ebaSmrg     /* vertical timings   */
35504007ebaSmrg     0x003C10A3,                /* freq = 60.065 MHz   */
35604007ebaSmrg     },
357f29dbc25Smrg
358f29dbc25Smrg    {
35904007ebaSmrg     GFX_MODE_100HZ |           /* refresh rate = 100 */
36004007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
36104007ebaSmrg     /* all BPP valid      */
36204007ebaSmrg     GFX_MODE_16BPP | GFX_MODE_24BPP,
36304007ebaSmrg     0x0320, 0x0320, 0x0350, 0x03A8, 0x0430, 0x0430,
36404007ebaSmrg     /* horizontal timings */
36504007ebaSmrg     0x0258, 0x0258, 0x0259, 0x025C, 0x0277, 0x027C,
36604007ebaSmrg     /* vertical timings   */
36704007ebaSmrg     0x00442DD2,                /* freq = 68.179 MHz  */
36804007ebaSmrg     },
369f29dbc25Smrg
370f29dbc25Smrg/* 1024x768 */
371f29dbc25Smrg
372f29dbc25Smrg    {
37304007ebaSmrg     GFX_MODE_60HZ |            /* refresh rate = 60  */
37404007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
37504007ebaSmrg     /* all BPP valid      */
37604007ebaSmrg     GFX_MODE_16BPP | GFX_MODE_24BPP | GFX_MODE_NEG_HSYNC | GFX_MODE_NEG_VSYNC, /* negative syncs     */
37704007ebaSmrg     0x0400, 0x0400, 0x0418, 0x04A0, 0x0540, 0x0540,
37804007ebaSmrg     /* horizontal timings */
37904007ebaSmrg     0x0300, 0x0300, 0x0303, 0x0309, 0x0326, 0x0326,
38004007ebaSmrg     /* vertical timings   */
38104007ebaSmrg     0x00410000,                /* freq = 65.00 MHz   */
38204007ebaSmrg     },
383f29dbc25Smrg
384f29dbc25Smrg    {
38504007ebaSmrg     GFX_MODE_70HZ |            /* refresh rate = 70  */
38604007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
38704007ebaSmrg     /* all BPP valid      */
38804007ebaSmrg     GFX_MODE_16BPP | GFX_MODE_24BPP | GFX_MODE_NEG_HSYNC | GFX_MODE_NEG_VSYNC, /* negative syncs     */
38904007ebaSmrg     0x0400, 0x0400, 0x0418, 0x04A0, 0x0530, 0x0530,
39004007ebaSmrg     /* horizontal timings */
39104007ebaSmrg     0x0300, 0x0300, 0x0303, 0x0309, 0x0326, 0x0326,
39204007ebaSmrg     /* vertical timings   */
39304007ebaSmrg     0x004B0000,                /* freq = 75.00 MHz   */
39404007ebaSmrg     },
395f29dbc25Smrg
396f29dbc25Smrg    {
39704007ebaSmrg     GFX_MODE_72HZ |            /* refresh rate = 72  */
39804007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
39904007ebaSmrg     /* all BPP valid      */
40004007ebaSmrg     GFX_MODE_16BPP | GFX_MODE_24BPP,
40104007ebaSmrg     0x0400, 0x0400, 0x0438, 0x04A8, 0x0550, 0x0550,
40204007ebaSmrg     /* horizontal timings */
40304007ebaSmrg     0x0300, 0x0300, 0x0304, 0x0307, 0x0324, 0x0324,
40404007ebaSmrg     /* vertical timings   */
40504007ebaSmrg     0x004EC000,                /* freq = 78.75 MHz   */
40604007ebaSmrg     },
407f29dbc25Smrg
408f29dbc25Smrg    {
40904007ebaSmrg     GFX_MODE_75HZ |            /* refresh rate = 75  */
41004007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
41104007ebaSmrg     /* all BPP valid      */
41204007ebaSmrg     GFX_MODE_16BPP | GFX_MODE_24BPP,
41304007ebaSmrg     0x0400, 0x0400, 0x0410, 0x0470, 0x0520, 0x0520,
41404007ebaSmrg     /* horizontal timings */
41504007ebaSmrg     0x0300, 0x0300, 0x0301, 0x0304, 0x0320, 0x0320,
41604007ebaSmrg     /* vertical timings   */
41704007ebaSmrg     0x004EC000,                /* freq = 78.75 MHz   */
41804007ebaSmrg     },
419f29dbc25Smrg
420f29dbc25Smrg    {
42104007ebaSmrg     GFX_MODE_85HZ |            /* refresh rate = 85  */
42204007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
42304007ebaSmrg     /* all BPP valid      */
42404007ebaSmrg     GFX_MODE_16BPP | GFX_MODE_24BPP,
42504007ebaSmrg     0x0400, 0x0400, 0x0430, 0x0490, 0x0560, 0x0560,
42604007ebaSmrg     /* horizontal timings */
42704007ebaSmrg     0x0300, 0x0300, 0x0301, 0x0304, 0x0328, 0x0328,
42804007ebaSmrg     /* vertical timings   */
42904007ebaSmrg     0x005E8000,                /* freq = 94.50 MHz   */
43004007ebaSmrg     },
431f29dbc25Smrg
432f29dbc25Smrg    {
43304007ebaSmrg     GFX_MODE_90HZ |            /* refresh rate = 90  */
43404007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
43504007ebaSmrg     /* all BPP valid      */
43604007ebaSmrg     GFX_MODE_16BPP | GFX_MODE_24BPP,
43704007ebaSmrg     0x0400, 0x0400, 0x0440, 0x04B0, 0x0560, 0x0560,
43804007ebaSmrg     /* horizontal timings */
43904007ebaSmrg     0x0300, 0x0300, 0x0301, 0x0304, 0x0329, 0x0329,
44004007ebaSmrg     /* vertical timings   */
44104007ebaSmrg     0x00642FDF,                /* freq = 100.187 MHz */
44204007ebaSmrg     },
443f29dbc25Smrg
444f29dbc25Smrg    {
44504007ebaSmrg     GFX_MODE_100HZ |           /* refresh rate = 100 */
44604007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
44704007ebaSmrg     /* all BPP valid      */
44804007ebaSmrg     GFX_MODE_16BPP | GFX_MODE_24BPP,
44904007ebaSmrg     0x0400, 0x0400, 0x0448, 0x04B8, 0x0570, 0x0570,
45004007ebaSmrg     /* horizontal timings */
45104007ebaSmrg     0x0300, 0x0300, 0x0301, 0x0304, 0x032E, 0x032E,
45204007ebaSmrg     /* vertical timings   */
45304007ebaSmrg     0x00714F1A,                /* freq = 113.309 MHz */
45404007ebaSmrg     },
455f29dbc25Smrg
456f29dbc25Smrg/* 1152x864 */
457f29dbc25Smrg
458f29dbc25Smrg    {
45904007ebaSmrg     GFX_MODE_60HZ |            /* refresh rate = 60  */
46004007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
46104007ebaSmrg     /* all BPP valid      */
46204007ebaSmrg     GFX_MODE_16BPP | GFX_MODE_24BPP,
46304007ebaSmrg     0x0480, 0x0480, 0x04C0, 0x0538, 0x05F0, 0x05F0,
46404007ebaSmrg     /* horizontal timings */
46504007ebaSmrg     0x0360, 0x0360, 0x0361, 0x0364, 0x037F, 0x037F,
46604007ebaSmrg     /* vertical timings   */
46704007ebaSmrg     0x00519999,                /* freq = 81.60 MHz  */
46804007ebaSmrg     },
469f29dbc25Smrg
470f29dbc25Smrg    {
47104007ebaSmrg     GFX_MODE_70HZ |            /* refresh rate = 70  */
47204007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
47304007ebaSmrg     /* all BPP valid      */
47404007ebaSmrg     GFX_MODE_16BPP | GFX_MODE_24BPP,
47504007ebaSmrg     0x0480, 0x0480, 0x04C8, 0x0540, 0x0600, 0x0600,
47604007ebaSmrg     /* horizontal timings */
47704007ebaSmrg     0x0360, 0x0360, 0x0368, 0x036B, 0x038B, 0x038B,
47804007ebaSmrg     /* vertical timings   */
47904007ebaSmrg     0x00618560,                /* freq = 97.521 MHz  */
48004007ebaSmrg     },
481f29dbc25Smrg
482f29dbc25Smrg    {
48304007ebaSmrg     GFX_MODE_72HZ |            /* refresh rate = 70  */
48404007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
48504007ebaSmrg     /* all BPP valid      */
48604007ebaSmrg     GFX_MODE_16BPP | GFX_MODE_24BPP,
48704007ebaSmrg     0x0480, 0x0480, 0x04C8, 0x0548, 0x0610, 0x0610,
48804007ebaSmrg     /* horizontal timings */
48904007ebaSmrg     0x0360, 0x0360, 0x0367, 0x036A, 0x038B, 0x038B,
49004007ebaSmrg     /* vertical timings   */
49104007ebaSmrg     0x00656B85,                /* freq = 101.42 MHz  */
49204007ebaSmrg     },
493f29dbc25Smrg
494f29dbc25Smrg    {
49504007ebaSmrg     GFX_MODE_75HZ |            /* refresh rate = 75  */
49604007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
49704007ebaSmrg     /* all BPP valid      */
49804007ebaSmrg     GFX_MODE_16BPP | GFX_MODE_24BPP,
49904007ebaSmrg     0x0480, 0x0480, 0x04C0, 0x0540, 0x0640, 0x0640,
50004007ebaSmrg     /* horizontal timings */
50104007ebaSmrg     0x0360, 0x0360, 0x0361, 0x0364, 0x0384, 0x0384,
50204007ebaSmrg     /* vertical timings   */
50304007ebaSmrg     0x006C0000,                /* freq = 108.00 MHz  */
50404007ebaSmrg     },
505f29dbc25Smrg
506f29dbc25Smrg    {
50704007ebaSmrg     GFX_MODE_85HZ |            /* refresh rate = 85  */
50804007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
50904007ebaSmrg     /* all BPP valid      */
51004007ebaSmrg     GFX_MODE_16BPP | GFX_MODE_24BPP,
51104007ebaSmrg     0x0480, 0x0480, 0x04C8, 0x0548, 0x0610, 0x0610,
51204007ebaSmrg     /* horizontal timings */
51304007ebaSmrg     0x0360, 0x0360, 0x0363, 0x0366, 0x038B, 0x038B,
51404007ebaSmrg     /* vertical timings   */
51504007ebaSmrg     0x0077A666,                /* freq = 119.65 MHz  */
51604007ebaSmrg     },
517f29dbc25Smrg
518f29dbc25Smrg    {
51904007ebaSmrg     GFX_MODE_90HZ |            /* refresh rate = 90  */
52004007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
52104007ebaSmrg     /* all BPP valid      */
52204007ebaSmrg     GFX_MODE_16BPP | GFX_MODE_24BPP,
52304007ebaSmrg     0x0480, 0x0480, 0x04D0, 0x0550, 0x0620, 0x0620,
52404007ebaSmrg     /* horizontal timings */
52504007ebaSmrg     0x0360, 0x0360, 0x0363, 0x0366, 0x038E, 0x038E,
52604007ebaSmrg     /* vertical timings   */
52704007ebaSmrg     0x00806666,                /* freq = 128.40 MHz  */
52804007ebaSmrg     },
529f29dbc25Smrg
530f29dbc25Smrg    {
53104007ebaSmrg     GFX_MODE_100HZ |           /* refresh rate = 100 */
53204007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
53304007ebaSmrg     /* all BPP valid      */
53404007ebaSmrg     GFX_MODE_16BPP | GFX_MODE_24BPP,
53504007ebaSmrg     0x0480, 0x0480, 0x04D0, 0x0550, 0x0620, 0x0620,
53604007ebaSmrg     /* horizontal timings */
53704007ebaSmrg     0x0360, 0x0360, 0x0365, 0x0368, 0x0398, 0x0398,
53804007ebaSmrg     /* vertical timings   */
53904007ebaSmrg     0x00906147,                /* freq = 144.38 MHz  */
54004007ebaSmrg     },
541f29dbc25Smrg
542f29dbc25Smrg/* 1280x1024 */
543f29dbc25Smrg
544f29dbc25Smrg    {
54504007ebaSmrg     GFX_MODE_60HZ |            /* refresh rate = 60  */
54604007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
54704007ebaSmrg     /* all BPP valid      */
54804007ebaSmrg     GFX_MODE_16BPP | GFX_MODE_24BPP,
54904007ebaSmrg     0x0500, 0x0500, 0x0530, 0x05A0, 0x0698, 0x0698,
55004007ebaSmrg     /* horizontal timings */
55104007ebaSmrg     0x0400, 0x0400, 0x0401, 0x0404, 0x042A, 0x042A,
55204007ebaSmrg     /* vertical timings   */
55304007ebaSmrg     0x006C0000,                /* freq = 108.0 MHz   */
55404007ebaSmrg     },
555f29dbc25Smrg
556f29dbc25Smrg    {
55704007ebaSmrg     GFX_MODE_70HZ |            /* refresh rate = 70  */
55804007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
55904007ebaSmrg     /* all BPP valid      */
56004007ebaSmrg     GFX_MODE_16BPP | GFX_MODE_24BPP,
56104007ebaSmrg     0x0500, 0x0500, 0x0558, 0x05E0, 0x06C0, 0x06C0,
56204007ebaSmrg     /* horizontal timings */
56304007ebaSmrg     0x0400, 0x0400, 0x040A, 0x040D, 0x0433, 0x0433,
56404007ebaSmrg     /* vertical timings   */
56504007ebaSmrg     0x00821999,                /* freq = 130.1 MHz   */
56604007ebaSmrg     },
567f29dbc25Smrg
568f29dbc25Smrg    {
56904007ebaSmrg     GFX_MODE_72HZ |            /* refresh rate = 72  */
57004007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
57104007ebaSmrg     /* all BPP valid      */
57204007ebaSmrg     GFX_MODE_16BPP | GFX_MODE_24BPP,
57304007ebaSmrg     0x0500, 0x0500, 0x0558, 0x05E0, 0x06C0, 0x06C0,
57404007ebaSmrg     /* horizontal timings */
57504007ebaSmrg     0x0400, 0x0400, 0x0407, 0x040A, 0x0431, 0x0431,
57604007ebaSmrg     /* vertical timings   */
57704007ebaSmrg     0x00858000,                /* freq = 133.5 MHz   */
57804007ebaSmrg     },
579f29dbc25Smrg
580f29dbc25Smrg    {
58104007ebaSmrg     GFX_MODE_75HZ |            /* refresh rate = 75  */
58204007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
58304007ebaSmrg     /* all BPP valid      */
58404007ebaSmrg     GFX_MODE_16BPP | GFX_MODE_24BPP,
58504007ebaSmrg     0x0500, 0x0500, 0x0510, 0x05A0, 0x0698, 0x0698,
58604007ebaSmrg     /* horizontal timings */
58704007ebaSmrg     0x0400, 0x0400, 0x0401, 0x0404, 0x042A, 0x042A,
58804007ebaSmrg     /* vertical timings   */
58904007ebaSmrg     0x00870000,                /* freq = 135.0 MHz   */
59004007ebaSmrg     },
591f29dbc25Smrg
592f29dbc25Smrg    {
59304007ebaSmrg     GFX_MODE_85HZ |            /* refresh rate = 85  */
59404007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
59504007ebaSmrg     /* all BPP valid      */
59604007ebaSmrg     GFX_MODE_16BPP | GFX_MODE_24BPP,
59704007ebaSmrg     0x0500, 0x0500, 0x0540, 0x05E0, 0x06C0, 0x06C0,
59804007ebaSmrg     /* horizontal timings */
59904007ebaSmrg     0x0400, 0x0400, 0x0401, 0x0404, 0x0430, 0x0430,
60004007ebaSmrg     /* vertical timings   */
60104007ebaSmrg     0x009D8000,                /* freq = 157.5 MHz   */
60204007ebaSmrg     },
603f29dbc25Smrg
604f29dbc25Smrg    {
60504007ebaSmrg     GFX_MODE_90HZ |            /* refresh rate = 90  */
60604007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
60704007ebaSmrg     /* all BPP valid      */
60804007ebaSmrg     GFX_MODE_16BPP | GFX_MODE_24BPP,
60904007ebaSmrg     0x0500, 0x0500, 0x0560, 0x05E8, 0x06D0, 0x06D0,
61004007ebaSmrg     /* horizontal timings */
61104007ebaSmrg     0x0400, 0x0400, 0x0401, 0x0404, 0x0436, 0x0436,
61204007ebaSmrg     /* vertical timings   */
61304007ebaSmrg     0x00A933F7,                /* freq = 169.203 MHz */
61404007ebaSmrg     },
615f29dbc25Smrg
616f29dbc25Smrg    {
61704007ebaSmrg     GFX_MODE_100HZ |           /* refresh rate = 100 */
61804007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
61904007ebaSmrg     /* all BPP valid      */
62004007ebaSmrg     GFX_MODE_16BPP | GFX_MODE_24BPP,
62104007ebaSmrg     0x0500, 0x0500, 0x0560, 0x05F0, 0x06E0, 0x06E0,
62204007ebaSmrg     /* horizontal timings */
62304007ebaSmrg     0x0400, 0x0400, 0x0401, 0x0404, 0x043D, 0x043D,
62404007ebaSmrg     /* vertical timings   */
62504007ebaSmrg     0x00BEF5C2,                /* freq = 190.96 MHz  */
62604007ebaSmrg     },
627f29dbc25Smrg
628f29dbc25Smrg/*********************************/
629f29dbc25Smrg/* BEGIN REDCLOUD-SPECIFIC MODES */
630f29dbc25Smrg/*-------------------------------*/
631f29dbc25Smrg
632f29dbc25Smrg/* 1600 x 1200 */
633f29dbc25Smrg
634f29dbc25Smrg    {
63504007ebaSmrg     GFX_MODE_60HZ |            /* refresh rate = 60  */
63604007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
63704007ebaSmrg     /* all BPP valid      */
63804007ebaSmrg     GFX_MODE_16BPP | GFX_MODE_24BPP,
63904007ebaSmrg     0x0640, 0x0640, 0x0680, 0x0740, 0x0870, 0x0870,
64004007ebaSmrg     /* horizontal timings */
64104007ebaSmrg     0x04B0, 0x04B0, 0x04B1, 0x04B4, 0x04E2, 0x04E2,
64204007ebaSmrg     /* vertical timings   */
64304007ebaSmrg     0x00A20000,                /* freq = 162.0 MHz   */
64404007ebaSmrg     },
645f29dbc25Smrg
646f29dbc25Smrg    {
64704007ebaSmrg     GFX_MODE_70HZ |            /* refresh rate = 70  */
64804007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
64904007ebaSmrg     /* all BPP valid      */
65004007ebaSmrg     GFX_MODE_16BPP | GFX_MODE_24BPP,
65104007ebaSmrg     0x0640, 0x0640, 0x0680, 0x0740, 0x0870, 0x0870,
65204007ebaSmrg     /* horizontal timings */
65304007ebaSmrg     0x04B0, 0x04B0, 0x04B1, 0x04B4, 0x04E2, 0x04E2,
65404007ebaSmrg     /* vertical timings   */
65504007ebaSmrg     0x00BD0000,                /* freq = 189.0 MHz   */
65604007ebaSmrg     },
657f29dbc25Smrg
658f29dbc25Smrg    {
65904007ebaSmrg     GFX_MODE_72HZ |            /* refresh rate = 72  */
66004007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
66104007ebaSmrg     /* all BPP valid      */
66204007ebaSmrg     GFX_MODE_16BPP | GFX_MODE_24BPP,
66304007ebaSmrg     0x0640, 0x0640, 0x06B0, 0x0760, 0x0880, 0x0880,
66404007ebaSmrg     /* horizontal timings */
66504007ebaSmrg     0x04B0, 0x04B0, 0x04BD, 0x04C0, 0x04EF, 0x04EF,
66604007ebaSmrg     /* vertical timings   */
66704007ebaSmrg     0x00C60000,                /* freq = 198.0 MHz   */
66804007ebaSmrg     },
669f29dbc25Smrg
670f29dbc25Smrg    {
67104007ebaSmrg     GFX_MODE_75HZ |            /* refresh rate = 75  */
67204007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
67304007ebaSmrg     /* all BPP valid      */
67404007ebaSmrg     GFX_MODE_16BPP | GFX_MODE_24BPP,
67504007ebaSmrg     0x0640, 0x0640, 0x0680, 0x0740, 0x0870, 0x0870,
67604007ebaSmrg     /* horizontal timings */
67704007ebaSmrg     0x04B0, 0x04B0, 0x04B1, 0x04B4, 0x04E2, 0x04E2,
67804007ebaSmrg     /* vertical timings   */
67904007ebaSmrg     0x00CA8000,                /* freq = 202.5 MHz   */
68004007ebaSmrg     },
681f29dbc25Smrg
682f29dbc25Smrg    {
68304007ebaSmrg     GFX_MODE_85HZ |            /* refresh rate = 85  */
68404007ebaSmrg     GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP |
68504007ebaSmrg     /* all BPP valid      */
68604007ebaSmrg     GFX_MODE_16BPP | GFX_MODE_24BPP,
68704007ebaSmrg     0x0640, 0x0640, 0x0680, 0x0740, 0x0870, 0x0870,
68804007ebaSmrg     /* horizontal timings */
68904007ebaSmrg     0x04B0, 0x04B0, 0x04B1, 0x04B4, 0x04E2, 0x04E2,
69004007ebaSmrg     /* vertical timings   */
69104007ebaSmrg     0x00E58000,                /* freq = 229.5 MHz   */
69204007ebaSmrg     },
693f29dbc25Smrg};
694f29dbc25Smrg
695f29dbc25Smrg/* UPDATE THIS VARIABLE WHENEVER NEW REDCLOUD-SPECIFIC MODES ARE ADDED */
696f29dbc25Smrg
697f29dbc25Smrg#define REDCLOUD_SPECIFIC_MODES 4
698f29dbc25Smrg
699f29dbc25Smrg#define NUM_RC_DISPLAY_MODES sizeof(DisplayParams) / sizeof(DISPLAYMODE)
700f29dbc25Smrg#define NUM_GX_DISPLAY_MODES (NUM_RC_DISPLAY_MODES - REDCLOUD_SPECIFIC_MODES)
701f29dbc25Smrg
702f29dbc25SmrgFIXEDTIMINGS FixedParams[] = {
703f29dbc25Smrg/* 640x480 Panel */
704f29dbc25Smrg    {640, 480, 640, 480,
70504007ebaSmrg     0x0280, 0x0280, 0x0290, 0x02E8, 0x0318, 0x0320,
70604007ebaSmrg     0x01E0, 0x01E0, 0x01EA, 0x01EC, 0x0205, 0x020D,
70704007ebaSmrg     0x00192CCC,
70804007ebaSmrg     },
709f29dbc25Smrg
710f29dbc25Smrg    {640, 480, 800, 600,
71104007ebaSmrg     0x0280, 0x0280, 0x0290, 0x02E8, 0x0318, 0x0320,
71204007ebaSmrg     0x01E0, 0x01E0, 0x01EA, 0x01EC, 0x0205, 0x020D,
71304007ebaSmrg     0x00192CCC,
71404007ebaSmrg     },
715f29dbc25Smrg
716f29dbc25Smrg    {640, 480, 1024, 768,
71704007ebaSmrg     0x0280, 0x0280, 0x0290, 0x02E8, 0x0318, 0x0320,
71804007ebaSmrg     0x01E0, 0x01E0, 0x01EA, 0x01EC, 0x0205, 0x020D,
71904007ebaSmrg     0x00192CCC,
72004007ebaSmrg     },
721f29dbc25Smrg
722f29dbc25Smrg    {640, 480, 1152, 864,
72304007ebaSmrg     0x0280, 0x0280, 0x0290, 0x02E8, 0x0318, 0x0320,
72404007ebaSmrg     0x01E0, 0x01E0, 0x01EA, 0x01EC, 0x0205, 0x020D,
72504007ebaSmrg     0x00192CCC,
72604007ebaSmrg     },
727f29dbc25Smrg
728f29dbc25Smrg    {640, 480, 1280, 1024,
72904007ebaSmrg     0x0280, 0x0280, 0x0290, 0x02E8, 0x0318, 0x0320,
73004007ebaSmrg     0x01E0, 0x01E0, 0x01EA, 0x01EC, 0x0205, 0x020D,
73104007ebaSmrg     0x00192CCC,
73204007ebaSmrg     },
733f29dbc25Smrg
734f29dbc25Smrg    {640, 480, 1600, 1200,
73504007ebaSmrg     0x0280, 0x0280, 0x0290, 0x02E8, 0x0318, 0x0320,
73604007ebaSmrg     0x01E0, 0x01E0, 0x01EA, 0x01EC, 0x0205, 0x020D,
73704007ebaSmrg     0x00192CCC,
73804007ebaSmrg     },
739f29dbc25Smrg
740f29dbc25Smrg/* 800x600 Panel */
741f29dbc25Smrg    {800, 600, 640, 480,
74204007ebaSmrg     0x0280, 0x2d0, 0x2f8, 0x378, 0x3d0, 0x420,
74304007ebaSmrg     0x1e0, 0x21c, 0x21d, 0x221, 0x238, 0x274,
74404007ebaSmrg     0x00280000,
74504007ebaSmrg     },
746f29dbc25Smrg
747f29dbc25Smrg    {800, 600, 800, 600,
74804007ebaSmrg     0x320, 0x320, 0x348, 0x3c8, 0x420, 0x420,
74904007ebaSmrg     0x258, 0x258, 0x259, 0x25d, 0x274, 0x274,
75004007ebaSmrg     0x00280000,
75104007ebaSmrg     },
752f29dbc25Smrg
753f29dbc25Smrg    {800, 600, 1024, 768,
75404007ebaSmrg     0x320, 0x320, 0x348, 0x3c8, 0x420, 0x420,
75504007ebaSmrg     0x258, 0x258, 0x259, 0x25d, 0x274, 0x274,
75604007ebaSmrg     0x00280000,
75704007ebaSmrg     },
758f29dbc25Smrg
759f29dbc25Smrg    {800, 600, 1152, 864,
76004007ebaSmrg     0x320, 0x320, 0x348, 0x3c8, 0x420, 0x420,
76104007ebaSmrg     0x258, 0x258, 0x259, 0x25d, 0x274, 0x274,
76204007ebaSmrg     0x00280000,
76304007ebaSmrg     },
764f29dbc25Smrg
765f29dbc25Smrg    {800, 600, 1280, 1024,
76604007ebaSmrg     0x320, 0x320, 0x348, 0x3c8, 0x420, 0x420,
76704007ebaSmrg     0x258, 0x258, 0x259, 0x25d, 0x274, 0x274,
76804007ebaSmrg     0x00280000,
76904007ebaSmrg     },
770f29dbc25Smrg
771f29dbc25Smrg    {800, 600, 1600, 1200,
77204007ebaSmrg     0x320, 0x320, 0x348, 0x3c8, 0x420, 0x420,
77304007ebaSmrg     0x258, 0x258, 0x259, 0x25d, 0x274, 0x274,
77404007ebaSmrg     0x00280000,
77504007ebaSmrg     },
776f29dbc25Smrg
777f29dbc25Smrg/* 1024x768 panel */
778f29dbc25Smrg    {1024, 768, 640, 480,
77904007ebaSmrg     0x0280, 0x340, 0x368, 0x3e8, 0x480, 0x540,
78004007ebaSmrg     0x1e0, 0x270, 0x271, 0x275, 0x296, 0x326,
78104007ebaSmrg     0x00410000,
78204007ebaSmrg     },
783f29dbc25Smrg
784f29dbc25Smrg    {1024, 768, 800, 600,
78504007ebaSmrg     0x0320, 0x390, 0x3b8, 0x438, 0x4D0, 0x540,
78604007ebaSmrg     0x258, 0x2ac, 0x2ad, 0x2b1, 0x2D2, 0x326,
78704007ebaSmrg     0x00410000,
78804007ebaSmrg     },
789f29dbc25Smrg
790f29dbc25Smrg    {1024, 768, 1024, 768,
79104007ebaSmrg     0x0400, 0x0400, 0x0418, 0x04A0, 0x0540, 0x0540,
79204007ebaSmrg     0x0300, 0x0300, 0x0303, 0x0309, 0x0326, 0x0326,
79304007ebaSmrg     0x00410000,
79404007ebaSmrg     },
795f29dbc25Smrg
796f29dbc25Smrg    {1024, 768, 1152, 864,
79704007ebaSmrg     0x0400, 0x0400, 0x0418, 0x04A0, 0x0540, 0x0540,
79804007ebaSmrg     0x0300, 0x0300, 0x0303, 0x0309, 0x0326, 0x0326,
79904007ebaSmrg     0x00410000,
80004007ebaSmrg     },
801f29dbc25Smrg
802f29dbc25Smrg    {1024, 768, 1280, 1024,
80304007ebaSmrg     0x0400, 0x0400, 0x0418, 0x04A0, 0x0540, 0x0540,
80404007ebaSmrg     0x0300, 0x0300, 0x0303, 0x0309, 0x0326, 0x0326,
80504007ebaSmrg     0x00410000,
80604007ebaSmrg     },
807f29dbc25Smrg
808f29dbc25Smrg    {1024, 768, 1600, 1200,
80904007ebaSmrg     0x0400, 0x0400, 0x0418, 0x04A0, 0x0540, 0x0540,
81004007ebaSmrg     0x0300, 0x0300, 0x0303, 0x0309, 0x0326, 0x0326,
81104007ebaSmrg     0x00410000,
81204007ebaSmrg     },
813f29dbc25Smrg
814f29dbc25Smrg/* 1280x1024 panel */
815f29dbc25Smrg    {1280, 1024, 640, 480,
81604007ebaSmrg     640, 960, 1008, 1120, 1368, 1688,
81704007ebaSmrg     480, 752, 753, 756, 794, 1066,
81804007ebaSmrg     0x006C0000,
81904007ebaSmrg     },
820f29dbc25Smrg
821f29dbc25Smrg    {1280, 1024, 800, 600,
82204007ebaSmrg     800, 1040, 1088, 1200, 1448, 1688,
82304007ebaSmrg     600, 812, 813, 816, 854, 1066,
82404007ebaSmrg     0x006C0000,
82504007ebaSmrg     },
826f29dbc25Smrg
827f29dbc25Smrg    {1280, 1024, 1024, 768,
82804007ebaSmrg     1024, 1152, 1200, 1312, 1560, 1688,
82904007ebaSmrg     768, 896, 897, 900, 938, 1066,
83004007ebaSmrg     0x006C0000,
83104007ebaSmrg     },
832f29dbc25Smrg
833f29dbc25Smrg    {1280, 1024, 1152, 864,
83404007ebaSmrg     1152, 1216, 1264, 1376, 1624, 1688,
83504007ebaSmrg     864, 944, 945, 948, 986, 1066,
83604007ebaSmrg     0x006C0000,
83704007ebaSmrg     },
838f29dbc25Smrg
839f29dbc25Smrg    {1280, 1024, 1280, 1024,
84004007ebaSmrg     1280, 1280, 1328, 1440, 1688, 1688,
84104007ebaSmrg     1024, 1024, 1025, 1028, 1066, 1066,
84204007ebaSmrg     0x006C0000,
84304007ebaSmrg     },
844f29dbc25Smrg
845f29dbc25Smrg};
846f29dbc25Smrg
847f29dbc25Smrg#define NUM_FIXED_TIMINGS_MODES sizeof(FixedParams)/sizeof(FIXEDTIMINGS)
848f29dbc25Smrg
849f29dbc25Smrg/* INCLUDE SUPPORT FOR FIRST GENERATION, IF SPECIFIED. */
850f29dbc25Smrg
851f29dbc25Smrg#if GFX_DISPLAY_GU1
852f29dbc25Smrg#include "disp_gu1.c"
853f29dbc25Smrg#endif
854f29dbc25Smrg
855f29dbc25Smrg/* INCLUDE SUPPORT FOR SECOND GENERATION, IF SPECIFIED. */
856f29dbc25Smrg
857f29dbc25Smrg#if GFX_DISPLAY_GU2
858f29dbc25Smrg#include "disp_gu2.c"
859f29dbc25Smrg#endif
860f29dbc25Smrg
861f29dbc25Smrg/*---------------------------------------------------------------------------
862f29dbc25Smrg * gfx_reset_timing_lock
863f29dbc25Smrg *
864f29dbc25Smrg * This routine resets the timing change lock. The lock can only be set by
865f29dbc25Smrg * setting a flag when calling mode set.
866f29dbc25Smrg *---------------------------------------------------------------------------
867f29dbc25Smrg */
868f29dbc25Smrgvoid
869f29dbc25Smrggfx_reset_timing_lock(void)
870f29dbc25Smrg{
871f29dbc25Smrg    gfx_timing_lock = 0;
872f29dbc25Smrg}
873f29dbc25Smrg
874f29dbc25Smrg/* WRAPPERS IF DYNAMIC SELECTION */
875f29dbc25Smrg/* Extra layer to call either first or second generation routines. */
876f29dbc25Smrg
877f29dbc25Smrg#if GFX_DISPLAY_DYNAMIC
878f29dbc25Smrg
879f29dbc25Smrg/*---------------------------------------------------------------------------
880f29dbc25Smrg * gfx_set_display_bpp
881f29dbc25Smrg *---------------------------------------------------------------------------
882f29dbc25Smrg */
883f29dbc25Smrgint
884f29dbc25Smrggfx_set_display_bpp(unsigned short bpp)
885f29dbc25Smrg{
886f29dbc25Smrg    int retval = 0;
887f29dbc25Smrg
888f29dbc25Smrg#if GFX_DISPLAY_GU1
889f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
890f29dbc25Smrg        retval = gu1_set_display_bpp(bpp);
891f29dbc25Smrg#endif
892f29dbc25Smrg#if GFX_DISPLAY_GU2
893f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
894f29dbc25Smrg        retval = gu2_set_display_bpp(bpp);
895f29dbc25Smrg#endif
896f29dbc25Smrg    return (retval);
897f29dbc25Smrg}
898f29dbc25Smrg
899f29dbc25Smrg/*---------------------------------------------------------------------------
900f29dbc25Smrg * gfx_is_display_mode_supported
901f29dbc25Smrg * check if given mode supported,
902f29dbc25Smrg * return the supported mode on success, -1 on fail
903f29dbc25Smrg *---------------------------------------------------------------------------
904f29dbc25Smrg */
905f29dbc25Smrgint
906f29dbc25Smrggfx_is_display_mode_supported(int xres, int yres, int bpp, int hz)
907f29dbc25Smrg{
908f29dbc25Smrg    int retval = -1;
909f29dbc25Smrg
910f29dbc25Smrg#if GFX_DISPLAY_GU1
911f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
912f29dbc25Smrg        retval = gu1_is_display_mode_supported(xres, yres, bpp, hz);
913f29dbc25Smrg#endif
914f29dbc25Smrg#if GFX_DISPLAY_GU2
915f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
916f29dbc25Smrg        retval = gu2_is_display_mode_supported(xres, yres, bpp, hz);
917f29dbc25Smrg#endif
918f29dbc25Smrg    return (retval);
919f29dbc25Smrg}
920f29dbc25Smrg
921f29dbc25Smrg/*---------------------------------------------------------------------------
922f29dbc25Smrg * gfx_set_display_mode
923f29dbc25Smrg *---------------------------------------------------------------------------
924f29dbc25Smrg */
925f29dbc25Smrgint
926f29dbc25Smrggfx_set_display_mode(int xres, int yres, int bpp, int hz)
927f29dbc25Smrg{
928f29dbc25Smrg    int retval = 0;
929f29dbc25Smrg
930f29dbc25Smrg#if GFX_DISPLAY_GU1
931f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
932f29dbc25Smrg        retval = gu1_set_display_mode(xres, yres, bpp, hz);
933f29dbc25Smrg#endif
934f29dbc25Smrg#if GFX_DISPLAY_GU2
935f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
936f29dbc25Smrg        retval = gu2_set_display_mode(xres, yres, bpp, hz);
937f29dbc25Smrg#endif
938f29dbc25Smrg    return (retval);
939f29dbc25Smrg}
940f29dbc25Smrg
941f29dbc25Smrg/*---------------------------------------------------------------------------
942f29dbc25Smrg * gfx_set_display_timings
943f29dbc25Smrg *---------------------------------------------------------------------------
944f29dbc25Smrg */
945f29dbc25Smrgint
946f29dbc25Smrggfx_set_display_timings(unsigned short bpp, unsigned short flags,
94704007ebaSmrg                        unsigned short hactive, unsigned short hblankstart,
94804007ebaSmrg                        unsigned short hsyncstart, unsigned short hsyncend,
94904007ebaSmrg                        unsigned short hblankend, unsigned short htotal,
95004007ebaSmrg                        unsigned short vactive, unsigned short vblankstart,
95104007ebaSmrg                        unsigned short vsyncstart, unsigned short vsyncend,
95204007ebaSmrg                        unsigned short vblankend, unsigned short vtotal,
95304007ebaSmrg                        unsigned long frequency)
954f29dbc25Smrg{
955f29dbc25Smrg    int retval = 0;
956f29dbc25Smrg
957f29dbc25Smrg#if GFX_DISPLAY_GU1
958f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
959f29dbc25Smrg        retval = gu1_set_display_timings(bpp, flags,
96004007ebaSmrg                                         hactive, hblankstart, hsyncstart,
96104007ebaSmrg                                         hsyncend, hblankend, htotal, vactive,
96204007ebaSmrg                                         vblankstart, vsyncstart, vsyncend,
96304007ebaSmrg                                         vblankend, vtotal, frequency);
964f29dbc25Smrg#endif
965f29dbc25Smrg#if GFX_DISPLAY_GU2
966f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
967f29dbc25Smrg        retval = gu2_set_display_timings(bpp, flags,
96804007ebaSmrg                                         hactive, hblankstart, hsyncstart,
96904007ebaSmrg                                         hsyncend, hblankend, htotal, vactive,
97004007ebaSmrg                                         vblankstart, vsyncstart, vsyncend,
97104007ebaSmrg                                         vblankend, vtotal, frequency);
972f29dbc25Smrg#endif
973f29dbc25Smrg    return (retval);
974f29dbc25Smrg}
975f29dbc25Smrg
976f29dbc25Smrg/*---------------------------------------------------------------------------
977f29dbc25Smrg * gfx_set_display_pitch
978f29dbc25Smrg *---------------------------------------------------------------------------
979f29dbc25Smrg */
980f29dbc25Smrgvoid
981f29dbc25Smrggfx_set_display_pitch(unsigned short pitch)
982f29dbc25Smrg{
983f29dbc25Smrg#if GFX_DISPLAY_GU1
984f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
985f29dbc25Smrg        gu1_set_display_pitch(pitch);
986f29dbc25Smrg#endif
987f29dbc25Smrg#if GFX_DISPLAY_GU2
988f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
989f29dbc25Smrg        gu2_set_display_pitch(pitch);
990f29dbc25Smrg#endif
991f29dbc25Smrg}
992f29dbc25Smrg
993f29dbc25Smrg/*---------------------------------------------------------------------------
994f29dbc25Smrg * gfx_set_display_offset
995f29dbc25Smrg *---------------------------------------------------------------------------
996f29dbc25Smrg */
997f29dbc25Smrgvoid
998f29dbc25Smrggfx_set_display_offset(unsigned long offset)
999f29dbc25Smrg{
1000f29dbc25Smrg#if GFX_DISPLAY_GU1
1001f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1002f29dbc25Smrg        gu1_set_display_offset(offset);
1003f29dbc25Smrg#endif
1004f29dbc25Smrg#if GFX_DISPLAY_GU2
1005f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1006f29dbc25Smrg        gu2_set_display_offset(offset);
1007f29dbc25Smrg#endif
1008f29dbc25Smrg}
1009f29dbc25Smrg
1010f29dbc25Smrg/*---------------------------------------------------------------------------
1011f29dbc25Smrg * gfx_set_display_palette_entry
1012f29dbc25Smrg *---------------------------------------------------------------------------
1013f29dbc25Smrg */
1014f29dbc25Smrgint
1015f29dbc25Smrggfx_set_display_palette_entry(unsigned long index, unsigned long palette)
1016f29dbc25Smrg{
1017f29dbc25Smrg    int status = 0;
1018f29dbc25Smrg
1019f29dbc25Smrg#if GFX_DISPLAY_GU1
1020f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1021f29dbc25Smrg        status = gu1_set_display_palette_entry(index, palette);
1022f29dbc25Smrg#endif
1023f29dbc25Smrg#if GFX_DISPLAY_GU2
1024f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1025f29dbc25Smrg        status = gu2_set_display_palette_entry(index, palette);
1026f29dbc25Smrg#endif
1027f29dbc25Smrg    return (status);
1028f29dbc25Smrg}
1029f29dbc25Smrg
1030f29dbc25Smrg/*---------------------------------------------------------------------------
1031f29dbc25Smrg * gfx_set_display_palette
1032f29dbc25Smrg *---------------------------------------------------------------------------
1033f29dbc25Smrg */
1034f29dbc25Smrgint
1035f29dbc25Smrggfx_set_display_palette(unsigned long *palette)
1036f29dbc25Smrg{
1037f29dbc25Smrg    int status = 0;
1038f29dbc25Smrg
1039f29dbc25Smrg#if GFX_DISPLAY_GU1
1040f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1041f29dbc25Smrg        status = gu1_set_display_palette(palette);
1042f29dbc25Smrg#endif
1043f29dbc25Smrg#if GFX_DISPLAY_GU2
1044f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1045f29dbc25Smrg        status = gu2_set_display_palette(palette);
1046f29dbc25Smrg#endif
1047f29dbc25Smrg    return (status);
1048f29dbc25Smrg}
1049f29dbc25Smrg
1050f29dbc25Smrg/*---------------------------------------------------------------------------
1051f29dbc25Smrg * gfx_set_cursor_enable
1052f29dbc25Smrg *---------------------------------------------------------------------------
1053f29dbc25Smrg */
1054f29dbc25Smrgvoid
1055f29dbc25Smrggfx_set_cursor_enable(int enable)
1056f29dbc25Smrg{
1057f29dbc25Smrg#if GFX_DISPLAY_GU1
1058f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1059f29dbc25Smrg        gu1_set_cursor_enable(enable);
1060f29dbc25Smrg#endif
1061f29dbc25Smrg#if GFX_DISPLAY_GU2
1062f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1063f29dbc25Smrg        gu2_set_cursor_enable(enable);
1064f29dbc25Smrg#endif
1065f29dbc25Smrg}
1066f29dbc25Smrg
1067f29dbc25Smrg/*---------------------------------------------------------------------------
1068f29dbc25Smrg * gfx_set_cursor_colors
1069f29dbc25Smrg *---------------------------------------------------------------------------
1070f29dbc25Smrg */
1071f29dbc25Smrgvoid
1072f29dbc25Smrggfx_set_cursor_colors(unsigned long bkcolor, unsigned long fgcolor)
1073f29dbc25Smrg{
1074f29dbc25Smrg#if GFX_DISPLAY_GU1
1075f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1076f29dbc25Smrg        gu1_set_cursor_colors(bkcolor, fgcolor);
1077f29dbc25Smrg#endif
1078f29dbc25Smrg#if GFX_DISPLAY_GU2
1079f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1080f29dbc25Smrg        gu2_set_cursor_colors(bkcolor, fgcolor);
1081f29dbc25Smrg#endif
1082f29dbc25Smrg}
1083f29dbc25Smrg
1084f29dbc25Smrg/*---------------------------------------------------------------------------
1085f29dbc25Smrg * gfx_set_cursor_position
1086f29dbc25Smrg *---------------------------------------------------------------------------
1087f29dbc25Smrg */
1088f29dbc25Smrgvoid
1089f29dbc25Smrggfx_set_cursor_position(unsigned long memoffset,
109004007ebaSmrg                        unsigned short xpos, unsigned short ypos,
109104007ebaSmrg                        unsigned short xhotspot, unsigned short yhotspot)
1092f29dbc25Smrg{
1093f29dbc25Smrg#if GFX_DISPLAY_GU1
1094f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1095f29dbc25Smrg        gu1_set_cursor_position(memoffset, xpos, ypos, xhotspot, yhotspot);
1096f29dbc25Smrg#endif
1097f29dbc25Smrg#if GFX_DISPLAY_GU2
1098f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1099f29dbc25Smrg        gu2_set_cursor_position(memoffset, xpos, ypos, xhotspot, yhotspot);
1100f29dbc25Smrg#endif
1101f29dbc25Smrg}
1102f29dbc25Smrg
1103f29dbc25Smrg/*---------------------------------------------------------------------------
1104f29dbc25Smrg * gfx_set_cursor_shape32
1105f29dbc25Smrg *---------------------------------------------------------------------------
1106f29dbc25Smrg */
1107f29dbc25Smrgvoid
1108f29dbc25Smrggfx_set_cursor_shape32(unsigned long memoffset,
110904007ebaSmrg                       unsigned long *andmask, unsigned long *xormask)
1110f29dbc25Smrg{
1111f29dbc25Smrg#if GFX_DISPLAY_GU1
1112f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1113f29dbc25Smrg        gu1_set_cursor_shape32(memoffset, andmask, xormask);
1114f29dbc25Smrg#endif
1115f29dbc25Smrg#if GFX_DISPLAY_GU2
1116f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1117f29dbc25Smrg        gu2_set_cursor_shape32(memoffset, andmask, xormask);
1118f29dbc25Smrg#endif
1119f29dbc25Smrg}
1120f29dbc25Smrg
1121f29dbc25Smrg/*---------------------------------------------------------------------------
1122f29dbc25Smrg * gfx_set_cursor_shape64
1123f29dbc25Smrg *---------------------------------------------------------------------------
1124f29dbc25Smrg */
1125f29dbc25Smrgvoid
1126f29dbc25Smrggfx_set_cursor_shape64(unsigned long memoffset,
112704007ebaSmrg                       unsigned long *andmask, unsigned long *xormask)
1128f29dbc25Smrg{
1129f29dbc25Smrg#if GFX_DISPLAY_GU2
1130f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1131f29dbc25Smrg        gu2_set_cursor_shape64(memoffset, andmask, xormask);
1132f29dbc25Smrg#endif
1133f29dbc25Smrg}
1134f29dbc25Smrg
1135f29dbc25Smrg/*---------------------------------------------------------------------------
1136f29dbc25Smrg * gfx_set_icon_enable
1137f29dbc25Smrg *---------------------------------------------------------------------------
1138f29dbc25Smrg */
1139f29dbc25Smrgvoid
1140f29dbc25Smrggfx_set_icon_enable(int enable)
1141f29dbc25Smrg{
1142f29dbc25Smrg#if GFX_DISPLAY_GU2
1143f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1144f29dbc25Smrg        gu2_set_icon_enable(enable);
1145f29dbc25Smrg#endif
1146f29dbc25Smrg}
1147f29dbc25Smrg
1148f29dbc25Smrg/*---------------------------------------------------------------------------
1149f29dbc25Smrg * gfx_set_icon_colors
1150f29dbc25Smrg *---------------------------------------------------------------------------
1151f29dbc25Smrg */
1152f29dbc25Smrgvoid
1153f29dbc25Smrggfx_set_icon_colors(unsigned long color0, unsigned long color1,
115404007ebaSmrg                    unsigned long color2)
1155f29dbc25Smrg{
1156f29dbc25Smrg#if GFX_DISPLAY_GU2
1157f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1158f29dbc25Smrg        gu2_set_icon_colors(color0, color1, color2);
1159f29dbc25Smrg#endif
1160f29dbc25Smrg}
1161f29dbc25Smrg
1162f29dbc25Smrg/*---------------------------------------------------------------------------
1163f29dbc25Smrg * gfx_set_icon_position
1164f29dbc25Smrg *---------------------------------------------------------------------------
1165f29dbc25Smrg */
1166f29dbc25Smrgvoid
1167f29dbc25Smrggfx_set_icon_position(unsigned long memoffset, unsigned short xpos)
1168f29dbc25Smrg{
1169f29dbc25Smrg#if GFX_DISPLAY_GU2
1170f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1171f29dbc25Smrg        gu2_set_icon_position(memoffset, xpos);
1172f29dbc25Smrg#endif
1173f29dbc25Smrg}
1174f29dbc25Smrg
1175f29dbc25Smrg/*---------------------------------------------------------------------------
1176f29dbc25Smrg * gfx_set_icon_shape64
1177f29dbc25Smrg *---------------------------------------------------------------------------
1178f29dbc25Smrg */
1179f29dbc25Smrgvoid
1180f29dbc25Smrggfx_set_icon_shape64(unsigned long memoffset,
118104007ebaSmrg                     unsigned long *andmask, unsigned long *xormask,
118204007ebaSmrg                     unsigned int lines)
1183f29dbc25Smrg{
1184f29dbc25Smrg#if GFX_DISPLAY_GU2
1185f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1186f29dbc25Smrg        gu2_set_icon_shape64(memoffset, andmask, xormask, lines);
1187f29dbc25Smrg#endif
1188f29dbc25Smrg}
1189f29dbc25Smrg
1190f29dbc25Smrg/*---------------------------------------------------------------------------
1191f29dbc25Smrg * gfx_set_compression_enable
1192f29dbc25Smrg *---------------------------------------------------------------------------
1193f29dbc25Smrg */
1194f29dbc25Smrgint
1195f29dbc25Smrggfx_set_compression_enable(int enable)
1196f29dbc25Smrg{
1197f29dbc25Smrg    int status = 0;
1198f29dbc25Smrg
1199f29dbc25Smrg#if GFX_DISPLAY_GU1
1200f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1201f29dbc25Smrg        status = gu1_set_compression_enable(enable);
1202f29dbc25Smrg#endif
1203f29dbc25Smrg#if GFX_DISPLAY_GU2
1204f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1205f29dbc25Smrg        status = gu2_set_compression_enable(enable);
1206f29dbc25Smrg#endif
1207f29dbc25Smrg    return (status);
1208f29dbc25Smrg}
1209f29dbc25Smrg
1210f29dbc25Smrg/*---------------------------------------------------------------------------
1211f29dbc25Smrg * gfx_set_compression_offset
1212f29dbc25Smrg *---------------------------------------------------------------------------
1213f29dbc25Smrg */
1214f29dbc25Smrgint
1215f29dbc25Smrggfx_set_compression_offset(unsigned long offset)
1216f29dbc25Smrg{
1217f29dbc25Smrg    int status = 0;
1218f29dbc25Smrg
1219f29dbc25Smrg#if GFX_DISPLAY_GU1
1220f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1221f29dbc25Smrg        status = gu1_set_compression_offset(offset);
1222f29dbc25Smrg#endif
1223f29dbc25Smrg#if GFX_DISPLAY_GU2
1224f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1225f29dbc25Smrg        status = gu2_set_compression_offset(offset);
1226f29dbc25Smrg#endif
1227f29dbc25Smrg    return (status);
1228f29dbc25Smrg}
1229f29dbc25Smrg
1230f29dbc25Smrg/*---------------------------------------------------------------------------
1231f29dbc25Smrg * gfx_set_compression_pitch
1232f29dbc25Smrg *---------------------------------------------------------------------------
1233f29dbc25Smrg */
1234f29dbc25Smrgint
1235f29dbc25Smrggfx_set_compression_pitch(unsigned short pitch)
1236f29dbc25Smrg{
1237f29dbc25Smrg    int status = 0;
1238f29dbc25Smrg
1239f29dbc25Smrg#if GFX_DISPLAY_GU1
1240f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1241f29dbc25Smrg        status = gu1_set_compression_pitch(pitch);
1242f29dbc25Smrg#endif
1243f29dbc25Smrg#if GFX_DISPLAY_GU2
1244f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1245f29dbc25Smrg        status = gu2_set_compression_pitch(pitch);
1246f29dbc25Smrg#endif
1247f29dbc25Smrg    return (status);
1248f29dbc25Smrg}
1249f29dbc25Smrg
1250f29dbc25Smrg/*---------------------------------------------------------------------------
1251f29dbc25Smrg * gfx_set_compression_size
1252f29dbc25Smrg *---------------------------------------------------------------------------
1253f29dbc25Smrg */
1254f29dbc25Smrgint
1255f29dbc25Smrggfx_set_compression_size(unsigned short size)
1256f29dbc25Smrg{
1257f29dbc25Smrg    int status = 0;
1258f29dbc25Smrg
1259f29dbc25Smrg#if GFX_DISPLAY_GU1
1260f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1261f29dbc25Smrg        status = gu1_set_compression_size(size);
1262f29dbc25Smrg#endif
1263f29dbc25Smrg#if GFX_DISPLAY_GU2
1264f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1265f29dbc25Smrg        status = gu2_set_compression_size(size);
1266f29dbc25Smrg#endif
1267f29dbc25Smrg    return (status);
1268f29dbc25Smrg}
1269f29dbc25Smrg
1270f29dbc25Smrg/*---------------------------------------------------------------------------
1271f29dbc25Smrg * gfx_set_display_priority_high
1272f29dbc25Smrg *---------------------------------------------------------------------------
1273f29dbc25Smrg */
1274f29dbc25Smrgvoid
1275f29dbc25Smrggfx_set_display_priority_high(int enable)
1276f29dbc25Smrg{
1277f29dbc25Smrg#if GFX_DISPLAY_GU1
1278f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1279f29dbc25Smrg        gu1_set_display_priority_high(enable);
1280f29dbc25Smrg#endif
1281f29dbc25Smrg}
1282f29dbc25Smrg
1283f29dbc25Smrg/*---------------------------------------------------------------------------
1284f29dbc25Smrg * gfx_set_display_video_format (PRIVATE ROUTINE - NOT PART OF API)
1285f29dbc25Smrg *
1286f29dbc25Smrg * This routine is called by "gfx_set_video_format".  It abstracts the
1287f29dbc25Smrg * version of the display controller from the video overlay routines.
1288f29dbc25Smrg *---------------------------------------------------------------------------
1289f29dbc25Smrg */
1290f29dbc25Smrgvoid
1291f29dbc25Smrggfx_set_display_video_format(unsigned long format)
1292f29dbc25Smrg{
1293f29dbc25Smrg#if GFX_DISPLAY_GU2
1294f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1295f29dbc25Smrg        gu2_set_display_video_format(format);
1296f29dbc25Smrg#endif
1297f29dbc25Smrg}
1298f29dbc25Smrg
1299f29dbc25Smrg/*---------------------------------------------------------------------------
1300f29dbc25Smrg * gfx_set_display_video_enable (PRIVATE ROUTINE - NOT PART OF API)
1301f29dbc25Smrg *
1302f29dbc25Smrg * This routine is called by "gfx_set_video_enable".  It abstracts the
1303f29dbc25Smrg * version of the display controller from the video overlay routines.
1304f29dbc25Smrg *---------------------------------------------------------------------------
1305f29dbc25Smrg */
1306f29dbc25Smrgvoid
1307f29dbc25Smrggfx_set_display_video_enable(int enable)
1308f29dbc25Smrg{
1309f29dbc25Smrg#if GFX_DISPLAY_GU1
1310f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1311f29dbc25Smrg        gu1_set_display_video_enable(enable);
1312f29dbc25Smrg#endif
1313f29dbc25Smrg#if GFX_DISPLAY_GU2
1314f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1315f29dbc25Smrg        gu2_set_display_video_enable(enable);
1316f29dbc25Smrg#endif
1317f29dbc25Smrg    return;
1318f29dbc25Smrg}
1319f29dbc25Smrg
1320f29dbc25Smrg/*---------------------------------------------------------------------------
1321f29dbc25Smrg * gfx_set_display_video_size (PRIVATE ROUTINE - NOT PART OF API)
1322f29dbc25Smrg *
1323f29dbc25Smrg * This routine is called by "gfx_set_video_size".  It abstracts the
1324f29dbc25Smrg * version of the display controller from the video overlay routines.
1325f29dbc25Smrg *---------------------------------------------------------------------------
1326f29dbc25Smrg */
1327f29dbc25Smrgvoid
1328f29dbc25Smrggfx_set_display_video_size(unsigned short width, unsigned short height)
1329f29dbc25Smrg{
1330f29dbc25Smrg#if GFX_DISPLAY_GU1
1331f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1332f29dbc25Smrg        gu1_set_display_video_size(width, height);
1333f29dbc25Smrg#endif
1334f29dbc25Smrg#if GFX_DISPLAY_GU2
1335f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1336f29dbc25Smrg        gu2_set_display_video_size(width, height);
1337f29dbc25Smrg#endif
1338f29dbc25Smrg}
1339f29dbc25Smrg
1340f29dbc25Smrg/*---------------------------------------------------------------------------
1341f29dbc25Smrg * gfx_set_display_video_offset (PRIVATE ROUTINE - NOT PART OF API)
1342f29dbc25Smrg *
1343f29dbc25Smrg * This routine is called by "gfx_set_video_offset".  It abstracts the
1344f29dbc25Smrg * version of the display controller from the video overlay routines.
1345f29dbc25Smrg *---------------------------------------------------------------------------
1346f29dbc25Smrg */
1347f29dbc25Smrgvoid
1348f29dbc25Smrggfx_set_display_video_offset(unsigned long offset)
1349f29dbc25Smrg{
1350f29dbc25Smrg#if GFX_DISPLAY_GU1
1351f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1352f29dbc25Smrg        gu1_set_display_video_offset(offset);
1353f29dbc25Smrg#endif
1354f29dbc25Smrg#if GFX_DISPLAY_GU2
1355f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1356f29dbc25Smrg        gu2_set_display_video_offset(offset);
1357f29dbc25Smrg#endif
1358f29dbc25Smrg}
1359f29dbc25Smrg
1360f29dbc25Smrg/*---------------------------------------------------------------------------
1361f29dbc25Smrg * gfx_set_display_video_yuv_offsets (PRIVATE ROUTINE - NOT PART OF API)
1362f29dbc25Smrg *
1363f29dbc25Smrg * This routine is called by "gfx_set_video_yuv_offsets".  It abstracts the
1364f29dbc25Smrg * version of the display controller from the video overlay routines.
1365f29dbc25Smrg *---------------------------------------------------------------------------
1366f29dbc25Smrg */
1367f29dbc25Smrgvoid
1368f29dbc25Smrggfx_set_display_video_yuv_offsets(unsigned long yoffset,
136904007ebaSmrg                                  unsigned long uoffset, unsigned long voffset)
1370f29dbc25Smrg{
1371f29dbc25Smrg#if GFX_DISPLAY_GU2
1372f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1373f29dbc25Smrg        gu2_set_display_video_yuv_offsets(yoffset, uoffset, voffset);
1374f29dbc25Smrg#endif
1375f29dbc25Smrg}
1376f29dbc25Smrg
1377f29dbc25Smrg/*---------------------------------------------------------------------------
1378f29dbc25Smrg * gfx_set_display_video_yuv_pitch (PRIVATE ROUTINE - NOT PART OF API)
1379f29dbc25Smrg *
1380f29dbc25Smrg * This routine is called by "gfx_set_video_yuv_pitch".  It abstracts the
1381f29dbc25Smrg * version of the display controller from the video overlay routines.
1382f29dbc25Smrg *---------------------------------------------------------------------------
1383f29dbc25Smrg */
1384f29dbc25Smrgvoid
1385f29dbc25Smrggfx_set_display_video_yuv_pitch(unsigned long ypitch, unsigned long uvpitch)
1386f29dbc25Smrg{
1387f29dbc25Smrg#if GFX_DISPLAY_GU2
1388f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1389f29dbc25Smrg        gu2_set_display_video_yuv_pitch(ypitch, uvpitch);
1390f29dbc25Smrg#endif
1391f29dbc25Smrg}
1392f29dbc25Smrg
1393f29dbc25Smrg/*---------------------------------------------------------------------------
1394f29dbc25Smrg * gfx_set_display_video_downscale (PRIVATE ROUTINE - NOT PART OF API)
1395f29dbc25Smrg *
1396f29dbc25Smrg * This routine is called by "gfx_set_video_vertical_downscale".  It abstracts the
1397f29dbc25Smrg * version of the display controller from the video overlay routines.
1398f29dbc25Smrg *---------------------------------------------------------------------------
1399f29dbc25Smrg */
1400f29dbc25Smrgvoid
1401f29dbc25Smrggfx_set_display_video_downscale(unsigned short srch, unsigned short dsth)
1402f29dbc25Smrg{
1403f29dbc25Smrg#if GFX_DISPLAY_GU2
1404f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1405f29dbc25Smrg        gu2_set_display_video_downscale(srch, dsth);
1406f29dbc25Smrg#endif
1407f29dbc25Smrg}
1408f29dbc25Smrg
1409f29dbc25Smrg/*---------------------------------------------------------------------------
1410f29dbc25Smrg * gfx_set_display_video_vertical_downscale_enable (PRIVATE ROUTINE - NOT PART OF API)
1411f29dbc25Smrg *
1412f29dbc25Smrg * This routine is called by "gfx_set_video_vertical_downscale_enable".  It abstracts the
1413f29dbc25Smrg * version of the display controller from the video overlay routines.
1414f29dbc25Smrg *---------------------------------------------------------------------------
1415f29dbc25Smrg */
1416f29dbc25Smrgvoid
1417f29dbc25Smrggfx_set_display_video_vertical_downscale_enable(int enable)
1418f29dbc25Smrg{
1419f29dbc25Smrg#if GFX_DISPLAY_GU2
1420f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1421f29dbc25Smrg        gu2_set_display_video_vertical_downscale_enable(enable);
1422f29dbc25Smrg#endif
1423f29dbc25Smrg}
1424f29dbc25Smrg
1425f29dbc25Smrg/*---------------------------------------------------------------------------
1426f29dbc25Smrg * gfx_test_timing_active
1427f29dbc25Smrg *---------------------------------------------------------------------------
1428f29dbc25Smrg */
1429f29dbc25Smrgint
1430f29dbc25Smrggfx_test_timing_active(void)
1431f29dbc25Smrg{
1432f29dbc25Smrg    int status = 0;
1433f29dbc25Smrg
1434f29dbc25Smrg#if GFX_DISPLAY_GU1
1435f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1436f29dbc25Smrg        status = gu1_test_timing_active();
1437f29dbc25Smrg#endif
1438f29dbc25Smrg#if GFX_DISPLAY_GU2
1439f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1440f29dbc25Smrg        status = gu2_test_timing_active();
1441f29dbc25Smrg#endif
1442f29dbc25Smrg    return (status);
1443f29dbc25Smrg}
1444f29dbc25Smrg
1445f29dbc25Smrg/*---------------------------------------------------------------------------
1446f29dbc25Smrg * gfx_test_vertical_active
1447f29dbc25Smrg *---------------------------------------------------------------------------
1448f29dbc25Smrg */
1449f29dbc25Smrgint
1450f29dbc25Smrggfx_test_vertical_active(void)
1451f29dbc25Smrg{
1452f29dbc25Smrg    int status = 0;
1453f29dbc25Smrg
1454f29dbc25Smrg#if GFX_DISPLAY_GU1
1455f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1456f29dbc25Smrg        status = gu1_test_vertical_active();
1457f29dbc25Smrg#endif
1458f29dbc25Smrg#if GFX_DISPLAY_GU2
1459f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1460f29dbc25Smrg        status = gu2_test_vertical_active();
1461f29dbc25Smrg#endif
1462f29dbc25Smrg    return (status);
1463f29dbc25Smrg}
1464f29dbc25Smrg
1465f29dbc25Smrg/*---------------------------------------------------------------------------
1466f29dbc25Smrg * gfx_wait_vertical_blank
1467f29dbc25Smrg *---------------------------------------------------------------------------
1468f29dbc25Smrg */
1469f29dbc25Smrgint
1470f29dbc25Smrggfx_wait_vertical_blank(void)
1471f29dbc25Smrg{
1472f29dbc25Smrg    int status = 0;
1473f29dbc25Smrg
1474f29dbc25Smrg#if GFX_DISPLAY_GU1
1475f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1476f29dbc25Smrg        status = gu1_wait_vertical_blank();
1477f29dbc25Smrg#endif
1478f29dbc25Smrg#if GFX_DISPLAY_GU2
1479f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1480f29dbc25Smrg        status = gu2_wait_vertical_blank();
1481f29dbc25Smrg#endif
1482f29dbc25Smrg    return (status);
1483f29dbc25Smrg}
1484f29dbc25Smrg
1485f29dbc25Smrg/*---------------------------------------------------------------------------
1486f29dbc25Smrg * gfx_delay_milliseconds
1487f29dbc25Smrg *---------------------------------------------------------------------------
1488f29dbc25Smrg */
1489f29dbc25Smrgvoid
1490f29dbc25Smrggfx_delay_milliseconds(unsigned long milliseconds)
1491f29dbc25Smrg{
1492f29dbc25Smrg#if GFX_DISPLAY_GU1
1493f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1494f29dbc25Smrg        gu1_delay_milliseconds(milliseconds);
1495f29dbc25Smrg#endif
1496f29dbc25Smrg#if GFX_DISPLAY_GU2
1497f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1498f29dbc25Smrg        gu2_delay_milliseconds(milliseconds);
1499f29dbc25Smrg#endif
1500f29dbc25Smrg}
1501f29dbc25Smrg
1502f29dbc25Smrg/*---------------------------------------------------------------------------
1503f29dbc25Smrg * gfx_delay_microseconds
1504f29dbc25Smrg *---------------------------------------------------------------------------
1505f29dbc25Smrg */
1506f29dbc25Smrgvoid
1507f29dbc25Smrggfx_delay_microseconds(unsigned long microseconds)
1508f29dbc25Smrg{
1509f29dbc25Smrg#if GFX_DISPLAY_GU1
1510f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1511f29dbc25Smrg        gu1_delay_microseconds(microseconds);
1512f29dbc25Smrg#endif
1513f29dbc25Smrg#if GFX_DISPLAY_GU2
1514f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1515f29dbc25Smrg        gu2_delay_microseconds(microseconds);
1516f29dbc25Smrg#endif
1517f29dbc25Smrg}
1518f29dbc25Smrg
1519f29dbc25Smrg/*---------------------------------------------------------------------------
1520f29dbc25Smrg * gfx_enable_panning
1521f29dbc25Smrg *
1522f29dbc25Smrg * This routine  enables the panning when the Mode is bigger than the panel
1523f29dbc25Smrg * size.
1524f29dbc25Smrg *---------------------------------------------------------------------------
1525f29dbc25Smrg */
1526f29dbc25Smrgvoid
1527f29dbc25Smrggfx_enable_panning(int x, int y)
1528f29dbc25Smrg{
1529f29dbc25Smrg#if GFX_DISPLAY_GU1
1530f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1531f29dbc25Smrg        gu1_enable_panning(x, y);
1532f29dbc25Smrg#endif
1533f29dbc25Smrg#if GFX_DISPLAY_GU2
1534f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1535f29dbc25Smrg        gu2_enable_panning(x, y);
1536f29dbc25Smrg#endif
1537f29dbc25Smrg}
1538f29dbc25Smrg
1539f29dbc25Smrg/*---------------------------------------------------------------------------
1540f29dbc25Smrg * gfx_is_panel_mode_supported
1541f29dbc25Smrg *---------------------------------------------------------------------------
1542f29dbc25Smrg */
1543f29dbc25Smrgint
1544f29dbc25Smrggfx_is_panel_mode_supported(int panelResX, int panelResY,
154504007ebaSmrg                            unsigned short width, unsigned short height,
154604007ebaSmrg                            unsigned short bpp)
1547f29dbc25Smrg{
1548f29dbc25Smrg    int status = -1;
1549f29dbc25Smrg
1550f29dbc25Smrg#if GFX_DISPLAY_GU2
1551f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1552f29dbc25Smrg        status =
1553f29dbc25Smrg            gu2_is_panel_mode_supported(panelResX, panelResY, width, height,
155404007ebaSmrg                                        bpp);
1555f29dbc25Smrg#endif
1556f29dbc25Smrg
1557f29dbc25Smrg    return (status);
1558f29dbc25Smrg}
1559f29dbc25Smrg
1560f29dbc25Smrg/*---------------------------------------------------------------------------
1561f29dbc25Smrg * gfx_set_fixed_timings
1562f29dbc25Smrg *---------------------------------------------------------------------------
1563f29dbc25Smrg */
1564f29dbc25Smrgint
1565f29dbc25Smrggfx_set_fixed_timings(int panelResX, int panelResY, unsigned short width,
156604007ebaSmrg                      unsigned short height, unsigned short bpp)
1567f29dbc25Smrg{
1568f29dbc25Smrg    int status = 0;
1569f29dbc25Smrg
1570f29dbc25Smrg#if GFX_DISPLAY_GU1
1571f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1572f29dbc25Smrg        status =
1573f29dbc25Smrg            gu1_set_fixed_timings(panelResX, panelResY, width, height, bpp);
1574f29dbc25Smrg#endif
1575f29dbc25Smrg#if GFX_DISPLAY_GU2
1576f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1577f29dbc25Smrg        status =
1578f29dbc25Smrg            gu2_set_fixed_timings(panelResX, panelResY, width, height, bpp);
1579f29dbc25Smrg#endif
1580f29dbc25Smrg    return (status);
1581f29dbc25Smrg}
1582f29dbc25Smrg
1583f29dbc25Smrg/*---------------------------------------------------------------------------
1584f29dbc25Smrg * gfx_set_panel_present
1585f29dbc25Smrg *---------------------------------------------------------------------------
1586f29dbc25Smrg */
1587f29dbc25Smrgint
1588f29dbc25Smrggfx_set_panel_present(int panelResX, int panelResY, unsigned short width,
158904007ebaSmrg                      unsigned short height, unsigned short bpp)
1590f29dbc25Smrg{
1591f29dbc25Smrg    int status = 0;
1592f29dbc25Smrg
1593f29dbc25Smrg#if GFX_DISPLAY_GU1
1594f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1595f29dbc25Smrg        status =
1596f29dbc25Smrg            gu1_set_panel_present(panelResX, panelResY, width, height, bpp);
1597f29dbc25Smrg#endif
1598f29dbc25Smrg#if GFX_DISPLAY_GU2
1599f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1600f29dbc25Smrg        status =
1601f29dbc25Smrg            gu2_set_panel_present(panelResX, panelResY, width, height, bpp);
1602f29dbc25Smrg#endif
1603f29dbc25Smrg    return (status);
1604f29dbc25Smrg}
1605f29dbc25Smrg
1606f29dbc25Smrg/*---------------------------------------------------------------------------
1607f29dbc25Smrg * gfx_set_vtotal
1608f29dbc25Smrg *---------------------------------------------------------------------------
1609f29dbc25Smrg */
1610f29dbc25Smrgint
1611f29dbc25Smrggfx_set_vtotal(unsigned short vtotal)
1612f29dbc25Smrg{
1613f29dbc25Smrg    int retval = 0;
1614f29dbc25Smrg
1615f29dbc25Smrg#if GFX_DISPLAY_GU1
1616f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1617f29dbc25Smrg        retval = gu1_set_vtotal(vtotal);
1618f29dbc25Smrg#endif
1619f29dbc25Smrg#if GFX_DISPLAY_GU2
1620f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1621f29dbc25Smrg        retval = gu2_set_vtotal(vtotal);
1622f29dbc25Smrg#endif
1623f29dbc25Smrg    return (retval);
1624f29dbc25Smrg}
1625f29dbc25Smrg
1626f29dbc25Smrg/*-----------------------------------------------------------------------*
1627f29dbc25Smrg * THE FOLLOWING READ ROUTINES ARE ALWAYS INCLUDED:                      *
1628f29dbc25Smrg * gfx_get_hsync_end, gfx_get_htotal, gfx_get_vsync_end, gfx_get_vtotal  *
1629f29dbc25Smrg * are used by the video overlay routines.                               *
1630f29dbc25Smrg *                                                                       *
1631f29dbc25Smrg * gfx_get_vline and gfx_vactive are used to prevent an issue for the    *
1632f29dbc25Smrg * SC1200.                                                               *
1633f29dbc25Smrg *                                                                       *
1634f29dbc25Smrg * The others are part of the Durango API.                               *
1635f29dbc25Smrg *-----------------------------------------------------------------------*/
1636f29dbc25Smrg
1637f29dbc25Smrg/*----------------------------------------------------------------------------
1638f29dbc25Smrg * gfx_mode_frequency_supported
1639f29dbc25Smrg *----------------------------------------------------------------------------
1640f29dbc25Smrg */
1641f29dbc25Smrgint
1642f29dbc25Smrggfx_mode_frequency_supported(int xres, int yres, int bpp,
164304007ebaSmrg                             unsigned long frequency)
1644f29dbc25Smrg{
1645f29dbc25Smrg    int freq = 0;
1646f29dbc25Smrg
1647f29dbc25Smrg#if GFX_DISPLAY_GU1
1648f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1649f29dbc25Smrg        freq = gu1_mode_frequency_supported(xres, yres, bpp, frequency);
1650f29dbc25Smrg#endif
1651f29dbc25Smrg#if GFX_DISPLAY_GU2
1652f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1653f29dbc25Smrg        freq = gu2_mode_frequency_supported(xres, yres, bpp, frequency);
1654f29dbc25Smrg#endif
1655f29dbc25Smrg    return (freq);
1656f29dbc25Smrg}
1657f29dbc25Smrg
1658f29dbc25Smrg/*----------------------------------------------------------------------------
1659f29dbc25Smrg * gfx_refreshrate_from_frequency
1660f29dbc25Smrg *----------------------------------------------------------------------------
1661f29dbc25Smrg */
1662f29dbc25Smrgint
1663f29dbc25Smrggfx_get_refreshrate_from_frequency(int xres, int yres, int bpp, int *hz,
166404007ebaSmrg                                   unsigned long frequency)
1665f29dbc25Smrg{
1666f29dbc25Smrg#if GFX_DISPLAY_GU1
1667f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1668f29dbc25Smrg        gu1_get_refreshrate_from_frequency(xres, yres, bpp, hz, frequency);
1669f29dbc25Smrg#endif
1670f29dbc25Smrg#if GFX_DISPLAY_GU2
1671f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1672f29dbc25Smrg        gu2_get_refreshrate_from_frequency(xres, yres, bpp, hz, frequency);
1673f29dbc25Smrg#endif
1674f29dbc25Smrg
1675f29dbc25Smrg    return (1);
1676f29dbc25Smrg}
1677f29dbc25Smrg
1678f29dbc25Smrg/*----------------------------------------------------------------------------
1679f29dbc25Smrg * gfx_refreshrate_from_mode
1680f29dbc25Smrg *----------------------------------------------------------------------------
1681f29dbc25Smrg */
1682f29dbc25Smrgint
1683f29dbc25Smrggfx_get_refreshrate_from_mode(int xres, int yres, int bpp, int *hz,
168404007ebaSmrg                              unsigned long frequency)
1685f29dbc25Smrg{
1686f29dbc25Smrg#if GFX_DISPLAY_GU1
1687f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1688f29dbc25Smrg        gu1_get_refreshrate_from_mode(xres, yres, bpp, hz, frequency);
1689f29dbc25Smrg#endif
1690f29dbc25Smrg#if GFX_DISPLAY_GU2
1691f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1692f29dbc25Smrg        gu2_get_refreshrate_from_mode(xres, yres, bpp, hz, frequency);
1693f29dbc25Smrg#endif
1694f29dbc25Smrg
1695f29dbc25Smrg    return (1);
1696f29dbc25Smrg}
1697f29dbc25Smrg
1698f29dbc25Smrg/*----------------------------------------------------------------------------
1699f29dbc25Smrg * gfx_get_frequency_from_refreshrate
1700f29dbc25Smrg *----------------------------------------------------------------------------
1701f29dbc25Smrg */
1702f29dbc25Smrgint
1703f29dbc25Smrggfx_get_frequency_from_refreshrate(int xres, int yres, int bpp, int hz,
170404007ebaSmrg                                   int *frequency)
1705f29dbc25Smrg{
1706f29dbc25Smrg    int retval = -1;
1707f29dbc25Smrg
1708f29dbc25Smrg#if GFX_DISPLAY_GU1
1709f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1710f29dbc25Smrg        retval =
171104007ebaSmrg            gu1_get_frequency_from_refreshrate(xres, yres, bpp, hz, frequency);
1712f29dbc25Smrg#endif
1713f29dbc25Smrg#if GFX_DISPLAY_GU2
1714f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1715f29dbc25Smrg        retval =
171604007ebaSmrg            gu2_get_frequency_from_refreshrate(xres, yres, bpp, hz, frequency);
1717f29dbc25Smrg#endif
1718f29dbc25Smrg
1719f29dbc25Smrg    return retval;
1720f29dbc25Smrg}
1721f29dbc25Smrg
1722f29dbc25Smrg/*---------------------------------------------------------------------------
1723f29dbc25Smrg * gfx_get_max_supported_pixel_clock
1724f29dbc25Smrg *---------------------------------------------------------------------------
1725f29dbc25Smrg */
1726f29dbc25Smrgunsigned long
1727f29dbc25Smrggfx_get_max_supported_pixel_clock(void)
1728f29dbc25Smrg{
1729f29dbc25Smrg    unsigned long status = 0;
1730f29dbc25Smrg
1731f29dbc25Smrg#if GFX_DISPLAY_GU1
1732f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1733f29dbc25Smrg        status = gu1_get_max_supported_pixel_clock();
1734f29dbc25Smrg#endif
1735f29dbc25Smrg#if GFX_DISPLAY_GU2
1736f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1737f29dbc25Smrg        status = gu2_get_max_supported_pixel_clock();
1738f29dbc25Smrg#endif
1739f29dbc25Smrg    return (status);
1740f29dbc25Smrg}
1741f29dbc25Smrg
1742f29dbc25Smrg/*---------------------------------------------------------------------------
1743f29dbc25Smrg * gfx_get_display_pitch
1744f29dbc25Smrg *---------------------------------------------------------------------------
1745f29dbc25Smrg */
1746f29dbc25Smrgunsigned short
1747f29dbc25Smrggfx_get_display_pitch(void)
1748f29dbc25Smrg{
1749f29dbc25Smrg    unsigned short pitch = 0;
1750f29dbc25Smrg
1751f29dbc25Smrg#if GFX_DISPLAY_GU1
1752f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1753f29dbc25Smrg        pitch = gu1_get_display_pitch();
1754f29dbc25Smrg#endif
1755f29dbc25Smrg#if GFX_DISPLAY_GU2
1756f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1757f29dbc25Smrg        pitch = gu2_get_display_pitch();
1758f29dbc25Smrg#endif
1759f29dbc25Smrg    return (pitch);
1760f29dbc25Smrg}
1761f29dbc25Smrg
1762f29dbc25Smrg/*---------------------------------------------------------------------------
1763f29dbc25Smrg * gfx_get_display_mode_count
1764f29dbc25Smrg * return # of modes supported.
1765f29dbc25Smrg *---------------------------------------------------------------------------
1766f29dbc25Smrg */
1767f29dbc25Smrgint
1768f29dbc25Smrggfx_get_display_mode_count(void)
1769f29dbc25Smrg{
1770f29dbc25Smrg    int retval = 0;
1771f29dbc25Smrg
1772f29dbc25Smrg#if GFX_DISPLAY_GU1
1773f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1774f29dbc25Smrg        retval = gu1_get_display_mode_count();
1775f29dbc25Smrg#endif
1776f29dbc25Smrg#if GFX_DISPLAY_GU2
1777f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1778f29dbc25Smrg        retval = gu2_get_display_mode_count();
1779f29dbc25Smrg#endif
1780f29dbc25Smrg    return (retval);
1781f29dbc25Smrg}
1782f29dbc25Smrg
1783f29dbc25Smrg/*---------------------------------------------------------------------------
1784f29dbc25Smrg * gfx_get_frame_buffer_line_size
1785f29dbc25Smrg *---------------------------------------------------------------------------
1786f29dbc25Smrg */
1787f29dbc25Smrgunsigned long
1788f29dbc25Smrggfx_get_frame_buffer_line_size(void)
1789f29dbc25Smrg{
1790f29dbc25Smrg    unsigned long retval = 0;
1791f29dbc25Smrg
1792f29dbc25Smrg#if GFX_DISPLAY_GU1
1793f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1794f29dbc25Smrg        retval = gu1_get_frame_buffer_line_size();
1795f29dbc25Smrg#endif
1796f29dbc25Smrg#if GFX_DISPLAY_GU2
1797f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1798f29dbc25Smrg        retval = gu2_get_frame_buffer_line_size();
1799f29dbc25Smrg#endif
1800f29dbc25Smrg    return (retval);
1801f29dbc25Smrg}
1802f29dbc25Smrg
1803f29dbc25Smrg/*---------------------------------------------------------------------------
1804f29dbc25Smrg * gfx_get_display_mode
180579d5fcd7Smrg * get the current mode set,
1806f29dbc25Smrg * return the supported mode on success, -1 on fail
1807f29dbc25Smrg *---------------------------------------------------------------------------
1808f29dbc25Smrg */
1809f29dbc25Smrgint
1810f29dbc25Smrggfx_get_display_mode(int *xres, int *yres, int *bpp, int *hz)
1811f29dbc25Smrg{
1812f29dbc25Smrg    int retval = -1;
1813f29dbc25Smrg
1814f29dbc25Smrg#if GFX_DISPLAY_GU1
1815f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1816f29dbc25Smrg        retval = gu1_get_display_mode(xres, yres, bpp, hz);
1817f29dbc25Smrg#endif
1818f29dbc25Smrg#if GFX_DISPLAY_GU2
1819f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1820f29dbc25Smrg        retval = gu2_get_display_mode(xres, yres, bpp, hz);
1821f29dbc25Smrg#endif
1822f29dbc25Smrg    return (retval);
1823f29dbc25Smrg}
1824f29dbc25Smrg
1825f29dbc25Smrg/*---------------------------------------------------------------------------
1826f29dbc25Smrg * gfx_get_display_details
182779d5fcd7Smrg * given the mode gets the resolution details, width, height, freq
1828f29dbc25Smrg *---------------------------------------------------------------------------
1829f29dbc25Smrg */
1830f29dbc25Smrgint
1831f29dbc25Smrggfx_get_display_details(unsigned int mode, int *xres, int *yres, int *hz)
1832f29dbc25Smrg{
1833f29dbc25Smrg    int retval = -1;
1834f29dbc25Smrg
1835f29dbc25Smrg#if GFX_DISPLAY_GU1
1836f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1837f29dbc25Smrg        retval = gu1_get_display_details(mode, xres, yres, hz);
1838f29dbc25Smrg#endif
1839f29dbc25Smrg#if GFX_DISPLAY_GU2
1840f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1841f29dbc25Smrg        retval = gu2_get_display_details(mode, xres, yres, hz);
1842f29dbc25Smrg#endif
1843f29dbc25Smrg    return (retval);
1844f29dbc25Smrg}
1845f29dbc25Smrg
1846f29dbc25Smrg/*---------------------------------------------------------------------------
1847f29dbc25Smrg * gfx_get_hactive
1848f29dbc25Smrg *---------------------------------------------------------------------------
1849f29dbc25Smrg */
1850f29dbc25Smrgunsigned short
1851f29dbc25Smrggfx_get_hactive(void)
1852f29dbc25Smrg{
1853f29dbc25Smrg    unsigned short hactive = 0;
1854f29dbc25Smrg
1855f29dbc25Smrg#if GFX_DISPLAY_GU1
1856f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1857f29dbc25Smrg        hactive = gu1_get_hactive();
1858f29dbc25Smrg#endif
1859f29dbc25Smrg#if GFX_DISPLAY_GU2
1860f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1861f29dbc25Smrg        hactive = gu2_get_hactive();
1862f29dbc25Smrg#endif
1863f29dbc25Smrg    return (hactive);
1864f29dbc25Smrg}
1865f29dbc25Smrg
1866f29dbc25Smrg/*---------------------------------------------------------------------------
1867f29dbc25Smrg * gfx_get_hsync_start
1868f29dbc25Smrg *---------------------------------------------------------------------------
1869f29dbc25Smrg */
1870f29dbc25Smrgunsigned short
1871f29dbc25Smrggfx_get_hsync_start(void)
1872f29dbc25Smrg{
1873f29dbc25Smrg    unsigned short hsync_start = 0;
1874f29dbc25Smrg
1875f29dbc25Smrg#if GFX_DISPLAY_GU1
1876f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1877f29dbc25Smrg        hsync_start = gu1_get_hsync_start();
1878f29dbc25Smrg#endif
1879f29dbc25Smrg#if GFX_DISPLAY_GU2
1880f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1881f29dbc25Smrg        hsync_start = gu2_get_hsync_start();
1882f29dbc25Smrg#endif
1883f29dbc25Smrg    return (hsync_start);
1884f29dbc25Smrg}
1885f29dbc25Smrg
1886f29dbc25Smrg/*---------------------------------------------------------------------------
1887f29dbc25Smrg * gfx_get_hsync_end
1888f29dbc25Smrg *---------------------------------------------------------------------------
1889f29dbc25Smrg */
1890f29dbc25Smrgunsigned short
1891f29dbc25Smrggfx_get_hsync_end(void)
1892f29dbc25Smrg{
1893f29dbc25Smrg    unsigned short hsync_end = 0;
1894f29dbc25Smrg
1895f29dbc25Smrg#if GFX_DISPLAY_GU1
1896f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1897f29dbc25Smrg        hsync_end = gu1_get_hsync_end();
1898f29dbc25Smrg#endif
1899f29dbc25Smrg#if GFX_DISPLAY_GU2
1900f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1901f29dbc25Smrg        hsync_end = gu2_get_hsync_end();
1902f29dbc25Smrg#endif
1903f29dbc25Smrg    return (hsync_end);
1904f29dbc25Smrg}
1905f29dbc25Smrg
1906f29dbc25Smrg/*---------------------------------------------------------------------------
1907f29dbc25Smrg * gfx_get_htotal
1908f29dbc25Smrg *---------------------------------------------------------------------------
1909f29dbc25Smrg */
1910f29dbc25Smrgunsigned short
1911f29dbc25Smrggfx_get_htotal(void)
1912f29dbc25Smrg{
1913f29dbc25Smrg    unsigned short htotal = 0;
1914f29dbc25Smrg
1915f29dbc25Smrg#if GFX_DISPLAY_GU1
1916f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1917f29dbc25Smrg        htotal = gu1_get_htotal();
1918f29dbc25Smrg#endif
1919f29dbc25Smrg#if GFX_DISPLAY_GU2
1920f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1921f29dbc25Smrg        htotal = gu2_get_htotal();
1922f29dbc25Smrg#endif
1923f29dbc25Smrg    return (htotal);
1924f29dbc25Smrg}
1925f29dbc25Smrg
1926f29dbc25Smrg/*---------------------------------------------------------------------------
1927f29dbc25Smrg * gfx_get_vactive
1928f29dbc25Smrg *---------------------------------------------------------------------------
1929f29dbc25Smrg */
1930f29dbc25Smrgunsigned short
1931f29dbc25Smrggfx_get_vactive(void)
1932f29dbc25Smrg{
1933f29dbc25Smrg    unsigned short vactive = 0;
1934f29dbc25Smrg
1935f29dbc25Smrg#if GFX_DISPLAY_GU1
1936f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1937f29dbc25Smrg        vactive = gu1_get_vactive();
1938f29dbc25Smrg#endif
1939f29dbc25Smrg#if GFX_DISPLAY_GU2
1940f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1941f29dbc25Smrg        vactive = gu2_get_vactive();
1942f29dbc25Smrg#endif
1943f29dbc25Smrg    return (vactive);
1944f29dbc25Smrg}
1945f29dbc25Smrg
1946f29dbc25Smrg/*---------------------------------------------------------------------------
1947f29dbc25Smrg * gfx_get_vsync_end
1948f29dbc25Smrg *---------------------------------------------------------------------------
1949f29dbc25Smrg */
1950f29dbc25Smrgunsigned short
1951f29dbc25Smrggfx_get_vsync_end(void)
1952f29dbc25Smrg{
1953f29dbc25Smrg    unsigned short vsync_end = 0;
1954f29dbc25Smrg
1955f29dbc25Smrg#if GFX_DISPLAY_GU1
1956f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1957f29dbc25Smrg        vsync_end = gu1_get_vsync_end();
1958f29dbc25Smrg#endif
1959f29dbc25Smrg#if GFX_DISPLAY_GU2
1960f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1961f29dbc25Smrg        vsync_end = gu2_get_vsync_end();
1962f29dbc25Smrg#endif
1963f29dbc25Smrg    return (vsync_end);
1964f29dbc25Smrg}
1965f29dbc25Smrg
1966f29dbc25Smrg/*---------------------------------------------------------------------------
1967f29dbc25Smrg * gfx_get_vtotal
1968f29dbc25Smrg *---------------------------------------------------------------------------
1969f29dbc25Smrg */
1970f29dbc25Smrgunsigned short
1971f29dbc25Smrggfx_get_vtotal(void)
1972f29dbc25Smrg{
1973f29dbc25Smrg    unsigned short vtotal = 0;
1974f29dbc25Smrg
1975f29dbc25Smrg#if GFX_DISPLAY_GU1
1976f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1977f29dbc25Smrg        vtotal = gu1_get_vtotal();
1978f29dbc25Smrg#endif
1979f29dbc25Smrg#if GFX_DISPLAY_GU2
1980f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
1981f29dbc25Smrg        vtotal = gu2_get_vtotal();
1982f29dbc25Smrg#endif
1983f29dbc25Smrg    return (vtotal);
1984f29dbc25Smrg}
1985f29dbc25Smrg
1986f29dbc25Smrg/*---------------------------------------------------------------------------
1987f29dbc25Smrg *  gfx_get_display_bpp
1988f29dbc25Smrg *---------------------------------------------------------------------------
1989f29dbc25Smrg */
1990f29dbc25Smrgunsigned short
1991f29dbc25Smrggfx_get_display_bpp(void)
1992f29dbc25Smrg{
1993f29dbc25Smrg    unsigned short bpp = 0;
1994f29dbc25Smrg
1995f29dbc25Smrg#if GFX_DISPLAY_GU1
1996f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
1997f29dbc25Smrg        bpp = gu1_get_display_bpp();
1998f29dbc25Smrg#endif
1999f29dbc25Smrg#if GFX_DISPLAY_GU2
2000f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2001f29dbc25Smrg        bpp = gu2_get_display_bpp();
2002f29dbc25Smrg#endif
2003f29dbc25Smrg    return (bpp);
2004f29dbc25Smrg}
2005f29dbc25Smrg
2006f29dbc25Smrg/*---------------------------------------------------------------------------
2007f29dbc25Smrg * gfx_get_vline
2008f29dbc25Smrg *---------------------------------------------------------------------------
2009f29dbc25Smrg */
2010f29dbc25Smrgunsigned short
2011f29dbc25Smrggfx_get_vline(void)
2012f29dbc25Smrg{
2013f29dbc25Smrg    unsigned short vline = 0;
2014f29dbc25Smrg
2015f29dbc25Smrg#if GFX_DISPLAY_GU1
2016f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
2017f29dbc25Smrg        vline = gu1_get_vline();
2018f29dbc25Smrg#endif
2019f29dbc25Smrg#if GFX_DISPLAY_GU2
2020f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2021f29dbc25Smrg        vline = gu2_get_vline();
2022f29dbc25Smrg#endif
2023f29dbc25Smrg    return (vline);
2024f29dbc25Smrg}
2025f29dbc25Smrg
2026f29dbc25Smrg/*---------------------------------------------------------------------------
2027f29dbc25Smrg *  gfx_get_display_offset
2028f29dbc25Smrg *---------------------------------------------------------------------------
2029f29dbc25Smrg */
2030f29dbc25Smrgunsigned long
2031f29dbc25Smrggfx_get_display_offset(void)
2032f29dbc25Smrg{
2033f29dbc25Smrg    unsigned long offset = 0;
2034f29dbc25Smrg
2035f29dbc25Smrg#if GFX_DISPLAY_GU1
2036f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
2037f29dbc25Smrg        offset = gu1_get_display_offset();
2038f29dbc25Smrg#endif
2039f29dbc25Smrg#if GFX_DISPLAY_GU2
2040f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2041f29dbc25Smrg        offset = gu2_get_display_offset();
2042f29dbc25Smrg#endif
2043f29dbc25Smrg    return (offset);
2044f29dbc25Smrg}
2045f29dbc25Smrg
2046f29dbc25Smrg/*---------------------------------------------------------------------------
2047f29dbc25Smrg *  gfx_get_cursor_offset
2048f29dbc25Smrg *---------------------------------------------------------------------------
2049f29dbc25Smrg */
2050f29dbc25Smrgunsigned long
2051f29dbc25Smrggfx_get_cursor_offset(void)
2052f29dbc25Smrg{
2053f29dbc25Smrg    unsigned long base = 0;
2054f29dbc25Smrg
2055f29dbc25Smrg#if GFX_DISPLAY_GU1
2056f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
2057f29dbc25Smrg        base = gu1_get_cursor_offset();
2058f29dbc25Smrg#endif
2059f29dbc25Smrg#if GFX_DISPLAY_GU2
2060f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2061f29dbc25Smrg        base = gu2_get_cursor_offset();
2062f29dbc25Smrg#endif
2063f29dbc25Smrg    return (base);
2064f29dbc25Smrg}
2065f29dbc25Smrg
2066f29dbc25Smrg/*************************************************************/
2067f29dbc25Smrg/*  READ ROUTINES  |  INCLUDED FOR DIAGNOSTIC PURPOSES ONLY  */
2068f29dbc25Smrg/*************************************************************/
2069f29dbc25Smrg
2070f29dbc25Smrg#if GFX_READ_ROUTINES
2071f29dbc25Smrg
2072f29dbc25Smrg/*---------------------------------------------------------------------------
2073f29dbc25Smrg * gfx_get_hblank_start
2074f29dbc25Smrg *---------------------------------------------------------------------------
2075f29dbc25Smrg */
2076f29dbc25Smrgunsigned short
2077f29dbc25Smrggfx_get_hblank_start(void)
2078f29dbc25Smrg{
2079f29dbc25Smrg    unsigned short hblank_start = 0;
2080f29dbc25Smrg
2081f29dbc25Smrg#if GFX_DISPLAY_GU1
2082f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
2083f29dbc25Smrg        hblank_start = gu1_get_hblank_start();
2084f29dbc25Smrg#endif
2085f29dbc25Smrg#if GFX_DISPLAY_GU2
2086f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2087f29dbc25Smrg        hblank_start = gu2_get_hblank_start();
2088f29dbc25Smrg#endif
2089f29dbc25Smrg    return (hblank_start);
2090f29dbc25Smrg}
2091f29dbc25Smrg
2092f29dbc25Smrg/*---------------------------------------------------------------------------
2093f29dbc25Smrg * gfx_get_hblank_end
2094f29dbc25Smrg *---------------------------------------------------------------------------
2095f29dbc25Smrg */
2096f29dbc25Smrgunsigned short
2097f29dbc25Smrggfx_get_hblank_end(void)
2098f29dbc25Smrg{
2099f29dbc25Smrg    unsigned short hblank_end = 0;
2100f29dbc25Smrg
2101f29dbc25Smrg#if GFX_DISPLAY_GU1
2102f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
2103f29dbc25Smrg        hblank_end = gu1_get_hblank_end();
2104f29dbc25Smrg#endif
2105f29dbc25Smrg#if GFX_DISPLAY_GU2
2106f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2107f29dbc25Smrg        hblank_end = gu2_get_hblank_end();
2108f29dbc25Smrg#endif
2109f29dbc25Smrg    return (hblank_end);
2110f29dbc25Smrg}
2111f29dbc25Smrg
2112f29dbc25Smrg/*---------------------------------------------------------------------------
2113f29dbc25Smrg * gfx_get_vblank_start
2114f29dbc25Smrg *---------------------------------------------------------------------------
2115f29dbc25Smrg */
2116f29dbc25Smrgunsigned short
2117f29dbc25Smrggfx_get_vblank_start(void)
2118f29dbc25Smrg{
2119f29dbc25Smrg    unsigned short vblank_start = 0;
2120f29dbc25Smrg
2121f29dbc25Smrg#if GFX_DISPLAY_GU1
2122f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
2123f29dbc25Smrg        vblank_start = gu1_get_vblank_start();
2124f29dbc25Smrg#endif
2125f29dbc25Smrg#if GFX_DISPLAY_GU2
2126f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2127f29dbc25Smrg        vblank_start = gu2_get_vblank_start();
2128f29dbc25Smrg#endif
2129f29dbc25Smrg    return (vblank_start);
2130f29dbc25Smrg}
2131f29dbc25Smrg
2132f29dbc25Smrg/*---------------------------------------------------------------------------
2133f29dbc25Smrg * gfx_get_vsync_start
2134f29dbc25Smrg *---------------------------------------------------------------------------
2135f29dbc25Smrg */
2136f29dbc25Smrgunsigned short
2137f29dbc25Smrggfx_get_vsync_start(void)
2138f29dbc25Smrg{
2139f29dbc25Smrg    unsigned short vsync_start = 0;
2140f29dbc25Smrg
2141f29dbc25Smrg#if GFX_DISPLAY_GU1
2142f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
2143f29dbc25Smrg        vsync_start = gu1_get_vsync_start();
2144f29dbc25Smrg#endif
2145f29dbc25Smrg#if GFX_DISPLAY_GU2
2146f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2147f29dbc25Smrg        vsync_start = gu2_get_vsync_start();
2148f29dbc25Smrg#endif
2149f29dbc25Smrg    return (vsync_start);
2150f29dbc25Smrg}
2151f29dbc25Smrg
2152f29dbc25Smrg/*---------------------------------------------------------------------------
2153f29dbc25Smrg * gfx_get_vblank_end
2154f29dbc25Smrg *---------------------------------------------------------------------------
2155f29dbc25Smrg */
2156f29dbc25Smrgunsigned short
2157f29dbc25Smrggfx_get_vblank_end(void)
2158f29dbc25Smrg{
2159f29dbc25Smrg    unsigned short vblank_end = 0;
2160f29dbc25Smrg
2161f29dbc25Smrg#if GFX_DISPLAY_GU1
2162f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
2163f29dbc25Smrg        vblank_end = gu1_get_vblank_end();
2164f29dbc25Smrg#endif
2165f29dbc25Smrg#if GFX_DISPLAY_GU2
2166f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2167f29dbc25Smrg        vblank_end = gu2_get_vblank_end();
2168f29dbc25Smrg#endif
2169f29dbc25Smrg    return (vblank_end);
2170f29dbc25Smrg}
2171f29dbc25Smrg
2172f29dbc25Smrg/*---------------------------------------------------------------------------
2173f29dbc25Smrg *  gfx_get_display_palette_entry
2174f29dbc25Smrg *---------------------------------------------------------------------------
2175f29dbc25Smrg */
2176f29dbc25Smrgint
2177f29dbc25Smrggfx_get_display_palette_entry(unsigned long index, unsigned long *palette)
2178f29dbc25Smrg{
2179f29dbc25Smrg    int status = 0;
2180f29dbc25Smrg
2181f29dbc25Smrg#if GFX_DISPLAY_GU1
2182f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
2183f29dbc25Smrg        status = gu1_get_display_palette_entry(index, palette);
2184f29dbc25Smrg#endif
2185f29dbc25Smrg#if GFX_DISPLAY_GU2
2186f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2187f29dbc25Smrg        status = gu2_get_display_palette_entry(index, palette);
2188f29dbc25Smrg#endif
2189f29dbc25Smrg
2190f29dbc25Smrg    return status;
2191f29dbc25Smrg}
2192f29dbc25Smrg
2193f29dbc25Smrg/*---------------------------------------------------------------------------
2194f29dbc25Smrg *  gfx_get_display_palette
2195f29dbc25Smrg *---------------------------------------------------------------------------
2196f29dbc25Smrg */
2197f29dbc25Smrgvoid
2198f29dbc25Smrggfx_get_display_palette(unsigned long *palette)
2199f29dbc25Smrg{
2200f29dbc25Smrg#if GFX_DISPLAY_GU1
2201f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
2202f29dbc25Smrg        gu1_get_display_palette(palette);
2203f29dbc25Smrg#endif
2204f29dbc25Smrg#if GFX_DISPLAY_GU2
2205f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2206f29dbc25Smrg        gu2_get_display_palette(palette);
2207f29dbc25Smrg#endif
2208f29dbc25Smrg}
2209f29dbc25Smrg
2210f29dbc25Smrg/*---------------------------------------------------------------------------
2211f29dbc25Smrg *  gfx_get_cursor_enable
2212f29dbc25Smrg *---------------------------------------------------------------------------
2213f29dbc25Smrg */
2214f29dbc25Smrgunsigned long
2215f29dbc25Smrggfx_get_cursor_enable(void)
2216f29dbc25Smrg{
2217f29dbc25Smrg    unsigned long enable = 0;
2218f29dbc25Smrg
2219f29dbc25Smrg#if GFX_DISPLAY_GU1
2220f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
2221f29dbc25Smrg        enable = gu1_get_cursor_enable();
2222f29dbc25Smrg#endif
2223f29dbc25Smrg#if GFX_DISPLAY_GU2
2224f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2225f29dbc25Smrg        enable = gu2_get_cursor_enable();
2226f29dbc25Smrg#endif
2227f29dbc25Smrg    return (enable);
2228f29dbc25Smrg}
2229f29dbc25Smrg
2230f29dbc25Smrg/*---------------------------------------------------------------------------
2231f29dbc25Smrg *  gfx_get_cursor_position
2232f29dbc25Smrg *---------------------------------------------------------------------------
2233f29dbc25Smrg */
2234f29dbc25Smrgunsigned long
2235f29dbc25Smrggfx_get_cursor_position(void)
2236f29dbc25Smrg{
2237f29dbc25Smrg    unsigned long position = 0;
2238f29dbc25Smrg
2239f29dbc25Smrg#if GFX_DISPLAY_GU1
2240f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
2241f29dbc25Smrg        position = gu1_get_cursor_position();
2242f29dbc25Smrg#endif
2243f29dbc25Smrg#if GFX_DISPLAY_GU2
2244f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2245f29dbc25Smrg        position = gu2_get_cursor_position();
2246f29dbc25Smrg#endif
2247f29dbc25Smrg    return (position);
2248f29dbc25Smrg}
2249f29dbc25Smrg
2250f29dbc25Smrg/*---------------------------------------------------------------------------
2251f29dbc25Smrg *  gfx_get_cursor_clip
2252f29dbc25Smrg *---------------------------------------------------------------------------
2253f29dbc25Smrg */
2254f29dbc25Smrgunsigned long
2255f29dbc25Smrggfx_get_cursor_clip(void)
2256f29dbc25Smrg{
2257f29dbc25Smrg    unsigned long offset = 0;
2258f29dbc25Smrg
2259f29dbc25Smrg#if GFX_DISPLAY_GU1
2260f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
2261f29dbc25Smrg        offset = gu1_get_cursor_clip();
2262f29dbc25Smrg#endif
2263f29dbc25Smrg#if GFX_DISPLAY_GU2
2264f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2265f29dbc25Smrg        offset = gu2_get_cursor_clip();
2266f29dbc25Smrg#endif
2267f29dbc25Smrg    return (offset);
2268f29dbc25Smrg}
2269f29dbc25Smrg
2270f29dbc25Smrg/*---------------------------------------------------------------------------
2271f29dbc25Smrg *  gfx_get_cursor_color
2272f29dbc25Smrg *---------------------------------------------------------------------------
2273f29dbc25Smrg */
2274f29dbc25Smrgunsigned long
2275f29dbc25Smrggfx_get_cursor_color(int index)
2276f29dbc25Smrg{
2277f29dbc25Smrg    unsigned long color = 0;
2278f29dbc25Smrg
2279f29dbc25Smrg#if GFX_DISPLAY_GU1
2280f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
2281f29dbc25Smrg        color = gu1_get_cursor_color(index);
2282f29dbc25Smrg#endif
2283f29dbc25Smrg#if GFX_DISPLAY_GU2
2284f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2285f29dbc25Smrg        color = gu2_get_cursor_color(index);
2286f29dbc25Smrg#endif
2287f29dbc25Smrg    return (color);
2288f29dbc25Smrg}
2289f29dbc25Smrg
2290f29dbc25Smrg/*---------------------------------------------------------------------------
2291f29dbc25Smrg *  gfx_get_icon_enable
2292f29dbc25Smrg *---------------------------------------------------------------------------
2293f29dbc25Smrg */
2294f29dbc25Smrgunsigned long
2295f29dbc25Smrggfx_get_icon_enable(void)
2296f29dbc25Smrg{
2297f29dbc25Smrg    unsigned long enable = 0;
2298f29dbc25Smrg
2299f29dbc25Smrg#if GFX_DISPLAY_GU2
2300f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2301f29dbc25Smrg        enable = gu2_get_icon_enable();
2302f29dbc25Smrg#endif
2303f29dbc25Smrg    return (enable);
2304f29dbc25Smrg}
2305f29dbc25Smrg
2306f29dbc25Smrg/*---------------------------------------------------------------------------
2307f29dbc25Smrg *  gfx_get_icon_offset
2308f29dbc25Smrg *---------------------------------------------------------------------------
2309f29dbc25Smrg */
2310f29dbc25Smrgunsigned long
2311f29dbc25Smrggfx_get_icon_offset(void)
2312f29dbc25Smrg{
2313f29dbc25Smrg    unsigned long base = 0;
2314f29dbc25Smrg
2315f29dbc25Smrg#if GFX_DISPLAY_GU2
2316f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2317f29dbc25Smrg        base = gu2_get_icon_offset();
2318f29dbc25Smrg#endif
2319f29dbc25Smrg
2320f29dbc25Smrg    return (base);
2321f29dbc25Smrg}
2322f29dbc25Smrg
2323f29dbc25Smrg/*---------------------------------------------------------------------------
2324f29dbc25Smrg *  gfx_get_icon_position
2325f29dbc25Smrg *---------------------------------------------------------------------------
2326f29dbc25Smrg */
2327f29dbc25Smrgunsigned long
2328f29dbc25Smrggfx_get_icon_position(void)
2329f29dbc25Smrg{
2330f29dbc25Smrg    unsigned long position = 0;
2331f29dbc25Smrg
2332f29dbc25Smrg#if GFX_DISPLAY_GU2
2333f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2334f29dbc25Smrg        position = gu2_get_icon_position();
2335f29dbc25Smrg#endif
2336f29dbc25Smrg
2337f29dbc25Smrg    return (position);
2338f29dbc25Smrg}
2339f29dbc25Smrg
2340f29dbc25Smrg/*---------------------------------------------------------------------------
2341f29dbc25Smrg *  gfx_get_icon_color
2342f29dbc25Smrg *---------------------------------------------------------------------------
2343f29dbc25Smrg */
2344f29dbc25Smrgunsigned long
2345f29dbc25Smrggfx_get_icon_color(int index)
2346f29dbc25Smrg{
2347f29dbc25Smrg    unsigned long color = 0;
2348f29dbc25Smrg
2349f29dbc25Smrg#if GFX_DISPLAY_GU2
2350f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2351f29dbc25Smrg        color = gu2_get_icon_color(index);
2352f29dbc25Smrg#endif
2353f29dbc25Smrg
2354f29dbc25Smrg    return (color);
2355f29dbc25Smrg}
2356f29dbc25Smrg
2357f29dbc25Smrg/*---------------------------------------------------------------------------
2358f29dbc25Smrg *  gfx_get_compression_enable
2359f29dbc25Smrg *---------------------------------------------------------------------------
2360f29dbc25Smrg */
2361f29dbc25Smrgint
2362f29dbc25Smrggfx_get_compression_enable(void)
2363f29dbc25Smrg{
2364f29dbc25Smrg    int enable = 0;
2365f29dbc25Smrg
2366f29dbc25Smrg#if GFX_DISPLAY_GU1
2367f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
2368f29dbc25Smrg        enable = gu1_get_compression_enable();
2369f29dbc25Smrg#endif
2370f29dbc25Smrg#if GFX_DISPLAY_GU2
2371f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2372f29dbc25Smrg        enable = gu2_get_compression_enable();
2373f29dbc25Smrg#endif
2374f29dbc25Smrg    return (enable);
2375f29dbc25Smrg}
2376f29dbc25Smrg
2377f29dbc25Smrg/*---------------------------------------------------------------------------
2378f29dbc25Smrg *  gfx_get_compression_offset
2379f29dbc25Smrg *---------------------------------------------------------------------------
2380f29dbc25Smrg */
2381f29dbc25Smrgunsigned long
2382f29dbc25Smrggfx_get_compression_offset(void)
2383f29dbc25Smrg{
2384f29dbc25Smrg    unsigned long offset = 0;
2385f29dbc25Smrg
2386f29dbc25Smrg#if GFX_DISPLAY_GU1
2387f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
2388f29dbc25Smrg        offset = gu1_get_compression_offset();
2389f29dbc25Smrg#endif
2390f29dbc25Smrg#if GFX_DISPLAY_GU2
2391f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2392f29dbc25Smrg        offset = gu2_get_compression_offset();
2393f29dbc25Smrg#endif
2394f29dbc25Smrg    return (offset);
2395f29dbc25Smrg}
2396f29dbc25Smrg
2397f29dbc25Smrg/*---------------------------------------------------------------------------
2398f29dbc25Smrg * gfx_get_compression_pitch
2399f29dbc25Smrg *---------------------------------------------------------------------------
2400f29dbc25Smrg */
2401f29dbc25Smrgunsigned short
2402f29dbc25Smrggfx_get_compression_pitch(void)
2403f29dbc25Smrg{
2404f29dbc25Smrg    unsigned short pitch = 0;
2405f29dbc25Smrg
2406f29dbc25Smrg#if GFX_DISPLAY_GU1
2407f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
2408f29dbc25Smrg        pitch = gu1_get_compression_pitch();
2409f29dbc25Smrg#endif
2410f29dbc25Smrg#if GFX_DISPLAY_GU2
2411f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2412f29dbc25Smrg        pitch = gu2_get_compression_pitch();
2413f29dbc25Smrg#endif
2414f29dbc25Smrg    return (pitch);
2415f29dbc25Smrg}
2416f29dbc25Smrg
2417f29dbc25Smrg/*---------------------------------------------------------------------------
2418f29dbc25Smrg * gfx_get_compression_size
2419f29dbc25Smrg *---------------------------------------------------------------------------
2420f29dbc25Smrg */
2421f29dbc25Smrgunsigned short
2422f29dbc25Smrggfx_get_compression_size(void)
2423f29dbc25Smrg{
2424f29dbc25Smrg    unsigned short size = 0;
2425f29dbc25Smrg
2426f29dbc25Smrg#if GFX_DISPLAY_GU1
2427f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
2428f29dbc25Smrg        size = gu1_get_compression_size();
2429f29dbc25Smrg#endif
2430f29dbc25Smrg#if GFX_DISPLAY_GU2
2431f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2432f29dbc25Smrg        size = gu2_get_compression_size();
2433f29dbc25Smrg#endif
2434f29dbc25Smrg    return (size);
2435f29dbc25Smrg}
2436f29dbc25Smrg
2437f29dbc25Smrg/*---------------------------------------------------------------------------
2438f29dbc25Smrg * gfx_get_display_priority_high
2439f29dbc25Smrg *---------------------------------------------------------------------------
2440f29dbc25Smrg */
2441f29dbc25Smrgint
2442f29dbc25Smrggfx_get_display_priority_high(void)
2443f29dbc25Smrg{
2444f29dbc25Smrg    int high = GFX_STATUS_UNSUPPORTED;
2445f29dbc25Smrg
2446f29dbc25Smrg#if GFX_DISPLAY_GU1
2447f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
2448f29dbc25Smrg        high = gu1_get_display_priority_high();
2449f29dbc25Smrg#endif
2450f29dbc25Smrg    return (high);
2451f29dbc25Smrg}
2452f29dbc25Smrg
2453f29dbc25Smrg/*---------------------------------------------------------------------------
2454f29dbc25Smrg * gfx_get_valid_bit
2455f29dbc25Smrg *---------------------------------------------------------------------------
2456f29dbc25Smrg */
2457f29dbc25Smrgint
2458f29dbc25Smrggfx_get_valid_bit(int line)
2459f29dbc25Smrg{
2460f29dbc25Smrg    int valid = 0;
2461f29dbc25Smrg
2462f29dbc25Smrg#if GFX_DISPLAY_GU1
2463f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
2464f29dbc25Smrg        valid = gu1_get_valid_bit(line);
2465f29dbc25Smrg#endif
2466f29dbc25Smrg#if GFX_DISPLAY_GU2
2467f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2468f29dbc25Smrg        valid = gu2_get_valid_bit(line);
2469f29dbc25Smrg#endif
2470f29dbc25Smrg    return (valid);
2471f29dbc25Smrg}
2472f29dbc25Smrg
2473f29dbc25Smrg/*---------------------------------------------------------------------------
2474f29dbc25Smrg * gfx_get_display_video_color_key
2475f29dbc25Smrg *---------------------------------------------------------------------------
2476f29dbc25Smrg */
2477f29dbc25Smrgunsigned long
2478f29dbc25Smrggfx_get_display_video_color_key(void)
2479f29dbc25Smrg{
2480f29dbc25Smrg    unsigned long value = 0;
248104007ebaSmrg
2482f29dbc25Smrg    return (value);
2483f29dbc25Smrg}
2484f29dbc25Smrg
2485f29dbc25Smrg/*---------------------------------------------------------------------------
2486f29dbc25Smrg * gfx_get_display_video_offset
2487f29dbc25Smrg *---------------------------------------------------------------------------
2488f29dbc25Smrg */
2489f29dbc25Smrgunsigned long
2490f29dbc25Smrggfx_get_display_video_offset(void)
2491f29dbc25Smrg{
2492f29dbc25Smrg    unsigned long offset = 0;
2493f29dbc25Smrg
2494f29dbc25Smrg#if GFX_DISPLAY_GU1
2495f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
2496f29dbc25Smrg        offset = gu1_get_display_video_offset();
2497f29dbc25Smrg#endif
2498f29dbc25Smrg#if GFX_DISPLAY_GU2
2499f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2500f29dbc25Smrg        offset = gu2_get_display_video_offset();
2501f29dbc25Smrg#endif
2502f29dbc25Smrg    return (offset);
2503f29dbc25Smrg}
2504f29dbc25Smrg
2505f29dbc25Smrg/*---------------------------------------------------------------------------
2506f29dbc25Smrg * gfx_get_display_video_yuv_offsets
2507f29dbc25Smrg *---------------------------------------------------------------------------
2508f29dbc25Smrg */
2509f29dbc25Smrgvoid
2510f29dbc25Smrggfx_get_display_video_yuv_offsets(unsigned long *yoffset,
251104007ebaSmrg                                  unsigned long *uoffset,
251204007ebaSmrg                                  unsigned long *voffset)
2513f29dbc25Smrg{
2514f29dbc25Smrg#if GFX_DISPLAY_GU2
2515f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2516f29dbc25Smrg        gu2_get_display_video_yuv_offsets(yoffset, uoffset, voffset);
2517f29dbc25Smrg#endif
2518f29dbc25Smrg}
2519f29dbc25Smrg
2520f29dbc25Smrg/*---------------------------------------------------------------------------
2521f29dbc25Smrg * gfx_get_display_video_yuv_offsets
2522f29dbc25Smrg *---------------------------------------------------------------------------
2523f29dbc25Smrg */
2524f29dbc25Smrgvoid
2525f29dbc25Smrggfx_get_display_video_yuv_pitch(unsigned long *ypitch, unsigned long *uvpitch)
2526f29dbc25Smrg{
2527f29dbc25Smrg#if GFX_DISPLAY_GU2
2528f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2529f29dbc25Smrg        gu2_get_display_video_yuv_pitch(ypitch, uvpitch);
2530f29dbc25Smrg#endif
2531f29dbc25Smrg}
2532f29dbc25Smrg
2533f29dbc25Smrg/*---------------------------------------------------------------------------
2534f29dbc25Smrg * gfx_get_display_video_downscale_delta
2535f29dbc25Smrg *---------------------------------------------------------------------------
2536f29dbc25Smrg */
2537f29dbc25Smrgunsigned long
2538f29dbc25Smrggfx_get_display_video_downscale_delta(void)
2539f29dbc25Smrg{
2540f29dbc25Smrg    unsigned long ret_value = 0;
2541f29dbc25Smrg
2542f29dbc25Smrg#if GFX_DISPLAY_GU2
2543f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2544f29dbc25Smrg        ret_value = gu2_get_display_video_downscale_delta();
2545f29dbc25Smrg#endif
2546f29dbc25Smrg
2547f29dbc25Smrg    return ret_value;
2548f29dbc25Smrg}
2549f29dbc25Smrg
2550f29dbc25Smrg/*---------------------------------------------------------------------------
2551f29dbc25Smrg * gfx_get_display_video_downscale_delta
2552f29dbc25Smrg *---------------------------------------------------------------------------
2553f29dbc25Smrg */
2554f29dbc25Smrgint
2555f29dbc25Smrggfx_get_display_video_downscale_enable(void)
2556f29dbc25Smrg{
2557f29dbc25Smrg    int ret_value = 0;
2558f29dbc25Smrg
2559f29dbc25Smrg#if GFX_DISPLAY_GU2
2560f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2561f29dbc25Smrg        ret_value = gu2_get_display_video_downscale_enable();
2562f29dbc25Smrg#endif
2563f29dbc25Smrg
2564f29dbc25Smrg    return ret_value;
2565f29dbc25Smrg}
2566f29dbc25Smrg
2567f29dbc25Smrg/*---------------------------------------------------------------------------
2568f29dbc25Smrg * gfx_get_display_video_size
2569f29dbc25Smrg *---------------------------------------------------------------------------
2570f29dbc25Smrg */
2571f29dbc25Smrgunsigned long
2572f29dbc25Smrggfx_get_display_video_size(void)
2573f29dbc25Smrg{
2574f29dbc25Smrg    unsigned long size = 0;
2575f29dbc25Smrg
2576f29dbc25Smrg#if GFX_DISPLAY_GU1
2577f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU1)
2578f29dbc25Smrg        size = gu1_get_display_video_size();
2579f29dbc25Smrg#endif
2580f29dbc25Smrg#if GFX_DISPLAY_GU2
2581f29dbc25Smrg    if (gfx_display_type & GFX_DISPLAY_TYPE_GU2)
2582f29dbc25Smrg        size = gu2_get_display_video_size();
2583f29dbc25Smrg#endif
2584f29dbc25Smrg    return (size);
2585f29dbc25Smrg}
2586f29dbc25Smrg
2587f29dbc25Smrg/*---------------------------------------------------------------------------
2588f29dbc25Smrg * gfx_get_display_video_color_key_mask
2589f29dbc25Smrg *---------------------------------------------------------------------------
2590f29dbc25Smrg */
2591f29dbc25Smrgunsigned long
2592f29dbc25Smrggfx_get_display_video_color_key_mask(void)
2593f29dbc25Smrg{
2594f29dbc25Smrg    unsigned long mask = 0;
259504007ebaSmrg
2596f29dbc25Smrg    return (mask);
2597f29dbc25Smrg}
2598f29dbc25Smrg
259904007ebaSmrg#endif                          /* GFX_READ_ROUTINES */
2600f29dbc25Smrg
260104007ebaSmrg#endif                          /* GFX_DISPLAY_DYNAMIC */
2602