aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorPaulo Zanoni <paulo.r.zanoni@intel.com>2012-07-17 16:53:45 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-07-25 12:23:48 -0400
commitab9d7c302af858e1bc8f613c3a6f1eea3c4c0364 (patch)
treedf67556c2ba40c048fcf564afeb8357f4ca2cd27 /drivers/gpu/drm
parent47ea7542a1ac33ba9f15608d2fca00abcc1c11e5 (diff)
drm/i915: add port field to struct intel_dp and use it
This will be needed for Haswell, but already has its uses here. This patch started as a small patch written patch by Shobhit Kumar, but it has changed so much that none of its original lines remain. Credits-to: Shobhit Kumar <shobhit.kumar@intel.com> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c20
-rw-r--r--drivers/gpu/drm/i915/intel_dp.c44
-rw-r--r--drivers/gpu/drm/i915/intel_drv.h4
3 files changed, 34 insertions, 34 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index e86fd3977f73..f8c2aa1ec27a 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -6764,10 +6764,10 @@ static void intel_setup_outputs(struct drm_device *dev)
6764 dpd_is_edp = intel_dpd_is_edp(dev); 6764 dpd_is_edp = intel_dpd_is_edp(dev);
6765 6765
6766 if (has_edp_a(dev)) 6766 if (has_edp_a(dev))
6767 intel_dp_init(dev, DP_A); 6767 intel_dp_init(dev, DP_A, PORT_A);
6768 6768
6769 if (dpd_is_edp && (I915_READ(PCH_DP_D) & DP_DETECTED)) 6769 if (dpd_is_edp && (I915_READ(PCH_DP_D) & DP_DETECTED))
6770 intel_dp_init(dev, PCH_DP_D); 6770 intel_dp_init(dev, PCH_DP_D, PORT_D);
6771 } 6771 }
6772 6772
6773 intel_crt_init(dev); 6773 intel_crt_init(dev);
@@ -6800,7 +6800,7 @@ static void intel_setup_outputs(struct drm_device *dev)
6800 if (!found) 6800 if (!found)
6801 intel_hdmi_init(dev, HDMIB, PORT_B); 6801 intel_hdmi_init(dev, HDMIB, PORT_B);
6802 if (!found && (I915_READ(PCH_DP_B) & DP_DETECTED)) 6802 if (!found && (I915_READ(PCH_DP_B) & DP_DETECTED))
6803 intel_dp_init(dev, PCH_DP_B); 6803 intel_dp_init(dev, PCH_DP_B, PORT_B);
6804 } 6804 }
6805 6805
6806 if (I915_READ(HDMIC) & PORT_DETECTED) 6806 if (I915_READ(HDMIC) & PORT_DETECTED)
@@ -6810,10 +6810,10 @@ static void intel_setup_outputs(struct drm_device *dev)
6810 intel_hdmi_init(dev, HDMID, PORT_D); 6810 intel_hdmi_init(dev, HDMID, PORT_D);
6811 6811
6812 if (I915_READ(PCH_DP_C) & DP_DETECTED) 6812 if (I915_READ(PCH_DP_C) & DP_DETECTED)
6813 intel_dp_init(dev, PCH_DP_C); 6813 intel_dp_init(dev, PCH_DP_C, PORT_C);
6814 6814
6815 if (!dpd_is_edp && (I915_READ(PCH_DP_D) & DP_DETECTED)) 6815 if (!dpd_is_edp && (I915_READ(PCH_DP_D) & DP_DETECTED))
6816 intel_dp_init(dev, PCH_DP_D); 6816 intel_dp_init(dev, PCH_DP_D, PORT_D);
6817 } else if (IS_VALLEYVIEW(dev)) { 6817 } else if (IS_VALLEYVIEW(dev)) {
6818 int found; 6818 int found;
6819 6819
@@ -6823,7 +6823,7 @@ static void intel_setup_outputs(struct drm_device *dev)
6823 if (!found) 6823 if (!found)
6824 intel_hdmi_init(dev, SDVOB, PORT_B); 6824 intel_hdmi_init(dev, SDVOB, PORT_B);
6825 if (!found && (I915_READ(DP_B) & DP_DETECTED)) 6825 if (!found && (I915_READ(DP_B) & DP_DETECTED))
6826 intel_dp_init(dev, DP_B); 6826 intel_dp_init(dev, DP_B, PORT_B);
6827 } 6827 }
6828 6828
6829 if (I915_READ(SDVOC) & PORT_DETECTED) 6829 if (I915_READ(SDVOC) & PORT_DETECTED)
@@ -6831,7 +6831,7 @@ static void intel_setup_outputs(struct drm_device *dev)
6831 6831
6832 /* Shares lanes with HDMI on SDVOC */ 6832 /* Shares lanes with HDMI on SDVOC */
6833 if (I915_READ(DP_C) & DP_DETECTED) 6833 if (I915_READ(DP_C) & DP_DETECTED)
6834 intel_dp_init(dev, DP_C); 6834 intel_dp_init(dev, DP_C, PORT_C);
6835 } else if (SUPPORTS_DIGITAL_OUTPUTS(dev)) { 6835 } else if (SUPPORTS_DIGITAL_OUTPUTS(dev)) {
6836 bool found = false; 6836 bool found = false;
6837 6837
@@ -6845,7 +6845,7 @@ static void intel_setup_outputs(struct drm_device *dev)
6845 6845
6846 if (!found && SUPPORTS_INTEGRATED_DP(dev)) { 6846 if (!found && SUPPORTS_INTEGRATED_DP(dev)) {
6847 DRM_DEBUG_KMS("probing DP_B\n"); 6847 DRM_DEBUG_KMS("probing DP_B\n");
6848 intel_dp_init(dev, DP_B); 6848 intel_dp_init(dev, DP_B, PORT_B);
6849 } 6849 }
6850 } 6850 }
6851 6851
@@ -6864,14 +6864,14 @@ static void intel_setup_outputs(struct drm_device *dev)
6864 } 6864 }
6865 if (SUPPORTS_INTEGRATED_DP(dev)) { 6865 if (SUPPORTS_INTEGRATED_DP(dev)) {
6866 DRM_DEBUG_KMS("probing DP_C\n"); 6866 DRM_DEBUG_KMS("probing DP_C\n");
6867 intel_dp_init(dev, DP_C); 6867 intel_dp_init(dev, DP_C, PORT_C);
6868 } 6868 }
6869 } 6869 }
6870 6870
6871 if (SUPPORTS_INTEGRATED_DP(dev) && 6871 if (SUPPORTS_INTEGRATED_DP(dev) &&
6872 (I915_READ(DP_D) & DP_DETECTED)) { 6872 (I915_READ(DP_D) & DP_DETECTED)) {
6873 DRM_DEBUG_KMS("probing DP_D\n"); 6873 DRM_DEBUG_KMS("probing DP_D\n");
6874 intel_dp_init(dev, DP_D); 6874 intel_dp_init(dev, DP_D, PORT_D);
6875 } 6875 }
6876 } else if (IS_GEN2(dev)) 6876 } else if (IS_GEN2(dev))
6877 intel_dvo_init(dev); 6877 intel_dvo_init(dev);
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 61400c1fef0f..ad90a499dab7 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -2426,7 +2426,7 @@ intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *connect
2426} 2426}
2427 2427
2428void 2428void
2429intel_dp_init(struct drm_device *dev, int output_reg) 2429intel_dp_init(struct drm_device *dev, int output_reg, enum port port)
2430{ 2430{
2431 struct drm_i915_private *dev_priv = dev->dev_private; 2431 struct drm_i915_private *dev_priv = dev->dev_private;
2432 struct drm_connector *connector; 2432 struct drm_connector *connector;
@@ -2441,6 +2441,7 @@ intel_dp_init(struct drm_device *dev, int output_reg)
2441 return; 2441 return;
2442 2442
2443 intel_dp->output_reg = output_reg; 2443 intel_dp->output_reg = output_reg;
2444 intel_dp->port = port;
2444 intel_dp->dpms_mode = -1; 2445 intel_dp->dpms_mode = -1;
2445 2446
2446 intel_connector = kzalloc(sizeof(struct intel_connector), GFP_KERNEL); 2447 intel_connector = kzalloc(sizeof(struct intel_connector), GFP_KERNEL);
@@ -2486,28 +2487,25 @@ intel_dp_init(struct drm_device *dev, int output_reg)
2486 drm_sysfs_connector_add(connector); 2487 drm_sysfs_connector_add(connector);
2487 2488
2488 /* Set up the DDC bus. */ 2489 /* Set up the DDC bus. */
2489 switch (output_reg) { 2490 switch (port) {
2490 case DP_A: 2491 case PORT_A:
2491 name = "DPDDC-A"; 2492 name = "DPDDC-A";
2492 break; 2493 break;
2493 case DP_B: 2494 case PORT_B:
2494 case PCH_DP_B: 2495 dev_priv->hotplug_supported_mask |= DPB_HOTPLUG_INT_STATUS;
2495 dev_priv->hotplug_supported_mask |= 2496 name = "DPDDC-B";
2496 DPB_HOTPLUG_INT_STATUS; 2497 break;
2497 name = "DPDDC-B"; 2498 case PORT_C:
2498 break; 2499 dev_priv->hotplug_supported_mask |= DPC_HOTPLUG_INT_STATUS;
2499 case DP_C: 2500 name = "DPDDC-C";
2500 case PCH_DP_C: 2501 break;
2501 dev_priv->hotplug_supported_mask |= 2502 case PORT_D:
2502 DPC_HOTPLUG_INT_STATUS; 2503 dev_priv->hotplug_supported_mask |= DPD_HOTPLUG_INT_STATUS;
2503 name = "DPDDC-C"; 2504 name = "DPDDC-D";
2504 break; 2505 break;
2505 case DP_D: 2506 default:
2506 case PCH_DP_D: 2507 WARN(1, "Invalid port %c\n", port_name(port));
2507 dev_priv->hotplug_supported_mask |= 2508 break;
2508 DPD_HOTPLUG_INT_STATUS;
2509 name = "DPDDC-D";
2510 break;
2511 } 2509 }
2512 2510
2513 intel_dp_i2c_init(intel_dp, intel_connector, name); 2511 intel_dp_i2c_init(intel_dp, intel_connector, name);
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index d234f1af5db5..2846f5e8cca3 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -306,6 +306,7 @@ struct intel_dp {
306 uint8_t link_configuration[DP_LINK_CONFIGURATION_SIZE]; 306 uint8_t link_configuration[DP_LINK_CONFIGURATION_SIZE];
307 bool has_audio; 307 bool has_audio;
308 enum hdmi_force_audio force_audio; 308 enum hdmi_force_audio force_audio;
309 enum port port;
309 uint32_t color_range; 310 uint32_t color_range;
310 int dpms_mode; 311 int dpms_mode;
311 uint8_t link_bw; 312 uint8_t link_bw;
@@ -375,7 +376,8 @@ extern void intel_tv_init(struct drm_device *dev);
375extern void intel_mark_busy(struct drm_device *dev, 376extern void intel_mark_busy(struct drm_device *dev,
376 struct drm_i915_gem_object *obj); 377 struct drm_i915_gem_object *obj);
377extern bool intel_lvds_init(struct drm_device *dev); 378extern bool intel_lvds_init(struct drm_device *dev);
378extern void intel_dp_init(struct drm_device *dev, int dp_reg); 379extern void intel_dp_init(struct drm_device *dev, int output_reg,
380 enum port port);
379void 381void
380intel_dp_set_m_n(struct drm_crtc *crtc, struct drm_display_mode *mode, 382intel_dp_set_m_n(struct drm_crtc *crtc, struct drm_display_mode *mode,
381 struct drm_display_mode *adjusted_mode); 383 struct drm_display_mode *adjusted_mode);