Received: by 10.213.65.68 with SMTP id h4csp802140imn; Tue, 13 Mar 2018 23:53:45 -0700 (PDT) X-Google-Smtp-Source: AG47ELv0Fe3EcoMlCrSg/mlYuYGJsB7PcSiRNptBoR7rkNowcKhuTVaSi69pJ3NqKy8MMROHG/h5 X-Received: by 10.99.107.9 with SMTP id g9mr2756277pgc.3.1521010425315; Tue, 13 Mar 2018 23:53:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521010425; cv=none; d=google.com; s=arc-20160816; b=SorFtWhnhtfu9PWEtVWrUJ1+n0Zvtu38gtq4u67mKmykyP/ShrkBG9lVvrqtn5Aqg2 ESS+puvoIZOzePZiVorZj6a5U0OMi7DHkRnDcTRJaZqDihodvHLOL4TUZB15OSd62osv MAnCDIaO1MdvKzxf8QUKZ48K+4Pl7b/gYS4i/ZglpaIrf5htk0UskACMb6drxdSRBlao xE2eFQ6mWKGS7oDCQHeuBfBF2/hHDto7mj+eO108tajcSGMeQakTo2Sm2D/WXPP3Br2o V0zLnSEYW5uLs08vj0/IW4AT1wkja0bPSD1OIMH2dbQooMAMcz7u453zcYHSeoGDzfXV cFOg== 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-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature:arc-authentication-results; bh=gPe5DYFRCLxEKSeaHuQgYLyEfF9seIi2YfjZDbfbPo8=; b=HQrlJocfBDCyTUHk1L7F6y/Y1NHtMK9fZAYhwSIAwRW5CiHI8V1Swb7C07cYplmZyq 6wpI17xZIAa6EEj0bOPdDUQaawHCq24yltqg3d9HFxXDXRovMOi1iW9kFCZxIX6Ns3dO qD2WwugE1E9uLb1M4oBJxpSNXkzDTvHK4Y5Haf4IujbBV2FdU8zV16B56dsc4AUfDNlM R8KpDslS2qx1t0QMc516ivSsl6N8kku7jy+HT10HacQqHLLvRUQcpQLi1Kz7IFK9/ZUV ap+qeG5HPCgJoDDSOqUxZfI+QlwX5XEZG5aXdlWOpaCJqB+nLN00zR6KVXHfvxk1Yzwy GX7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=lelQA87q; dkim=pass header.i=@codeaurora.org header.s=default header.b=Lseq6JaX; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o20-v6si1501845pli.229.2018.03.13.23.53.30; Tue, 13 Mar 2018 23:53:45 -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; dkim=pass header.i=@codeaurora.org header.s=default header.b=lelQA87q; dkim=pass header.i=@codeaurora.org header.s=default header.b=Lseq6JaX; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753434AbeCNGwb (ORCPT + 99 others); Wed, 14 Mar 2018 02:52:31 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:40786 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750934AbeCNGw3 (ORCPT ); Wed, 14 Mar 2018 02:52:29 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id DB7C260853; Wed, 14 Mar 2018 06:52:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1521010348; bh=QC7FeSukI2thXb4Luqxu2OL36S/rlHjnd/qH8c7Iwxg=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=lelQA87qRqcEuyw9682zdra1BYGKmFVLgtU8QwmM96B/MXrkXBkev4vhH9/VXMA6y kuSUqA3uTKSxmuXcA4+ITWiw4blmqc5oYsL2MRvMxFLMMyOoRhDG3cXpTeriP+Ok14 yG/lRBUS0b/gh23udgZ3ssLHB4u7QuIpdhSmTekQ= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from [192.168.1.84] (unknown [182.71.117.114]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: architt@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 7FE9060452; Wed, 14 Mar 2018 06:52:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1521010347; bh=QC7FeSukI2thXb4Luqxu2OL36S/rlHjnd/qH8c7Iwxg=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=Lseq6JaX/Dhmfv73lbOfhaqkbdpG1AHHdpCYKikPKXHWf3GpXSOt3f6JAdgUWNXeM j7mn6Pvr1Uy2LzHNrtaOWYrupe5atyE+pUj3t7VLpj4doie8zNu2GlvFeeHSLSxs+P Xhg5c6EC2ijhvLt0f4SJhf7DFk3FwAelH4v/6MaA= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 7FE9060452 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=architt@codeaurora.org Subject: Re: [PATCH v5 23/36] drm/bridge: analogix_dp: Move fast link training detect to set_bridge To: Enric Balletbo i Serra , 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, ykk@rock-chips.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, linux-input@vger.kernel.org, orjan.eide@arm.com, wxt@rock-chips.com, jeffy.chen@rock-chips.com, linux-arm-kernel@lists.infradead.org, mark.yao@rock-chips.com, 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 References: <20180309222327.18689-1-enric.balletbo@collabora.com> <20180309222327.18689-24-enric.balletbo@collabora.com> From: Archit Taneja Message-ID: Date: Wed, 14 Mar 2018 12:22:13 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180309222327.18689-24-enric.balletbo@collabora.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Saturday 10 March 2018 03:53 AM, Enric Balletbo i Serra wrote: > From: zain wang > > It's too early to detect fast link training, if other step after it > failed, we will set fast_link flag to 1, and retry set_bridge again. In > this case we will power down and power up panel power supply, and we > will do fast link training since we have set fast_link flag to 1. In > fact, we should do full link training now, not the fast link training. > So we should move the fast link detection at the end of set_bridge. Is it possible to re-write this commit message? It's a bit hard to follow. Thanks, Archit > > Cc: Tomasz Figa > Signed-off-by: zain wang > Signed-off-by: Douglas Anderson > Signed-off-by: Sean Paul > Signed-off-by: Thierry Escande > Reviewed-by: Andrzej Hajda > Signed-off-by: Enric Balletbo i Serra > Tested-by: Marek Szyprowski > --- > > drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 42 +++++++++++++--------- > 1 file changed, 26 insertions(+), 16 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c > index d76e1652b1fd..37b16643f14c 100644 > --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c > +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c > @@ -601,7 +601,7 @@ static int analogix_dp_process_equalizer_training(struct analogix_dp_device *dp) > { > int lane, lane_count, retval; > u32 reg; > - u8 link_align, link_status[2], adjust_request[2], spread; > + u8 link_align, link_status[2], adjust_request[2]; > > usleep_range(400, 401); > > @@ -645,20 +645,6 @@ static int analogix_dp_process_equalizer_training(struct analogix_dp_device *dp) > dev_dbg(dp->dev, "final lane count = %.2x\n", > dp->link_train.lane_count); > > - retval = drm_dp_dpcd_readb(&dp->aux, DP_MAX_DOWNSPREAD, > - &spread); > - if (retval != 1) { > - dev_err(dp->dev, "failed to read downspread %d\n", > - retval); > - dp->fast_train_enable = false; > - } else { > - 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_enable ? "supported" : "unsupported"); > - > dp->link_train.lt_state = FINISHED; > > return 0; > @@ -996,6 +982,22 @@ static irqreturn_t analogix_dp_irq_thread(int irq, void *arg) > return IRQ_HANDLED; > } > > +static int analogix_dp_fast_link_train_detection(struct analogix_dp_device *dp) > +{ > + int ret; > + u8 spread; > + > + ret = drm_dp_dpcd_readb(&dp->aux, DP_MAX_DOWNSPREAD, &spread); > + if (ret != 1) { > + dev_err(dp->dev, "failed to read downspread %d\n", ret); > + return ret; > + } > + dp->fast_train_enable = !!(spread & DP_NO_AUX_HANDSHAKE_LINK_TRAINING); > + dev_dbg(dp->dev, "fast link training %s\n", > + dp->fast_train_enable ? "supported" : "unsupported"); > + return 0; > +} > + > static int analogix_dp_commit(struct analogix_dp_device *dp) > { > int ret; > @@ -1038,8 +1040,16 @@ static int analogix_dp_commit(struct analogix_dp_device *dp) > if (ret) > return ret; > > - if (dp->psr_enable) > + if (dp->psr_enable) { > ret = analogix_dp_enable_sink_psr(dp); > + if (ret) > + return ret; > + } > + > + /* Check whether panel supports fast training */ > + ret = analogix_dp_fast_link_train_detection(dp); > + if (ret) > + dp->psr_enable = false; > > return ret; > } >