diff options
-rw-r--r-- | drivers/gpu/drm/i915/i915_debugfs.c | 18 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.h | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 51 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_dp.c | 38 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_hdmi.c | 48 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_sideband.c | 18 |
6 files changed, 99 insertions, 78 deletions
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index a6f4cb5af185..9ac4e3182112 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c | |||
@@ -1610,27 +1610,27 @@ static int i915_dpio_info(struct seq_file *m, void *data) | |||
1610 | seq_printf(m, "DPIO_CTL: 0x%08x\n", I915_READ(DPIO_CTL)); | 1610 | seq_printf(m, "DPIO_CTL: 0x%08x\n", I915_READ(DPIO_CTL)); |
1611 | 1611 | ||
1612 | seq_printf(m, "DPIO_DIV_A: 0x%08x\n", | 1612 | seq_printf(m, "DPIO_DIV_A: 0x%08x\n", |
1613 | vlv_dpio_read(dev_priv, _DPIO_DIV_A)); | 1613 | vlv_dpio_read(dev_priv, PIPE_A, _DPIO_DIV_A)); |
1614 | seq_printf(m, "DPIO_DIV_B: 0x%08x\n", | 1614 | seq_printf(m, "DPIO_DIV_B: 0x%08x\n", |
1615 | vlv_dpio_read(dev_priv, _DPIO_DIV_B)); | 1615 | vlv_dpio_read(dev_priv, PIPE_A, _DPIO_DIV_B)); |
1616 | 1616 | ||
1617 | seq_printf(m, "DPIO_REFSFR_A: 0x%08x\n", | 1617 | seq_printf(m, "DPIO_REFSFR_A: 0x%08x\n", |
1618 | vlv_dpio_read(dev_priv, _DPIO_REFSFR_A)); | 1618 | vlv_dpio_read(dev_priv, PIPE_A, _DPIO_REFSFR_A)); |
1619 | seq_printf(m, "DPIO_REFSFR_B: 0x%08x\n", | 1619 | seq_printf(m, "DPIO_REFSFR_B: 0x%08x\n", |
1620 | vlv_dpio_read(dev_priv, _DPIO_REFSFR_B)); | 1620 | vlv_dpio_read(dev_priv, PIPE_A, _DPIO_REFSFR_B)); |
1621 | 1621 | ||
1622 | seq_printf(m, "DPIO_CORE_CLK_A: 0x%08x\n", | 1622 | seq_printf(m, "DPIO_CORE_CLK_A: 0x%08x\n", |
1623 | vlv_dpio_read(dev_priv, _DPIO_CORE_CLK_A)); | 1623 | vlv_dpio_read(dev_priv, PIPE_A, _DPIO_CORE_CLK_A)); |
1624 | seq_printf(m, "DPIO_CORE_CLK_B: 0x%08x\n", | 1624 | seq_printf(m, "DPIO_CORE_CLK_B: 0x%08x\n", |
1625 | vlv_dpio_read(dev_priv, _DPIO_CORE_CLK_B)); | 1625 | vlv_dpio_read(dev_priv, PIPE_A, _DPIO_CORE_CLK_B)); |
1626 | 1626 | ||
1627 | seq_printf(m, "DPIO_LPF_COEFF_A: 0x%08x\n", | 1627 | seq_printf(m, "DPIO_LPF_COEFF_A: 0x%08x\n", |
1628 | vlv_dpio_read(dev_priv, _DPIO_LPF_COEFF_A)); | 1628 | vlv_dpio_read(dev_priv, PIPE_A, _DPIO_LPF_COEFF_A)); |
1629 | seq_printf(m, "DPIO_LPF_COEFF_B: 0x%08x\n", | 1629 | seq_printf(m, "DPIO_LPF_COEFF_B: 0x%08x\n", |
1630 | vlv_dpio_read(dev_priv, _DPIO_LPF_COEFF_B)); | 1630 | vlv_dpio_read(dev_priv, PIPE_A, _DPIO_LPF_COEFF_B)); |
1631 | 1631 | ||
1632 | seq_printf(m, "DPIO_FASTCLK_DISABLE: 0x%08x\n", | 1632 | seq_printf(m, "DPIO_FASTCLK_DISABLE: 0x%08x\n", |
1633 | vlv_dpio_read(dev_priv, DPIO_FASTCLK_DISABLE)); | 1633 | vlv_dpio_read(dev_priv, PIPE_A, DPIO_FASTCLK_DISABLE)); |
1634 | 1634 | ||
1635 | mutex_unlock(&dev_priv->dpio_lock); | 1635 | mutex_unlock(&dev_priv->dpio_lock); |
1636 | 1636 | ||
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 769c1388a69e..e357995a6aad 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
@@ -2282,8 +2282,8 @@ u32 vlv_ccu_read(struct drm_i915_private *dev_priv, u32 reg); | |||
2282 | void vlv_ccu_write(struct drm_i915_private *dev_priv, u32 reg, u32 val); | 2282 | void vlv_ccu_write(struct drm_i915_private *dev_priv, u32 reg, u32 val); |
2283 | u32 vlv_gps_core_read(struct drm_i915_private *dev_priv, u32 reg); | 2283 | u32 vlv_gps_core_read(struct drm_i915_private *dev_priv, u32 reg); |
2284 | void vlv_gps_core_write(struct drm_i915_private *dev_priv, u32 reg, u32 val); | 2284 | void vlv_gps_core_write(struct drm_i915_private *dev_priv, u32 reg, u32 val); |
2285 | u32 vlv_dpio_read(struct drm_i915_private *dev_priv, int reg); | 2285 | u32 vlv_dpio_read(struct drm_i915_private *dev_priv, enum pipe pipe, int reg); |
2286 | void vlv_dpio_write(struct drm_i915_private *dev_priv, int reg, u32 val); | 2286 | void vlv_dpio_write(struct drm_i915_private *dev_priv, enum pipe pipe, int reg, u32 val); |
2287 | u32 intel_sbi_read(struct drm_i915_private *dev_priv, u16 reg, | 2287 | u32 intel_sbi_read(struct drm_i915_private *dev_priv, u16 reg, |
2288 | enum intel_sbi_destination destination); | 2288 | enum intel_sbi_destination destination); |
2289 | void intel_sbi_write(struct drm_i915_private *dev_priv, u16 reg, u32 value, | 2289 | void intel_sbi_write(struct drm_i915_private *dev_priv, u16 reg, u32 value, |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index d88057edfdea..bac71520b299 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -4354,7 +4354,8 @@ static void i9xx_update_pll_dividers(struct intel_crtc *crtc, | |||
4354 | } | 4354 | } |
4355 | } | 4355 | } |
4356 | 4356 | ||
4357 | static void vlv_pllb_recal_opamp(struct drm_i915_private *dev_priv) | 4357 | static void vlv_pllb_recal_opamp(struct drm_i915_private *dev_priv, enum pipe |
4358 | pipe) | ||
4358 | { | 4359 | { |
4359 | u32 reg_val; | 4360 | u32 reg_val; |
4360 | 4361 | ||
@@ -4362,24 +4363,24 @@ static void vlv_pllb_recal_opamp(struct drm_i915_private *dev_priv) | |||
4362 | * PLLB opamp always calibrates to max value of 0x3f, force enable it | 4363 | * PLLB opamp always calibrates to max value of 0x3f, force enable it |
4363 | * and set it to a reasonable value instead. | 4364 | * and set it to a reasonable value instead. |
4364 | */ | 4365 | */ |
4365 | reg_val = vlv_dpio_read(dev_priv, DPIO_IREF(1)); | 4366 | reg_val = vlv_dpio_read(dev_priv, pipe, DPIO_IREF(1)); |
4366 | reg_val &= 0xffffff00; | 4367 | reg_val &= 0xffffff00; |
4367 | reg_val |= 0x00000030; | 4368 | reg_val |= 0x00000030; |
4368 | vlv_dpio_write(dev_priv, DPIO_IREF(1), reg_val); | 4369 | vlv_dpio_write(dev_priv, pipe, DPIO_IREF(1), reg_val); |
4369 | 4370 | ||
4370 | reg_val = vlv_dpio_read(dev_priv, DPIO_CALIBRATION); | 4371 | reg_val = vlv_dpio_read(dev_priv, pipe, DPIO_CALIBRATION); |
4371 | reg_val &= 0x8cffffff; | 4372 | reg_val &= 0x8cffffff; |
4372 | reg_val = 0x8c000000; | 4373 | reg_val = 0x8c000000; |
4373 | vlv_dpio_write(dev_priv, DPIO_CALIBRATION, reg_val); | 4374 | vlv_dpio_write(dev_priv, pipe, DPIO_CALIBRATION, reg_val); |
4374 | 4375 | ||
4375 | reg_val = vlv_dpio_read(dev_priv, DPIO_IREF(1)); | 4376 | reg_val = vlv_dpio_read(dev_priv, pipe, DPIO_IREF(1)); |
4376 | reg_val &= 0xffffff00; | 4377 | reg_val &= 0xffffff00; |
4377 | vlv_dpio_write(dev_priv, DPIO_IREF(1), reg_val); | 4378 | vlv_dpio_write(dev_priv, pipe, DPIO_IREF(1), reg_val); |
4378 | 4379 | ||
4379 | reg_val = vlv_dpio_read(dev_priv, DPIO_CALIBRATION); | 4380 | reg_val = vlv_dpio_read(dev_priv, pipe, DPIO_CALIBRATION); |
4380 | reg_val &= 0x00ffffff; | 4381 | reg_val &= 0x00ffffff; |
4381 | reg_val |= 0xb0000000; | 4382 | reg_val |= 0xb0000000; |
4382 | vlv_dpio_write(dev_priv, DPIO_CALIBRATION, reg_val); | 4383 | vlv_dpio_write(dev_priv, pipe, DPIO_CALIBRATION, reg_val); |
4383 | } | 4384 | } |
4384 | 4385 | ||
4385 | static void intel_pch_transcoder_set_m_n(struct intel_crtc *crtc, | 4386 | static void intel_pch_transcoder_set_m_n(struct intel_crtc *crtc, |
@@ -4445,18 +4446,18 @@ static void vlv_update_pll(struct intel_crtc *crtc) | |||
4445 | 4446 | ||
4446 | /* PLL B needs special handling */ | 4447 | /* PLL B needs special handling */ |
4447 | if (pipe) | 4448 | if (pipe) |
4448 | vlv_pllb_recal_opamp(dev_priv); | 4449 | vlv_pllb_recal_opamp(dev_priv, pipe); |
4449 | 4450 | ||
4450 | /* Set up Tx target for periodic Rcomp update */ | 4451 | /* Set up Tx target for periodic Rcomp update */ |
4451 | vlv_dpio_write(dev_priv, DPIO_IREF_BCAST, 0x0100000f); | 4452 | vlv_dpio_write(dev_priv, pipe, DPIO_IREF_BCAST, 0x0100000f); |
4452 | 4453 | ||
4453 | /* Disable target IRef on PLL */ | 4454 | /* Disable target IRef on PLL */ |
4454 | reg_val = vlv_dpio_read(dev_priv, DPIO_IREF_CTL(pipe)); | 4455 | reg_val = vlv_dpio_read(dev_priv, pipe, DPIO_IREF_CTL(pipe)); |
4455 | reg_val &= 0x00ffffff; | 4456 | reg_val &= 0x00ffffff; |
4456 | vlv_dpio_write(dev_priv, DPIO_IREF_CTL(pipe), reg_val); | 4457 | vlv_dpio_write(dev_priv, pipe, DPIO_IREF_CTL(pipe), reg_val); |
4457 | 4458 | ||
4458 | /* Disable fast lock */ | 4459 | /* Disable fast lock */ |
4459 | vlv_dpio_write(dev_priv, DPIO_FASTCLK_DISABLE, 0x610); | 4460 | vlv_dpio_write(dev_priv, pipe, DPIO_FASTCLK_DISABLE, 0x610); |
4460 | 4461 | ||
4461 | /* Set idtafcrecal before PLL is enabled */ | 4462 | /* Set idtafcrecal before PLL is enabled */ |
4462 | mdiv = ((bestm1 << DPIO_M1DIV_SHIFT) | (bestm2 & DPIO_M2DIV_MASK)); | 4463 | mdiv = ((bestm1 << DPIO_M1DIV_SHIFT) | (bestm2 & DPIO_M2DIV_MASK)); |
@@ -4470,48 +4471,48 @@ static void vlv_update_pll(struct intel_crtc *crtc) | |||
4470 | * Note: don't use the DAC post divider as it seems unstable. | 4471 | * Note: don't use the DAC post divider as it seems unstable. |
4471 | */ | 4472 | */ |
4472 | mdiv |= (DPIO_POST_DIV_HDMIDP << DPIO_POST_DIV_SHIFT); | 4473 | mdiv |= (DPIO_POST_DIV_HDMIDP << DPIO_POST_DIV_SHIFT); |
4473 | vlv_dpio_write(dev_priv, DPIO_DIV(pipe), mdiv); | 4474 | vlv_dpio_write(dev_priv, pipe, DPIO_DIV(pipe), mdiv); |
4474 | 4475 | ||
4475 | mdiv |= DPIO_ENABLE_CALIBRATION; | 4476 | mdiv |= DPIO_ENABLE_CALIBRATION; |
4476 | vlv_dpio_write(dev_priv, DPIO_DIV(pipe), mdiv); | 4477 | vlv_dpio_write(dev_priv, pipe, DPIO_DIV(pipe), mdiv); |
4477 | 4478 | ||
4478 | /* Set HBR and RBR LPF coefficients */ | 4479 | /* Set HBR and RBR LPF coefficients */ |
4479 | if (crtc->config.port_clock == 162000 || | 4480 | if (crtc->config.port_clock == 162000 || |
4480 | intel_pipe_has_type(&crtc->base, INTEL_OUTPUT_ANALOG) || | 4481 | intel_pipe_has_type(&crtc->base, INTEL_OUTPUT_ANALOG) || |
4481 | intel_pipe_has_type(&crtc->base, INTEL_OUTPUT_HDMI)) | 4482 | intel_pipe_has_type(&crtc->base, INTEL_OUTPUT_HDMI)) |
4482 | vlv_dpio_write(dev_priv, DPIO_LPF_COEFF(pipe), | 4483 | vlv_dpio_write(dev_priv, pipe, DPIO_LPF_COEFF(pipe), |
4483 | 0x009f0003); | 4484 | 0x009f0003); |
4484 | else | 4485 | else |
4485 | vlv_dpio_write(dev_priv, DPIO_LPF_COEFF(pipe), | 4486 | vlv_dpio_write(dev_priv, pipe, DPIO_LPF_COEFF(pipe), |
4486 | 0x00d0000f); | 4487 | 0x00d0000f); |
4487 | 4488 | ||
4488 | if (intel_pipe_has_type(&crtc->base, INTEL_OUTPUT_EDP) || | 4489 | if (intel_pipe_has_type(&crtc->base, INTEL_OUTPUT_EDP) || |
4489 | intel_pipe_has_type(&crtc->base, INTEL_OUTPUT_DISPLAYPORT)) { | 4490 | intel_pipe_has_type(&crtc->base, INTEL_OUTPUT_DISPLAYPORT)) { |
4490 | /* Use SSC source */ | 4491 | /* Use SSC source */ |
4491 | if (!pipe) | 4492 | if (!pipe) |
4492 | vlv_dpio_write(dev_priv, DPIO_REFSFR(pipe), | 4493 | vlv_dpio_write(dev_priv, pipe, DPIO_REFSFR(pipe), |
4493 | 0x0df40000); | 4494 | 0x0df40000); |
4494 | else | 4495 | else |
4495 | vlv_dpio_write(dev_priv, DPIO_REFSFR(pipe), | 4496 | vlv_dpio_write(dev_priv, pipe, DPIO_REFSFR(pipe), |
4496 | 0x0df70000); | 4497 | 0x0df70000); |
4497 | } else { /* HDMI or VGA */ | 4498 | } else { /* HDMI or VGA */ |
4498 | /* Use bend source */ | 4499 | /* Use bend source */ |
4499 | if (!pipe) | 4500 | if (!pipe) |
4500 | vlv_dpio_write(dev_priv, DPIO_REFSFR(pipe), | 4501 | vlv_dpio_write(dev_priv, pipe, DPIO_REFSFR(pipe), |
4501 | 0x0df70000); | 4502 | 0x0df70000); |
4502 | else | 4503 | else |
4503 | vlv_dpio_write(dev_priv, DPIO_REFSFR(pipe), | 4504 | vlv_dpio_write(dev_priv, pipe, DPIO_REFSFR(pipe), |
4504 | 0x0df40000); | 4505 | 0x0df40000); |
4505 | } | 4506 | } |
4506 | 4507 | ||
4507 | coreclk = vlv_dpio_read(dev_priv, DPIO_CORE_CLK(pipe)); | 4508 | coreclk = vlv_dpio_read(dev_priv, pipe, DPIO_CORE_CLK(pipe)); |
4508 | coreclk = (coreclk & 0x0000ff00) | 0x01c00000; | 4509 | coreclk = (coreclk & 0x0000ff00) | 0x01c00000; |
4509 | if (intel_pipe_has_type(&crtc->base, INTEL_OUTPUT_DISPLAYPORT) || | 4510 | if (intel_pipe_has_type(&crtc->base, INTEL_OUTPUT_DISPLAYPORT) || |
4510 | intel_pipe_has_type(&crtc->base, INTEL_OUTPUT_EDP)) | 4511 | intel_pipe_has_type(&crtc->base, INTEL_OUTPUT_EDP)) |
4511 | coreclk |= 0x01000000; | 4512 | coreclk |= 0x01000000; |
4512 | vlv_dpio_write(dev_priv, DPIO_CORE_CLK(pipe), coreclk); | 4513 | vlv_dpio_write(dev_priv, pipe, DPIO_CORE_CLK(pipe), coreclk); |
4513 | 4514 | ||
4514 | vlv_dpio_write(dev_priv, DPIO_PLL_CML(pipe), 0x87871000); | 4515 | vlv_dpio_write(dev_priv, pipe, DPIO_PLL_CML(pipe), 0x87871000); |
4515 | 4516 | ||
4516 | /* Enable DPIO clock input */ | 4517 | /* Enable DPIO clock input */ |
4517 | dpll = DPLL_EXT_BUFFER_ENABLE_VLV | DPLL_REFA_CLK_ENABLE_VLV | | 4518 | dpll = DPLL_EXT_BUFFER_ENABLE_VLV | DPLL_REFA_CLK_ENABLE_VLV | |
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index c192dbb8a36c..d6eba380ee2e 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -1746,16 +1746,16 @@ static void vlv_pre_enable_dp(struct intel_encoder *encoder) | |||
1746 | 1746 | ||
1747 | mutex_lock(&dev_priv->dpio_lock); | 1747 | mutex_lock(&dev_priv->dpio_lock); |
1748 | 1748 | ||
1749 | val = vlv_dpio_read(dev_priv, DPIO_DATA_LANE_A(port)); | 1749 | val = vlv_dpio_read(dev_priv, pipe, DPIO_DATA_LANE_A(port)); |
1750 | val = 0; | 1750 | val = 0; |
1751 | if (pipe) | 1751 | if (pipe) |
1752 | val |= (1<<21); | 1752 | val |= (1<<21); |
1753 | else | 1753 | else |
1754 | val &= ~(1<<21); | 1754 | val &= ~(1<<21); |
1755 | val |= 0x001000c4; | 1755 | val |= 0x001000c4; |
1756 | vlv_dpio_write(dev_priv, DPIO_DATA_CHANNEL(port), val); | 1756 | vlv_dpio_write(dev_priv, pipe, DPIO_DATA_CHANNEL(port), val); |
1757 | vlv_dpio_write(dev_priv, DPIO_PCS_CLOCKBUF0(port), 0x00760018); | 1757 | vlv_dpio_write(dev_priv, pipe, DPIO_PCS_CLOCKBUF0(port), 0x00760018); |
1758 | vlv_dpio_write(dev_priv, DPIO_PCS_CLOCKBUF8(port), 0x00400888); | 1758 | vlv_dpio_write(dev_priv, pipe, DPIO_PCS_CLOCKBUF8(port), 0x00400888); |
1759 | 1759 | ||
1760 | mutex_unlock(&dev_priv->dpio_lock); | 1760 | mutex_unlock(&dev_priv->dpio_lock); |
1761 | 1761 | ||
@@ -1769,26 +1769,29 @@ static void intel_dp_pre_pll_enable(struct intel_encoder *encoder) | |||
1769 | struct intel_digital_port *dport = enc_to_dig_port(&encoder->base); | 1769 | struct intel_digital_port *dport = enc_to_dig_port(&encoder->base); |
1770 | struct drm_device *dev = encoder->base.dev; | 1770 | struct drm_device *dev = encoder->base.dev; |
1771 | struct drm_i915_private *dev_priv = dev->dev_private; | 1771 | struct drm_i915_private *dev_priv = dev->dev_private; |
1772 | struct intel_crtc *intel_crtc = | ||
1773 | to_intel_crtc(encoder->base.crtc); | ||
1772 | int port = vlv_dport_to_channel(dport); | 1774 | int port = vlv_dport_to_channel(dport); |
1775 | int pipe = intel_crtc->pipe; | ||
1773 | 1776 | ||
1774 | if (!IS_VALLEYVIEW(dev)) | 1777 | if (!IS_VALLEYVIEW(dev)) |
1775 | return; | 1778 | return; |
1776 | 1779 | ||
1777 | /* Program Tx lane resets to default */ | 1780 | /* Program Tx lane resets to default */ |
1778 | mutex_lock(&dev_priv->dpio_lock); | 1781 | mutex_lock(&dev_priv->dpio_lock); |
1779 | vlv_dpio_write(dev_priv, DPIO_PCS_TX(port), | 1782 | vlv_dpio_write(dev_priv, pipe, DPIO_PCS_TX(port), |
1780 | DPIO_PCS_TX_LANE2_RESET | | 1783 | DPIO_PCS_TX_LANE2_RESET | |
1781 | DPIO_PCS_TX_LANE1_RESET); | 1784 | DPIO_PCS_TX_LANE1_RESET); |
1782 | vlv_dpio_write(dev_priv, DPIO_PCS_CLK(port), | 1785 | vlv_dpio_write(dev_priv, pipe, DPIO_PCS_CLK(port), |
1783 | DPIO_PCS_CLK_CRI_RXEB_EIOS_EN | | 1786 | DPIO_PCS_CLK_CRI_RXEB_EIOS_EN | |
1784 | DPIO_PCS_CLK_CRI_RXDIGFILTSG_EN | | 1787 | DPIO_PCS_CLK_CRI_RXDIGFILTSG_EN | |
1785 | (1<<DPIO_PCS_CLK_DATAWIDTH_SHIFT) | | 1788 | (1<<DPIO_PCS_CLK_DATAWIDTH_SHIFT) | |
1786 | DPIO_PCS_CLK_SOFT_RESET); | 1789 | DPIO_PCS_CLK_SOFT_RESET); |
1787 | 1790 | ||
1788 | /* Fix up inter-pair skew failure */ | 1791 | /* Fix up inter-pair skew failure */ |
1789 | vlv_dpio_write(dev_priv, DPIO_PCS_STAGGER1(port), 0x00750f00); | 1792 | vlv_dpio_write(dev_priv, pipe, DPIO_PCS_STAGGER1(port), 0x00750f00); |
1790 | vlv_dpio_write(dev_priv, DPIO_TX_CTL(port), 0x00001500); | 1793 | vlv_dpio_write(dev_priv, pipe, DPIO_TX_CTL(port), 0x00001500); |
1791 | vlv_dpio_write(dev_priv, DPIO_TX_LANE(port), 0x40400000); | 1794 | vlv_dpio_write(dev_priv, pipe, DPIO_TX_LANE(port), 0x40400000); |
1792 | mutex_unlock(&dev_priv->dpio_lock); | 1795 | mutex_unlock(&dev_priv->dpio_lock); |
1793 | } | 1796 | } |
1794 | 1797 | ||
@@ -1923,10 +1926,13 @@ static uint32_t intel_vlv_signal_levels(struct intel_dp *intel_dp) | |||
1923 | struct drm_device *dev = intel_dp_to_dev(intel_dp); | 1926 | struct drm_device *dev = intel_dp_to_dev(intel_dp); |
1924 | struct drm_i915_private *dev_priv = dev->dev_private; | 1927 | struct drm_i915_private *dev_priv = dev->dev_private; |
1925 | struct intel_digital_port *dport = dp_to_dig_port(intel_dp); | 1928 | struct intel_digital_port *dport = dp_to_dig_port(intel_dp); |
1929 | struct intel_crtc *intel_crtc = | ||
1930 | to_intel_crtc(dport->base.base.crtc); | ||
1926 | unsigned long demph_reg_value, preemph_reg_value, | 1931 | unsigned long demph_reg_value, preemph_reg_value, |
1927 | uniqtranscale_reg_value; | 1932 | uniqtranscale_reg_value; |
1928 | uint8_t train_set = intel_dp->train_set[0]; | 1933 | uint8_t train_set = intel_dp->train_set[0]; |
1929 | int port = vlv_dport_to_channel(dport); | 1934 | int port = vlv_dport_to_channel(dport); |
1935 | int pipe = intel_crtc->pipe; | ||
1930 | 1936 | ||
1931 | switch (train_set & DP_TRAIN_PRE_EMPHASIS_MASK) { | 1937 | switch (train_set & DP_TRAIN_PRE_EMPHASIS_MASK) { |
1932 | case DP_TRAIN_PRE_EMPHASIS_0: | 1938 | case DP_TRAIN_PRE_EMPHASIS_0: |
@@ -2002,14 +2008,14 @@ static uint32_t intel_vlv_signal_levels(struct intel_dp *intel_dp) | |||
2002 | } | 2008 | } |
2003 | 2009 | ||
2004 | mutex_lock(&dev_priv->dpio_lock); | 2010 | mutex_lock(&dev_priv->dpio_lock); |
2005 | vlv_dpio_write(dev_priv, DPIO_TX_OCALINIT(port), 0x00000000); | 2011 | vlv_dpio_write(dev_priv, pipe, DPIO_TX_OCALINIT(port), 0x00000000); |
2006 | vlv_dpio_write(dev_priv, DPIO_TX_SWING_CTL4(port), demph_reg_value); | 2012 | vlv_dpio_write(dev_priv, pipe, DPIO_TX_SWING_CTL4(port), demph_reg_value); |
2007 | vlv_dpio_write(dev_priv, DPIO_TX_SWING_CTL2(port), | 2013 | vlv_dpio_write(dev_priv, pipe, DPIO_TX_SWING_CTL2(port), |
2008 | uniqtranscale_reg_value); | 2014 | uniqtranscale_reg_value); |
2009 | vlv_dpio_write(dev_priv, DPIO_TX_SWING_CTL3(port), 0x0C782040); | 2015 | vlv_dpio_write(dev_priv, pipe, DPIO_TX_SWING_CTL3(port), 0x0C782040); |
2010 | vlv_dpio_write(dev_priv, DPIO_PCS_STAGGER0(port), 0x00030000); | 2016 | vlv_dpio_write(dev_priv, pipe, DPIO_PCS_STAGGER0(port), 0x00030000); |
2011 | vlv_dpio_write(dev_priv, DPIO_PCS_CTL_OVER1(port), preemph_reg_value); | 2017 | vlv_dpio_write(dev_priv, pipe, DPIO_PCS_CTL_OVER1(port), preemph_reg_value); |
2012 | vlv_dpio_write(dev_priv, DPIO_TX_OCALINIT(port), 0x80000000); | 2018 | vlv_dpio_write(dev_priv, pipe, DPIO_TX_OCALINIT(port), 0x80000000); |
2013 | mutex_unlock(&dev_priv->dpio_lock); | 2019 | mutex_unlock(&dev_priv->dpio_lock); |
2014 | 2020 | ||
2015 | return 0; | 2021 | return 0; |
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c index 4148cc85bf7f..70c716ed8350 100644 --- a/drivers/gpu/drm/i915/intel_hdmi.c +++ b/drivers/gpu/drm/i915/intel_hdmi.c | |||
@@ -1079,35 +1079,35 @@ static void intel_hdmi_pre_enable(struct intel_encoder *encoder) | |||
1079 | 1079 | ||
1080 | /* Enable clock channels for this port */ | 1080 | /* Enable clock channels for this port */ |
1081 | mutex_lock(&dev_priv->dpio_lock); | 1081 | mutex_lock(&dev_priv->dpio_lock); |
1082 | val = vlv_dpio_read(dev_priv, DPIO_DATA_LANE_A(port)); | 1082 | val = vlv_dpio_read(dev_priv, pipe, DPIO_DATA_LANE_A(port)); |
1083 | val = 0; | 1083 | val = 0; |
1084 | if (pipe) | 1084 | if (pipe) |
1085 | val |= (1<<21); | 1085 | val |= (1<<21); |
1086 | else | 1086 | else |
1087 | val &= ~(1<<21); | 1087 | val &= ~(1<<21); |
1088 | val |= 0x001000c4; | 1088 | val |= 0x001000c4; |
1089 | vlv_dpio_write(dev_priv, DPIO_DATA_CHANNEL(port), val); | 1089 | vlv_dpio_write(dev_priv, pipe, DPIO_DATA_CHANNEL(port), val); |
1090 | 1090 | ||
1091 | /* HDMI 1.0V-2dB */ | 1091 | /* HDMI 1.0V-2dB */ |
1092 | vlv_dpio_write(dev_priv, DPIO_TX_OCALINIT(port), 0); | 1092 | vlv_dpio_write(dev_priv, pipe, DPIO_TX_OCALINIT(port), 0); |
1093 | vlv_dpio_write(dev_priv, DPIO_TX_SWING_CTL4(port), | 1093 | vlv_dpio_write(dev_priv, pipe, DPIO_TX_SWING_CTL4(port), |
1094 | 0x2b245f5f); | 1094 | 0x2b245f5f); |
1095 | vlv_dpio_write(dev_priv, DPIO_TX_SWING_CTL2(port), | 1095 | vlv_dpio_write(dev_priv, pipe, DPIO_TX_SWING_CTL2(port), |
1096 | 0x5578b83a); | 1096 | 0x5578b83a); |
1097 | vlv_dpio_write(dev_priv, DPIO_TX_SWING_CTL3(port), | 1097 | vlv_dpio_write(dev_priv, pipe, DPIO_TX_SWING_CTL3(port), |
1098 | 0x0c782040); | 1098 | 0x0c782040); |
1099 | vlv_dpio_write(dev_priv, DPIO_TX3_SWING_CTL4(port), | 1099 | vlv_dpio_write(dev_priv, pipe, DPIO_TX3_SWING_CTL4(port), |
1100 | 0x2b247878); | 1100 | 0x2b247878); |
1101 | vlv_dpio_write(dev_priv, DPIO_PCS_STAGGER0(port), 0x00030000); | 1101 | vlv_dpio_write(dev_priv, pipe, DPIO_PCS_STAGGER0(port), 0x00030000); |
1102 | vlv_dpio_write(dev_priv, DPIO_PCS_CTL_OVER1(port), | 1102 | vlv_dpio_write(dev_priv, pipe, DPIO_PCS_CTL_OVER1(port), |
1103 | 0x00002000); | 1103 | 0x00002000); |
1104 | vlv_dpio_write(dev_priv, DPIO_TX_OCALINIT(port), | 1104 | vlv_dpio_write(dev_priv, pipe, DPIO_TX_OCALINIT(port), |
1105 | DPIO_TX_OCALINIT_EN); | 1105 | DPIO_TX_OCALINIT_EN); |
1106 | 1106 | ||
1107 | /* Program lane clock */ | 1107 | /* Program lane clock */ |
1108 | vlv_dpio_write(dev_priv, DPIO_PCS_CLOCKBUF0(port), | 1108 | vlv_dpio_write(dev_priv, pipe, DPIO_PCS_CLOCKBUF0(port), |
1109 | 0x00760018); | 1109 | 0x00760018); |
1110 | vlv_dpio_write(dev_priv, DPIO_PCS_CLOCKBUF8(port), | 1110 | vlv_dpio_write(dev_priv, pipe, DPIO_PCS_CLOCKBUF8(port), |
1111 | 0x00400888); | 1111 | 0x00400888); |
1112 | mutex_unlock(&dev_priv->dpio_lock); | 1112 | mutex_unlock(&dev_priv->dpio_lock); |
1113 | 1113 | ||
@@ -1121,30 +1121,33 @@ static void intel_hdmi_pre_pll_enable(struct intel_encoder *encoder) | |||
1121 | struct intel_digital_port *dport = enc_to_dig_port(&encoder->base); | 1121 | struct intel_digital_port *dport = enc_to_dig_port(&encoder->base); |
1122 | struct drm_device *dev = encoder->base.dev; | 1122 | struct drm_device *dev = encoder->base.dev; |
1123 | struct drm_i915_private *dev_priv = dev->dev_private; | 1123 | struct drm_i915_private *dev_priv = dev->dev_private; |
1124 | struct intel_crtc *intel_crtc = | ||
1125 | to_intel_crtc(encoder->base.crtc); | ||
1124 | int port = vlv_dport_to_channel(dport); | 1126 | int port = vlv_dport_to_channel(dport); |
1127 | int pipe = intel_crtc->pipe; | ||
1125 | 1128 | ||
1126 | if (!IS_VALLEYVIEW(dev)) | 1129 | if (!IS_VALLEYVIEW(dev)) |
1127 | return; | 1130 | return; |
1128 | 1131 | ||
1129 | /* Program Tx lane resets to default */ | 1132 | /* Program Tx lane resets to default */ |
1130 | mutex_lock(&dev_priv->dpio_lock); | 1133 | mutex_lock(&dev_priv->dpio_lock); |
1131 | vlv_dpio_write(dev_priv, DPIO_PCS_TX(port), | 1134 | vlv_dpio_write(dev_priv, pipe, DPIO_PCS_TX(port), |
1132 | DPIO_PCS_TX_LANE2_RESET | | 1135 | DPIO_PCS_TX_LANE2_RESET | |
1133 | DPIO_PCS_TX_LANE1_RESET); | 1136 | DPIO_PCS_TX_LANE1_RESET); |
1134 | vlv_dpio_write(dev_priv, DPIO_PCS_CLK(port), | 1137 | vlv_dpio_write(dev_priv, pipe, DPIO_PCS_CLK(port), |
1135 | DPIO_PCS_CLK_CRI_RXEB_EIOS_EN | | 1138 | DPIO_PCS_CLK_CRI_RXEB_EIOS_EN | |
1136 | DPIO_PCS_CLK_CRI_RXDIGFILTSG_EN | | 1139 | DPIO_PCS_CLK_CRI_RXDIGFILTSG_EN | |
1137 | (1<<DPIO_PCS_CLK_DATAWIDTH_SHIFT) | | 1140 | (1<<DPIO_PCS_CLK_DATAWIDTH_SHIFT) | |
1138 | DPIO_PCS_CLK_SOFT_RESET); | 1141 | DPIO_PCS_CLK_SOFT_RESET); |
1139 | 1142 | ||
1140 | /* Fix up inter-pair skew failure */ | 1143 | /* Fix up inter-pair skew failure */ |
1141 | vlv_dpio_write(dev_priv, DPIO_PCS_STAGGER1(port), 0x00750f00); | 1144 | vlv_dpio_write(dev_priv, pipe, DPIO_PCS_STAGGER1(port), 0x00750f00); |
1142 | vlv_dpio_write(dev_priv, DPIO_TX_CTL(port), 0x00001500); | 1145 | vlv_dpio_write(dev_priv, pipe, DPIO_TX_CTL(port), 0x00001500); |
1143 | vlv_dpio_write(dev_priv, DPIO_TX_LANE(port), 0x40400000); | 1146 | vlv_dpio_write(dev_priv, pipe, DPIO_TX_LANE(port), 0x40400000); |
1144 | 1147 | ||
1145 | vlv_dpio_write(dev_priv, DPIO_PCS_CTL_OVER1(port), | 1148 | vlv_dpio_write(dev_priv, pipe, DPIO_PCS_CTL_OVER1(port), |
1146 | 0x00002000); | 1149 | 0x00002000); |
1147 | vlv_dpio_write(dev_priv, DPIO_TX_OCALINIT(port), | 1150 | vlv_dpio_write(dev_priv, pipe, DPIO_TX_OCALINIT(port), |
1148 | DPIO_TX_OCALINIT_EN); | 1151 | DPIO_TX_OCALINIT_EN); |
1149 | mutex_unlock(&dev_priv->dpio_lock); | 1152 | mutex_unlock(&dev_priv->dpio_lock); |
1150 | } | 1153 | } |
@@ -1153,12 +1156,15 @@ static void intel_hdmi_post_disable(struct intel_encoder *encoder) | |||
1153 | { | 1156 | { |
1154 | struct intel_digital_port *dport = enc_to_dig_port(&encoder->base); | 1157 | struct intel_digital_port *dport = enc_to_dig_port(&encoder->base); |
1155 | struct drm_i915_private *dev_priv = encoder->base.dev->dev_private; | 1158 | struct drm_i915_private *dev_priv = encoder->base.dev->dev_private; |
1159 | struct intel_crtc *intel_crtc = | ||
1160 | to_intel_crtc(encoder->base.crtc); | ||
1156 | int port = vlv_dport_to_channel(dport); | 1161 | int port = vlv_dport_to_channel(dport); |
1162 | int pipe = intel_crtc->pipe; | ||
1157 | 1163 | ||
1158 | /* Reset lanes to avoid HDMI flicker (VLV w/a) */ | 1164 | /* Reset lanes to avoid HDMI flicker (VLV w/a) */ |
1159 | mutex_lock(&dev_priv->dpio_lock); | 1165 | mutex_lock(&dev_priv->dpio_lock); |
1160 | vlv_dpio_write(dev_priv, DPIO_PCS_TX(port), 0x00000000); | 1166 | vlv_dpio_write(dev_priv, pipe, DPIO_PCS_TX(port), 0x00000000); |
1161 | vlv_dpio_write(dev_priv, DPIO_PCS_CLK(port), 0x00e00060); | 1167 | vlv_dpio_write(dev_priv, pipe, DPIO_PCS_CLK(port), 0x00e00060); |
1162 | mutex_unlock(&dev_priv->dpio_lock); | 1168 | mutex_unlock(&dev_priv->dpio_lock); |
1163 | } | 1169 | } |
1164 | 1170 | ||
diff --git a/drivers/gpu/drm/i915/intel_sideband.c b/drivers/gpu/drm/i915/intel_sideband.c index 0a4167019769..acd1cfe8b7dd 100644 --- a/drivers/gpu/drm/i915/intel_sideband.c +++ b/drivers/gpu/drm/i915/intel_sideband.c | |||
@@ -157,19 +157,27 @@ void vlv_gps_core_write(struct drm_i915_private *dev_priv, u32 reg, u32 val) | |||
157 | PUNIT_OPCODE_REG_WRITE, reg, &val); | 157 | PUNIT_OPCODE_REG_WRITE, reg, &val); |
158 | } | 158 | } |
159 | 159 | ||
160 | u32 vlv_dpio_read(struct drm_i915_private *dev_priv, int reg) | 160 | static u32 vlv_get_phy_port(enum pipe pipe) |
161 | { | ||
162 | u32 port = IOSF_PORT_DPIO; | ||
163 | |||
164 | WARN_ON ((pipe != PIPE_A) && (pipe != PIPE_B)); | ||
165 | |||
166 | return port; | ||
167 | } | ||
168 | |||
169 | u32 vlv_dpio_read(struct drm_i915_private *dev_priv, enum pipe pipe, int reg) | ||
161 | { | 170 | { |
162 | u32 val = 0; | 171 | u32 val = 0; |
163 | 172 | ||
164 | vlv_sideband_rw(dev_priv, DPIO_DEVFN, IOSF_PORT_DPIO, | 173 | vlv_sideband_rw(dev_priv, DPIO_DEVFN, vlv_get_phy_port(pipe), |
165 | DPIO_OPCODE_REG_READ, reg, &val); | 174 | DPIO_OPCODE_REG_READ, reg, &val); |
166 | |||
167 | return val; | 175 | return val; |
168 | } | 176 | } |
169 | 177 | ||
170 | void vlv_dpio_write(struct drm_i915_private *dev_priv, int reg, u32 val) | 178 | void vlv_dpio_write(struct drm_i915_private *dev_priv, enum pipe pipe, int reg, u32 val) |
171 | { | 179 | { |
172 | vlv_sideband_rw(dev_priv, DPIO_DEVFN, IOSF_PORT_DPIO, | 180 | vlv_sideband_rw(dev_priv, DPIO_DEVFN, vlv_get_phy_port(pipe), |
173 | DPIO_OPCODE_REG_WRITE, reg, &val); | 181 | DPIO_OPCODE_REG_WRITE, reg, &val); |
174 | } | 182 | } |
175 | 183 | ||