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