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 #include "via_modesetting.h"
27 /* Define Bit Field */
37 /* Video Memory Size */
38 #define VIDEO_MEMORY_SIZE_16M 0x1000000
41 * Lengths of the VPIT structure arrays.
54 /* Define Color Depth */
63 /* Sequencer Registers */
108 /* CRT Controller Registers */
135 /* Extend CRT Controller Registers */
257 #define LUT_DATA 0x3C9 /* DACDATA */
258 #define LUT_INDEX_READ 0x3C7 /* DACRX */
259 #define LUT_INDEX_WRITE 0x3C8 /* DACWX */
260 #define DACMASK 0x3C6
262 /* Definition Device */
263 #define DEVICE_CRT 0x01
264 #define DEVICE_DVI 0x03
265 #define DEVICE_LCD 0x04
267 /* Device output interface */
268 #define INTERFACE_NONE 0x00
269 #define INTERFACE_ANALOG_RGB 0x01
270 #define INTERFACE_DVP0 0x02
271 #define INTERFACE_DVP1 0x03
272 #define INTERFACE_DFP_HIGH 0x04
273 #define INTERFACE_DFP_LOW 0x05
274 #define INTERFACE_DFP 0x06
275 #define INTERFACE_LVDS0 0x07
276 #define INTERFACE_LVDS1 0x08
277 #define INTERFACE_LVDS0LVDS1 0x09
278 #define INTERFACE_TMDS 0x0A
280 #define HW_LAYOUT_LCD_ONLY 0x01
281 #define HW_LAYOUT_DVI_ONLY 0x02
282 #define HW_LAYOUT_LCD_DVI 0x03
283 #define HW_LAYOUT_LCD1_LCD2 0x04
284 #define HW_LAYOUT_LCD_EXTERNAL_LCD2 0x10
286 /* Definition Refresh Rate */
287 #define REFRESH_49 49
288 #define REFRESH_50 50
289 #define REFRESH_60 60
290 #define REFRESH_75 75
291 #define REFRESH_85 85
292 #define REFRESH_100 100
293 #define REFRESH_120 120
295 /* Definition Sync Polarity*/
299 /*480x640@60 Sync Polarity (GTF)
301 #define M480X640_R60_HSP NEGATIVE
302 #define M480X640_R60_VSP POSITIVE
304 /*640x480@60 Sync Polarity (VESA Mode)
306 #define M640X480_R60_HSP NEGATIVE
307 #define M640X480_R60_VSP NEGATIVE
309 /*640x480@75 Sync Polarity (VESA Mode)
311 #define M640X480_R75_HSP NEGATIVE
312 #define M640X480_R75_VSP NEGATIVE
314 /*640x480@85 Sync Polarity (VESA Mode)
316 #define M640X480_R85_HSP NEGATIVE
317 #define M640X480_R85_VSP NEGATIVE
319 /*640x480@100 Sync Polarity (GTF Mode)
321 #define M640X480_R100_HSP NEGATIVE
322 #define M640X480_R100_VSP POSITIVE
324 /*640x480@120 Sync Polarity (GTF Mode)
326 #define M640X480_R120_HSP NEGATIVE
327 #define M640X480_R120_VSP POSITIVE
329 /*720x480@60 Sync Polarity (GTF Mode)
331 #define M720X480_R60_HSP NEGATIVE
332 #define M720X480_R60_VSP POSITIVE
334 /*720x576@60 Sync Polarity (GTF Mode)
336 #define M720X576_R60_HSP NEGATIVE
337 #define M720X576_R60_VSP POSITIVE
339 /*800x600@60 Sync Polarity (VESA Mode)
341 #define M800X600_R60_HSP POSITIVE
342 #define M800X600_R60_VSP POSITIVE
344 /*800x600@75 Sync Polarity (VESA Mode)
346 #define M800X600_R75_HSP POSITIVE
347 #define M800X600_R75_VSP POSITIVE
349 /*800x600@85 Sync Polarity (VESA Mode)
351 #define M800X600_R85_HSP POSITIVE
352 #define M800X600_R85_VSP POSITIVE
354 /*800x600@100 Sync Polarity (GTF Mode)
356 #define M800X600_R100_HSP NEGATIVE
357 #define M800X600_R100_VSP POSITIVE
359 /*800x600@120 Sync Polarity (GTF Mode)
361 #define M800X600_R120_HSP NEGATIVE
362 #define M800X600_R120_VSP POSITIVE
364 /*800x480@60 Sync Polarity (CVT Mode)
366 #define M800X480_R60_HSP NEGATIVE
367 #define M800X480_R60_VSP POSITIVE
369 /*848x480@60 Sync Polarity (CVT Mode)
371 #define M848X480_R60_HSP NEGATIVE
372 #define M848X480_R60_VSP POSITIVE
374 /*852x480@60 Sync Polarity (GTF Mode)
376 #define M852X480_R60_HSP NEGATIVE
377 #define M852X480_R60_VSP POSITIVE
379 /*1024x512@60 Sync Polarity (GTF Mode)
381 #define M1024X512_R60_HSP NEGATIVE
382 #define M1024X512_R60_VSP POSITIVE
384 /*1024x600@60 Sync Polarity (GTF Mode)
386 #define M1024X600_R60_HSP NEGATIVE
387 #define M1024X600_R60_VSP POSITIVE
389 /*1024x768@60 Sync Polarity (VESA Mode)
391 #define M1024X768_R60_HSP NEGATIVE
392 #define M1024X768_R60_VSP NEGATIVE
394 /*1024x768@75 Sync Polarity (VESA Mode)
396 #define M1024X768_R75_HSP POSITIVE
397 #define M1024X768_R75_VSP POSITIVE
399 /*1024x768@85 Sync Polarity (VESA Mode)
401 #define M1024X768_R85_HSP POSITIVE
402 #define M1024X768_R85_VSP POSITIVE
404 /*1024x768@100 Sync Polarity (GTF Mode)
406 #define M1024X768_R100_HSP NEGATIVE
407 #define M1024X768_R100_VSP POSITIVE
409 /*1152x864@75 Sync Polarity (VESA Mode)
411 #define M1152X864_R75_HSP POSITIVE
412 #define M1152X864_R75_VSP POSITIVE
414 /*1280x720@60 Sync Polarity (GTF Mode)
416 #define M1280X720_R60_HSP NEGATIVE
417 #define M1280X720_R60_VSP POSITIVE
419 /* 1280x768@50 Sync Polarity (GTF Mode) */
420 #define M1280X768_R50_HSP NEGATIVE
421 #define M1280X768_R50_VSP POSITIVE
423 /*1280x768@60 Sync Polarity (GTF Mode)
425 #define M1280X768_R60_HSP NEGATIVE
426 #define M1280X768_R60_VSP POSITIVE
428 /*1280x800@60 Sync Polarity (CVT Mode)
430 #define M1280X800_R60_HSP NEGATIVE
431 #define M1280X800_R60_VSP POSITIVE
433 /*1280x960@60 Sync Polarity (VESA Mode)
435 #define M1280X960_R60_HSP POSITIVE
436 #define M1280X960_R60_VSP POSITIVE
438 /*1280x1024@60 Sync Polarity (VESA Mode)
440 #define M1280X1024_R60_HSP POSITIVE
441 #define M1280X1024_R60_VSP POSITIVE
443 /* 1360x768@60 Sync Polarity (CVT Mode) */
444 #define M1360X768_R60_HSP POSITIVE
445 #define M1360X768_R60_VSP POSITIVE
447 /* 1360x768@60 Sync Polarity (CVT Reduce Blanking Mode) */
448 #define M1360X768_RB_R60_HSP POSITIVE
449 #define M1360X768_RB_R60_VSP NEGATIVE
451 /* 1368x768@50 Sync Polarity (GTF Mode) */
452 #define M1368X768_R50_HSP NEGATIVE
453 #define M1368X768_R50_VSP POSITIVE
455 /* 1368x768@60 Sync Polarity (VESA Mode) */
456 #define M1368X768_R60_HSP NEGATIVE
457 #define M1368X768_R60_VSP POSITIVE
459 /*1280x1024@75 Sync Polarity (VESA Mode)
461 #define M1280X1024_R75_HSP POSITIVE
462 #define M1280X1024_R75_VSP POSITIVE
464 /*1280x1024@85 Sync Polarity (VESA Mode)
466 #define M1280X1024_R85_HSP POSITIVE
467 #define M1280X1024_R85_VSP POSITIVE
469 /*1440x1050@60 Sync Polarity (GTF Mode)
471 #define M1440X1050_R60_HSP NEGATIVE
472 #define M1440X1050_R60_VSP POSITIVE
474 /*1600x1200@60 Sync Polarity (VESA Mode)
476 #define M1600X1200_R60_HSP POSITIVE
477 #define M1600X1200_R60_VSP POSITIVE
479 /*1600x1200@75 Sync Polarity (VESA Mode)
481 #define M1600X1200_R75_HSP POSITIVE
482 #define M1600X1200_R75_VSP POSITIVE
484 /* 1680x1050@60 Sync Polarity (CVT Mode) */
485 #define M1680x1050_R60_HSP NEGATIVE
486 #define M1680x1050_R60_VSP NEGATIVE
488 /* 1680x1050@60 Sync Polarity (CVT Reduce Blanking Mode) */
489 #define M1680x1050_RB_R60_HSP POSITIVE
490 #define M1680x1050_RB_R60_VSP NEGATIVE
492 /* 1680x1050@75 Sync Polarity (CVT Mode) */
493 #define M1680x1050_R75_HSP NEGATIVE
494 #define M1680x1050_R75_VSP POSITIVE
496 /*1920x1080@60 Sync Polarity (CVT Mode)
498 #define M1920X1080_R60_HSP NEGATIVE
499 #define M1920X1080_R60_VSP POSITIVE
501 /* 1920x1080@60 Sync Polarity (CVT Reduce Blanking Mode) */
502 #define M1920X1080_RB_R60_HSP POSITIVE
503 #define M1920X1080_RB_R60_VSP NEGATIVE
505 /*1920x1440@60 Sync Polarity (VESA Mode)
507 #define M1920X1440_R60_HSP NEGATIVE
508 #define M1920X1440_R60_VSP POSITIVE
510 /*1920x1440@75 Sync Polarity (VESA Mode)
512 #define M1920X1440_R75_HSP NEGATIVE
513 #define M1920X1440_R75_VSP POSITIVE
516 /* 1400x1050@60 Sync Polarity (VESA Mode) */
517 #define M1400X1050_R60_HSP NEGATIVE
518 #define M1400X1050_R60_VSP NEGATIVE
521 /* 1400x1050@60 Sync Polarity (CVT Mode) */
522 #define M1400X1050_R60_HSP NEGATIVE
523 #define M1400X1050_R60_VSP POSITIVE
525 /* 1400x1050@60 Sync Polarity (CVT Reduce Blanking Mode) */
526 #define M1400X1050_RB_R60_HSP POSITIVE
527 #define M1400X1050_RB_R60_VSP NEGATIVE
529 /* 1400x1050@75 Sync Polarity (CVT Mode) */
530 #define M1400X1050_R75_HSP NEGATIVE
531 #define M1400X1050_R75_VSP POSITIVE
533 /* 960x600@60 Sync Polarity (CVT Mode) */
534 #define M960X600_R60_HSP NEGATIVE
535 #define M960X600_R60_VSP POSITIVE
537 /* 1000x600@60 Sync Polarity (GTF Mode) */
538 #define M1000X600_R60_HSP NEGATIVE
539 #define M1000X600_R60_VSP POSITIVE
541 /* 1024x576@60 Sync Polarity (GTF Mode) */
542 #define M1024X576_R60_HSP NEGATIVE
543 #define M1024X576_R60_VSP POSITIVE
545 /*1024x600@60 Sync Polarity (GTF Mode)*/
546 #define M1024X600_R60_HSP NEGATIVE
547 #define M1024X600_R60_VSP POSITIVE
549 /* 1088x612@60 Sync Polarity (CVT Mode) */
550 #define M1088X612_R60_HSP NEGATIVE
551 #define M1088X612_R60_VSP POSITIVE
553 /* 1152x720@60 Sync Polarity (CVT Mode) */
554 #define M1152X720_R60_HSP NEGATIVE
555 #define M1152X720_R60_VSP POSITIVE
557 /* 1200x720@60 Sync Polarity (GTF Mode) */
558 #define M1200X720_R60_HSP NEGATIVE
559 #define M1200X720_R60_VSP POSITIVE
561 /* 1200x900@60 Sync Polarity (DCON) */
562 #define M1200X900_R60_HSP POSITIVE
563 #define M1200X900_R60_VSP POSITIVE
565 /* 1280x600@60 Sync Polarity (GTF Mode) */
566 #define M1280x600_R60_HSP NEGATIVE
567 #define M1280x600_R60_VSP POSITIVE
569 /* 1280x720@50 Sync Polarity (GTF Mode) */
570 #define M1280X720_R50_HSP NEGATIVE
571 #define M1280X720_R50_VSP POSITIVE
573 /* 1440x900@60 Sync Polarity (CVT Mode) */
574 #define M1440X900_R60_HSP NEGATIVE
575 #define M1440X900_R60_VSP POSITIVE
577 /* 1440x900@75 Sync Polarity (CVT Mode) */
578 #define M1440X900_R75_HSP NEGATIVE
579 #define M1440X900_R75_VSP POSITIVE
581 /* 1440x900@60 Sync Polarity (CVT Reduce Blanking Mode) */
582 #define M1440X900_RB_R60_HSP POSITIVE
583 #define M1440X900_RB_R60_VSP NEGATIVE
585 /* 1600x900@60 Sync Polarity (CVT Mode) */
586 #define M1600X900_R60_HSP NEGATIVE
587 #define M1600X900_R60_VSP POSITIVE
589 /* 1600x900@60 Sync Polarity (CVT Reduce Blanking Mode) */
590 #define M1600X900_RB_R60_HSP POSITIVE
591 #define M1600X900_RB_R60_VSP NEGATIVE
593 /* 1600x1024@60 Sync Polarity (GTF Mode) */
594 #define M1600X1024_R60_HSP NEGATIVE
595 #define M1600X1024_R60_VSP POSITIVE
597 /* 1792x1344@60 Sync Polarity (DMT Mode) */
598 #define M1792x1344_R60_HSP NEGATIVE
599 #define M1792x1344_R60_VSP POSITIVE
601 /* 1856x1392@60 Sync Polarity (DMT Mode) */
602 #define M1856x1392_R60_HSP NEGATIVE
603 #define M1856x1392_R60_VSP POSITIVE
605 /* 1920x1200@60 Sync Polarity (CVT Mode) */
606 #define M1920X1200_R60_HSP NEGATIVE
607 #define M1920X1200_R60_VSP POSITIVE
609 /* 1920x1200@60 Sync Polarity (CVT Reduce Blanking Mode) */
610 #define M1920X1200_RB_R60_HSP POSITIVE
611 #define M1920X1200_RB_R60_VSP NEGATIVE
613 /* 2048x1536@60 Sync Polarity (CVT Mode) */
614 #define M2048x1536_R60_HSP NEGATIVE
615 #define M2048x1536_R60_VSP POSITIVE
617 /* Definition CRTC Timing Index */
618 #define H_TOTAL_INDEX 0
619 #define H_ADDR_INDEX 1
620 #define H_BLANK_START_INDEX 2
621 #define H_BLANK_END_INDEX 3
622 #define H_SYNC_START_INDEX 4
623 #define H_SYNC_END_INDEX 5
624 #define V_TOTAL_INDEX 6
625 #define V_ADDR_INDEX 7
626 #define V_BLANK_START_INDEX 8
627 #define V_BLANK_END_INDEX 9
628 #define V_SYNC_START_INDEX 10
629 #define V_SYNC_END_INDEX 11
630 #define H_TOTAL_SHADOW_INDEX 12
631 #define H_BLANK_END_SHADOW_INDEX 13
632 #define V_TOTAL_SHADOW_INDEX 14
633 #define V_ADDR_SHADOW_INDEX 15
634 #define V_BLANK_SATRT_SHADOW_INDEX 16
635 #define V_BLANK_END_SHADOW_INDEX 17
636 #define V_SYNC_SATRT_SHADOW_INDEX 18
637 #define V_SYNC_END_SHADOW_INDEX 19
639 /* LCD display method
641 #define LCD_EXPANDSION 0x00
642 #define LCD_CENTERING 0x01
646 #define LCD_OPENLDI 0x00
647 #define LCD_SPWG 0x01
649 struct crt_mode_table
{
653 struct display_timing crtc
;
663 #endif /* __SHARE_H__ */