Received: by 10.223.176.46 with SMTP id f43csp687771wra; Fri, 26 Jan 2018 05:24:48 -0800 (PST) X-Google-Smtp-Source: AH8x224ATGD/GGq2Lh4tPDpM5PJUERSd39Fta4fJwjJJBDI6xe3rXnKMSqnHVWESOAVLgybVARD9 X-Received: by 10.99.116.88 with SMTP id e24mr15264052pgn.279.1516973088123; Fri, 26 Jan 2018 05:24:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516973088; cv=none; d=google.com; s=arc-20160816; b=qCvM/nkLlH41WWurO3b9cJpPbKmgkEsypoqkCsFUT2y6N7t6DYx5a6KLF/P4zeyvac 6AFdTK31tf8/GNF0ucSDlzS9rkKugQMXaybBSTsrRqJjz26jrOt5/lYd8xUHpBlrqFst 8SxAyu1oolvpmzNNuYzgLME8ln0R66HnedRuYNSozh5SzJHROrf3Z3EgIMsC9/3f91Vn 59yZvK8Z5SQJY32HXWjUZYQURJls9m7isvzRAkJ6Mksxm8Gu2w+Tu5tkVlgRuKzawj7f xsl2oLy/o36u8+6lVx1nefnsEf+XXQq+JrQ3rpkH3lX1s+rhw0T+9ZPap8fHfO1pqhWc CyZg== 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=BE3fsTcj0fej6MN9VGYXudT/3NzUGT+LkSv1KJfiJuo=; b=R5nNudAu7EksJtGcj3mQzDlhnUE0uKxoe/W1VpjNanpvjcbyOcJAvVid9aZUP7nDS6 EPWTfQdzs8iyoOWx9Yzdj51YkgiFZtm165d5aBEXXNhn+hnqj3Ps4w1ILcN/tu3O+nxR IclYCwC5vFU7FZzfFUP88eEUm0VyN5R1HbhnJrfpz5LhCRix8sr6B9+KB7oaRwFCnUlb AtKbY72SEgaNe/d9YumgaaEXvbS2ibJnbF9sg1vue7MtAUA1B9m6h6/hL58d6E/cIVmw bYyySpBvQ/ZNzuLI7yTmiegWZV0PW1QQCpRUvhOFdCHPKU4UeCweUMyic+82Gg2w4O2l vnwQ== 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 r69si2985312pgr.678.2018.01.26.05.24.33; Fri, 26 Jan 2018 05:24:48 -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 S1752321AbeAZNRy (ORCPT + 99 others); Fri, 26 Jan 2018 08:17:54 -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 S1752231AbeAZNRt (ORCPT ); Fri, 26 Jan 2018 08:17:49 -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 E7AE72747FA; Fri, 26 Jan 2018 13:17:47 +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 15/43] drm/bridge: analogix_dp: Don't use fast link training when panel just powered up Date: Fri, 26 Jan 2018 14:16:42 +0100 Message-Id: <20180126131710.7622-16-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 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 --- 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 8ef9e31c6713..179c2106b8a2 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, @@ -1198,6 +1198,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.14.1