From patchwork Sat Nov 11 10:41:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 13453046 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9409EC4167D for ; Sat, 11 Nov 2023 10:43:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=CB5M676F7DzUo5oR1Sts5zw9SPcsPJ6gEBLNKENDqPk=; b=2XFc1D4jAndkyT jyppSjFsuInvU5IBTiaeVrghWSx9gUCHjD2yeu87BDco5QOEmT8G18fmuEtXC4pcQsdzEg537aBdh 35xWVLizbJUj9M1SECz1oRyAV8J2FB8j/TZ10VwbUWxOlsQSvQqOSXwVnXrQ+Ww1RMJyw9Ub9gpdb gQDEr0ehmn4yNyzkHCBAXPLxmfzxAEuVhchHodDVygvG2Wu/wcpNQYnumbOqxEeylTxE32c926r6e Tf9ZFJ73pzTVvTxV8xvfAmtxB2fYbjqLMJxsOHla+1tMG6kUbKfsMlKcCFxudY0TV0XbPTha8sYwz IvCa+dBcbkj/gh1gqK+g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r1lRs-00AMBf-0y; Sat, 11 Nov 2023 10:42:44 +0000 Received: from mail-ej1-x642.google.com ([2a00:1450:4864:20::642]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r1lRm-00AM9r-2n for linux-arm-kernel@lists.infradead.org; Sat, 11 Nov 2023 10:42:40 +0000 Received: by mail-ej1-x642.google.com with SMTP id a640c23a62f3a-9e1021dbd28so457253166b.3 for ; Sat, 11 Nov 2023 02:42:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1699699357; x=1700304157; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eutcu8nha5gIvSO1Nw/orY10THf/Z0yjX5SxOR1EIyg=; b=JhmjjhT2gYvYJRmSfhDNPDaH6J4QdPihHniJf5KTdB+6GC6WipAqUytHErzhxBcbKo Zc4szwWXDGau777MeFzoFyjK+kVq5gyVi5rEolC4Y8lS0AX5CbJp/c5I7nDUL95Loqit GyiQPqJg1+3azcrgzpk9c6akOaw1yAQh4i20g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699699357; x=1700304157; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eutcu8nha5gIvSO1Nw/orY10THf/Z0yjX5SxOR1EIyg=; b=YmDRGOt9a/a5vNQhWTah90SqC/ywjCKBaGid9UbWCl/kUMpahikaC0xoy+LENJlOIF iDLHgfV1BFUChAyR18kpYktuDTqUhM9rOMjzW7JFdqrYOZgf+HwM4pk/bQ9HeFlwQKl/ jf/X+sthPExO55Oa8iv4EfRi7t5JHLywAwCC+MiyKNDb/AeMyLGmImM/wQku/0MAjQBF doTy2B7tO1nrSANQk8lNpRTkFVzfpAkShhq+n5hIs9AsLUaRanvcyygTh/z1F7cM2JNX 5jxS5hMEXxKLPE1YZID6lhadoDWCwus94U/lLCz2NJgIn49mD7Pv/F/8PT2B9sNxgsUW eWBA== X-Gm-Message-State: AOJu0YxyeqoRidC0PNAFea+VB0JkUlgGE/vuo/oVkl3GmLlqnOCMjcrz cSqgJ/Vdf/v1UhGxRlYG57dJug== X-Google-Smtp-Source: AGHT+IFaeH1R8CrvRx8lpT+f3/8b10gmDt0Mv/InNxCSXdSMqZkc1Dynsl2CrxZY/kuNg5o1BYLkuA== X-Received: by 2002:a17:906:4742:b0:9bf:4915:22ca with SMTP id j2-20020a170906474200b009bf491522camr1072967ejs.45.1699699357215; Sat, 11 Nov 2023 02:42:37 -0800 (PST) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-79-20-97-182.retail.telecomitalia.it. [79.20.97.182]) by smtp.gmail.com with ESMTPSA id ga33-20020a1709070c2100b0099e12a49c8fsm872183ejc.173.2023.11.11.02.42.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Nov 2023 02:42:36 -0800 (PST) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: linux-amarula@amarulasolutions.com, Dario Binacchi , Fabio Estevam , Helge Deller , Martin Kaiser , NXP Linux Team , Pengutronix Kernel Team , Sascha Hauer , Shawn Guo , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-fbdev@vger.kernel.org Subject: [PATCH 01/10] fbdev: imxfb: fix left margin setting Date: Sat, 11 Nov 2023 11:41:50 +0100 Message-ID: <20231111104225.136512-2-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231111104225.136512-1-dario.binacchi@amarulasolutions.com> References: <20231111104225.136512-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231111_024238_903190_82BC8C5F X-CRM114-Status: GOOD ( 16.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The previous setting did not take into account the CSTN mode. For the H_WAIT_2 bitfield (bits 0-7) of the LCDC Horizontal Configuration Register (LCDCR), the IMX25RM manual states that: In TFT mode, it specifies the number of SCLK periods between the end of HSYNC and the beginning of OE signal, and the total delay time equals (H_WAIT_2 + 3) of SCLK periods. In CSTN mode, it specifies the number of SCLK periods between the end of HSYNC and the first display data in each line, and the total delay time equals (H_WAIT_2 + 2) of SCLK periods. The patch handles both cases. Fixes: 4e47382fbca9 ("fbdev: imxfb: warn about invalid left/right margin") Fixes: 7e8549bcee00 ("imxfb: Fix margin settings") Signed-off-by: Dario Binacchi --- drivers/video/fbdev/imxfb.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/drivers/video/fbdev/imxfb.c b/drivers/video/fbdev/imxfb.c index 84201c9608d3..7042a43b81d8 100644 --- a/drivers/video/fbdev/imxfb.c +++ b/drivers/video/fbdev/imxfb.c @@ -42,6 +42,7 @@ #include