diff options
author | Owain G. Ainsworth <oga@openbsd.org> | 2010-05-29 15:04:13 +0100 |
---|---|---|
committer | Owain G. Ainsworth <oga@openbsd.org> | 2010-06-07 21:49:43 +0100 |
commit | e003fffef0158352649ac415bc3004de30c12a1e (patch) | |
tree | 541105cd6f61595a32b774743a81b97de66e5cc7 | |
parent | 1b8b09896bb8e052fb2c045a28d1488d6950a7d6 (diff) |
pipeconf fixes (cherry picked from commit f24f0b2e1499260ff5d2266eb4d77539cc5fe54a)
From RHEL5 backport branch courtesy of Dave Airlie.
Conflicts:
src/i830_display.c
-rw-r--r-- | src/i830_display.c | 40 |
1 files changed, 28 insertions, 12 deletions
diff --git a/src/i830_display.c b/src/i830_display.c index fc7dceb6..7bb352d3 100644 --- a/src/i830_display.c +++ b/src/i830_display.c @@ -1550,15 +1550,22 @@ static void igdng_crtc_dpms(xf86CrtcPtr crtc, int mode) } ErrorF("PCH FDI RX PLL enable\n"); - /* enable PCH FDI RX PLL, wait warmup plus DMI latency */ - while (!((temp = INREG(fdi_rx_reg)) & FDI_RX_PLL_ENABLE)) { - temp &= (~FDI_DP_PORT_WIDTH_MASK | FDI_BPC_MASK); - temp |= FDI_RX_PLL_ENABLE | FDI_SEL_PCDCLK | FDI_DP_PORT_WIDTH_X4; - temp |= (pipe_bpc << 11); - OUTREG(fdi_rx_reg, temp); /* default 4 lanes */ - usleep(200); - } + temp = INREG(fdi_rx_reg); + temp &= ~(0x7 << 16); + temp |= (pipe_bpc << 11); + temp &= ~(FDI_DP_PORT_WIDTH_MASK << 19); + temp |= FDI_DP_PORT_WIDTH_X4; + + OUTREG(fdi_rx_reg, temp); /* default 4 lanes */ + INREG(fdi_rx_reg); + usleep(200); + + temp = INREG(fdi_rx_reg); + OUTREG(fdi_rx_reg, temp | FDI_SEL_PCDCLK); + INREG(fdi_rx_reg); + usleep(200); + ErrorF("PCH FDI TX PLL enable\n"); /* Enable CPU FDI TX PLL, always on for IGDNG */ while (!((temp = INREG(fdi_tx_reg)) & FDI_TX_PLL_ENABLE)) { @@ -1725,7 +1732,7 @@ static void igdng_crtc_dpms(xf86CrtcPtr crtc, int mode) n = 0; while (!((temp = INREG(transconf_reg)) & TRANS_STATE_ENABLE)) { temp |= TRANS_ENABLE; - temp &= ~FDI_BPC_MASK; + temp &= ~PIPE_BPC_MASK; temp |= pipe_bpc; OUTREG(transconf_reg, temp | TRANS_ENABLE); n++; @@ -2242,6 +2249,7 @@ i830_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode, int pch_fp_reg = (pipe == 0) ? PCH_FPA0 : PCH_FPB0; int pch_dpll_reg = (pipe == 0) ? PCH_DPLL_A : PCH_DPLL_B; int fdi_rx_reg = (pipe == 0) ? FDI_RXA_CTL : FDI_RXB_CTL; + int fdi_tx_reg = (pipe == 0) ? FDI_TXA_CTL : FDI_TXB_CTL; int lvds_reg = LVDS; uint32_t temp; int sdvo_pixel_multiply; @@ -2493,6 +2501,7 @@ i830_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode, } if (IS_IGDNG(intel)) { + pipeconf &= ~(7 << 5); if (intel_crtc->bpc == 6) pipeconf |= (1 << 6); /* 0 is 8bpc */ if (intel_crtc->bpc != 8) @@ -2647,13 +2656,20 @@ i830_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode, OUTREG(link_m1_reg, m_n.link_m); OUTREG(link_n1_reg, m_n.link_n); -#if 0 /* enable FDI RX PLL too */ - /* XXX this doesn't work */ temp = INREG(fdi_rx_reg); OUTREG(fdi_rx_reg, temp | FDI_RX_PLL_ENABLE); + INREG(fdi_rx_reg); + usleep(200); + + temp = INREG(fdi_tx_reg); + OUTREG(fdi_tx_reg, temp | FDI_TX_PLL_ENABLE); + INREG(fdi_tx_reg); + + temp = INREG(fdi_rx_reg); + OUTREG(fdi_rx_reg, temp | FDI_RX_PLL_ENABLE); + INREG(fdi_rx_reg); usleep(200); -#endif } OUTREG(pipeconf_reg, pipeconf); |