Commit 5d8a7752 authored by Ville Syrjälä's avatar Ville Syrjälä Committed by Daniel Vetter

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=71051Tested-by: default avatarRobert Hooker <robert.hooker@canonical.com>
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
[danvet: Wrestle the patch to apply and compile properly.]
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent fec8cba3
...@@ -173,7 +173,7 @@ static void intel_prepare_ddi_buffers(struct drm_device *dev, enum port port) ...@@ -173,7 +173,7 @@ static void intel_prepare_ddi_buffers(struct drm_device *dev, enum port port)
ddi_translations = ddi_translations_dp; ddi_translations = ddi_translations_dp;
break; break;
case PORT_D: case PORT_D:
if (intel_dpd_is_edp(dev)) if (intel_dp_is_edp(dev, PORT_D))
ddi_translations = ddi_translations_edp; ddi_translations = ddi_translations_edp;
else else
ddi_translations = ddi_translations_dp; ddi_translations = ddi_translations_dp;
......
...@@ -10049,7 +10049,7 @@ static void intel_setup_outputs(struct drm_device *dev) ...@@ -10049,7 +10049,7 @@ static void intel_setup_outputs(struct drm_device *dev)
intel_ddi_init(dev, PORT_D); intel_ddi_init(dev, PORT_D);
} else if (HAS_PCH_SPLIT(dev)) { } else if (HAS_PCH_SPLIT(dev)) {
int found; int found;
dpd_is_edp = intel_dpd_is_edp(dev); dpd_is_edp = intel_dp_is_edp(dev, PORT_D);
if (has_edp_a(dev)) if (has_edp_a(dev))
intel_dp_init(dev, DP_A, PORT_A); intel_dp_init(dev, DP_A, PORT_A);
...@@ -10086,8 +10086,7 @@ static void intel_setup_outputs(struct drm_device *dev) ...@@ -10086,8 +10086,7 @@ static void intel_setup_outputs(struct drm_device *dev)
intel_hdmi_init(dev, VLV_DISPLAY_BASE + GEN4_HDMIC, intel_hdmi_init(dev, VLV_DISPLAY_BASE + GEN4_HDMIC,
PORT_C); PORT_C);
if (I915_READ(VLV_DISPLAY_BASE + DP_C) & DP_DETECTED) if (I915_READ(VLV_DISPLAY_BASE + DP_C) & DP_DETECTED)
intel_dp_init(dev, VLV_DISPLAY_BASE + DP_C, intel_dp_init(dev, VLV_DISPLAY_BASE + DP_C, PORT_C);
PORT_C);
} }
intel_dsi_init(dev); intel_dsi_init(dev);
......
...@@ -3326,11 +3326,16 @@ intel_trans_dp_port_sel(struct drm_crtc *crtc) ...@@ -3326,11 +3326,16 @@ intel_trans_dp_port_sel(struct drm_crtc *crtc)
} }
/* check the VBT to see whether the eDP is on DP-D port */ /* check the VBT to see whether the eDP is on DP-D port */
bool intel_dpd_is_edp(struct drm_device *dev) bool intel_dp_is_edp(struct drm_device *dev, enum port port)
{ {
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
union child_device_config *p_child; union child_device_config *p_child;
int i; int i;
static const short port_mapping[] = {
[PORT_B] = PORT_IDPB,
[PORT_C] = PORT_IDPC,
[PORT_D] = PORT_IDPD,
};
if (!dev_priv->vbt.child_dev_num) if (!dev_priv->vbt.child_dev_num)
return false; return false;
...@@ -3338,7 +3343,7 @@ bool intel_dpd_is_edp(struct drm_device *dev) ...@@ -3338,7 +3343,7 @@ bool intel_dpd_is_edp(struct drm_device *dev)
for (i = 0; i < dev_priv->vbt.child_dev_num; i++) { for (i = 0; i < dev_priv->vbt.child_dev_num; i++) {
p_child = dev_priv->vbt.child_dev + i; p_child = dev_priv->vbt.child_dev + i;
if (p_child->common.dvo_port == PORT_IDPD && if (p_child->common.dvo_port == port_mapping[port] &&
(p_child->common.device_type & DEVICE_TYPE_eDP_BITS) == (p_child->common.device_type & DEVICE_TYPE_eDP_BITS) ==
(DEVICE_TYPE_eDP & DEVICE_TYPE_eDP_BITS)) (DEVICE_TYPE_eDP & DEVICE_TYPE_eDP_BITS))
return true; return true;
...@@ -3625,12 +3630,13 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port, ...@@ -3625,12 +3630,13 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
case PORT_A: case PORT_A:
type = DRM_MODE_CONNECTOR_eDP; type = DRM_MODE_CONNECTOR_eDP;
break; break;
case PORT_B:
case PORT_C: case PORT_C:
if (IS_VALLEYVIEW(dev)) if (IS_VALLEYVIEW(dev) && intel_dp_is_edp(dev, port))
type = DRM_MODE_CONNECTOR_eDP; type = DRM_MODE_CONNECTOR_eDP;
break; break;
case PORT_D: case PORT_D:
if (HAS_PCH_SPLIT(dev) && intel_dpd_is_edp(dev)) if (HAS_PCH_SPLIT(dev) && intel_dp_is_edp(dev, port))
type = DRM_MODE_CONNECTOR_eDP; type = DRM_MODE_CONNECTOR_eDP;
break; break;
default: /* silence GCC warning */ default: /* silence GCC warning */
......
...@@ -708,7 +708,7 @@ void intel_dp_encoder_destroy(struct drm_encoder *encoder); ...@@ -708,7 +708,7 @@ void intel_dp_encoder_destroy(struct drm_encoder *encoder);
void intel_dp_check_link_status(struct intel_dp *intel_dp); void intel_dp_check_link_status(struct intel_dp *intel_dp);
bool intel_dp_compute_config(struct intel_encoder *encoder, bool intel_dp_compute_config(struct intel_encoder *encoder,
struct intel_crtc_config *pipe_config); struct intel_crtc_config *pipe_config);
bool intel_dpd_is_edp(struct drm_device *dev); bool intel_dp_is_edp(struct drm_device *dev, enum port port);
void ironlake_edp_backlight_on(struct intel_dp *intel_dp); void ironlake_edp_backlight_on(struct intel_dp *intel_dp);
void ironlake_edp_backlight_off(struct intel_dp *intel_dp); void ironlake_edp_backlight_off(struct intel_dp *intel_dp);
void ironlake_edp_panel_on(struct intel_dp *intel_dp); void ironlake_edp_panel_on(struct intel_dp *intel_dp);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment