2 * Copyright 1998-2008 VIA Technologies, Inc. All Rights Reserved.
3 * Copyright 2001-2008 S3 Graphics, Inc. All Rights Reserved.
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public
7 * License as published by the Free Software Foundation;
8 * either version 2, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTIES OR REPRESENTATIONS; without even
12 * the implied warranty of MERCHANTABILITY or FITNESS FOR
13 * A PARTICULAR PURPOSE.See the GNU General Public License
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
19 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 /* Define Return Value */
33 /* Define Bit Field */
43 /* Video Memory Size */
44 #define VIDEO_MEMORY_SIZE_16M 0x1000000
47 * Lengths of the VPIT structure arrays.
60 /* Define Color Depth */
69 /* Sequencer Registers */
114 /* CRT Controller Registers */
141 /* Extend CRT Controller Registers */
263 #define LUT_DATA 0x3C9 /* DACDATA */
264 #define LUT_INDEX_READ 0x3C7 /* DACRX */
265 #define LUT_INDEX_WRITE 0x3C8 /* DACWX */
266 #define DACMASK 0x3C6
268 /* Definition Device */
269 #define DEVICE_CRT 0x01
270 #define DEVICE_DVI 0x03
271 #define DEVICE_LCD 0x04
273 /* Device output interface */
274 #define INTERFACE_NONE 0x00
275 #define INTERFACE_ANALOG_RGB 0x01
276 #define INTERFACE_DVP0 0x02
277 #define INTERFACE_DVP1 0x03
278 #define INTERFACE_DFP_HIGH 0x04
279 #define INTERFACE_DFP_LOW 0x05
280 #define INTERFACE_DFP 0x06
281 #define INTERFACE_LVDS0 0x07
282 #define INTERFACE_LVDS1 0x08
283 #define INTERFACE_LVDS0LVDS1 0x09
284 #define INTERFACE_TMDS 0x0A
286 #define HW_LAYOUT_LCD_ONLY 0x01
287 #define HW_LAYOUT_DVI_ONLY 0x02
288 #define HW_LAYOUT_LCD_DVI 0x03
289 #define HW_LAYOUT_LCD1_LCD2 0x04
290 #define HW_LAYOUT_LCD_EXTERNAL_LCD2 0x10
292 /* Definition Refresh Rate */
293 #define REFRESH_50 50
294 #define REFRESH_60 60
295 #define REFRESH_75 75
296 #define REFRESH_85 85
297 #define REFRESH_100 100
298 #define REFRESH_120 120
300 /* Definition Sync Polarity*/
304 /*480x640@60 Sync Polarity (GTF)
306 #define M480X640_R60_HSP NEGATIVE
307 #define M480X640_R60_VSP POSITIVE
309 /*640x480@60 Sync Polarity (VESA Mode)
311 #define M640X480_R60_HSP NEGATIVE
312 #define M640X480_R60_VSP NEGATIVE
314 /*640x480@75 Sync Polarity (VESA Mode)
316 #define M640X480_R75_HSP NEGATIVE
317 #define M640X480_R75_VSP NEGATIVE
319 /*640x480@85 Sync Polarity (VESA Mode)
321 #define M640X480_R85_HSP NEGATIVE
322 #define M640X480_R85_VSP NEGATIVE
324 /*640x480@100 Sync Polarity (GTF Mode)
326 #define M640X480_R100_HSP NEGATIVE
327 #define M640X480_R100_VSP POSITIVE
329 /*640x480@120 Sync Polarity (GTF Mode)
331 #define M640X480_R120_HSP NEGATIVE
332 #define M640X480_R120_VSP POSITIVE
334 /*720x480@60 Sync Polarity (GTF Mode)
336 #define M720X480_R60_HSP NEGATIVE
337 #define M720X480_R60_VSP POSITIVE
339 /*720x576@60 Sync Polarity (GTF Mode)
341 #define M720X576_R60_HSP NEGATIVE
342 #define M720X576_R60_VSP POSITIVE
344 /*800x600@60 Sync Polarity (VESA Mode)
346 #define M800X600_R60_HSP POSITIVE
347 #define M800X600_R60_VSP POSITIVE
349 /*800x600@75 Sync Polarity (VESA Mode)
351 #define M800X600_R75_HSP POSITIVE
352 #define M800X600_R75_VSP POSITIVE
354 /*800x600@85 Sync Polarity (VESA Mode)
356 #define M800X600_R85_HSP POSITIVE
357 #define M800X600_R85_VSP POSITIVE
359 /*800x600@100 Sync Polarity (GTF Mode)
361 #define M800X600_R100_HSP NEGATIVE
362 #define M800X600_R100_VSP POSITIVE
364 /*800x600@120 Sync Polarity (GTF Mode)
366 #define M800X600_R120_HSP NEGATIVE
367 #define M800X600_R120_VSP POSITIVE
369 /*800x480@60 Sync Polarity (CVT Mode)
371 #define M800X480_R60_HSP NEGATIVE
372 #define M800X480_R60_VSP POSITIVE
374 /*848x480@60 Sync Polarity (CVT Mode)
376 #define M848X480_R60_HSP NEGATIVE
377 #define M848X480_R60_VSP POSITIVE
379 /*852x480@60 Sync Polarity (GTF Mode)
381 #define M852X480_R60_HSP NEGATIVE
382 #define M852X480_R60_VSP POSITIVE
384 /*1024x512@60 Sync Polarity (GTF Mode)
386 #define M1024X512_R60_HSP NEGATIVE
387 #define M1024X512_R60_VSP POSITIVE
389 /*1024x600@60 Sync Polarity (GTF Mode)
391 #define M1024X600_R60_HSP NEGATIVE
392 #define M1024X600_R60_VSP POSITIVE
394 /*1024x768@60 Sync Polarity (VESA Mode)
396 #define M1024X768_R60_HSP NEGATIVE
397 #define M1024X768_R60_VSP NEGATIVE
399 /*1024x768@75 Sync Polarity (VESA Mode)
401 #define M1024X768_R75_HSP POSITIVE
402 #define M1024X768_R75_VSP POSITIVE
404 /*1024x768@85 Sync Polarity (VESA Mode)
406 #define M1024X768_R85_HSP POSITIVE
407 #define M1024X768_R85_VSP POSITIVE
409 /*1024x768@100 Sync Polarity (GTF Mode)
411 #define M1024X768_R100_HSP NEGATIVE
412 #define M1024X768_R100_VSP POSITIVE
414 /*1152x864@75 Sync Polarity (VESA Mode)
416 #define M1152X864_R75_HSP POSITIVE
417 #define M1152X864_R75_VSP POSITIVE
419 /*1280x720@60 Sync Polarity (GTF Mode)
421 #define M1280X720_R60_HSP NEGATIVE
422 #define M1280X720_R60_VSP POSITIVE
424 /* 1280x768@50 Sync Polarity (GTF Mode) */
425 #define M1280X768_R50_HSP NEGATIVE
426 #define M1280X768_R50_VSP POSITIVE
428 /*1280x768@60 Sync Polarity (GTF Mode)
430 #define M1280X768_R60_HSP NEGATIVE
431 #define M1280X768_R60_VSP POSITIVE
433 /*1280x800@60 Sync Polarity (CVT Mode)
435 #define M1280X800_R60_HSP NEGATIVE
436 #define M1280X800_R60_VSP POSITIVE
438 /*1280x960@60 Sync Polarity (VESA Mode)
440 #define M1280X960_R60_HSP POSITIVE
441 #define M1280X960_R60_VSP POSITIVE
443 /*1280x1024@60 Sync Polarity (VESA Mode)
445 #define M1280X1024_R60_HSP POSITIVE
446 #define M1280X1024_R60_VSP POSITIVE
448 /* 1360x768@60 Sync Polarity (CVT Mode) */
449 #define M1360X768_R60_HSP POSITIVE
450 #define M1360X768_R60_VSP POSITIVE
452 /* 1360x768@60 Sync Polarity (CVT Reduce Blanking Mode) */
453 #define M1360X768_RB_R60_HSP POSITIVE
454 #define M1360X768_RB_R60_VSP NEGATIVE
456 /* 1368x768@50 Sync Polarity (GTF Mode) */
457 #define M1368X768_R50_HSP NEGATIVE
458 #define M1368X768_R50_VSP POSITIVE
460 /* 1368x768@60 Sync Polarity (VESA Mode) */
461 #define M1368X768_R60_HSP NEGATIVE
462 #define M1368X768_R60_VSP POSITIVE
464 /*1280x1024@75 Sync Polarity (VESA Mode)
466 #define M1280X1024_R75_HSP POSITIVE
467 #define M1280X1024_R75_VSP POSITIVE
469 /*1280x1024@85 Sync Polarity (VESA Mode)
471 #define M1280X1024_R85_HSP POSITIVE
472 #define M1280X1024_R85_VSP POSITIVE
474 /*1440x1050@60 Sync Polarity (GTF Mode)
476 #define M1440X1050_R60_HSP NEGATIVE
477 #define M1440X1050_R60_VSP POSITIVE
479 /*1600x1200@60 Sync Polarity (VESA Mode)
481 #define M1600X1200_R60_HSP POSITIVE
482 #define M1600X1200_R60_VSP POSITIVE
484 /*1600x1200@75 Sync Polarity (VESA Mode)
486 #define M1600X1200_R75_HSP POSITIVE
487 #define M1600X1200_R75_VSP POSITIVE
489 /* 1680x1050@60 Sync Polarity (CVT Mode) */
490 #define M1680x1050_R60_HSP NEGATIVE
491 #define M1680x1050_R60_VSP NEGATIVE
493 /* 1680x1050@60 Sync Polarity (CVT Reduce Blanking Mode) */
494 #define M1680x1050_RB_R60_HSP POSITIVE
495 #define M1680x1050_RB_R60_VSP NEGATIVE
497 /* 1680x1050@75 Sync Polarity (CVT Mode) */
498 #define M1680x1050_R75_HSP NEGATIVE
499 #define M1680x1050_R75_VSP POSITIVE
501 /*1920x1080@60 Sync Polarity (CVT Mode)
503 #define M1920X1080_R60_HSP NEGATIVE
504 #define M1920X1080_R60_VSP POSITIVE
506 /* 1920x1080@60 Sync Polarity (CVT Reduce Blanking Mode) */
507 #define M1920X1080_RB_R60_HSP POSITIVE
508 #define M1920X1080_RB_R60_VSP NEGATIVE
510 /*1920x1440@60 Sync Polarity (VESA Mode)
512 #define M1920X1440_R60_HSP NEGATIVE
513 #define M1920X1440_R60_VSP POSITIVE
515 /*1920x1440@75 Sync Polarity (VESA Mode)
517 #define M1920X1440_R75_HSP NEGATIVE
518 #define M1920X1440_R75_VSP POSITIVE
521 /* 1400x1050@60 Sync Polarity (VESA Mode) */
522 #define M1400X1050_R60_HSP NEGATIVE
523 #define M1400X1050_R60_VSP NEGATIVE
526 /* 1400x1050@60 Sync Polarity (CVT Mode) */
527 #define M1400X1050_R60_HSP NEGATIVE
528 #define M1400X1050_R60_VSP POSITIVE
530 /* 1400x1050@60 Sync Polarity (CVT Reduce Blanking Mode) */
531 #define M1400X1050_RB_R60_HSP POSITIVE
532 #define M1400X1050_RB_R60_VSP NEGATIVE
534 /* 1400x1050@75 Sync Polarity (CVT Mode) */
535 #define M1400X1050_R75_HSP NEGATIVE
536 #define M1400X1050_R75_VSP POSITIVE
538 /* 960x600@60 Sync Polarity (CVT Mode) */
539 #define M960X600_R60_HSP NEGATIVE
540 #define M960X600_R60_VSP POSITIVE
542 /* 1000x600@60 Sync Polarity (GTF Mode) */
543 #define M1000X600_R60_HSP NEGATIVE
544 #define M1000X600_R60_VSP POSITIVE
546 /* 1024x576@60 Sync Polarity (GTF Mode) */
547 #define M1024X576_R60_HSP NEGATIVE
548 #define M1024X576_R60_VSP POSITIVE
550 /*1024x600@60 Sync Polarity (GTF Mode)*/
551 #define M1024X600_R60_HSP NEGATIVE
552 #define M1024X600_R60_VSP POSITIVE
554 /* 1088x612@60 Sync Polarity (CVT Mode) */
555 #define M1088X612_R60_HSP NEGATIVE
556 #define M1088X612_R60_VSP POSITIVE
558 /* 1152x720@60 Sync Polarity (CVT Mode) */
559 #define M1152X720_R60_HSP NEGATIVE
560 #define M1152X720_R60_VSP POSITIVE
562 /* 1200x720@60 Sync Polarity (GTF Mode) */
563 #define M1200X720_R60_HSP NEGATIVE
564 #define M1200X720_R60_VSP POSITIVE
566 /* 1200x900@60 Sync Polarity (DCON) */
567 #define M1200X900_R60_HSP NEGATIVE
568 #define M1200X900_R60_VSP NEGATIVE
570 /* 1280x600@60 Sync Polarity (GTF Mode) */
571 #define M1280x600_R60_HSP NEGATIVE
572 #define M1280x600_R60_VSP POSITIVE
574 /* 1280x720@50 Sync Polarity (GTF Mode) */
575 #define M1280X720_R50_HSP NEGATIVE
576 #define M1280X720_R50_VSP POSITIVE
578 /* 1280x720@60 Sync Polarity (CEA Mode) */
579 #define M1280X720_CEA_R60_HSP POSITIVE
580 #define M1280X720_CEA_R60_VSP POSITIVE
582 /* 1440x900@60 Sync Polarity (CVT Mode) */
583 #define M1440X900_R60_HSP NEGATIVE
584 #define M1440X900_R60_VSP POSITIVE
586 /* 1440x900@75 Sync Polarity (CVT Mode) */
587 #define M1440X900_R75_HSP NEGATIVE
588 #define M1440X900_R75_VSP POSITIVE
590 /* 1440x900@60 Sync Polarity (CVT Reduce Blanking Mode) */
591 #define M1440X900_RB_R60_HSP POSITIVE
592 #define M1440X900_RB_R60_VSP NEGATIVE
594 /* 1600x900@60 Sync Polarity (CVT Mode) */
595 #define M1600X900_R60_HSP NEGATIVE
596 #define M1600X900_R60_VSP POSITIVE
598 /* 1600x900@60 Sync Polarity (CVT Reduce Blanking Mode) */
599 #define M1600X900_RB_R60_HSP POSITIVE
600 #define M1600X900_RB_R60_VSP NEGATIVE
602 /* 1600x1024@60 Sync Polarity (GTF Mode) */
603 #define M1600X1024_R60_HSP NEGATIVE
604 #define M1600X1024_R60_VSP POSITIVE
606 /* 1792x1344@60 Sync Polarity (DMT Mode) */
607 #define M1792x1344_R60_HSP NEGATIVE
608 #define M1792x1344_R60_VSP POSITIVE
610 /* 1856x1392@60 Sync Polarity (DMT Mode) */
611 #define M1856x1392_R60_HSP NEGATIVE
612 #define M1856x1392_R60_VSP POSITIVE
614 /* 1920x1200@60 Sync Polarity (CVT Mode) */
615 #define M1920X1200_R60_HSP NEGATIVE
616 #define M1920X1200_R60_VSP POSITIVE
618 /* 1920x1200@60 Sync Polarity (CVT Reduce Blanking Mode) */
619 #define M1920X1200_RB_R60_HSP POSITIVE
620 #define M1920X1200_RB_R60_VSP NEGATIVE
622 /* 1920x1080@60 Sync Polarity (CEA Mode) */
623 #define M1920X1080_CEA_R60_HSP POSITIVE
624 #define M1920X1080_CEA_R60_VSP POSITIVE
626 /* 2048x1536@60 Sync Polarity (CVT Mode) */
627 #define M2048x1536_R60_HSP NEGATIVE
628 #define M2048x1536_R60_VSP POSITIVE
630 /* Definition CRTC Timing Index */
631 #define H_TOTAL_INDEX 0
632 #define H_ADDR_INDEX 1
633 #define H_BLANK_START_INDEX 2
634 #define H_BLANK_END_INDEX 3
635 #define H_SYNC_START_INDEX 4
636 #define H_SYNC_END_INDEX 5
637 #define V_TOTAL_INDEX 6
638 #define V_ADDR_INDEX 7
639 #define V_BLANK_START_INDEX 8
640 #define V_BLANK_END_INDEX 9
641 #define V_SYNC_START_INDEX 10
642 #define V_SYNC_END_INDEX 11
643 #define H_TOTAL_SHADOW_INDEX 12
644 #define H_BLANK_END_SHADOW_INDEX 13
645 #define V_TOTAL_SHADOW_INDEX 14
646 #define V_ADDR_SHADOW_INDEX 15
647 #define V_BLANK_SATRT_SHADOW_INDEX 16
648 #define V_BLANK_END_SHADOW_INDEX 17
649 #define V_SYNC_SATRT_SHADOW_INDEX 18
650 #define V_SYNC_END_SHADOW_INDEX 19
652 /* Definition Video Mode Pixel Clock (picoseconds)
654 #define RES_640X480_60HZ_PIXCLOCK 39722
656 /* LCD display method
658 #define LCD_EXPANDSION 0x00
659 #define LCD_CENTERING 0x01
663 #define LCD_OPENLDI 0x00
664 #define LCD_SPWG 0x01
666 /* Define display timing
668 struct display_timing
{
683 struct crt_mode_table
{
687 struct display_timing crtc
;
697 #endif /* __SHARE_H__ */