Rev 1321 | Rev 1430 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1321 | Rev 1404 | ||
---|---|---|---|
Line 593... | Line 593... | ||
593 | return true; |
593 | return true; |
594 | } |
594 | } |
595 | return false; |
595 | return false; |
596 | } |
596 | } |
Line -... | Line 597... | ||
- | 597 | ||
- | 598 | bool radeon_combios_sideport_present(struct radeon_device *rdev) |
|
- | 599 | { |
|
- | 600 | struct drm_device *dev = rdev->ddev; |
|
- | 601 | u16 igp_info; |
|
- | 602 | ||
- | 603 | igp_info = combios_get_table_offset(dev, COMBIOS_INTEGRATED_SYSTEM_INFO_TABLE); |
|
- | 604 | ||
- | 605 | if (igp_info) { |
|
- | 606 | if (RBIOS16(igp_info + 0x4)) |
|
- | 607 | return true; |
|
- | 608 | } |
|
- | 609 | return false; |
|
- | 610 | } |
|
- | 611 | ||
- | 612 | static const uint32_t default_primarydac_adj[CHIP_LAST] = { |
|
- | 613 | 0x00000808, /* r100 */ |
|
- | 614 | 0x00000808, /* rv100 */ |
|
- | 615 | 0x00000808, /* rs100 */ |
|
- | 616 | 0x00000808, /* rv200 */ |
|
- | 617 | 0x00000808, /* rs200 */ |
|
- | 618 | 0x00000808, /* r200 */ |
|
- | 619 | 0x00000808, /* rv250 */ |
|
- | 620 | 0x00000000, /* rs300 */ |
|
- | 621 | 0x00000808, /* rv280 */ |
|
- | 622 | 0x00000808, /* r300 */ |
|
- | 623 | 0x00000808, /* r350 */ |
|
- | 624 | 0x00000808, /* rv350 */ |
|
- | 625 | 0x00000808, /* rv380 */ |
|
- | 626 | 0x00000808, /* r420 */ |
|
- | 627 | 0x00000808, /* r423 */ |
|
- | 628 | 0x00000808, /* rv410 */ |
|
- | 629 | 0x00000000, /* rs400 */ |
|
- | 630 | 0x00000000, /* rs480 */ |
|
- | 631 | }; |
|
- | 632 | ||
- | 633 | static void radeon_legacy_get_primary_dac_info_from_table(struct radeon_device *rdev, |
|
- | 634 | struct radeon_encoder_primary_dac *p_dac) |
|
- | 635 | { |
|
- | 636 | p_dac->ps2_pdac_adj = default_primarydac_adj[rdev->family]; |
|
- | 637 | return; |
|
- | 638 | } |
|
597 | 639 | ||
598 | struct radeon_encoder_primary_dac *radeon_combios_get_primary_dac_info(struct |
640 | struct radeon_encoder_primary_dac *radeon_combios_get_primary_dac_info(struct |
599 | radeon_encoder |
641 | radeon_encoder |
600 | *encoder) |
642 | *encoder) |
601 | { |
643 | { |
602 | struct drm_device *dev = encoder->base.dev; |
644 | struct drm_device *dev = encoder->base.dev; |
603 | struct radeon_device *rdev = dev->dev_private; |
645 | struct radeon_device *rdev = dev->dev_private; |
604 | uint16_t dac_info; |
646 | uint16_t dac_info; |
605 | uint8_t rev, bg, dac; |
647 | uint8_t rev, bg, dac; |
- | 648 | struct radeon_encoder_primary_dac *p_dac = NULL; |
|
Line 606... | Line -... | ||
606 | struct radeon_encoder_primary_dac *p_dac = NULL; |
- | |
607 | - | ||
608 | if (rdev->bios == NULL) |
- | |
609 | return NULL; |
- | |
610 | - | ||
611 | /* check CRT table */ |
- | |
612 | dac_info = combios_get_table_offset(dev, COMBIOS_CRT_INFO_TABLE); |
- | |
613 | if (dac_info) { |
649 | int found = 0; |
614 | p_dac = |
650 | |
Line 615... | Line 651... | ||
615 | kzalloc(sizeof(struct radeon_encoder_primary_dac), |
651 | p_dac = kzalloc(sizeof(struct radeon_encoder_primary_dac), |
616 | GFP_KERNEL); |
652 | GFP_KERNEL); |
Line -... | Line 653... | ||
- | 653 | ||
- | 654 | if (!p_dac) |
|
- | 655 | return NULL; |
|
- | 656 | ||
- | 657 | if (rdev->bios == NULL) |
|
- | 658 | goto out; |
|
617 | 659 | ||
618 | if (!p_dac) |
660 | /* check CRT table */ |
619 | return NULL; |
661 | dac_info = combios_get_table_offset(dev, COMBIOS_CRT_INFO_TABLE); |
620 | 662 | if (dac_info) { |
|
621 | rev = RBIOS8(dac_info) & 0x3; |
663 | rev = RBIOS8(dac_info) & 0x3; |
622 | if (rev < 2) { |
664 | if (rev < 2) { |
623 | bg = RBIOS8(dac_info + 0x2) & 0xf; |
665 | bg = RBIOS8(dac_info + 0x2) & 0xf; |
624 | dac = (RBIOS8(dac_info + 0x2) >> 4) & 0xf; |
666 | dac = (RBIOS8(dac_info + 0x2) >> 4) & 0xf; |
625 | p_dac->ps2_pdac_adj = (bg << 8) | (dac); |
667 | p_dac->ps2_pdac_adj = (bg << 8) | (dac); |
626 | } else { |
668 | } else { |
627 | bg = RBIOS8(dac_info + 0x2) & 0xf; |
669 | bg = RBIOS8(dac_info + 0x2) & 0xf; |
628 | dac = RBIOS8(dac_info + 0x3) & 0xf; |
670 | dac = RBIOS8(dac_info + 0x3) & 0xf; |
Line -... | Line 671... | ||
- | 671 | p_dac->ps2_pdac_adj = (bg << 8) | (dac); |
|
- | 672 | } |
|
- | 673 | found = 1; |
|
- | 674 | } |
|
629 | p_dac->ps2_pdac_adj = (bg << 8) | (dac); |
675 | |
630 | } |
676 | out: |
Line 631... | Line 677... | ||
631 | 677 | if (!found) /* fallback to defaults */ |
|
632 | } |
678 | radeon_legacy_get_primary_dac_info_from_table(rdev, p_dac); |
633 | 679 | ||
634 | return p_dac; |
680 | return p_dac; |
635 | } |
- | |
636 | 681 | } |
|
637 | static enum radeon_tv_std |
682 | |
Line -... | Line 683... | ||
- | 683 | enum radeon_tv_std |
|
- | 684 | radeon_combios_get_tv_info(struct radeon_device *rdev) |
|
- | 685 | { |
|
638 | radeon_combios_get_tv_info(struct radeon_encoder *encoder) |
686 | struct drm_device *dev = rdev->ddev; |
639 | { |
687 | uint16_t tv_info; |
640 | struct drm_device *dev = encoder->base.dev; |
688 | enum radeon_tv_std tv_std = TV_STD_NTSC; |
641 | struct radeon_device *rdev = dev->dev_private; |
689 | |
642 | uint16_t tv_info; |
690 | if (rdev->bios == NULL) |
Line 777... | Line 825... | ||
777 | bg = RBIOS8(dac_info + 0xe) & 0xf; |
825 | bg = RBIOS8(dac_info + 0xe) & 0xf; |
778 | dac = (RBIOS8(dac_info + 0xe) >> 4) & 0xf; |
826 | dac = (RBIOS8(dac_info + 0xe) >> 4) & 0xf; |
779 | tv_dac->ntsc_tvdac_adj = (bg << 16) | (dac << 20); |
827 | tv_dac->ntsc_tvdac_adj = (bg << 16) | (dac << 20); |
780 | found = 1; |
828 | found = 1; |
781 | } |
829 | } |
782 | tv_dac->tv_std = radeon_combios_get_tv_info(encoder); |
830 | tv_dac->tv_std = radeon_combios_get_tv_info(rdev); |
783 | } |
831 | } |
784 | if (!found) { |
832 | if (!found) { |
785 | /* then check CRT table */ |
833 | /* then check CRT table */ |
786 | dac_info = |
834 | dac_info = |
787 | combios_get_table_offset(dev, COMBIOS_CRT_INFO_TABLE); |
835 | combios_get_table_offset(dev, COMBIOS_CRT_INFO_TABLE); |
Line 921... | Line 969... | ||
921 | 969 | ||
922 | DRM_INFO("Panel Size %dx%d\n", lvds->native_mode.hdisplay, |
970 | DRM_INFO("Panel Size %dx%d\n", lvds->native_mode.hdisplay, |
Line 923... | Line 971... | ||
923 | lvds->native_mode.vdisplay); |
971 | lvds->native_mode.vdisplay); |
924 | 972 | ||
925 | lvds->panel_vcc_delay = RBIOS16(lcd_info + 0x2c); |
- | |
Line 926... | Line 973... | ||
926 | if (lvds->panel_vcc_delay > 2000 || lvds->panel_vcc_delay < 0) |
973 | lvds->panel_vcc_delay = RBIOS16(lcd_info + 0x2c); |
927 | lvds->panel_vcc_delay = 2000; |
974 | lvds->panel_vcc_delay = min_t(u16, lvds->panel_vcc_delay, 2000); |
928 | 975 |