Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp1797905rdg; Sat, 12 Aug 2023 17:59:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHANEjOjeBd9GUiag7hkzkojfv4CmzHJkJk+PumDYTGXAOykvWINv52unSFiv3g45ZZWQOA X-Received: by 2002:a17:907:a044:b0:99c:72c8:bfe1 with SMTP id gz4-20020a170907a04400b0099c72c8bfe1mr4845774ejc.38.1691888358287; Sat, 12 Aug 2023 17:59:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691888358; cv=none; d=google.com; s=arc-20160816; b=FMoePC3bDbQel+Bv/60f0O3nLKOGTZskGnkQqk9ggeuq2SS0dUizU6VOZuj0KFC+eX kbMj/vujznRTlIat0KVh5H64vITIsbgWK5cMcI0VmwzZ6TXOVc4iNyjEhqWTXGxGXMEz qHdOppJdrMWRsJcubXxfp2Bx6Tw71OdncfMmYQ1uJ+/VlXGVheJYNftsiASZSk/wka/2 le9eOjdRgcCuXeV+HTdzyc2Q4m4r+ylceqDaew1ch9DwqegjedhcRqM59CSyS10FXWoZ 2fJUvkL2qvYh0VFoemfgshy5EM0AQbXEhtW4le6nDGbmepDEXoPG/1CNZIUhh+S5dMEl b71A== 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 :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=w8UpPEN/PkpMGRBM/kJqhYOp8lqLmyddT0ZDjSAgSpY=; fh=Kvw7Pqxc3Ve+jf5i58A8qKzDQUBLRWZp1raL2CzSl0E=; b=Kk6pnIeVM5TuypcqEbhGmDs9OVSIUNDZncr4QeHv92BOrzFpi/hfMOJq7wTgVzPxL0 +TydgD1FI6COoyElWVkxAM8nCGHSIU4SLSZGbyRvgeBUwg1PANcrjzH7VHduMFsNmFDS DX/CiTbw3MuwXHhUJSQROlAkpqy6k/gfGcKWREC96j5j+s+ogU/SB4oYJmTLY9EbsTZ4 890PyQ0rrVW0IjMbftuOgtf6HiUV3ZbT1auOB4z+1mxXXISJDhF0+vIeIxmI3A22ofYd F3dCIfVrtg8sxMo4FGhpm8a3dPuedmzW2HgcF6EKbfEcjVHSCIvPMEm6wF3FU3G2YQSO MA3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=MHI6BSdY; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a22-20020a170906191600b009827e07cca6si5492109eje.17.2023.08.12.17.58.54; Sat, 12 Aug 2023 17:59:18 -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 header.i=@gmail.com header.s=20221208 header.b=MHI6BSdY; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229893AbjHMAXY (ORCPT + 99 others); Sat, 12 Aug 2023 20:23:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229458AbjHMAXX (ORCPT ); Sat, 12 Aug 2023 20:23:23 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 301E7FC for ; Sat, 12 Aug 2023 17:23:26 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-99bf9252eddso442335366b.3 for ; Sat, 12 Aug 2023 17:23:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691886204; x=1692491004; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=w8UpPEN/PkpMGRBM/kJqhYOp8lqLmyddT0ZDjSAgSpY=; b=MHI6BSdYmfvQUuGts4c9XfX7RmDJKyv/Ebh8scD0xAZWfMgl0jCvAmv4Az37voEGv8 ruPlzjOSso8TG8jzcytKqkZeuxIB3n4ZLqcz1GgTApZHwWrIb6BoFDMYqP6XMA90/med TEYh2deTkvBBSw3cNfs8AqBXQUh+jvYkjKe4v1hKcQXmd5AdnIXjmCWx2Y5455MnN92w D7qKm2XnfmQ2QcIX29wT5Hiu7a90vT6efxQLMwYEfXlD70fRQ63Dz7LF4o9D9JVHRXYd rgDDtd9KX2CSpjLlBC9EAXPs91P1qI8aMo6Q0Yad044igMY1xghV0qqChKjhGwagljT8 /Gug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691886204; x=1692491004; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=w8UpPEN/PkpMGRBM/kJqhYOp8lqLmyddT0ZDjSAgSpY=; b=hHZUs3BPon++wg+sIrS76JFykg5/wEuigiPaGNAbYg86T3c1o4qcpqW/+T4b0CpjNn b/OoNnJo2AXhBQGgms81yc+Cv4QssGkKVMGdn5lMRR2S3LaBoA6xn65U11RsbGkMK4Lu dXbtCkaeG39CKypNbByzvvB8QI/YPrCZIS0oLxMaa2Fb80E0TP4heZF+wGehhf9YGLv+ J0gOHNKyg17IApHAXbFITjurYCzSbYZei1KXmsMhvLBteTtkQX/k8WnmnjZYeMe2AkJv 3zKRSCPvu+c90JsgbcPsWBLyaXyLvW75flO3jYw7rTZd5m7VqlqwhHAt2S0sw4QS2IP8 XOAw== X-Gm-Message-State: AOJu0YwfjUNDeGN0prAZ6t4RVLTmItHq+4qQk4IXzc3DPWQFE8RpV+Y6 ZbOhs1n/gJSt2YYTg3/2sxA= X-Received: by 2002:a17:906:315a:b0:99b:e5c3:2e45 with SMTP id e26-20020a170906315a00b0099be5c32e45mr4636857eje.28.1691886204277; Sat, 12 Aug 2023 17:23:24 -0700 (PDT) Received: from ?IPV6:2a02:908:8b3:1840:9c00:9bd:fed3:8356? ([2a02:908:8b3:1840:9c00:9bd:fed3:8356]) by smtp.gmail.com with ESMTPSA id k8-20020a1709061c0800b0099d9b50d786sm720356ejg.199.2023.08.12.17.23.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 12 Aug 2023 17:23:23 -0700 (PDT) Message-ID: <92396880-edb5-d8e0-4fcf-54aeaa2b40d7@gmail.com> Date: Sun, 13 Aug 2023 02:23:22 +0200 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 Content-Language: en-US To: Tomi Valkeinen , =?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> From: Maxim Schwalm In-Reply-To: <241937b4-1ef8-abad-7c4a-b26bfab86a3a@ideasonboard.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, 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 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. Best regards, Maxim