Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp2405138rdg; Mon, 14 Aug 2023 01:03:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEKyebsbMDVYQ3fLbc8LZPHn2GJYVVgMsQMPUj/93vA4+enJ+gJlcgxI3Efh0X/RpE1ZXO4 X-Received: by 2002:a05:6870:e313:b0:1bb:9de5:badb with SMTP id z19-20020a056870e31300b001bb9de5badbmr8546093oad.19.1692000186543; Mon, 14 Aug 2023 01:03:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692000186; cv=none; d=google.com; s=arc-20160816; b=YCoUKWyOyFCk702coiaHPmzn9UpDMB4wsrD+KWtpK683HScDd88A8yCK4qBiDJIY84 ajKbUjNdst+RviyxNSYddL24ZLCDE+ByDltgmFTHx4VdIMTk7mrDGRumWxHlkUOLgumD 1lQbtoy1OPAlqGtI3HYARQDhPtoizlccAS34BFdKkhZGJh83SL76nsByLAECJoWUqKPP dUCoCMoqZynWcMyErE7XdZJFa5hhpsEYPBNESejcaGR888XFMvWA9ybqyrtwqskWpb+3 1QIdcHKwLqzLHUkCQycA5RguOPK212xIViNuoqzgEE68upWFOHyzgvKDdyZ8g5q+Lt2o vCTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=i5K0mYZo+5NlsBvSRDGTqwt5s0UC/oK9OvSqBPdG+/E=; fh=92jXOcYXZkLanIYU7bv2+vPO6hHwr7tCMnop9KBchrE=; b=BVSiITONBZ5PgbdiLJAVcaq9TgqPdLi0c/1715EyE+BiRZdmHbIK/IA1snGyNU5tlR VaaRz4qnQiZk7b26p4D7DDg81M+obUGYYiBlJIgfo6d3Gi7pAPVD6+FcQTanX/11TOb3 RxgNFkM04tmC4tdJ526arp8QDEGFR1Rmrzeue8g9gINd2uw8Kbxi3yqa1Jd+O0j8HPNH 7ertYKXJVLvpT+kydFKbkpDlo/Y4YwzhX70DYyQ18QiXUYNTU614cmeEqTFOB3UOVtuQ lAnOOAb039wzJGXAZyMaJhv4Za2jymmTpCuQ7UDHpO2RFKI9JRyuBMAwIbqhnRgYLwfu 68cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=dorz4o2g; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hs14-20020a17090b200e00b0025979e8c246si7744160pjb.70.2023.08.14.01.02.42; Mon, 14 Aug 2023 01:03:06 -0700 (PDT) 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 (test mode) header.i=@ideasonboard.com header.s=mail header.b=dorz4o2g; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233382AbjHNGef (ORCPT + 99 others); Mon, 14 Aug 2023 02:34:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232990AbjHNGeM (ORCPT ); Mon, 14 Aug 2023 02:34:12 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E11AEE5C for ; Sun, 13 Aug 2023 23:34:10 -0700 (PDT) Received: from [192.168.88.20] (91-154-35-171.elisa-laajakaista.fi [91.154.35.171]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 161666BE; Mon, 14 Aug 2023 08:32:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1691994777; bh=/DYEn30+6HEozQkj6O3O6Do0eZsx6OSvvF348Fw4750=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=dorz4o2gnoAbS/qairEhmdNGqWIxg5BzJSB292xN4A8/axFaqsCtVtXT3mp2CnkNy +DybRrmnq+3kzQyiTd8prmF15Deqhohspc5l3HRrYciLDCN6czA7yHz8WAcp1xawxF RHE1T6oikUomo0PhxwxsOhcVShok89ZHl8zZUjOY= Message-ID: <52151daa-90af-a6c0-9b03-f69081321253@ideasonboard.com> Date: Mon, 14 Aug 2023 09:34:04 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH 02/11] drm/bridge: tc358768: Fix bit updates To: Maxim Schwalm , =?UTF-8?Q?P=c3=a9ter_Ujfalusi?= , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , Francesco Dolcini Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Aradhya Bhatia References: <20230804-tc358768-v1-0-1afd44b7826b@ideasonboard.com> <20230804-tc358768-v1-2-1afd44b7826b@ideasonboard.com> <241937b4-1ef8-abad-7c4a-b26bfab86a3a@ideasonboard.com> <92396880-edb5-d8e0-4fcf-54aeaa2b40d7@gmail.com> Content-Language: en-US From: Tomi Valkeinen In-Reply-To: <92396880-edb5-d8e0-4fcf-54aeaa2b40d7@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,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 On 13/08/2023 03:23, Maxim Schwalm wrote: > Hi, > > On 11.08.23 19:02, Tomi Valkeinen wrote: >> On 11/08/2023 19:23, Péter Ujfalusi wrote: >>> >>> >>> On 04/08/2023 13:44, Tomi Valkeinen wrote: >>>> The driver has a few places where it does: >>>> >>>> if (thing_is_enabled_in_config) >>>> update_thing_bit_in_hw() >>>> >>>> This means that if the thing is _not_ enabled, the bit never gets >>>> cleared. This affects the h/vsyncs and continuous DSI clock bits. >>> >>> I guess the idea was to keep the reset value unless it needs to be flipped. >>> >>>> >>>> Fix the driver to always update the bit. >>>> >>>> Fixes: ff1ca6397b1d ("drm/bridge: Add tc358768 driver") >>>> Signed-off-by: Tomi Valkeinen >>>> --- >>>> drivers/gpu/drm/bridge/tc358768.c | 13 +++++++------ >>>> 1 file changed, 7 insertions(+), 6 deletions(-) >>>> >>>> diff --git a/drivers/gpu/drm/bridge/tc358768.c b/drivers/gpu/drm/bridge/tc358768.c >>>> index bc97a837955b..b668f77673c3 100644 >>>> --- a/drivers/gpu/drm/bridge/tc358768.c >>>> +++ b/drivers/gpu/drm/bridge/tc358768.c >>>> @@ -794,8 +794,8 @@ static void tc358768_bridge_pre_enable(struct drm_bridge *bridge) >>>> val |= BIT(i + 1); >>>> tc358768_write(priv, TC358768_HSTXVREGEN, val); >>>> >>>> - if (!(mode_flags & MIPI_DSI_CLOCK_NON_CONTINUOUS)) >>>> - tc358768_write(priv, TC358768_TXOPTIONCNTRL, 0x1); >>>> + tc358768_write(priv, TC358768_TXOPTIONCNTRL, >>>> + (mode_flags & MIPI_DSI_CLOCK_NON_CONTINUOUS) ? 0 : BIT(0)); >>>> >>>> /* TXTAGOCNT[26:16] RXTASURECNT[10:0] */ >>>> val = tc358768_to_ns((lptxcnt + 1) * dsibclk_nsk * 4); >>>> @@ -861,11 +861,12 @@ static void tc358768_bridge_pre_enable(struct drm_bridge *bridge) >>>> tc358768_write(priv, TC358768_DSI_HACT, hact); >>>> >>>> /* VSYNC polarity */ >>>> - if (!(mode->flags & DRM_MODE_FLAG_NVSYNC)) >>>> - tc358768_update_bits(priv, TC358768_CONFCTL, BIT(5), BIT(5)); >>>> + tc358768_update_bits(priv, TC358768_CONFCTL, BIT(5), >>>> + (mode->flags & DRM_MODE_FLAG_PVSYNC) ? BIT(5) : 0); >>> >>> Was this the reverse before and should be: >>> (mode->flags & DRM_MODE_FLAG_PVSYNC) ? 0 : BIT(5) >> >> Bit 5 is 1 for active high vsync polarity. The test was previously >> !nvsync, i.e. the same as pvsync. > > this statement doesn't seem to be true, since this change causes a > regression on the Asus TF700T. Apparently, !nvsync is true and pvsync is > false in the present case. panasonic_vvx10f004b00_mode in panel_simple.c doesn't seem to have mode flags set. I would say that means the panel doesn't care about the sync polarities (which obviously is not the case), but maybe there's an assumption that if sync polarities are not set, the default is... positive? But I can't find any mention about this. Does it work for you if you set the polarities in panasonic_vvx10f004b00_mode? Tomi