Received: by 10.223.176.46 with SMTP id f43csp689291wra; Fri, 26 Jan 2018 05:26:19 -0800 (PST) X-Google-Smtp-Source: AH8x224sOzzSdnncwxKOysiHgutAHJKY/NF52Iuf3KNRXy68wrUE6RtMUqYJegIGz0U0UoKmM6ZD X-Received: by 2002:a17:902:6988:: with SMTP id l8-v6mr14194776plk.394.1516973178952; Fri, 26 Jan 2018 05:26:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516973178; cv=none; d=google.com; s=arc-20160816; b=CpTpIYndiJZFsrsQxx17mRdqx78BpvZKu5/LdFTOLcUCsrX3JpWnQbDfIuN1VdOJvf DoZsWEtgw1/0zptaTDTLVs71GtwxqqHRdhRlZzNXf8EaTcgMLmRx1+yslNNQ8Ifz7voh M10lhW90hUswz14IC3nvlXCznUHM0rIh5O7turN8cu4S0A+MXMXnglKsWNa2QA2yIcds hwEauYi0zt8tcal+FH+lLw1TubLyYCVJMkSjxbkl26bfjr5AVpZZ88CkmhYl3yO4LKd1 BRFBK71hvLunQyJzqrDac1ce3YEdWGe1bX3jy+u9vV076iiJFl8QjjJPFPebclgi7Y9R XhrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-transfert-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=2gYEvyDOxaQd3dlqGRtyfpJSgFdCFdU6h5qtUPAEmiM=; b=W1mS9lRtPW2dzp8nySWIyfzNVDm/6cnO+vEsX46Y8XRNdO+3J3vwSn+nvYcOMhyCth Fd9qhFIlbgVSM3+5XTDSfpiLTL/qWf6w6Vx+uXbvWZSnDV91WKiCGK7OjDA2+4XVSlq5 GYjF636Ln4cfk1sC6jfckzP8tTK0OEFi9saLjOJVwTuXhdIgTqSWkBZU2kySW6N2JXom opvn0w/AkrGJi+x0h/Y2jIxRohwtfGR84M7DL8/M5pjVvpF8WPFvumhgDUwcOXOZN8KI 2AXHNbcifx7Nt0Zi0l7BtoDWHpO7ljD4bQt32LKO78xc4SBixIeTsVHuV2mVbikPIry2 F8+w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bg5-v6si3701064plb.822.2018.01.26.05.26.04; Fri, 26 Jan 2018 05:26:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752374AbeAZNYQ (ORCPT + 99 others); Fri, 26 Jan 2018 08:24:16 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:34374 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752252AbeAZNRu (ORCPT ); Fri, 26 Jan 2018 08:17:50 -0500 Received: from localhost.localdomain (unknown [IPv6:2a01:e35:8a7e:4790:a8d7:ca4:7b4f:7f87]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: tescande) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 5C971274802; Fri, 26 Jan 2018 13:17:49 +0000 (GMT) From: Thierry Escande To: Archit Taneja , Inki Dae , Thierry Reding , Sandy Huang , Sean Paul , David Airlie , Tomasz Figa Cc: Haixia Shi , =?UTF-8?q?=C3=98rjan=20Eide?= , Zain Wang , Yakir Yang , Lin Huang , Douglas Anderson , Mark Yao , linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, dri-devel@lists.freedesktop.org Subject: [PATCH v2 17/43] drm/bridge: analogix_dp: Wait for HPD signal before configuring link Date: Fri, 26 Jan 2018 14:16:44 +0100 Message-Id: <20180126131710.7622-18-thierry.escande@collabora.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180126131710.7622-1-thierry.escande@collabora.com> References: <20180126131710.7622-1-thierry.escande@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Type: text/plain; charset = "utf-8" Content-Transfert-Encoding: 8bit Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: zain wang According to DP spec v1.3 chap 3.5.1.2 Link Training, Link Policy Maker must first detect that the HPD signal is asserted high by the Downstream Device before establishing a link with it. Cc: Stéphane Marchesin Signed-off-by: zain wang Signed-off-by: Sean Paul Signed-off-by: Thierry Escande --- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c index ba2506e17f6d..c940a5bb80ac 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c @@ -1170,6 +1170,17 @@ static int analogix_dp_set_bridge(struct analogix_dp_device *dp) if (ret) goto out_dp_init; + /* + * According to DP spec v1.3 chap 3.5.1.2 Link Training, + * We should first make sure the HPD signal is asserted high by device + * when we want to establish a link with it. + */ + ret = analogix_dp_detect_hpd(dp); + if (ret) { + DRM_ERROR("failed to get hpd single ret = %d\n", ret); + goto out_dp_init; + } + ret = analogix_dp_commit(dp); if (ret) goto out_dp_init; -- 2.14.1