Received: by 10.192.165.148 with SMTP id m20csp3274119imm; Mon, 23 Apr 2018 03:52:13 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/bwb1bRTQ6jtCWFFA0jKkhUcmo5Q1Z+xc+aiB4G158912CP6YIa9TKOAksGai6hquieekr X-Received: by 10.98.88.194 with SMTP id m185mr19116851pfb.167.1524480733237; Mon, 23 Apr 2018 03:52:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524480733; cv=none; d=google.com; s=arc-20160816; b=Fs1k6LhiUSXVV2PNIJypVO8/wGu+pQ8e1AyD7nPEf3aGKhn3eOz3YJe/1stkl4RrXZ o/Fd1Jrj78FBQEtU6l2xl4Q+l9dfRfMYP8Dmc4jFVtMlwEOyQML4Ebnb9NILXMdA+Kur M9c+mfi0xZkg3UQgqzOIF8laxHKH7GcxPiSrqGDJi3/sxJKn+dHwQwik7xigDpKwf8wd t5iNNWckCj6mD2stqVZ855vrLqstUChjj7GropHoSYr87iNBmiseAB0vVE4b2335E3Rr 0w4qbN2Y/1HNCnCgyj11nQFwvE7FOL7bRs4Cb8tYRLxV3O7eei4LP/94B7H2mO/L9a45 gygw== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=tPEill9z+1QUjImiDJNg/VTZbXTXYNKrbj1Waedm7Jw=; b=aTwZ2zcJu2TQw7eWi/Pu6mrqmwvFgxezdqcCVOJNkYqWHxo4KvcuDRwnntZq3LalGJ 21XLGI+jkE4zez+6d+9Ii9t5KhE5jYu3SL34dqZZfRCp6GdDj52zUc4yF4TD2Mo7Oltk Jki0NL1LSlzxVTJZOuKSIdXJQtsCV5o/SV7UER+/Hrf54yP+g3yZiMGGn0jAN525Jx+R tal8tRhcHyRufMU4rXXJVLFmnR4N2rOvWg8UO9vAn5zLdLPGOO3QeGSYUoaiiVt4jsMu 5cQApnmNcavgNqVuvPYalKRe8sEeLJZF4iKem+L6CjoI5b/dBh2dCVqlQZVSRfpsgqbW muBQ== 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 n17si10284572pfa.187.2018.04.23.03.51.58; Mon, 23 Apr 2018 03:52:13 -0700 (PDT) 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 S1754881AbeDWKu3 (ORCPT + 99 others); Mon, 23 Apr 2018 06:50:29 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:38514 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754078AbeDWKuX (ORCPT ); Mon, 23 Apr 2018 06:50:23 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id AC0AC277B9A From: Enric Balletbo i Serra To: architt@codeaurora.org, inki.dae@samsung.com, thierry.reding@gmail.com, hjc@rock-chips.com, seanpaul@chromium.org, airlied@linux.ie, tfiga@chromium.org, heiko@sntech.de Cc: dri-devel@lists.freedesktop.org, dianders@chromium.org, a.hajda@samsung.com, kernel@collabora.com, m.szyprowski@samsung.com, linux-samsung-soc@vger.kernel.org, jy0922.shim@samsung.com, rydberg@bitmath.org, krzk@kernel.org, linux-rockchip@lists.infradead.org, kgene@kernel.org, orjan.eide@arm.com, wxt@rock-chips.com, jeffy.chen@rock-chips.com, linux-arm-kernel@lists.infradead.org, wzz@rock-chips.com, hl@rock-chips.com, jingoohan1@gmail.com, sw0312.kim@samsung.com, linux-kernel@vger.kernel.org, kyungmin.park@samsung.com, Laurent.pinchart@ideasonboard.com, kuankuan.y@gmail.com, hshi@chromium.org, =?UTF-8?q?St=C3=A9phane=20Marchesin?= , Enric Balletbo i Serra Subject: [RESEND PATCH v6 03/27] drm/bridge: analogix_dp: Don't use fast link training when panel just powered up Date: Mon, 23 Apr 2018 12:49:39 +0200 Message-Id: <20180423105003.9004-4-enric.balletbo@collabora.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180423105003.9004-1-enric.balletbo@collabora.com> References: <20180423105003.9004-1-enric.balletbo@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 Panel would reset its setting when it powers down. It would forget the last succeeded link training setting. So we can't use the last successful link training setting to do fast link training. Let's reset fast_train_enable in analogix_dp_bridge_disable(); Cc: Stéphane Marchesin Signed-off-by: zain wang Signed-off-by: Sean Paul Signed-off-by: Thierry Escande Signed-off-by: Enric Balletbo i Serra Tested-by: Marek Szyprowski Reviewed-by: Archit Taneja --- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 9 +++++---- drivers/gpu/drm/bridge/analogix/analogix_dp_core.h | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c index 05a0ca4af057..85dbb1ca9886 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c @@ -579,14 +579,14 @@ static int analogix_dp_process_equalizer_training(struct analogix_dp_device *dp) if (retval != 1) { dev_err(dp->dev, "failed to read downspread %d\n", retval); - dp->fast_train_support = false; + dp->fast_train_enable = false; } else { - dp->fast_train_support = + dp->fast_train_enable = (spread & DP_NO_AUX_HANDSHAKE_LINK_TRAINING) ? true : false; } dev_dbg(dp->dev, "fast link training %s\n", - dp->fast_train_support ? "supported" : "unsupported"); + dp->fast_train_enable ? "supported" : "unsupported"); /* set enhanced mode if available */ analogix_dp_set_enhanced_mode(dp); @@ -793,7 +793,7 @@ static int analogix_dp_fast_link_train(struct analogix_dp_device *dp) static int analogix_dp_train_link(struct analogix_dp_device *dp) { - if (dp->fast_train_support) + if (dp->fast_train_enable) return analogix_dp_fast_link_train(dp); return analogix_dp_full_link_train(dp, dp->video_info.max_lane_count, @@ -1197,6 +1197,7 @@ static void analogix_dp_bridge_disable(struct drm_bridge *bridge) DRM_ERROR("failed to setup the panel ret = %d\n", ret); dp->psr_enable = false; + dp->fast_train_enable = false; dp->dpms_mode = DRM_MODE_DPMS_OFF; } diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h index 6a96ef7e6934..403ff853464b 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h @@ -173,7 +173,7 @@ struct analogix_dp_device { int hpd_gpio; bool force_hpd; bool psr_enable; - bool fast_train_support; + bool fast_train_enable; struct mutex panel_lock; bool panel_is_modeset; -- 2.17.0