aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/intel_ddi.c
diff options
context:
space:
mode:
authorPaulo Zanoni <paulo.r.zanoni@intel.com>2012-10-15 15:51:38 -0300
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-10-18 20:43:43 +0200
commit0bdee30ed351d437cc24bb0ec51dfd02f60273fb (patch)
treee636ede8a60293a1791627f890356ff63185bf83 /drivers/gpu/drm/i915/intel_ddi.c
parent750eb99e0ec12f9a13446284d493d35a60866624 (diff)
drm/i915: add DP support to intel_ddi_get_encoder_port
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Reviewed-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_ddi.c')
-rw-r--r--drivers/gpu/drm/i915/intel_ddi.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index 5071370339b..ab1693c209d 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -60,14 +60,20 @@ static const u32 hsw_ddi_translations_fdi[] = {
static enum port intel_ddi_get_encoder_port(struct intel_encoder *intel_encoder)
{
+ struct drm_encoder *encoder = &intel_encoder->base;
int type = intel_encoder->type;
- if (type == INTEL_OUTPUT_HDMI) {
- struct intel_hdmi *intel_hdmi =
- enc_to_intel_hdmi(&intel_encoder->base);
+ if (type == INTEL_OUTPUT_DISPLAYPORT || type == INTEL_OUTPUT_EDP) {
+ struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
+ return intel_dp->port;
+
+ } else if (type == INTEL_OUTPUT_HDMI) {
+ struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder);
return intel_hdmi->ddi_port;
+
} else if (type == INTEL_OUTPUT_ANALOG) {
return PORT_E;
+
} else {
DRM_ERROR("Invalid DDI encoder type %d\n", type);
BUG();