Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756199AbcLBDyf (ORCPT ); Thu, 1 Dec 2016 22:54:35 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:32834 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754342AbcLBDyc (ORCPT ); Thu, 1 Dec 2016 22:54:32 -0500 DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org 66DD3612CF Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=pass smtp.mailfrom=architt@codeaurora.org Subject: Re: [PATCH] drm/bridge: analogix: Don't return -EINVAL when panel not support PSR in PSR functions To: zain wang , Sean Paul , Daniel Vetter , Inki Dae , David Airlie References: <1480645942-29912-1-git-send-email-wzz@rock-chips.com> Cc: Tomeu Vizoso , Mika Kahola , =?UTF-8?Q?St=c3=a9phane_Marchesin?= , Tomasz Figa , dianders@chromium.org, Thierry Reding , Krzysztof Kozlowski , Heiko Stuebner , Jingoo Han , Javier Martinez Canillas , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-rockchip@lists.infradead.org From: Archit Taneja Message-ID: Date: Fri, 2 Dec 2016 09:24:11 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <1480645942-29912-1-git-send-email-wzz@rock-chips.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2087 Lines: 62 Hi, On 12/02/2016 08:02 AM, zain wang wrote: > We will ignored PSR setting if panel not support it. So, in this case, we should > return from analogix_dp_enable/disable_psr() without any error code. > Let's retrun 0 instead of -EINVAL when panel not support PSR in > analogix_dp_enable/disable_psr(). > > Signed-off-by: zain wang > --- > drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c > index 6e0447f..0cb3695 100644 > --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c > +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c > @@ -112,7 +112,7 @@ int analogix_dp_enable_psr(struct device *dev) > struct edp_vsc_psr psr_vsc; > > if (!dp->psr_support) > - return -EINVAL; > + return 0; Looking at the rockchip analogix dp code, in analogix_dp_psr_set, the worker that calls analogix_dp_enable/disable_psr isn't even if psr isn't enabled. So, the bridge funcs shouldn't be called in the first place. I think the error handling is fine to have here. > > /* Prepare VSC packet as per EDP 1.4 spec, Table 6.9 */ > memset(&psr_vsc, 0, sizeof(psr_vsc)); > @@ -135,7 +135,7 @@ int analogix_dp_disable_psr(struct device *dev) > struct edp_vsc_psr psr_vsc; > > if (!dp->psr_support) > - return -EINVAL; > + return 0; > > /* Prepare VSC packet as per EDP 1.4 spec, Table 6.9 */ > memset(&psr_vsc, 0, sizeof(psr_vsc)); > @@ -878,6 +878,8 @@ static void analogix_dp_commit(struct analogix_dp_device *dp) > dp->psr_support = analogix_dp_detect_sink_psr(dp); > if (dp->psr_support) > analogix_dp_enable_sink_psr(dp); > + else > + dev_warn(dp->dev, "Sink not support PSR\n"); This doesn't seem beneficial either. There seems to be a debug print already in analogix_dp_detect_sink_psr which reports PSR related info. Archit > } > > /* > -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project