From patchwork Tue Aug 28 22:06:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Zanoni X-Patchwork-Id: 1382771 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 3E8D83FDF5 for ; Tue, 28 Aug 2012 22:15:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 063419E879 for ; Tue, 28 Aug 2012 15:15:17 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-yw0-f53.google.com (mail-yw0-f53.google.com [209.85.213.53]) by gabe.freedesktop.org (Postfix) with ESMTP id A086A9EFC5 for ; Tue, 28 Aug 2012 15:07:36 -0700 (PDT) Received: by mail-yw0-f53.google.com with SMTP id 3so1991825yhp.26 for ; Tue, 28 Aug 2012 15:07:36 -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=/NWiM7bBwU32gkcx4k1BbJV99JdbRXJDf38U6l0P1y8=; b=GcJ47yETOa9W0RtBGkNLRdzQpxjbhJNYul1AzO6GyhuPBebqTuzl3GNwmOpN2BfTI8 IPgreU+hg71sJOpwpEIwfAQaDdNY/lWDESSmWkQH3pAbo+t4WrWXIix6n5c6NxGRWPLT GTpIumzgZVQirtFgYav6xE7NpbFGm8I9BjVgqbsK2iM6c7NFNuu7FNKgVrbh2t73Ln3/ NGTT3XE9FljVKmP8X9C8IFCQNdVa8nMyedi1KzRPRXbEdZIjtV7B9eoox1JhKhi2i4SX p1UrTyIWvPXX3NgOtOR8/cuQZzXtdSBjkOGs3i91KaudzgEfMSzzqKE9dzQQ4fM3ym/W z+kA== Received: by 10.101.152.23 with SMTP id e23mr4747469ano.53.1346191656579; Tue, 28 Aug 2012 15:07:36 -0700 (PDT) Received: from vicky.domain.invalid (189.114.178.236.dynamic.adsl.gvt.net.br. [189.114.178.236]) by mx.google.com with ESMTPS id z3sm4434172anj.20.2012.08.28.15.07.34 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 28 Aug 2012 15:07:36 -0700 (PDT) From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Tue, 28 Aug 2012 19:06:41 -0300 Message-Id: <1346191621-12996-11-git-send-email-przanoni@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1346191621-12996-1-git-send-email-przanoni@gmail.com> References: <1346191621-12996-1-git-send-email-przanoni@gmail.com> Cc: Paulo Zanoni Subject: [Intel-gfx] [RFC 10/30] drm/i915: add DP support to intel_ddi_disable_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 Just a missing register. There is no problem to run this code when the output is HDMI. Signed-off-by: Paulo Zanoni --- drivers/gpu/drm/i915/intel_ddi.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c index dd28e35..fed7856 100644 --- a/drivers/gpu/drm/i915/intel_ddi.c +++ b/drivers/gpu/drm/i915/intel_ddi.c @@ -961,15 +961,25 @@ static void intel_ddi_disable_port(struct drm_i915_private *dev_priv, enum port port) { uint32_t reg, val; + bool wait = false; reg = DDI_BUF_CTL(port); val = I915_READ(reg); if (val & DDI_BUF_CTL_ENABLE) { val &= ~DDI_BUF_CTL_ENABLE; I915_WRITE(reg, val); - intel_wait_ddi_buf_idle(dev_priv, port); + wait = true; } + reg = DP_TP_CTL(port); + val = I915_READ(reg); + val &= ~(DP_TP_CTL_ENABLE | DP_TP_CTL_LINK_TRAIN_MASK); + val |= DP_TP_CTL_LINK_TRAIN_PAT1; + I915_WRITE(reg, val); + + if (wait) + intel_wait_ddi_buf_idle(dev_priv, port); + switch (I915_READ(PORT_CLK_SEL(port))) { case PORT_CLK_SEL_WRPLL1: reg = WRPLL_CTL1;