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 Bit Field */
35 /* Video Memory Size */
36 #define VIDEO_MEMORY_SIZE_16M 0x1000000
39 * Lengths of the VPIT structure arrays.
52 /* Define Color Depth */
61 /* Sequencer Registers */
106 /* CRT Controller Registers */
133 /* Extend CRT Controller Registers */
255 #define LUT_DATA 0x3C9 /* DACDATA */
256 #define LUT_INDEX_READ 0x3C7 /* DACRX */
257 #define LUT_INDEX_WRITE 0x3C8 /* DACWX */
258 #define DACMASK 0x3C6
260 /* Definition Device */
261 #define DEVICE_CRT 0x01
262 #define DEVICE_DVI 0x03
263 #define DEVICE_LCD 0x04
265 /* Device output interface */
266 #define INTERFACE_NONE 0x00
267 #define INTERFACE_ANALOG_RGB 0x01
268 #define INTERFACE_DVP0 0x02
269 #define INTERFACE_DVP1 0x03
270 #define INTERFACE_DFP_HIGH 0x04
271 #define INTERFACE_DFP_LOW 0x05
272 #define INTERFACE_DFP 0x06
273 #define INTERFACE_LVDS0 0x07
274 #define INTERFACE_LVDS1 0x08
275 #define INTERFACE_LVDS0LVDS1 0x09
276 #define INTERFACE_TMDS 0x0A
278 #define HW_LAYOUT_LCD_ONLY 0x01
279 #define HW_LAYOUT_DVI_ONLY 0x02
280 #define HW_LAYOUT_LCD_DVI 0x03
281 #define HW_LAYOUT_LCD1_LCD2 0x04
282 #define HW_LAYOUT_LCD_EXTERNAL_LCD2 0x10
284 /* Definition Refresh Rate */
285 #define REFRESH_49 49
286 #define REFRESH_50 50
287 #define REFRESH_60 60
288 #define REFRESH_75 75
289 #define REFRESH_85 85
290 #define REFRESH_100 100
291 #define REFRESH_120 120
293 /* Definition Sync Polarity*/
297 /*480x640@60 Sync Polarity (GTF)
299 #define M480X640_R60_HSP NEGATIVE
300 #define M480X640_R60_VSP POSITIVE
302 /*640x480@60 Sync Polarity (VESA Mode)
304 #define M640X480_R60_HSP NEGATIVE
305 #define M640X480_R60_VSP NEGATIVE
307 /*640x480@75 Sync Polarity (VESA Mode)
309 #define M640X480_R75_HSP NEGATIVE
310 #define M640X480_R75_VSP NEGATIVE
312 /*640x480@85 Sync Polarity (VESA Mode)
314 #define M640X480_R85_HSP NEGATIVE
315 #define M640X480_R85_VSP NEGATIVE
317 /*640x480@100 Sync Polarity (GTF Mode)
319 #define M640X480_R100_HSP NEGATIVE
320 #define M640X480_R100_VSP POSITIVE
322 /*640x480@120 Sync Polarity (GTF Mode)
324 #define M640X480_R120_HSP NEGATIVE
325 #define M640X480_R120_VSP POSITIVE
327 /*720x480@60 Sync Polarity (GTF Mode)
329 #define M720X480_R60_HSP NEGATIVE
330 #define M720X480_R60_VSP POSITIVE
332 /*720x576@60 Sync Polarity (GTF Mode)
334 #define M720X576_R60_HSP NEGATIVE
335 #define M720X576_R60_VSP POSITIVE
337 /*800x600@60 Sync Polarity (VESA Mode)
339 #define M800X600_R60_HSP POSITIVE
340 #define M800X600_R60_VSP POSITIVE
342 /*800x600@75 Sync Polarity (VESA Mode)
344 #define M800X600_R75_HSP POSITIVE
345 #define M800X600_R75_VSP POSITIVE
347 /*800x600@85 Sync Polarity (VESA Mode)
349 #define M800X600_R85_HSP POSITIVE
350 #define M800X600_R85_VSP POSITIVE
352 /*800x600@100 Sync Polarity (GTF Mode)
354 #define M800X600_R100_HSP NEGATIVE
355 #define M800X600_R100_VSP POSITIVE
357 /*800x600@120 Sync Polarity (GTF Mode)
359 #define M800X600_R120_HSP NEGATIVE
360 #define M800X600_R120_VSP POSITIVE
362 /*800x480@60 Sync Polarity (CVT Mode)
364 #define M800X480_R60_HSP NEGATIVE
365 #define M800X480_R60_VSP POSITIVE
367 /*848x480@60 Sync Polarity (CVT Mode)
369 #define M848X480_R60_HSP NEGATIVE
370 #define M848X480_R60_VSP POSITIVE
372 /*852x480@60 Sync Polarity (GTF Mode)
374 #define M852X480_R60_HSP NEGATIVE
375 #define M852X480_R60_VSP POSITIVE
377 /*1024x512@60 Sync Polarity (GTF Mode)
379 #define M1024X512_R60_HSP NEGATIVE
380 #define M1024X512_R60_VSP POSITIVE
382 /*1024x600@60 Sync Polarity (GTF Mode)
384 #define M1024X600_R60_HSP NEGATIVE
385 #define M1024X600_R60_VSP POSITIVE
387 /*1024x768@60 Sync Polarity (VESA Mode)
389 #define M1024X768_R60_HSP NEGATIVE
390 #define M1024X768_R60_VSP NEGATIVE
392 /*1024x768@75 Sync Polarity (VESA Mode)
394 #define M1024X768_R75_HSP POSITIVE
395 #define M1024X768_R75_VSP POSITIVE
397 /*1024x768@85 Sync Polarity (VESA Mode)
399 #define M1024X768_R85_HSP POSITIVE
400 #define M1024X768_R85_VSP POSITIVE
402 /*1024x768@100 Sync Polarity (GTF Mode)
404 #define M1024X768_R100_HSP NEGATIVE
405 #define M1024X768_R100_VSP POSITIVE
407 /*1152x864@75 Sync Polarity (VESA Mode)
409 #define M1152X864_R75_HSP POSITIVE
410 #define M1152X864_R75_VSP POSITIVE
412 /*1280x720@60 Sync Polarity (GTF Mode)
414 #define M1280X720_R60_HSP NEGATIVE
415 #define M1280X720_R60_VSP POSITIVE
417 /* 1280x768@50 Sync Polarity (GTF Mode) */
418 #define M1280X768_R50_HSP NEGATIVE
419 #define M1280X768_R50_VSP POSITIVE
421 /*1280x768@60 Sync Polarity (GTF Mode)
423 #define M1280X768_R60_HSP NEGATIVE
424 #define M1280X768_R60_VSP POSITIVE
426 /*1280x800@60 Sync Polarity (CVT Mode)
428 #define M1280X800_R60_HSP NEGATIVE
429 #define M1280X800_R60_VSP POSITIVE
431 /*1280x960@60 Sync Polarity (VESA Mode)
433 #define M1280X960_R60_HSP POSITIVE
434 #define M1280X960_R60_VSP POSITIVE
436 /*1280x1024@60 Sync Polarity (VESA Mode)
438 #define M1280X1024_R60_HSP POSITIVE
439 #define M1280X1024_R60_VSP POSITIVE
441 /* 1360x768@60 Sync Polarity (CVT Mode) */
442 #define M1360X768_R60_HSP POSITIVE
443 #define M1360X768_R60_VSP POSITIVE
445 /* 1360x768@60 Sync Polarity (CVT Reduce Blanking Mode) */
446 #define M1360X768_RB_R60_HSP POSITIVE
447 #define M1360X768_RB_R60_VSP NEGATIVE
449 /* 1368x768@50 Sync Polarity (GTF Mode) */
450 #define M1368X768_R50_HSP NEGATIVE
451 #define M1368X768_R50_VSP POSITIVE
453 /* 1368x768@60 Sync Polarity (VESA Mode) */
454 #define M1368X768_R60_HSP NEGATIVE
455 #define M1368X768_R60_VSP POSITIVE
457 /*1280x1024@75 Sync Polarity (VESA Mode)
459 #define M1280X1024_R75_HSP POSITIVE
460 #define M1280X1024_R75_VSP POSITIVE
462 /*1280x1024@85 Sync Polarity (VESA Mode)
464 #define M1280X1024_R85_HSP POSITIVE
465 #define M1280X1024_R85_VSP POSITIVE
467 /*1440x1050@60 Sync Polarity (GTF Mode)
469 #define M1440X1050_R60_HSP NEGATIVE
470 #define M1440X1050_R60_VSP POSITIVE
472 /*1600x1200@60 Sync Polarity (VESA Mode)
474 #define M1600X1200_R60_HSP POSITIVE
475 #define M1600X1200_R60_VSP POSITIVE
477 /*1600x1200@75 Sync Polarity (VESA Mode)
479 #define M1600X1200_R75_HSP POSITIVE
480 #define M1600X1200_R75_VSP POSITIVE
482 /* 1680x1050@60 Sync Polarity (CVT Mode) */
483 #define M1680x1050_R60_HSP NEGATIVE
484 #define M1680x1050_R60_VSP NEGATIVE
486 /* 1680x1050@60 Sync Polarity (CVT Reduce Blanking Mode) */
487 #define M1680x1050_RB_R60_HSP POSITIVE
488 #define M1680x1050_RB_R60_VSP NEGATIVE
490 /* 1680x1050@75 Sync Polarity (CVT Mode) */
491 #define M1680x1050_R75_HSP NEGATIVE
492 #define M1680x1050_R75_VSP POSITIVE
494 /*1920x1080@60 Sync Polarity (CVT Mode)
496 #define M1920X1080_R60_HSP NEGATIVE
497 #define M1920X1080_R60_VSP POSITIVE
499 /* 1920x1080@60 Sync Polarity (CVT Reduce Blanking Mode) */
500 #define M1920X1080_RB_R60_HSP POSITIVE
501 #define M1920X1080_RB_R60_VSP NEGATIVE
503 /*1920x1440@60 Sync Polarity (VESA Mode)
505 #define M1920X1440_R60_HSP NEGATIVE
506 #define M1920X1440_R60_VSP POSITIVE
508 /*1920x1440@75 Sync Polarity (VESA Mode)
510 #define M1920X1440_R75_HSP NEGATIVE
511 #define M1920X1440_R75_VSP POSITIVE
514 /* 1400x1050@60 Sync Polarity (VESA Mode) */
515 #define M1400X1050_R60_HSP NEGATIVE
516 #define M1400X1050_R60_VSP NEGATIVE
519 /* 1400x1050@60 Sync Polarity (CVT Mode) */
520 #define M1400X1050_R60_HSP NEGATIVE
521 #define M1400X1050_R60_VSP POSITIVE
523 /* 1400x1050@60 Sync Polarity (CVT Reduce Blanking Mode) */
524 #define M1400X1050_RB_R60_HSP POSITIVE
525 #define M1400X1050_RB_R60_VSP NEGATIVE
527 /* 1400x1050@75 Sync Polarity (CVT Mode) */
528 #define M1400X1050_R75_HSP NEGATIVE
529 #define M1400X1050_R75_VSP POSITIVE
531 /* 960x600@60 Sync Polarity (CVT Mode) */
532 #define M960X600_R60_HSP NEGATIVE
533 #define M960X600_R60_VSP POSITIVE
535 /* 1000x600@60 Sync Polarity (GTF Mode) */
536 #define M1000X600_R60_HSP NEGATIVE
537 #define M1000X600_R60_VSP POSITIVE
539 /* 1024x576@60 Sync Polarity (GTF Mode) */
540 #define M1024X576_R60_HSP NEGATIVE
541 #define M1024X576_R60_VSP POSITIVE
543 /*1024x600@60 Sync Polarity (GTF Mode)*/
544 #define M1024X600_R60_HSP NEGATIVE
545 #define M1024X600_R60_VSP POSITIVE
547 /* 1088x612@60 Sync Polarity (CVT Mode) */
548 #define M1088X612_R60_HSP NEGATIVE
549 #define M1088X612_R60_VSP POSITIVE
551 /* 1152x720@60 Sync Polarity (CVT Mode) */
552 #define M1152X720_R60_HSP NEGATIVE
553 #define M1152X720_R60_VSP POSITIVE
555 /* 1200x720@60 Sync Polarity (GTF Mode) */
556 #define M1200X720_R60_HSP NEGATIVE
557 #define M1200X720_R60_VSP POSITIVE
559 /* 1200x900@60 Sync Polarity (DCON) */
560 #define M1200X900_R60_HSP NEGATIVE
561 #define M1200X900_R60_VSP NEGATIVE
563 /* 1280x600@60 Sync Polarity (GTF Mode) */
564 #define M1280x600_R60_HSP NEGATIVE
565 #define M1280x600_R60_VSP POSITIVE
567 /* 1280x720@50 Sync Polarity (GTF Mode) */
568 #define M1280X720_R50_HSP NEGATIVE
569 #define M1280X720_R50_VSP POSITIVE
571 /* 1440x900@60 Sync Polarity (CVT Mode) */
572 #define M1440X900_R60_HSP NEGATIVE
573 #define M1440X900_R60_VSP POSITIVE
575 /* 1440x900@75 Sync Polarity (CVT Mode) */
576 #define M1440X900_R75_HSP NEGATIVE
577 #define M1440X900_R75_VSP POSITIVE
579 /* 1440x900@60 Sync Polarity (CVT Reduce Blanking Mode) */
580 #define M1440X900_RB_R60_HSP POSITIVE
581 #define M1440X900_RB_R60_VSP NEGATIVE
583 /* 1600x900@60 Sync Polarity (CVT Mode) */
584 #define M1600X900_R60_HSP NEGATIVE
585 #define M1600X900_R60_VSP POSITIVE
587 /* 1600x900@60 Sync Polarity (CVT Reduce Blanking Mode) */
588 #define M1600X900_RB_R60_HSP POSITIVE
589 #define M1600X900_RB_R60_VSP NEGATIVE
591 /* 1600x1024@60 Sync Polarity (GTF Mode) */
592 #define M1600X1024_R60_HSP NEGATIVE
593 #define M1600X1024_R60_VSP POSITIVE
595 /* 1792x1344@60 Sync Polarity (DMT Mode) */
596 #define M1792x1344_R60_HSP NEGATIVE
597 #define M1792x1344_R60_VSP POSITIVE
599 /* 1856x1392@60 Sync Polarity (DMT Mode) */
600 #define M1856x1392_R60_HSP NEGATIVE
601 #define M1856x1392_R60_VSP POSITIVE
603 /* 1920x1200@60 Sync Polarity (CVT Mode) */
604 #define M1920X1200_R60_HSP NEGATIVE
605 #define M1920X1200_R60_VSP POSITIVE
607 /* 1920x1200@60 Sync Polarity (CVT Reduce Blanking Mode) */
608 #define M1920X1200_RB_R60_HSP POSITIVE
609 #define M1920X1200_RB_R60_VSP NEGATIVE
611 /* 2048x1536@60 Sync Polarity (CVT Mode) */
612 #define M2048x1536_R60_HSP NEGATIVE
613 #define M2048x1536_R60_VSP POSITIVE
615 /* Definition CRTC Timing Index */
616 #define H_TOTAL_INDEX 0
617 #define H_ADDR_INDEX 1
618 #define H_BLANK_START_INDEX 2
619 #define H_BLANK_END_INDEX 3
620 #define H_SYNC_START_INDEX 4
621 #define H_SYNC_END_INDEX 5
622 #define V_TOTAL_INDEX 6
623 #define V_ADDR_INDEX 7
624 #define V_BLANK_START_INDEX 8
625 #define V_BLANK_END_INDEX 9
626 #define V_SYNC_START_INDEX 10
627 #define V_SYNC_END_INDEX 11
628 #define H_TOTAL_SHADOW_INDEX 12
629 #define H_BLANK_END_SHADOW_INDEX 13
630 #define V_TOTAL_SHADOW_INDEX 14
631 #define V_ADDR_SHADOW_INDEX 15
632 #define V_BLANK_SATRT_SHADOW_INDEX 16
633 #define V_BLANK_END_SHADOW_INDEX 17
634 #define V_SYNC_SATRT_SHADOW_INDEX 18
635 #define V_SYNC_END_SHADOW_INDEX 19
637 /* Definition Video Mode Pixel Clock (picoseconds)
639 #define RES_640X480_60HZ_PIXCLOCK 39722
641 /* LCD display method
643 #define LCD_EXPANDSION 0x00
644 #define LCD_CENTERING 0x01
648 #define LCD_OPENLDI 0x00
649 #define LCD_SPWG 0x01
651 /* Define display timing
653 struct display_timing
{
668 struct crt_mode_table
{
672 struct display_timing crtc
;
682 #endif /* __SHARE_H__ */