From patchwork Fri Mar 10 04:32:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 9614777 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 EFA0260415 for ; Fri, 10 Mar 2017 04:50:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E007D286E3 for ; Fri, 10 Mar 2017 04:50:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D4D6D286F3; Fri, 10 Mar 2017 04:50:45 +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=unavailable 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 9B8E6286E3 for ; Fri, 10 Mar 2017 04:50:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F3F5A6ED96; Fri, 10 Mar 2017 04:50:38 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk0-x22c.google.com (mail-qk0-x22c.google.com [IPv6:2607:f8b0:400d:c09::22c]) by gabe.freedesktop.org (Postfix) with ESMTPS id C17786ED96 for ; Fri, 10 Mar 2017 04:48:16 +0000 (UTC) Received: by mail-qk0-x22c.google.com with SMTP id v125so149120513qkh.2 for ; Thu, 09 Mar 2017 20:48:16 -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=VEBOmKbYBgLWwwguVTphh/lkjEE3v9SgXAvEFCvjMqs=; b=ml5/bdUHVqzP5BXDySCAw5LBGDXASyg5ZxzgChGUMyeGw1A/GysdklxW8DASVjQhH0 UxGBd/4bfopSB+mt0/WJbW08UjnWNgRB+W1C1QkykIBKqTU8LuqjkB+LWeAVgNMNZQYL 4una7eMsOkHgjSoFI/UiYI1S9qDxcb/w+SSAk= 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=VEBOmKbYBgLWwwguVTphh/lkjEE3v9SgXAvEFCvjMqs=; b=I4YeHPRXFGuRVezsvM8vpoc5ZdJPRN55nxejc9b9Exe49cby3oH1n2r0xXD0zzTDtt KON1nF71nI7KiDw+VbymXcMsbRdEckf8FafVsbyFsKmbYg6OAEHnH5ayDrXIU7dFtTZE Mzc2U/VXdAQOH+4wYdzFnRuFo9QPqAaGOmUydper40067hI7CoHJc4dhMqRGEMRK9pLT oT/0NXxNjS4iC4WM6vqB/vGyR2oIprmvyziEuUX8NmkSXxZnJkvsp2Egc8dWrasqSXXW Hq53zXlrWmJOD6NwKa80d0sdN+ZX/dfJQysAX491Wsu9A7/UNGPnARWEGTdi9M5BOfwY JJhg== X-Gm-Message-State: AMke39kTmffU+jIBVK9QuNpy1I/ZiT/f7G2n0CJq2p7TLPfVRpaeIM2hrTPo2m0ziDuVpotG X-Received: by 10.55.17.206 with SMTP id 75mr18452145qkr.156.1489120659328; Thu, 09 Mar 2017 20:37:39 -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.37.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Mar 2017 20:37:38 -0800 (PST) From: Sean Paul To: linux-rockchip@lists.infradead.org, dri-devel@lists.freedesktop.org Subject: [PATCH 17/41] drm/bridge: analogix_dp: Don't use fast link training when panel just powered up Date: Thu, 9 Mar 2017 23:32:32 -0500 Message-Id: <20170310043305.17216-18-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 , Krzysztof Kozlowski , 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 Panel would reset it's setting when it power down. It would forget the last successed 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 --- 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 52218d743059..919ae68e7670 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c @@ -582,14 +582,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); @@ -796,7 +796,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, @@ -1200,6 +1200,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;