Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp123014rwb; Mon, 28 Nov 2022 18:00:28 -0800 (PST) X-Google-Smtp-Source: AA0mqf7zwbFpxJBO8MSMt73RlQu2i448UgCDnOZNfy/j2Lu3F8gm/dfBmHsLl9C1HvFSaBM3qKXo X-Received: by 2002:a05:6402:68c:b0:461:b506:6b8a with SMTP id f12-20020a056402068c00b00461b5066b8amr49836833edy.208.1669687227843; Mon, 28 Nov 2022 18:00:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669687227; cv=none; d=google.com; s=arc-20160816; b=QgVg9djGVEzWFw5h86NBttzSRNE8Y1M6T6RtlOISSs5ATYskNN2LvUqsVzhnS534zz tfq/e34MJfl7MmMiQg3jQC8R1blT49VDTzEDX8C9vlMWrdn/L8M0Dn4WoiN71DbXL1Ae Yvqql+yuM7KCbP5VIG+MPzs+DOCo0yk3v+Z9W3NW6oo26VYxzQYkAll+eLvQaIQeasRE 81ATdSEBOamBv+SNv0JaI/c0dd1xLgrTNp+DyckL7xAz8b7lvA7QcQF4SmNrY0XWoiaz t7H20HtZLVcYvL9dxBTzKk3abpxIb+ythURlDmnH4pHN9ULZH1zxSoOeXeuPmWNkxxA5 y7sA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=DGaZ8OVtGKgX/mLPb9bYbnNCU4GtJ5ZaE5Va30mZJao=; b=XwsUa1E4lUq5dtSS7BAs3j4R5rqWBXPrMPFoK512r9gnkx4AJXaMVyPTmAStP3Z+5N DqTT0SvbZWQiT2RvUrXEyX8jraRM1Fj6dT7qxR0UFEiyYaBYVTEHVQLlNGmkvKnn/qIs d2qVZnzYkuRrPEth2K+U5P9hgDXcWf5q4H/DliKqAF7SUOsfE2gaKbuz3VXbXKuSa4bP sCWyEtqK6V133iyOLuFtQiQJ2CNEPk9HpgFMPQ6MAp+ViZymwY6eyJz7ulePmGEbSCN8 2DcKVUaxMDaGsAfmq18e7z2GtixQMIzF2Vst9/gD3sT6oOnvGeYB52BPa1lQKoN3uNva k5hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ELTV3dgI; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p8-20020a50cd88000000b004672d4e4ff2si11109202edi.171.2022.11.28.18.00.07; Mon, 28 Nov 2022 18:00:27 -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; dkim=pass header.i=@chromium.org header.s=google header.b=ELTV3dgI; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234949AbiK2BOK (ORCPT + 83 others); Mon, 28 Nov 2022 20:14:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234694AbiK2BOJ (ORCPT ); Mon, 28 Nov 2022 20:14:09 -0500 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 628DD21E2F for ; Mon, 28 Nov 2022 17:14:08 -0800 (PST) Received: by mail-ed1-x535.google.com with SMTP id m19so16575095edj.8 for ; Mon, 28 Nov 2022 17:14:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=DGaZ8OVtGKgX/mLPb9bYbnNCU4GtJ5ZaE5Va30mZJao=; b=ELTV3dgIgDmcf8n+nhp3+EKzarX3RK5zG2X2Wj1L32uLqyj40nfyvEwXi1rdM+K6N5 2hubboKg8Rv6AiOgSqoaKJ/blr/UIDCSePyTPKtMKEKulQKmEfLPTI8ocUkX+jqDNkGm 4AE88T0j+84vh8oSq1xNrZK2YtsYqNB1E5H6k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=DGaZ8OVtGKgX/mLPb9bYbnNCU4GtJ5ZaE5Va30mZJao=; b=cnRfo2naQh/+iQvJMySqbupipfrDWWoTRPuKLk5TeYxHIpTXOWYP5g94ig0oqcuyOv ytmsaM7RBNlb4IYgpPa00DOv9ikIG/BNNPT2/ILueYkoDqr7ypE5GUAYcOmUBXidTE9g KySwsshNCgcwrbgaXA18nXo+/BjjVDq1zABi7RaBI89GIj1xMt2dcItU0zPjdy+VVlEE Gzac6+YHsqjcSOlAVX2NOjkwWiHKM2eNALrF/VtUCRRdnqamIyHbGa4RgmHzxJRdeJjz UTgVv6PWiI+M5ZMWl1cM1VlB7bt8AirAmCk+B6UwT0PN1P2yFBgCAQhdR9XLw22cUigk xa6g== X-Gm-Message-State: ANoB5pngWDGJV9kyaa0UUGoEWClhtRFAOey1DvkMcCxE5atPsKAmRCoo owRA0sb8S1VY68cJwlmqHj8UXP/dpuz1vWCn X-Received: by 2002:a05:6402:2b87:b0:45b:c731:b683 with SMTP id fj7-20020a0564022b8700b0045bc731b683mr51560869edb.251.1669684445760; Mon, 28 Nov 2022 17:14:05 -0800 (PST) Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com. [209.85.221.49]) by smtp.gmail.com with ESMTPSA id f2-20020a056402194200b0046182b3ad46sm2128712edz.20.2022.11.28.17.14.02 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Nov 2022 17:14:03 -0800 (PST) Received: by mail-wr1-f49.google.com with SMTP id bs21so19768945wrb.4 for ; Mon, 28 Nov 2022 17:14:02 -0800 (PST) X-Received: by 2002:adf:fb4c:0:b0:236:5270:735e with SMTP id c12-20020adffb4c000000b002365270735emr22142643wrs.659.1669684442306; Mon, 28 Nov 2022 17:14:02 -0800 (PST) MIME-Version: 1.0 References: <20221125104558.84616-1-eddy.zhang@rock-chips.com> In-Reply-To: <20221125104558.84616-1-eddy.zhang@rock-chips.com> From: Doug Anderson Date: Mon, 28 Nov 2022 17:13:50 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] drm/bridge: ti-sn65dsi86: Fix output polarity setting bug To: Qiqi Zhang Cc: andrzej.hajda@intel.com, neil.armstrong@linaro.org, robert.foss@linaro.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, airlied@gmail.com, daniel@ffwll.ch, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Tomi Valkeinen Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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 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 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") 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. -Doug