Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1875847rwb; Tue, 29 Nov 2022 21:56:23 -0800 (PST) X-Google-Smtp-Source: AA0mqf46Nw7y4vIWTcebDfS2VpwOiUFvdsaBYrbSZ2rBnZYtyo2gQgENncQ0AXzYaEOoSAA882Uy X-Received: by 2002:a63:4908:0:b0:477:e0b4:3f5 with SMTP id w8-20020a634908000000b00477e0b403f5mr22155942pga.265.1669787782695; Tue, 29 Nov 2022 21:56:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669787782; cv=none; d=google.com; s=arc-20160816; b=k9g1X6yJ7n2y7acATo4aYVArzCjkErRrl4PiGPjn5Sz+fHMAqkgLyRh/hQOphSS64+ bj49cXOVU/23SsP8lOnRftVEQDbkBM8CX9n5DnwEVjANl88iPkYOubAytwTJzHduPKar dHJ9nPUiuMaBHX3eoN2v02KKTXt7U86sjXEysXZu5nME0Ed7evCTg+PS/YR7RSMadw/j 7R5aZNgaZVINICciAW5z5erGxBiLGLQRBF8p04yAAmhSsMmKfE6CaAZmdHCWwUq9vbKl M2S9PO+dHgfAyDuqnruZUJ1LI1mIJreI4FWLhYE9PA59jBKCI3o/VsKu1LCBEw5zeYmQ l9Lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=wLNoe/+NOwtWOX2j+AIq39OUuSGzSokvWhGzyXRuI84=; b=l3H6c8lJ0paFWO2u0nSaJDTxYa7n86UNxVA8m7d+7x0yAJO2i8WsrttfrUYDw7/hXC ow5K6AVCQfsZ3sBosARXEjBk8UmyG0lY9VAHKUfPPhqphG0NdgdU+yiFqi+hoOZBLCnt B77YyD4ss+2Ivfzwgx0O/4gjVsYkbkGQi1LKLciQUZBekhMSwdPU3SmsenKh1wTR4lGD dkKlhuv+q+lL39zIA5dlMHyeUSSdQBLnhuB2qIsfr7V8N7W3Oh0rDNHdPPxuAnJDcODI 9RahBcCG7oc0fXKW4dwuAe6xiAub9hkdgpMUquyevbAlte88rbdH1Unnn0Zu17xm5M/h 0n1Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=rock-chips.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t6-20020a170902e84600b00186ba56bda8si478555plg.61.2022.11.29.21.56.11; Tue, 29 Nov 2022 21:56:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=rock-chips.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233585AbiK3Fq6 (ORCPT + 85 others); Wed, 30 Nov 2022 00:46:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232704AbiK3Fq4 (ORCPT ); Wed, 30 Nov 2022 00:46:56 -0500 Received: from mail-m11880.qiye.163.com (mail-m11880.qiye.163.com [115.236.118.80]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBF3B233BE for ; Tue, 29 Nov 2022 21:46:54 -0800 (PST) Received: from localhost.localdomain (unknown [103.29.142.67]) by mail-m11880.qiye.163.com (Hmail) with ESMTPA id BB3AE202EB; Wed, 30 Nov 2022 13:46:44 +0800 (CST) From: Qiqi Zhang To: tomi.valkeinen@ideasonboard.com, dianders@chromium.org Cc: Laurent.pinchart@ideasonboard.com, airlied@gmail.com, andrzej.hajda@intel.com, daniel@ffwll.ch, dri-devel@lists.freedesktop.org, jernej.skrabec@gmail.com, jonas@kwiboo.se, linux-kernel@vger.kernel.org, neil.armstrong@linaro.org, robert.foss@linaro.org Subject: Re: [PATCH] drm/bridge: ti-sn65dsi86: Fix output polarity setting bug Date: Wed, 30 Nov 2022 13:45:51 +0800 Message-Id: <20221130054551.112944-1-eddy.zhang@rock-chips.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <34c2e9c8-9e3d-129c-8295-18ff440f1f84@ideasonboard.com> References: <34c2e9c8-9e3d-129c-8295-18ff440f1f84@ideasonboard.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFITzdXWS1ZQUlXWQ8JGhUIEh9ZQVkZHUlKVkhKTUodGB0fSBgfQlUTARMWGhIXJBQOD1 lXWRgSC1lBWUpLSFVJQlVKT0lVTUxZV1kWGg8SFR0UWUFZT0tIVUpKS0hKQ1VKS0tVS1kG X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6MVE6ERw6Aj0tNBIJHQo9OAIQ GAEaFBhVSlVKTU1CTENMSUtNSk5CVTMWGhIXVR4fHwJVARMaFRw7CRQYEFYYExILCFUYFBZFWVdZ EgtZQVlKS0hVSUJVSk9JVU1MWVdZCAFZQU9MTE83Bg++ X-HM-Tid: 0a84c712bfdc2eb6kusnbb3ae202eb X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, on Nov. 29, 2022, 11:45 a.m. Tomi wrote: >On 29/11/2022 03:13, Doug Anderson wrote: >> Hi, >> >> On Fri, Nov 25, 2022 at 2:54 AM Qiqi Zhang wrote: >>> >>> According to the description in ti-sn65dsi86's datasheet: >>> >>> CHA_HSYNC_POLARITY: >>> 0 = Active High Pulse. Synchronization signal is high for the sync >>> pulse width. (default) >>> 1 = Active Low Pulse. Synchronization signal is low for the sync >>> pulse width. >>> >>> CHA_VSYNC_POLARITY: >>> 0 = Active High Pulse. Synchronization signal is high for the sync >>> pulse width. (Default) >>> 1 = Active Low Pulse. Synchronization signal is low for the sync >>> pulse width. >>> >>> We should only set these bits when the polarity is negative. >>> Signed-off-by: Qiqi Zhang >>> --- >>> drivers/gpu/drm/bridge/ti-sn65dsi86.c | 4 ++-- >>> 1 file changed, 2 insertions(+), 2 deletions(-) >>> >>> diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c >>> index 3c3561942eb6..eb24322df721 100644 >>> --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c >>> +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c >>> @@ -931,9 +931,9 @@ static void ti_sn_bridge_set_video_timings(struct ti_sn65dsi86 *pdata) >>> &pdata->bridge.encoder->crtc->state->adjusted_mode; >>> u8 hsync_polarity = 0, vsync_polarity = 0; >>> >>> - if (mode->flags & DRM_MODE_FLAG_PHSYNC) >>> + if (mode->flags & DRM_MODE_FLAG_NHSYNC) >>> hsync_polarity = CHA_HSYNC_POLARITY; >>> - if (mode->flags & DRM_MODE_FLAG_PVSYNC) >>> + if (mode->flags & DRM_MODE_FLAG_NVSYNC) >>> vsync_polarity = CHA_VSYNC_POLARITY; >> >> Looks right to me. >> >> Reviewed-by: Douglas Anderson >> >> I've never seen the polarity matter for any eDP panels I've worked >> with, which presumably explains why this was wrong for so long. As far > >Afaik, DP doesn't have sync polarity as such (neither does DSI), and the >sync polarity is just "metadata". So if you're in full-DP domain, I >don't see why it would matter. I guess it becomes relevant when you >convert from DP to some other bus format. Just like Tomi said, the wrong polarity worked fine on my eDP panel(LP079QX1) and standard DP monitor, I didn't notice the polarity configuration problem here until my customer used the following solution and got a abnormal display: GPU->mipi->eDP->DP->lvds->panel. >> as I can tell, it's been wrong since the start. Probably you should >> have: >> >> Fixes: a095f15c00e2 ("drm/bridge: add support for sn65dsi86 bridge driver") Doug you mean I need to update my commit message? It's my first time using kernel list and I'm a little confused about this. >> >> I put this on a sc7180-trogdor-lazor device and it didn't make >> anything worse. Since the sync polarity never mattered to begin with, >> I guess this isn't a surprise. ...so I guess that's a weak tested-by: >> >> Tested-by: Douglas Anderson >> >> I'm happy to land this patch, but sounds like we're hoping to get >> extra testing so I'll hold off for now. > >Looks fine to me and works for me with my DP monitor. > >Reviewed-by: Tomi Valkeinen -Eddy