From patchwork Tue Jan 30 20:28:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thierry Escande X-Patchwork-Id: 10192583 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D50EA6020C for ; Tue, 30 Jan 2018 20:31:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C529A26AE3 for ; Tue, 30 Jan 2018 20:31:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B950A27BA5; Tue, 30 Jan 2018 20:31:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6D64126AE3 for ; Tue, 30 Jan 2018 20:31:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=aRYjKQdmumw1gyW3zSov9ZM2z+L3AaWITYZOZQyHRF4=; b=COPg9ygnpIBLVD nSR/NLfoIFdJC5/u4WhvGgoeCuag7/IVNnEEfv36FSLGHMTjNQz4w/8Ma3fcnavePCGc+M9Mk/g/t iNDivqrZuoA6Uuj0C/TMaDxGqvnqcksMp0dM5TGMY95Lsy8lHRCzueSz8t4KoLKhbAqIJNtFJfnA7 HIKzK/GYoo0Fx0b+6TU8Xq/dyrOVfY/vqQ57fW/8PuxsdhOdHgB/acl1ErmIjnU4b2b85ui0+gAFS M16VILO8hMIqHl8lzyRFrejypHMIiLrFUG00YxAH0Kzhx4PP/+0IZryUNNL6t4dafQvSqWQx8LRk2 zAtVtfCgtdOCs98kb4KQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1egcYc-0006Fi-Ok; Tue, 30 Jan 2018 20:31:06 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1egcXr-0005ue-UG for linux-rockchip@lists.infradead.org; Tue, 30 Jan 2018 20:30:23 +0000 Received: from localhost.localdomain (unknown [IPv6:2a01:e35:8a7e:4790:1865:5d14:35de:d167]) (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 E580A273E4D; Tue, 30 Jan 2018 20:29:39 +0000 (GMT) From: Thierry Escande To: Archit Taneja , Inki Dae , Thierry Reding , Sandy Huang , Sean Paul , David Airlie , Tomasz Figa , Enric Balletbo i Serra Subject: [PATCH v3 17/43] drm/bridge: analogix_dp: Wait for HPD signal before configuring link Date: Tue, 30 Jan 2018 21:28:47 +0100 Message-Id: <20180130202913.28724-18-thierry.escande@collabora.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180130202913.28724-1-thierry.escande@collabora.com> References: <20180130202913.28724-1-thierry.escande@collabora.com> MIME-Version: 1.0 Content-Transfert-Encoding: 8bit X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Zain Wang , Lin Huang , Douglas Anderson , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, Yakir Yang , =?UTF-8?q?=C3=98rjan=20Eide?= , Mark Yao , Haixia Shi Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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;