aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorPaulo Zanoni <paulo.r.zanoni@intel.com>2012-11-23 12:30:39 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-11-29 08:58:53 -0500
commitaffa935440733a79c5a9eb0e5357e2564ca4b355 (patch)
tree3bc587ef85dc71c639e55ca50d27defa3c20e28e /drivers
parent20749730e39bba1c6100bec0e0d1a45c99db559e (diff)
drm/i915: add HAS_DDI check
And use it whenever we call code that uses the DDIs. We already have intel_ddi.c and prefix every function with intel_ddi_something instead of haswell_something, so I think replacing the checks with HAS_DDI makes more sense. Just a cosmetical change, yes I know, but I have this OCD... Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Reviewed-by: Imre Deak <imre.deak@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h2
-rw-r--r--drivers/gpu/drm/i915/intel_crt.c2
-rw-r--r--drivers/gpu/drm/i915/intel_ddi.c2
-rw-r--r--drivers/gpu/drm/i915/intel_display.c19
-rw-r--r--drivers/gpu/drm/i915/intel_dp.c8
-rw-r--r--drivers/gpu/drm/i915/intel_hdmi.c4
6 files changed, 19 insertions, 18 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 9be7efd43c6a..e908c498ed87 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1208,6 +1208,8 @@ struct drm_i915_file_private {
1208 1208
1209#define HAS_PIPE_CONTROL(dev) (INTEL_INFO(dev)->gen >= 5) 1209#define HAS_PIPE_CONTROL(dev) (INTEL_INFO(dev)->gen >= 5)
1210 1210
1211#define HAS_DDI(dev) (IS_HASWELL(dev))
1212
1211#define INTEL_PCH_DEVICE_ID_MASK 0xff00 1213#define INTEL_PCH_DEVICE_ID_MASK 0xff00
1212#define INTEL_PCH_IBX_DEVICE_ID_TYPE 0x3b00 1214#define INTEL_PCH_IBX_DEVICE_ID_TYPE 0x3b00
1213#define INTEL_PCH_CPT_DEVICE_ID_TYPE 0x1c00 1215#define INTEL_PCH_CPT_DEVICE_ID_TYPE 0x1c00
diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c
index 5c7774396e10..bc07b3f0d5e7 100644
--- a/drivers/gpu/drm/i915/intel_crt.c
+++ b/drivers/gpu/drm/i915/intel_crt.c
@@ -771,7 +771,7 @@ void intel_crt_init(struct drm_device *dev)
771 771
772 crt->base.disable = intel_disable_crt; 772 crt->base.disable = intel_disable_crt;
773 crt->base.enable = intel_enable_crt; 773 crt->base.enable = intel_enable_crt;
774 if (IS_HASWELL(dev)) 774 if (HAS_DDI(dev))
775 crt->base.get_hw_state = intel_ddi_get_hw_state; 775 crt->base.get_hw_state = intel_ddi_get_hw_state;
776 else 776 else
777 crt->base.get_hw_state = intel_crt_get_hw_state; 777 crt->base.get_hw_state = intel_crt_get_hw_state;
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index 16d3e7854ced..197dede1870a 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -115,7 +115,7 @@ void intel_prepare_ddi(struct drm_device *dev)
115{ 115{
116 int port; 116 int port;
117 117
118 if (IS_HASWELL(dev)) { 118 if (HAS_DDI(dev)) {
119 for (port = PORT_A; port < PORT_E; port++) 119 for (port = PORT_A; port < PORT_E; port++)
120 intel_prepare_ddi_buffers(dev, port, false); 120 intel_prepare_ddi_buffers(dev, port, false);
121 121
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 511b397b5aaa..52b6b0e811bc 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -1072,8 +1072,8 @@ static void assert_fdi_tx(struct drm_i915_private *dev_priv,
1072 enum transcoder cpu_transcoder = intel_pipe_to_cpu_transcoder(dev_priv, 1072 enum transcoder cpu_transcoder = intel_pipe_to_cpu_transcoder(dev_priv,
1073 pipe); 1073 pipe);
1074 1074
1075 if (IS_HASWELL(dev_priv->dev)) { 1075 if (HAS_DDI(dev_priv->dev)) {
1076 /* On Haswell, DDI is used instead of FDI_TX_CTL */ 1076 /* DDI does not have a specific FDI_TX register */
1077 reg = TRANS_DDI_FUNC_CTL(cpu_transcoder); 1077 reg = TRANS_DDI_FUNC_CTL(cpu_transcoder);
1078 val = I915_READ(reg); 1078 val = I915_READ(reg);
1079 cur_state = !!(val & TRANS_DDI_FUNC_ENABLE); 1079 cur_state = !!(val & TRANS_DDI_FUNC_ENABLE);
@@ -1117,7 +1117,7 @@ static void assert_fdi_tx_pll_enabled(struct drm_i915_private *dev_priv,
1117 return; 1117 return;
1118 1118
1119 /* On Haswell, DDI ports are responsible for the FDI PLL setup */ 1119 /* On Haswell, DDI ports are responsible for the FDI PLL setup */
1120 if (IS_HASWELL(dev_priv->dev)) 1120 if (HAS_DDI(dev_priv->dev))
1121 return; 1121 return;
1122 1122
1123 reg = FDI_TX_CTL(pipe); 1123 reg = FDI_TX_CTL(pipe);
@@ -7976,7 +7976,7 @@ static const struct drm_crtc_funcs intel_crtc_funcs = {
7976 7976
7977static void intel_cpu_pll_init(struct drm_device *dev) 7977static void intel_cpu_pll_init(struct drm_device *dev)
7978{ 7978{
7979 if (IS_HASWELL(dev)) 7979 if (HAS_DDI(dev))
7980 intel_ddi_pll_init(dev); 7980 intel_ddi_pll_init(dev);
7981} 7981}
7982 7982
@@ -8112,11 +8112,10 @@ static void intel_setup_outputs(struct drm_device *dev)
8112 I915_WRITE(PFIT_CONTROL, 0); 8112 I915_WRITE(PFIT_CONTROL, 0);
8113 } 8113 }
8114 8114
8115 if (!(IS_HASWELL(dev) && 8115 if (!(HAS_DDI(dev) && (I915_READ(DDI_BUF_CTL(PORT_A)) & DDI_A_4_LANES)))
8116 (I915_READ(DDI_BUF_CTL(PORT_A)) & DDI_A_4_LANES)))
8117 intel_crt_init(dev); 8116 intel_crt_init(dev);
8118 8117
8119 if (IS_HASWELL(dev)) { 8118 if (HAS_DDI(dev)) {
8120 int found; 8119 int found;
8121 8120
8122 /* Haswell uses DDI functions to detect digital outputs */ 8121 /* Haswell uses DDI functions to detect digital outputs */
@@ -8360,7 +8359,7 @@ static void intel_init_display(struct drm_device *dev)
8360 struct drm_i915_private *dev_priv = dev->dev_private; 8359 struct drm_i915_private *dev_priv = dev->dev_private;
8361 8360
8362 /* We always want a DPMS function */ 8361 /* We always want a DPMS function */
8363 if (IS_HASWELL(dev)) { 8362 if (HAS_DDI(dev)) {
8364 dev_priv->display.crtc_mode_set = haswell_crtc_mode_set; 8363 dev_priv->display.crtc_mode_set = haswell_crtc_mode_set;
8365 dev_priv->display.crtc_enable = haswell_crtc_enable; 8364 dev_priv->display.crtc_enable = haswell_crtc_enable;
8366 dev_priv->display.crtc_disable = haswell_crtc_disable; 8365 dev_priv->display.crtc_disable = haswell_crtc_disable;
@@ -8849,7 +8848,7 @@ void intel_modeset_setup_hw_state(struct drm_device *dev,
8849 struct intel_encoder *encoder; 8848 struct intel_encoder *encoder;
8850 struct intel_connector *connector; 8849 struct intel_connector *connector;
8851 8850
8852 if (IS_HASWELL(dev)) { 8851 if (HAS_DDI(dev)) {
8853 tmp = I915_READ(TRANS_DDI_FUNC_CTL(TRANSCODER_EDP)); 8852 tmp = I915_READ(TRANS_DDI_FUNC_CTL(TRANSCODER_EDP));
8854 8853
8855 if (tmp & TRANS_DDI_FUNC_ENABLE) { 8854 if (tmp & TRANS_DDI_FUNC_ENABLE) {
@@ -8890,7 +8889,7 @@ void intel_modeset_setup_hw_state(struct drm_device *dev,
8890 crtc->active ? "enabled" : "disabled"); 8889 crtc->active ? "enabled" : "disabled");
8891 } 8890 }
8892 8891
8893 if (IS_HASWELL(dev)) 8892 if (HAS_DDI(dev))
8894 intel_ddi_setup_hw_pll_state(dev); 8893 intel_ddi_setup_hw_pll_state(dev);
8895 8894
8896 list_for_each_entry(encoder, &dev->mode_config.encoder_list, 8895 list_for_each_entry(encoder, &dev->mode_config.encoder_list,
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index d76258dcb8f8..f2904380a6f6 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -379,7 +379,7 @@ intel_dp_aux_ch(struct intel_dp *intel_dp,
379 * clock divider. 379 * clock divider.
380 */ 380 */
381 if (is_cpu_edp(intel_dp)) { 381 if (is_cpu_edp(intel_dp)) {
382 if (IS_HASWELL(dev)) 382 if (HAS_DDI(dev))
383 aux_clock_divider = intel_ddi_get_cdclk_freq(dev_priv) >> 1; 383 aux_clock_divider = intel_ddi_get_cdclk_freq(dev_priv) >> 1;
384 else if (IS_VALLEYVIEW(dev)) 384 else if (IS_VALLEYVIEW(dev))
385 aux_clock_divider = 100; 385 aux_clock_divider = 100;
@@ -1791,7 +1791,7 @@ intel_dp_start_link_train(struct intel_dp *intel_dp)
1791 int voltage_tries, loop_tries; 1791 int voltage_tries, loop_tries;
1792 uint32_t DP = intel_dp->DP; 1792 uint32_t DP = intel_dp->DP;
1793 1793
1794 if (IS_HASWELL(dev)) 1794 if (HAS_DDI(dev))
1795 intel_ddi_prepare_link_retrain(encoder); 1795 intel_ddi_prepare_link_retrain(encoder);
1796 1796
1797 /* Write the link configuration data */ 1797 /* Write the link configuration data */
@@ -1981,7 +1981,7 @@ intel_dp_link_down(struct intel_dp *intel_dp)
1981 * intel_ddi_prepare_link_retrain will take care of redoing the link 1981 * intel_ddi_prepare_link_retrain will take care of redoing the link
1982 * train. 1982 * train.
1983 */ 1983 */
1984 if (IS_HASWELL(dev)) 1984 if (HAS_DDI(dev))
1985 return; 1985 return;
1986 1986
1987 if (WARN_ON((I915_READ(intel_dp->output_reg) & DP_PORT_EN) == 0)) 1987 if (WARN_ON((I915_READ(intel_dp->output_reg) & DP_PORT_EN) == 0))
@@ -2742,7 +2742,7 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
2742 intel_connector_attach_encoder(intel_connector, intel_encoder); 2742 intel_connector_attach_encoder(intel_connector, intel_encoder);
2743 drm_sysfs_connector_add(connector); 2743 drm_sysfs_connector_add(connector);
2744 2744
2745 if (IS_HASWELL(dev)) 2745 if (HAS_DDI(dev))
2746 intel_connector->get_hw_state = intel_ddi_connector_get_hw_state; 2746 intel_connector->get_hw_state = intel_ddi_connector_get_hw_state;
2747 else 2747 else
2748 intel_connector->get_hw_state = intel_connector_get_hw_state; 2748 intel_connector->get_hw_state = intel_connector_get_hw_state;
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index 2ee9821b9d93..53df0a88a6a8 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -48,7 +48,7 @@ assert_hdmi_port_disabled(struct intel_hdmi *intel_hdmi)
48 struct drm_i915_private *dev_priv = dev->dev_private; 48 struct drm_i915_private *dev_priv = dev->dev_private;
49 uint32_t enabled_bits; 49 uint32_t enabled_bits;
50 50
51 enabled_bits = IS_HASWELL(dev) ? DDI_BUF_CTL_ENABLE : SDVO_ENABLE; 51 enabled_bits = HAS_DDI(dev) ? DDI_BUF_CTL_ENABLE : SDVO_ENABLE;
52 52
53 WARN(I915_READ(intel_hdmi->sdvox_reg) & enabled_bits, 53 WARN(I915_READ(intel_hdmi->sdvox_reg) & enabled_bits,
54 "HDMI port enabled, expecting disabled\n"); 54 "HDMI port enabled, expecting disabled\n");
@@ -1013,7 +1013,7 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
1013 intel_hdmi->set_infoframes = cpt_set_infoframes; 1013 intel_hdmi->set_infoframes = cpt_set_infoframes;
1014 } 1014 }
1015 1015
1016 if (IS_HASWELL(dev)) 1016 if (HAS_DDI(dev))
1017 intel_connector->get_hw_state = intel_ddi_connector_get_hw_state; 1017 intel_connector->get_hw_state = intel_ddi_connector_get_hw_state;
1018 else 1018 else
1019 intel_connector->get_hw_state = intel_connector_get_hw_state; 1019 intel_connector->get_hw_state = intel_connector_get_hw_state;