aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/atombios_crtc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/radeon/atombios_crtc.c')
-rw-r--r--drivers/gpu/drm/radeon/atombios_crtc.c31
1 files changed, 28 insertions, 3 deletions
diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c
index 9fbabaa6ee44..b3e5e7549008 100644
--- a/drivers/gpu/drm/radeon/atombios_crtc.c
+++ b/drivers/gpu/drm/radeon/atombios_crtc.c
@@ -673,9 +673,14 @@ union set_pixel_clock {
673 PIXEL_CLOCK_PARAMETERS_V2 v2; 673 PIXEL_CLOCK_PARAMETERS_V2 v2;
674 PIXEL_CLOCK_PARAMETERS_V3 v3; 674 PIXEL_CLOCK_PARAMETERS_V3 v3;
675 PIXEL_CLOCK_PARAMETERS_V5 v5; 675 PIXEL_CLOCK_PARAMETERS_V5 v5;
676 PIXEL_CLOCK_PARAMETERS_V6 v6;
676}; 677};
677 678
678static void atombios_crtc_set_dcpll(struct drm_crtc *crtc) 679/* on DCE5, make sure the voltage is high enough to support the
680 * required disp clk.
681 */
682static void atombios_crtc_set_dcpll(struct drm_crtc *crtc,
683 u32 dispclk)
679{ 684{
680 struct drm_device *dev = crtc->dev; 685 struct drm_device *dev = crtc->dev;
681 struct radeon_device *rdev = dev->dev_private; 686 struct radeon_device *rdev = dev->dev_private;
@@ -698,9 +703,16 @@ static void atombios_crtc_set_dcpll(struct drm_crtc *crtc)
698 * SetPixelClock provides the dividers 703 * SetPixelClock provides the dividers
699 */ 704 */
700 args.v5.ucCRTC = ATOM_CRTC_INVALID; 705 args.v5.ucCRTC = ATOM_CRTC_INVALID;
701 args.v5.usPixelClock = rdev->clock.default_dispclk; 706 args.v5.usPixelClock = dispclk;
702 args.v5.ucPpll = ATOM_DCPLL; 707 args.v5.ucPpll = ATOM_DCPLL;
703 break; 708 break;
709 case 6:
710 /* if the default dcpll clock is specified,
711 * SetPixelClock provides the dividers
712 */
713 args.v6.ulDispEngClkFreq = dispclk;
714 args.v6.ucPpll = ATOM_DCPLL;
715 break;
704 default: 716 default:
705 DRM_ERROR("Unknown table version %d %d\n", frev, crev); 717 DRM_ERROR("Unknown table version %d %d\n", frev, crev);
706 return; 718 return;
@@ -784,6 +796,18 @@ static void atombios_crtc_program_pll(struct drm_crtc *crtc,
784 args.v5.ucEncoderMode = encoder_mode; 796 args.v5.ucEncoderMode = encoder_mode;
785 args.v5.ucPpll = pll_id; 797 args.v5.ucPpll = pll_id;
786 break; 798 break;
799 case 6:
800 args.v6.ulCrtcPclkFreq.ucCRTC = crtc_id;
801 args.v6.ulCrtcPclkFreq.ulPixelClock = cpu_to_le32(clock / 10);
802 args.v6.ucRefDiv = ref_div;
803 args.v6.usFbDiv = cpu_to_le16(fb_div);
804 args.v6.ulFbDivDecFrac = cpu_to_le32(frac_fb_div * 100000);
805 args.v6.ucPostDiv = post_div;
806 args.v6.ucMiscInfo = 0; /* HDMI depth, etc. */
807 args.v6.ucTransmitterID = encoder_id;
808 args.v6.ucEncoderMode = encoder_mode;
809 args.v6.ucPpll = pll_id;
810 break;
787 default: 811 default:
788 DRM_ERROR("Unknown table version %d %d\n", frev, crev); 812 DRM_ERROR("Unknown table version %d %d\n", frev, crev);
789 return; 813 return;
@@ -1377,7 +1401,8 @@ int atombios_crtc_mode_set(struct drm_crtc *crtc,
1377 rdev->clock.default_dispclk); 1401 rdev->clock.default_dispclk);
1378 if (ss_enabled) 1402 if (ss_enabled)
1379 atombios_crtc_program_ss(crtc, ATOM_DISABLE, ATOM_DCPLL, &ss); 1403 atombios_crtc_program_ss(crtc, ATOM_DISABLE, ATOM_DCPLL, &ss);
1380 atombios_crtc_set_dcpll(crtc); 1404 /* XXX: DCE5, make sure voltage, dispclk is high enough */
1405 atombios_crtc_set_dcpll(crtc, rdev->clock.default_dispclk);
1381 if (ss_enabled) 1406 if (ss_enabled)
1382 atombios_crtc_program_ss(crtc, ATOM_ENABLE, ATOM_DCPLL, &ss); 1407 atombios_crtc_program_ss(crtc, ATOM_ENABLE, ATOM_DCPLL, &ss);
1383 } 1408 }