diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2013-11-01 12:22:39 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-11-28 07:42:12 -0500 |
commit | 5d8a77529bd6864361005117c3a611b6d810aa77 (patch) | |
tree | 488b67b585fa92e8e53fcb7d16400d1f00948941 | |
parent | fec8cba306f974f3a4491176994de5d821273643 (diff) |
drm/i915: Check VBT for eDP ports on VLV
VLV can have eDP on either port B or C, or even both. Based on the
VBT spec, intel_dpd_is_edp() should work on VLV too, assuming we
check the correct ports.
So instead of hardcoding port D, rename the function to
intel_dp_is_edp() and pass the port as a parameter, and use it
on VLV ports B and C.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71051
Tested-by: Robert Hooker <robert.hooker@canonical.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
[danvet: Wrestle the patch to apply and compile properly.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r-- | drivers/gpu/drm/i915/intel_ddi.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_dp.c | 14 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_drv.h | 2 |
4 files changed, 14 insertions, 9 deletions
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c index 333fff367e5e..526c8ded16b0 100644 --- a/drivers/gpu/drm/i915/intel_ddi.c +++ b/drivers/gpu/drm/i915/intel_ddi.c | |||
@@ -173,7 +173,7 @@ static void intel_prepare_ddi_buffers(struct drm_device *dev, enum port port) | |||
173 | ddi_translations = ddi_translations_dp; | 173 | ddi_translations = ddi_translations_dp; |
174 | break; | 174 | break; |
175 | case PORT_D: | 175 | case PORT_D: |
176 | if (intel_dpd_is_edp(dev)) | 176 | if (intel_dp_is_edp(dev, PORT_D)) |
177 | ddi_translations = ddi_translations_edp; | 177 | ddi_translations = ddi_translations_edp; |
178 | else | 178 | else |
179 | ddi_translations = ddi_translations_dp; | 179 | ddi_translations = ddi_translations_dp; |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 7ec8b488bb1d..0d9369578fde 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -10049,7 +10049,7 @@ static void intel_setup_outputs(struct drm_device *dev) | |||
10049 | intel_ddi_init(dev, PORT_D); | 10049 | intel_ddi_init(dev, PORT_D); |
10050 | } else if (HAS_PCH_SPLIT(dev)) { | 10050 | } else if (HAS_PCH_SPLIT(dev)) { |
10051 | int found; | 10051 | int found; |
10052 | dpd_is_edp = intel_dpd_is_edp(dev); | 10052 | dpd_is_edp = intel_dp_is_edp(dev, PORT_D); |
10053 | 10053 | ||
10054 | if (has_edp_a(dev)) | 10054 | if (has_edp_a(dev)) |
10055 | intel_dp_init(dev, DP_A, PORT_A); | 10055 | intel_dp_init(dev, DP_A, PORT_A); |
@@ -10086,8 +10086,7 @@ static void intel_setup_outputs(struct drm_device *dev) | |||
10086 | intel_hdmi_init(dev, VLV_DISPLAY_BASE + GEN4_HDMIC, | 10086 | intel_hdmi_init(dev, VLV_DISPLAY_BASE + GEN4_HDMIC, |
10087 | PORT_C); | 10087 | PORT_C); |
10088 | if (I915_READ(VLV_DISPLAY_BASE + DP_C) & DP_DETECTED) | 10088 | if (I915_READ(VLV_DISPLAY_BASE + DP_C) & DP_DETECTED) |
10089 | intel_dp_init(dev, VLV_DISPLAY_BASE + DP_C, | 10089 | intel_dp_init(dev, VLV_DISPLAY_BASE + DP_C, PORT_C); |
10090 | PORT_C); | ||
10091 | } | 10090 | } |
10092 | 10091 | ||
10093 | intel_dsi_init(dev); | 10092 | intel_dsi_init(dev); |
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 0b2e842fef01..2e5154e5955f 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -3326,11 +3326,16 @@ intel_trans_dp_port_sel(struct drm_crtc *crtc) | |||
3326 | } | 3326 | } |
3327 | 3327 | ||
3328 | /* check the VBT to see whether the eDP is on DP-D port */ | 3328 | /* check the VBT to see whether the eDP is on DP-D port */ |
3329 | bool intel_dpd_is_edp(struct drm_device *dev) | 3329 | bool intel_dp_is_edp(struct drm_device *dev, enum port port) |
3330 | { | 3330 | { |
3331 | struct drm_i915_private *dev_priv = dev->dev_private; | 3331 | struct drm_i915_private *dev_priv = dev->dev_private; |
3332 | union child_device_config *p_child; | 3332 | union child_device_config *p_child; |
3333 | int i; | 3333 | int i; |
3334 | static const short port_mapping[] = { | ||
3335 | [PORT_B] = PORT_IDPB, | ||
3336 | [PORT_C] = PORT_IDPC, | ||
3337 | [PORT_D] = PORT_IDPD, | ||
3338 | }; | ||
3334 | 3339 | ||
3335 | if (!dev_priv->vbt.child_dev_num) | 3340 | if (!dev_priv->vbt.child_dev_num) |
3336 | return false; | 3341 | return false; |
@@ -3338,7 +3343,7 @@ bool intel_dpd_is_edp(struct drm_device *dev) | |||
3338 | for (i = 0; i < dev_priv->vbt.child_dev_num; i++) { | 3343 | for (i = 0; i < dev_priv->vbt.child_dev_num; i++) { |
3339 | p_child = dev_priv->vbt.child_dev + i; | 3344 | p_child = dev_priv->vbt.child_dev + i; |
3340 | 3345 | ||
3341 | if (p_child->common.dvo_port == PORT_IDPD && | 3346 | if (p_child->common.dvo_port == port_mapping[port] && |
3342 | (p_child->common.device_type & DEVICE_TYPE_eDP_BITS) == | 3347 | (p_child->common.device_type & DEVICE_TYPE_eDP_BITS) == |
3343 | (DEVICE_TYPE_eDP & DEVICE_TYPE_eDP_BITS)) | 3348 | (DEVICE_TYPE_eDP & DEVICE_TYPE_eDP_BITS)) |
3344 | return true; | 3349 | return true; |
@@ -3625,12 +3630,13 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port, | |||
3625 | case PORT_A: | 3630 | case PORT_A: |
3626 | type = DRM_MODE_CONNECTOR_eDP; | 3631 | type = DRM_MODE_CONNECTOR_eDP; |
3627 | break; | 3632 | break; |
3633 | case PORT_B: | ||
3628 | case PORT_C: | 3634 | case PORT_C: |
3629 | if (IS_VALLEYVIEW(dev)) | 3635 | if (IS_VALLEYVIEW(dev) && intel_dp_is_edp(dev, port)) |
3630 | type = DRM_MODE_CONNECTOR_eDP; | 3636 | type = DRM_MODE_CONNECTOR_eDP; |
3631 | break; | 3637 | break; |
3632 | case PORT_D: | 3638 | case PORT_D: |
3633 | if (HAS_PCH_SPLIT(dev) && intel_dpd_is_edp(dev)) | 3639 | if (HAS_PCH_SPLIT(dev) && intel_dp_is_edp(dev, port)) |
3634 | type = DRM_MODE_CONNECTOR_eDP; | 3640 | type = DRM_MODE_CONNECTOR_eDP; |
3635 | break; | 3641 | break; |
3636 | default: /* silence GCC warning */ | 3642 | default: /* silence GCC warning */ |
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 1e49aa8f5377..a18e88b3e425 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h | |||
@@ -708,7 +708,7 @@ void intel_dp_encoder_destroy(struct drm_encoder *encoder); | |||
708 | void intel_dp_check_link_status(struct intel_dp *intel_dp); | 708 | void intel_dp_check_link_status(struct intel_dp *intel_dp); |
709 | bool intel_dp_compute_config(struct intel_encoder *encoder, | 709 | bool intel_dp_compute_config(struct intel_encoder *encoder, |
710 | struct intel_crtc_config *pipe_config); | 710 | struct intel_crtc_config *pipe_config); |
711 | bool intel_dpd_is_edp(struct drm_device *dev); | 711 | bool intel_dp_is_edp(struct drm_device *dev, enum port port); |
712 | void ironlake_edp_backlight_on(struct intel_dp *intel_dp); | 712 | void ironlake_edp_backlight_on(struct intel_dp *intel_dp); |
713 | void ironlake_edp_backlight_off(struct intel_dp *intel_dp); | 713 | void ironlake_edp_backlight_off(struct intel_dp *intel_dp); |
714 | void ironlake_edp_panel_on(struct intel_dp *intel_dp); | 714 | void ironlake_edp_panel_on(struct intel_dp *intel_dp); |