From: ville.syrjala@linux.intel.com
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 1/3] drm/i915: Check VBT for eDP ports on VLV
Date: Fri, 1 Nov 2013 18:22:39 +0200 [thread overview]
Message-ID: <1383322961-7394-2-git-send-email-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <1383322961-7394-1-git-send-email-ville.syrjala@linux.intel.com>
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
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>
---
drivers/gpu/drm/i915/intel_display.c | 5 ++---
drivers/gpu/drm/i915/intel_dp.c | 14 ++++++++++----
drivers/gpu/drm/i915/intel_drv.h | 2 +-
3 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 8f40ae3..3cdfbda 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -9954,7 +9954,7 @@ static void intel_setup_outputs(struct drm_device *dev)
intel_ddi_init(dev, PORT_D);
} else if (HAS_PCH_SPLIT(dev)) {
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))
intel_dp_init(dev, DP_A, PORT_A);
@@ -9991,8 +9991,7 @@ static void intel_setup_outputs(struct drm_device *dev)
intel_hdmi_init(dev, VLV_DISPLAY_BASE + GEN4_HDMIC,
PORT_C);
if (I915_READ(VLV_DISPLAY_BASE + DP_C) & DP_DETECTED)
- intel_dp_init(dev, VLV_DISPLAY_BASE + DP_C,
- PORT_C);
+ intel_dp_init(dev, VLV_DISPLAY_BASE + DP_C, PORT_C);
}
intel_dsi_init(dev);
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index b3cc333..ede023c 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -3263,11 +3263,16 @@ intel_trans_dp_port_sel(struct drm_crtc *crtc)
}
/* 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;
union child_device_config *p_child;
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)
return false;
@@ -3275,7 +3280,7 @@ bool intel_dpd_is_edp(struct drm_device *dev)
for (i = 0; i < dev_priv->vbt.child_dev_num; 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)
return true;
}
@@ -3564,12 +3569,13 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
case PORT_A:
type = DRM_MODE_CONNECTOR_eDP;
break;
+ case PORT_B:
case PORT_C:
- if (IS_VALLEYVIEW(dev))
+ if (IS_VALLEYVIEW(dev) && intel_dp_is_edp(dev, port))
type = DRM_MODE_CONNECTOR_eDP;
break;
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;
break;
default: /* silence GCC warning */
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 9d2624f..3612896 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -707,7 +707,7 @@ void intel_dp_encoder_destroy(struct drm_encoder *encoder);
void intel_dp_check_link_status(struct intel_dp *intel_dp);
bool intel_dp_compute_config(struct intel_encoder *encoder,
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_off(struct intel_dp *intel_dp);
void ironlake_edp_panel_on(struct intel_dp *intel_dp);
--
1.8.1.5
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2013-11-01 16:23 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-01 16:22 [PATCH 0/3] drm/i915: eDP vs. DP detection changes ville.syrjala
2013-11-01 16:22 ` ville.syrjala [this message]
2013-11-01 17:23 ` [PATCH 1/3] drm/i915: Check VBT for eDP ports on VLV Jesse Barnes
2013-11-01 16:22 ` [PATCH 2/3] drm/i915: Make intel_dp_is_edp() less specific ville.syrjala
2013-11-01 17:25 ` Jesse Barnes
2013-11-01 18:32 ` [PATCH 1/2] drm/i915: Give names to the VBT child device type bits ville.syrjala
2013-11-01 18:32 ` [PATCH v2 2/2] drm/i915: Make intel_dp_is_edp() less specific ville.syrjala
2013-11-04 16:08 ` Paulo Zanoni
2013-11-04 16:30 ` Daniel Vetter
2013-11-04 15:58 ` [PATCH 1/2] drm/i915: Give names to the VBT child device type bits Paulo Zanoni
2013-11-01 16:22 ` [PATCH 3/3] drm/i915: Simplify DP vs. eDP detection ville.syrjala
2013-11-01 17:25 ` Jesse Barnes
2013-11-28 12:43 ` Daniel Vetter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1383322961-7394-2-git-send-email-ville.syrjala@linux.intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.