diff options
Diffstat (limited to 'drivers/gpu/drm/i915/intel_ddi.c')
| -rw-r--r-- | drivers/gpu/drm/i915/intel_ddi.c | 216 |
1 files changed, 120 insertions, 96 deletions
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c index 01e523df363b..ad3b0ee5e55b 100644 --- a/drivers/gpu/drm/i915/intel_ddi.c +++ b/drivers/gpu/drm/i915/intel_ddi.c | |||
| @@ -948,7 +948,7 @@ static int bxt_calc_pll_link(struct drm_i915_private *dev_priv, | |||
| 948 | { | 948 | { |
| 949 | struct intel_shared_dpll *pll; | 949 | struct intel_shared_dpll *pll; |
| 950 | struct intel_dpll_hw_state *state; | 950 | struct intel_dpll_hw_state *state; |
| 951 | intel_clock_t clock; | 951 | struct dpll clock; |
| 952 | 952 | ||
| 953 | /* For DDI ports we always use a shared PLL. */ | 953 | /* For DDI ports we always use a shared PLL. */ |
| 954 | if (WARN_ON(dpll == DPLL_ID_PRIVATE)) | 954 | if (WARN_ON(dpll == DPLL_ID_PRIVATE)) |
| @@ -1342,6 +1342,14 @@ bool intel_ddi_get_hw_state(struct intel_encoder *encoder, | |||
| 1342 | DRM_DEBUG_KMS("No pipe for ddi port %c found\n", port_name(port)); | 1342 | DRM_DEBUG_KMS("No pipe for ddi port %c found\n", port_name(port)); |
| 1343 | 1343 | ||
| 1344 | out: | 1344 | out: |
| 1345 | if (ret && IS_BROXTON(dev_priv)) { | ||
| 1346 | tmp = I915_READ(BXT_PHY_CTL(port)); | ||
| 1347 | if ((tmp & (BXT_PHY_LANE_POWERDOWN_ACK | | ||
| 1348 | BXT_PHY_LANE_ENABLED)) != BXT_PHY_LANE_ENABLED) | ||
| 1349 | DRM_ERROR("Port %c enabled but PHY powered down? " | ||
| 1350 | "(PHY_CTL %08x)\n", port_name(port), tmp); | ||
| 1351 | } | ||
| 1352 | |||
| 1345 | intel_display_power_put(dev_priv, power_domain); | 1353 | intel_display_power_put(dev_priv, power_domain); |
| 1346 | 1354 | ||
| 1347 | return ret; | 1355 | return ret; |
| @@ -1742,9 +1750,11 @@ static void intel_disable_ddi(struct intel_encoder *intel_encoder) | |||
| 1742 | } | 1750 | } |
| 1743 | } | 1751 | } |
| 1744 | 1752 | ||
| 1745 | static bool broxton_phy_is_enabled(struct drm_i915_private *dev_priv, | 1753 | bool bxt_ddi_phy_is_enabled(struct drm_i915_private *dev_priv, |
| 1746 | enum dpio_phy phy) | 1754 | enum dpio_phy phy) |
| 1747 | { | 1755 | { |
| 1756 | enum port port; | ||
| 1757 | |||
| 1748 | if (!(I915_READ(BXT_P_CR_GT_DISP_PWRON) & GT_DISPLAY_POWER_ON(phy))) | 1758 | if (!(I915_READ(BXT_P_CR_GT_DISP_PWRON) & GT_DISPLAY_POWER_ON(phy))) |
| 1749 | return false; | 1759 | return false; |
| 1750 | 1760 | ||
| @@ -1770,38 +1780,48 @@ static bool broxton_phy_is_enabled(struct drm_i915_private *dev_priv, | |||
| 1770 | return false; | 1780 | return false; |
| 1771 | } | 1781 | } |
| 1772 | 1782 | ||
| 1783 | for_each_port_masked(port, | ||
| 1784 | phy == DPIO_PHY0 ? BIT(PORT_B) | BIT(PORT_C) : | ||
| 1785 | BIT(PORT_A)) { | ||
| 1786 | u32 tmp = I915_READ(BXT_PHY_CTL(port)); | ||
| 1787 | |||
| 1788 | if (tmp & BXT_PHY_CMNLANE_POWERDOWN_ACK) { | ||
| 1789 | DRM_DEBUG_DRIVER("DDI PHY %d powered, but common lane " | ||
| 1790 | "for port %c powered down " | ||
| 1791 | "(PHY_CTL %08x)\n", | ||
| 1792 | phy, port_name(port), tmp); | ||
| 1793 | |||
| 1794 | return false; | ||
| 1795 | } | ||
| 1796 | } | ||
| 1797 | |||
| 1773 | return true; | 1798 | return true; |
| 1774 | } | 1799 | } |
| 1775 | 1800 | ||
| 1776 | static u32 broxton_get_grc(struct drm_i915_private *dev_priv, enum dpio_phy phy) | 1801 | static u32 bxt_get_grc(struct drm_i915_private *dev_priv, enum dpio_phy phy) |
| 1777 | { | 1802 | { |
| 1778 | u32 val = I915_READ(BXT_PORT_REF_DW6(phy)); | 1803 | u32 val = I915_READ(BXT_PORT_REF_DW6(phy)); |
| 1779 | 1804 | ||
| 1780 | return (val & GRC_CODE_MASK) >> GRC_CODE_SHIFT; | 1805 | return (val & GRC_CODE_MASK) >> GRC_CODE_SHIFT; |
| 1781 | } | 1806 | } |
| 1782 | 1807 | ||
| 1783 | static void broxton_phy_wait_grc_done(struct drm_i915_private *dev_priv, | 1808 | static void bxt_phy_wait_grc_done(struct drm_i915_private *dev_priv, |
| 1784 | enum dpio_phy phy) | 1809 | enum dpio_phy phy) |
| 1785 | { | 1810 | { |
| 1786 | if (wait_for(I915_READ(BXT_PORT_REF_DW3(phy)) & GRC_DONE, 10)) | 1811 | if (wait_for(I915_READ(BXT_PORT_REF_DW3(phy)) & GRC_DONE, 10)) |
| 1787 | DRM_ERROR("timeout waiting for PHY%d GRC\n", phy); | 1812 | DRM_ERROR("timeout waiting for PHY%d GRC\n", phy); |
| 1788 | } | 1813 | } |
| 1789 | 1814 | ||
| 1790 | static bool broxton_phy_verify_state(struct drm_i915_private *dev_priv, | 1815 | void bxt_ddi_phy_init(struct drm_i915_private *dev_priv, enum dpio_phy phy) |
| 1791 | enum dpio_phy phy); | ||
| 1792 | |||
| 1793 | static void broxton_phy_init(struct drm_i915_private *dev_priv, | ||
| 1794 | enum dpio_phy phy) | ||
| 1795 | { | 1816 | { |
| 1796 | enum port port; | 1817 | u32 val; |
| 1797 | u32 ports, val; | ||
| 1798 | 1818 | ||
| 1799 | if (broxton_phy_is_enabled(dev_priv, phy)) { | 1819 | if (bxt_ddi_phy_is_enabled(dev_priv, phy)) { |
| 1800 | /* Still read out the GRC value for state verification */ | 1820 | /* Still read out the GRC value for state verification */ |
| 1801 | if (phy == DPIO_PHY0) | 1821 | if (phy == DPIO_PHY0) |
| 1802 | dev_priv->bxt_phy_grc = broxton_get_grc(dev_priv, phy); | 1822 | dev_priv->bxt_phy_grc = bxt_get_grc(dev_priv, phy); |
| 1803 | 1823 | ||
| 1804 | if (broxton_phy_verify_state(dev_priv, phy)) { | 1824 | if (bxt_ddi_phy_verify_state(dev_priv, phy)) { |
| 1805 | DRM_DEBUG_DRIVER("DDI PHY %d already enabled, " | 1825 | DRM_DEBUG_DRIVER("DDI PHY %d already enabled, " |
| 1806 | "won't reprogram it\n", phy); | 1826 | "won't reprogram it\n", phy); |
| 1807 | 1827 | ||
| @@ -1810,8 +1830,6 @@ static void broxton_phy_init(struct drm_i915_private *dev_priv, | |||
| 1810 | 1830 | ||
| 1811 | DRM_DEBUG_DRIVER("DDI PHY %d enabled with invalid state, " | 1831 | DRM_DEBUG_DRIVER("DDI PHY %d enabled with invalid state, " |
| 1812 | "force reprogramming it\n", phy); | 1832 | "force reprogramming it\n", phy); |
| 1813 | } else { | ||
| 1814 | DRM_DEBUG_DRIVER("DDI PHY %d not enabled, enabling it\n", phy); | ||
| 1815 | } | 1833 | } |
| 1816 | 1834 | ||
| 1817 | val = I915_READ(BXT_P_CR_GT_DISP_PWRON); | 1835 | val = I915_READ(BXT_P_CR_GT_DISP_PWRON); |
| @@ -1831,28 +1849,6 @@ static void broxton_phy_init(struct drm_i915_private *dev_priv, | |||
| 1831 | DRM_ERROR("timeout during PHY%d power on\n", phy); | 1849 | DRM_ERROR("timeout during PHY%d power on\n", phy); |
| 1832 | } | 1850 | } |
| 1833 | 1851 | ||
| 1834 | if (phy == DPIO_PHY0) | ||
| 1835 | ports = BIT(PORT_B) | BIT(PORT_C); | ||
| 1836 | else | ||
| 1837 | ports = BIT(PORT_A); | ||
| 1838 | |||
| 1839 | for_each_port_masked(port, ports) { | ||
| 1840 | int lane; | ||
| 1841 | |||
| 1842 | for (lane = 0; lane < 4; lane++) { | ||
| 1843 | val = I915_READ(BXT_PORT_TX_DW14_LN(port, lane)); | ||
| 1844 | /* | ||
| 1845 | * Note that on CHV this flag is called UPAR, but has | ||
| 1846 | * the same function. | ||
| 1847 | */ | ||
| 1848 | val &= ~LATENCY_OPTIM; | ||
| 1849 | if (lane != 1) | ||
| 1850 | val |= LATENCY_OPTIM; | ||
| 1851 | |||
| 1852 | I915_WRITE(BXT_PORT_TX_DW14_LN(port, lane), val); | ||
| 1853 | } | ||
| 1854 | } | ||
| 1855 | |||
| 1856 | /* Program PLL Rcomp code offset */ | 1852 | /* Program PLL Rcomp code offset */ |
| 1857 | val = I915_READ(BXT_PORT_CL1CM_DW9(phy)); | 1853 | val = I915_READ(BXT_PORT_CL1CM_DW9(phy)); |
| 1858 | val &= ~IREF0RC_OFFSET_MASK; | 1854 | val &= ~IREF0RC_OFFSET_MASK; |
| @@ -1899,10 +1895,7 @@ static void broxton_phy_init(struct drm_i915_private *dev_priv, | |||
| 1899 | * the corresponding calibrated value from PHY1, and disable | 1895 | * the corresponding calibrated value from PHY1, and disable |
| 1900 | * the automatic calibration on PHY0. | 1896 | * the automatic calibration on PHY0. |
| 1901 | */ | 1897 | */ |
| 1902 | broxton_phy_wait_grc_done(dev_priv, DPIO_PHY1); | 1898 | val = dev_priv->bxt_phy_grc = bxt_get_grc(dev_priv, DPIO_PHY1); |
| 1903 | |||
| 1904 | val = dev_priv->bxt_phy_grc = broxton_get_grc(dev_priv, | ||
| 1905 | DPIO_PHY1); | ||
| 1906 | grc_code = val << GRC_CODE_FAST_SHIFT | | 1899 | grc_code = val << GRC_CODE_FAST_SHIFT | |
| 1907 | val << GRC_CODE_SLOW_SHIFT | | 1900 | val << GRC_CODE_SLOW_SHIFT | |
| 1908 | val; | 1901 | val; |
| @@ -1912,31 +1905,16 @@ static void broxton_phy_init(struct drm_i915_private *dev_priv, | |||
| 1912 | val |= GRC_DIS | GRC_RDY_OVRD; | 1905 | val |= GRC_DIS | GRC_RDY_OVRD; |
| 1913 | I915_WRITE(BXT_PORT_REF_DW8(DPIO_PHY0), val); | 1906 | I915_WRITE(BXT_PORT_REF_DW8(DPIO_PHY0), val); |
| 1914 | } | 1907 | } |
| 1915 | /* | ||
| 1916 | * During PHY1 init delay waiting for GRC calibration to finish, since | ||
| 1917 | * it can happen in parallel with the subsequent PHY0 init. | ||
| 1918 | */ | ||
| 1919 | 1908 | ||
| 1920 | val = I915_READ(BXT_PHY_CTL_FAMILY(phy)); | 1909 | val = I915_READ(BXT_PHY_CTL_FAMILY(phy)); |
| 1921 | val |= COMMON_RESET_DIS; | 1910 | val |= COMMON_RESET_DIS; |
| 1922 | I915_WRITE(BXT_PHY_CTL_FAMILY(phy), val); | 1911 | I915_WRITE(BXT_PHY_CTL_FAMILY(phy), val); |
| 1923 | } | ||
| 1924 | 1912 | ||
| 1925 | void broxton_ddi_phy_init(struct drm_i915_private *dev_priv) | 1913 | if (phy == DPIO_PHY1) |
| 1926 | { | 1914 | bxt_phy_wait_grc_done(dev_priv, DPIO_PHY1); |
| 1927 | /* Enable PHY1 first since it provides Rcomp for PHY0 */ | ||
| 1928 | broxton_phy_init(dev_priv, DPIO_PHY1); | ||
| 1929 | broxton_phy_init(dev_priv, DPIO_PHY0); | ||
| 1930 | |||
| 1931 | /* | ||
| 1932 | * If BIOS enabled only PHY0 and not PHY1, we skipped waiting for the | ||
| 1933 | * PHY1 GRC calibration to finish, so wait for it here. | ||
| 1934 | */ | ||
| 1935 | broxton_phy_wait_grc_done(dev_priv, DPIO_PHY1); | ||
| 1936 | } | 1915 | } |
| 1937 | 1916 | ||
| 1938 | static void broxton_phy_uninit(struct drm_i915_private *dev_priv, | 1917 | void bxt_ddi_phy_uninit(struct drm_i915_private *dev_priv, enum dpio_phy phy) |
| 1939 | enum dpio_phy phy) | ||
| 1940 | { | 1918 | { |
| 1941 | uint32_t val; | 1919 | uint32_t val; |
| 1942 | 1920 | ||
| @@ -1949,12 +1927,6 @@ static void broxton_phy_uninit(struct drm_i915_private *dev_priv, | |||
| 1949 | I915_WRITE(BXT_P_CR_GT_DISP_PWRON, val); | 1927 | I915_WRITE(BXT_P_CR_GT_DISP_PWRON, val); |
| 1950 | } | 1928 | } |
| 1951 | 1929 | ||
| 1952 | void broxton_ddi_phy_uninit(struct drm_i915_private *dev_priv) | ||
| 1953 | { | ||
| 1954 | broxton_phy_uninit(dev_priv, DPIO_PHY1); | ||
| 1955 | broxton_phy_uninit(dev_priv, DPIO_PHY0); | ||
| 1956 | } | ||
| 1957 | |||
| 1958 | static bool __printf(6, 7) | 1930 | static bool __printf(6, 7) |
| 1959 | __phy_reg_verify_state(struct drm_i915_private *dev_priv, enum dpio_phy phy, | 1931 | __phy_reg_verify_state(struct drm_i915_private *dev_priv, enum dpio_phy phy, |
| 1960 | i915_reg_t reg, u32 mask, u32 expected, | 1932 | i915_reg_t reg, u32 mask, u32 expected, |
| @@ -1982,11 +1954,9 @@ __phy_reg_verify_state(struct drm_i915_private *dev_priv, enum dpio_phy phy, | |||
| 1982 | return false; | 1954 | return false; |
| 1983 | } | 1955 | } |
| 1984 | 1956 | ||
| 1985 | static bool broxton_phy_verify_state(struct drm_i915_private *dev_priv, | 1957 | bool bxt_ddi_phy_verify_state(struct drm_i915_private *dev_priv, |
| 1986 | enum dpio_phy phy) | 1958 | enum dpio_phy phy) |
| 1987 | { | 1959 | { |
| 1988 | enum port port; | ||
| 1989 | u32 ports; | ||
| 1990 | uint32_t mask; | 1960 | uint32_t mask; |
| 1991 | bool ok; | 1961 | bool ok; |
| 1992 | 1962 | ||
| @@ -1994,27 +1964,11 @@ static bool broxton_phy_verify_state(struct drm_i915_private *dev_priv, | |||
| 1994 | __phy_reg_verify_state(dev_priv, phy, reg, mask, exp, fmt, \ | 1964 | __phy_reg_verify_state(dev_priv, phy, reg, mask, exp, fmt, \ |
| 1995 | ## __VA_ARGS__) | 1965 | ## __VA_ARGS__) |
| 1996 | 1966 | ||
| 1997 | /* We expect the PHY to be always enabled */ | 1967 | if (!bxt_ddi_phy_is_enabled(dev_priv, phy)) |
| 1998 | if (!broxton_phy_is_enabled(dev_priv, phy)) | ||
| 1999 | return false; | 1968 | return false; |
| 2000 | 1969 | ||
| 2001 | ok = true; | 1970 | ok = true; |
| 2002 | 1971 | ||
| 2003 | if (phy == DPIO_PHY0) | ||
| 2004 | ports = BIT(PORT_B) | BIT(PORT_C); | ||
| 2005 | else | ||
| 2006 | ports = BIT(PORT_A); | ||
| 2007 | |||
| 2008 | for_each_port_masked(port, ports) { | ||
| 2009 | int lane; | ||
| 2010 | |||
| 2011 | for (lane = 0; lane < 4; lane++) | ||
| 2012 | ok &= _CHK(BXT_PORT_TX_DW14_LN(port, lane), | ||
| 2013 | LATENCY_OPTIM, | ||
| 2014 | lane != 1 ? LATENCY_OPTIM : 0, | ||
| 2015 | "BXT_PORT_TX_DW14_LN(%d, %d)", port, lane); | ||
| 2016 | } | ||
| 2017 | |||
| 2018 | /* PLL Rcomp code offset */ | 1972 | /* PLL Rcomp code offset */ |
| 2019 | ok &= _CHK(BXT_PORT_CL1CM_DW9(phy), | 1973 | ok &= _CHK(BXT_PORT_CL1CM_DW9(phy), |
| 2020 | IREF0RC_OFFSET_MASK, 0xe4 << IREF0RC_OFFSET_SHIFT, | 1974 | IREF0RC_OFFSET_MASK, 0xe4 << IREF0RC_OFFSET_SHIFT, |
| @@ -2058,11 +2012,65 @@ static bool broxton_phy_verify_state(struct drm_i915_private *dev_priv, | |||
| 2058 | #undef _CHK | 2012 | #undef _CHK |
| 2059 | } | 2013 | } |
| 2060 | 2014 | ||
| 2061 | void broxton_ddi_phy_verify_state(struct drm_i915_private *dev_priv) | 2015 | static uint8_t |
| 2016 | bxt_ddi_phy_calc_lane_lat_optim_mask(struct intel_encoder *encoder, | ||
| 2017 | struct intel_crtc_state *pipe_config) | ||
| 2062 | { | 2018 | { |
| 2063 | if (!broxton_phy_verify_state(dev_priv, DPIO_PHY0) || | 2019 | switch (pipe_config->lane_count) { |
| 2064 | !broxton_phy_verify_state(dev_priv, DPIO_PHY1)) | 2020 | case 1: |
| 2065 | i915_report_error(dev_priv, "DDI PHY state mismatch\n"); | 2021 | return 0; |
| 2022 | case 2: | ||
| 2023 | return BIT(2) | BIT(0); | ||
| 2024 | case 4: | ||
| 2025 | return BIT(3) | BIT(2) | BIT(0); | ||
| 2026 | default: | ||
| 2027 | MISSING_CASE(pipe_config->lane_count); | ||
| 2028 | |||
| 2029 | return 0; | ||
| 2030 | } | ||
| 2031 | } | ||
| 2032 | |||
| 2033 | static void bxt_ddi_pre_pll_enable(struct intel_encoder *encoder) | ||
| 2034 | { | ||
| 2035 | struct intel_digital_port *dport = enc_to_dig_port(&encoder->base); | ||
| 2036 | struct drm_i915_private *dev_priv = to_i915(dport->base.base.dev); | ||
| 2037 | enum port port = dport->port; | ||
| 2038 | struct intel_crtc *intel_crtc = to_intel_crtc(encoder->base.crtc); | ||
| 2039 | int lane; | ||
| 2040 | |||
| 2041 | for (lane = 0; lane < 4; lane++) { | ||
| 2042 | u32 val = I915_READ(BXT_PORT_TX_DW14_LN(port, lane)); | ||
| 2043 | |||
| 2044 | /* | ||
| 2045 | * Note that on CHV this flag is called UPAR, but has | ||
| 2046 | * the same function. | ||
| 2047 | */ | ||
| 2048 | val &= ~LATENCY_OPTIM; | ||
| 2049 | if (intel_crtc->config->lane_lat_optim_mask & BIT(lane)) | ||
| 2050 | val |= LATENCY_OPTIM; | ||
| 2051 | |||
| 2052 | I915_WRITE(BXT_PORT_TX_DW14_LN(port, lane), val); | ||
| 2053 | } | ||
| 2054 | } | ||
| 2055 | |||
| 2056 | static uint8_t | ||
| 2057 | bxt_ddi_phy_get_lane_lat_optim_mask(struct intel_encoder *encoder) | ||
| 2058 | { | ||
| 2059 | struct intel_digital_port *dport = enc_to_dig_port(&encoder->base); | ||
| 2060 | struct drm_i915_private *dev_priv = to_i915(dport->base.base.dev); | ||
| 2061 | enum port port = dport->port; | ||
| 2062 | int lane; | ||
| 2063 | uint8_t mask; | ||
| 2064 | |||
| 2065 | mask = 0; | ||
| 2066 | for (lane = 0; lane < 4; lane++) { | ||
| 2067 | u32 val = I915_READ(BXT_PORT_TX_DW14_LN(port, lane)); | ||
| 2068 | |||
| 2069 | if (val & LATENCY_OPTIM) | ||
| 2070 | mask |= BIT(lane); | ||
| 2071 | } | ||
| 2072 | |||
| 2073 | return mask; | ||
| 2066 | } | 2074 | } |
| 2067 | 2075 | ||
| 2068 | void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp) | 2076 | void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp) |
| @@ -2236,13 +2244,19 @@ void intel_ddi_get_config(struct intel_encoder *encoder, | |||
| 2236 | } | 2244 | } |
| 2237 | 2245 | ||
| 2238 | intel_ddi_clock_get(encoder, pipe_config); | 2246 | intel_ddi_clock_get(encoder, pipe_config); |
| 2247 | |||
| 2248 | if (IS_BROXTON(dev_priv)) | ||
| 2249 | pipe_config->lane_lat_optim_mask = | ||
| 2250 | bxt_ddi_phy_get_lane_lat_optim_mask(encoder); | ||
| 2239 | } | 2251 | } |
| 2240 | 2252 | ||
| 2241 | static bool intel_ddi_compute_config(struct intel_encoder *encoder, | 2253 | static bool intel_ddi_compute_config(struct intel_encoder *encoder, |
| 2242 | struct intel_crtc_state *pipe_config) | 2254 | struct intel_crtc_state *pipe_config) |
| 2243 | { | 2255 | { |
| 2256 | struct drm_i915_private *dev_priv = encoder->base.dev->dev_private; | ||
| 2244 | int type = encoder->type; | 2257 | int type = encoder->type; |
| 2245 | int port = intel_ddi_get_encoder_port(encoder); | 2258 | int port = intel_ddi_get_encoder_port(encoder); |
| 2259 | int ret; | ||
| 2246 | 2260 | ||
| 2247 | WARN(type == INTEL_OUTPUT_UNKNOWN, "compute_config() on unknown output!\n"); | 2261 | WARN(type == INTEL_OUTPUT_UNKNOWN, "compute_config() on unknown output!\n"); |
| 2248 | 2262 | ||
| @@ -2250,9 +2264,17 @@ static bool intel_ddi_compute_config(struct intel_encoder *encoder, | |||
| 2250 | pipe_config->cpu_transcoder = TRANSCODER_EDP; | 2264 | pipe_config->cpu_transcoder = TRANSCODER_EDP; |
| 2251 | 2265 | ||
| 2252 | if (type == INTEL_OUTPUT_HDMI) | 2266 | if (type == INTEL_OUTPUT_HDMI) |
| 2253 | return intel_hdmi_compute_config(encoder, pipe_config); | 2267 | ret = intel_hdmi_compute_config(encoder, pipe_config); |
| 2254 | else | 2268 | else |
| 2255 | return intel_dp_compute_config(encoder, pipe_config); | 2269 | ret = intel_dp_compute_config(encoder, pipe_config); |
| 2270 | |||
| 2271 | if (IS_BROXTON(dev_priv) && ret) | ||
| 2272 | pipe_config->lane_lat_optim_mask = | ||
| 2273 | bxt_ddi_phy_calc_lane_lat_optim_mask(encoder, | ||
| 2274 | pipe_config); | ||
| 2275 | |||
| 2276 | return ret; | ||
| 2277 | |||
| 2256 | } | 2278 | } |
| 2257 | 2279 | ||
| 2258 | static const struct drm_encoder_funcs intel_ddi_funcs = { | 2280 | static const struct drm_encoder_funcs intel_ddi_funcs = { |
| @@ -2347,10 +2369,12 @@ void intel_ddi_init(struct drm_device *dev, enum port port) | |||
| 2347 | encoder = &intel_encoder->base; | 2369 | encoder = &intel_encoder->base; |
| 2348 | 2370 | ||
| 2349 | drm_encoder_init(dev, encoder, &intel_ddi_funcs, | 2371 | drm_encoder_init(dev, encoder, &intel_ddi_funcs, |
| 2350 | DRM_MODE_ENCODER_TMDS, NULL); | 2372 | DRM_MODE_ENCODER_TMDS, "DDI %c", port_name(port)); |
| 2351 | 2373 | ||
| 2352 | intel_encoder->compute_config = intel_ddi_compute_config; | 2374 | intel_encoder->compute_config = intel_ddi_compute_config; |
| 2353 | intel_encoder->enable = intel_enable_ddi; | 2375 | intel_encoder->enable = intel_enable_ddi; |
| 2376 | if (IS_BROXTON(dev_priv)) | ||
| 2377 | intel_encoder->pre_pll_enable = bxt_ddi_pre_pll_enable; | ||
| 2354 | intel_encoder->pre_enable = intel_ddi_pre_enable; | 2378 | intel_encoder->pre_enable = intel_ddi_pre_enable; |
| 2355 | intel_encoder->disable = intel_disable_ddi; | 2379 | intel_encoder->disable = intel_disable_ddi; |
| 2356 | intel_encoder->post_disable = intel_ddi_post_disable; | 2380 | intel_encoder->post_disable = intel_ddi_post_disable; |
