From patchwork Mon Oct 15 18:51:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Zanoni X-Patchwork-Id: 1595191 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id C27C2DFB34 for ; Mon, 15 Oct 2012 18:58:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B50249F6FC for ; Mon, 15 Oct 2012 11:58:04 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-yh0-f49.google.com (mail-yh0-f49.google.com [209.85.213.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 8E5939F6CE for ; Mon, 15 Oct 2012 11:52:29 -0700 (PDT) Received: by mail-yh0-f49.google.com with SMTP id j52so1335408yhj.36 for ; Mon, 15 Oct 2012 11:52:29 -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=r34fiFRxcX+dEi6Xs6KS9VcMg3rgL29wjaLNw1I5Lvw=; b=DdiHB9Ye6t5UsdB/Kjm4GxOCmWN/iG9Y/4rUNlSuxgnIzKIFBtrcjM7giU2Fjkdlbn CZ+eFXxhrOLLVZZtpc7ivIJ+hVqDGUu//3z/XPrrEcTVXQ9kTE5BPM+jFaaQc+hCB+cL 47XZU4hrf4BbPTnpgcAIleSMID4UcbhPo/rwJuhNHN7jxEPmVcgHz0IYBq0lB/iRoj8c X6dfUhCcV0tEBHZq4OJiG205eGFvkYU3NltpIOWzF8hE1kwhp2/gSFBOn4EYalqCI4xu VaaILQeAe/kgcTxqpsHHTuzp9K6NkAXZ8+a3vQx3khAArY8B+O2sqLukJxOroxkyQQB7 FXLg== Received: by 10.236.77.229 with SMTP id d65mr11292874yhe.124.1350327149382; Mon, 15 Oct 2012 11:52:29 -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.27 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 15 Oct 2012 11:52:28 -0700 (PDT) From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Mon, 15 Oct 2012 15:51:40 -0300 Message-Id: <1350327102-4463-13-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 12/14] drm/i915: add DP support to intel_enable_ddi 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 We should only write the DDI_BUF_CTL at this point for HDMI/DVI. For DP we need to do this earlier, and the values written to the register are also different. Signed-off-by: Paulo Zanoni Reviewed-by: Damien Lespiau --- drivers/gpu/drm/i915/intel_ddi.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c index 9324636..601ffc2 100644 --- a/drivers/gpu/drm/i915/intel_ddi.c +++ b/drivers/gpu/drm/i915/intel_ddi.c @@ -1158,18 +1158,21 @@ void intel_ddi_post_disable(struct intel_encoder *intel_encoder) I915_WRITE(PORT_CLK_SEL(port), PORT_CLK_SEL_NONE); } -void intel_enable_ddi(struct intel_encoder *encoder) +void intel_enable_ddi(struct intel_encoder *intel_encoder) { - struct drm_device *dev = encoder->base.dev; + struct drm_encoder *encoder = &intel_encoder->base; + struct drm_device *dev = encoder->dev; struct drm_i915_private *dev_priv = dev->dev_private; - struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(&encoder->base); - int port = intel_hdmi->ddi_port; + enum port port = intel_ddi_get_encoder_port(intel_encoder); + int type = intel_encoder->type; - /* Enable DDI_BUF_CTL. In HDMI/DVI mode, the port width, - * and swing/emphasis values are ignored so nothing special needs - * to be done besides enabling the port. - */ - I915_WRITE(DDI_BUF_CTL(port), DDI_BUF_CTL_ENABLE); + if (type == INTEL_OUTPUT_HDMI) { + /* In HDMI/DVI mode, the port width, and swing/emphasis values + * are ignored so nothing special needs to be done besides + * enabling the port. + */ + I915_WRITE(DDI_BUF_CTL(port), DDI_BUF_CTL_ENABLE); + } } void intel_disable_ddi(struct intel_encoder *encoder)