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: 13453037 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 67DEEC4332F for ; Sat, 11 Nov 2023 10:42:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5689C10E26A; Sat, 11 Nov 2023 10:42:43 +0000 (UTC) Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) by gabe.freedesktop.org (Postfix) with ESMTPS id A6DCB10E260 for ; Sat, 11 Nov 2023 10:42:38 +0000 (UTC) Received: by mail-ej1-x643.google.com with SMTP id a640c23a62f3a-9e1021dbd28so457253066b.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.freedesktop.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=JybkrZWb05Woyh/xUr5qte6CYwh2yM2KOmDurVRzjUVCY+sKy9tEhJnp+wFufQ+2dl XShjmeTcqJGKkakmoczH+XGWK89KIKgcUU+NxpsRhZm4+hj78+q6HRUZdaNcmPJUWUMp 1SgTpPsK7LYvF9DyXKEaVJZggmqZ5UZyJlp7s= 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=DFG6a2gG9JRXPI5XAbtMLLn5hSUjj/iPanUQWOPtgMGm4/svcwhcCIxqkEJyabHn/x aqPqKwCkpb0jVqF35soHX5LuOe1svxh67HB35lXW8BT6B74WlYhOUoOMnJbvp+L46vMh AWjr7qTrogs45gPDlCDiE8Bx18PzWYacpiAY1wgvmoo9B18tVGaTjldOX59THbfUgcEe CtcCTIGjUBpPefqx4bePOD0lSlVboKTuwWQEcmUuuN8ugAYhsU+Dv62Hdjg2YQ74Dl97 HnQj8eWW20sqtLBxd1vTfq4dMuHNoAU0P11cqi1BwkMjiSjKgDW+lllp4M/zw2g3UhpN Kmjw== X-Gm-Message-State: AOJu0Ywfhp3bHiNPpLJml5P1iJA73J+Q5mtc/fiPgpyuEzuEuOF4R32M OsxjXin/eNlCXSCM59mHkTOC4w== 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 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-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-fbdev@vger.kernel.org, linux-amarula@amarulasolutions.com, Helge Deller , dri-devel@lists.freedesktop.org, NXP Linux Team , Pengutronix Kernel Team , Martin Kaiser , Shawn Guo , Dario Binacchi , Sascha Hauer , linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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