From patchwork Mon Oct 15 18:51:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Zanoni X-Patchwork-Id: 1595171 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 1396A3FD86 for ; Mon, 15 Oct 2012 18:57:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 01FDD9F738 for ; Mon, 15 Oct 2012 11:57:08 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-gg0-f177.google.com (mail-gg0-f177.google.com [209.85.161.177]) by gabe.freedesktop.org (Postfix) with ESMTP id EFABD9F6CE for ; Mon, 15 Oct 2012 11:52:25 -0700 (PDT) Received: by mail-gg0-f177.google.com with SMTP id h1so1328269gge.36 for ; Mon, 15 Oct 2012 11:52:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=4mjjGALKVNgBna2ODpH+X3haWY+rR6y+btM4es5EdPc=; b=kPHC9YGat9wnQWz1iTUhoLq1/KMT2fW8oltxoPXOmso0nTtzASooONRBBXet07wNvz LBPZdNNWxK77RwqIUNcY5xgRtFrT+V18U8hgilq6vZICczT0qqR/IXt1ecaUGbaUk7vF iqRXtL/1InwOphB5PvYMQ36s5lDijPmnseF8O/J8y3KMamguXFy2eBojUU1VaRESn0cT iD6lx++uMoM/sRccyvU/G/J0QUmhdrVbQo3o+Ol4qC0D4C+cbpztzf3KOUv4OYea0yCD Ju/Ca+utkI9StzUzNQjI9iAzvojoR9RTgjxwITD9Nf7MN4pGwKbqIpac1gs006qYbhvL mfJg== Received: by 10.101.10.22 with SMTP id n22mr3554362ani.76.1350327145645; Mon, 15 Oct 2012 11:52:25 -0700 (PDT) Received: from vicky.domain.invalid ([177.16.37.219]) by mx.google.com with ESMTPS id u67sm15879079yhb.8.2012.10.15.11.52.24 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 15 Oct 2012 11:52:25 -0700 (PDT) From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Mon, 15 Oct 2012 15:51:38 -0300 Message-Id: <1350327102-4463-11-git-send-email-przanoni@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1350327102-4463-1-git-send-email-przanoni@gmail.com> References: <1350327102-4463-1-git-send-email-przanoni@gmail.com> Cc: Paulo Zanoni Subject: [Intel-gfx] [PATCH 10/14] drm/i915: add DP support to intel_ddi_get_encoder_port X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org From: Paulo Zanoni Signed-off-by: Paulo Zanoni Reviewed-by: Damien Lespiau --- drivers/gpu/drm/i915/intel_ddi.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c index c6ddba9..817ebb2 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();