From patchwork Fri Mar 10 04:32:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 9614747 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 1B7BE60415 for ; Fri, 10 Mar 2017 04:47:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0DE2128518 for ; Fri, 10 Mar 2017 04:47:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 02C64285A6; Fri, 10 Mar 2017 04:47:27 +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.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B231D28518 for ; Fri, 10 Mar 2017 04:47:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 80E1D6ED86; Fri, 10 Mar 2017 04:47:24 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk0-x22a.google.com (mail-qk0-x22a.google.com [IPv6:2607:f8b0:400d:c09::22a]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2C36C6ED88 for ; Fri, 10 Mar 2017 04:46:20 +0000 (UTC) Received: by mail-qk0-x22a.google.com with SMTP id 1so151720136qkl.3 for ; Thu, 09 Mar 2017 20:46:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4Q1FZw4tftDM1H/dcn/RaxdJ3fyhC2t95dvfLesUlXk=; b=fBm8ebyrfqwSbYFXl3DRvJtHz7NLgpma8icsKECLT58E0Gh9IaAIMhG+oDK/22n3cS /nkOJWom1dewikvnZUYiCBP57jyZ08PJzfdriwrxVwj5uWBHgPydI7xNPtUL4001X7rK sesRYYhftspwCi+blgEVdG+Ig2ovmIlA9r0wQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4Q1FZw4tftDM1H/dcn/RaxdJ3fyhC2t95dvfLesUlXk=; b=EwXmbNC4vykwCTUVvsEHGWyKA9Ioc1lkHnDELNbXFKRNLCd0uAOIdVleKRF1N8C6Vk vRZI4vvn8SV3MVZaSPGR8jQoXQZcfve2cJ+LGQ9aGl/iTF4xoQqHwNGXv2XLwca6VYUC jjvJHzA5pV3CDBsfYDOLQYzd4Ns8dnlwTZ9ppbBQl/NNejPkwNrmbqH7v0XHgozpQMsm acr477665Nog8eVVckpkOMby3Tcd771hGQP331GxeCOdx2r8iC85sms9nQHfs/e1kzr1 M0zM9pnBBvjfZGiOrOXQnxO3Dqlv75w5WnK/gwk3E3BjN9DAKjtyYnlhTdzK0ndDvONQ EJ0A== X-Gm-Message-State: AMke39k9z9YP6Ebn8BDuSwj7AzKQQHQoC5EfMuboknWqhIJOfDwJ71vrNfn9T+K5n/omwYq/ X-Received: by 10.200.54.13 with SMTP id m13mr17598119qtb.214.1489120694313; Thu, 09 Mar 2017 20:38:14 -0800 (PST) Received: from boxwood.roam.corp.google.com (cpe-75-189-128-87.nc.res.rr.com. [75.189.128.87]) by smtp.gmail.com with ESMTPSA id n19sm5697731qtn.35.2017.03.09.20.38.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Mar 2017 20:38:13 -0800 (PST) From: Sean Paul To: linux-rockchip@lists.infradead.org, dri-devel@lists.freedesktop.org Subject: [PATCH 19/41] drm/bridge: analogix_dp: Wait for HPD signal before configuring link Date: Thu, 9 Mar 2017 23:32:34 -0500 Message-Id: <20170310043305.17216-20-seanpaul@chromium.org> X-Mailer: git-send-email 2.12.0.246.ga2ecc84866-goog In-Reply-To: <20170310043305.17216-1-seanpaul@chromium.org> References: <20170310043305.17216-1-seanpaul@chromium.org> MIME-Version: 1.0 Cc: zain wang , Lin Huang , Tomeu Vizoso , Douglas Anderson , Yakir Yang , =?UTF-8?q?St=C3=A9phane=20Marchesin?= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 --- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c index f3eea7636a2e..048b6f7c9b6e 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c @@ -1172,6 +1172,15 @@ 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;