From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 69AA3606A320 for ; Mon, 30 Nov 2026 15:13:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=EyZ6mLcM; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.a=rsa-sha256 header.s=mail header.b=j2qwUt6F DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=kN2q5lG4fYoEkkpoLyM64I55Iun1WcXjH/Ze6dv7kbU=; b=EyZ6mLcMDAn+VVJEU+HZtd8KWt WOMFJu1TfJWNJlbHmSuOZyzmLQz/tiU1N3OoJ4mDN3CgfGdQV+Hf9xTZIOk6JvcNole2apwdp5yCd 66fisYpxX4Xpl6HoT/WeDwp93qLhpqNSgk9fxeY9yljgXm7FFZwtYIjANtXeRqC60bf3nufg854f2 nwocj6OqebKY6OOiGigzQL3zKHMl8dBfeg7VVmaJ7E5uWvW6DwzEhmfrfiUOadbJzDtxta0Ec/J0k AYShjMv61BD4tAg+TV86Db7yaIQblcTP7/qE+P+Ol4bK49ikrfsxHCTr8CGZUyttaWXn1/4D1V/Ft CywKUleQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xY33e-00000004zzT-1PNg; Mon, 30 Nov 2026 15:12:46 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xY33Y-00000004zyw-0ZVB for linux-arm-kernel@lists.infradead.org; Mon, 30 Nov 2026 15:12:45 +0000 Received: from killaraus.ideasonboard.com (p773008-ipoe.ipoe.ocn.ne.jp [153.242.130.7]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 3B7014B0; Mon, 30 Nov 2026 16:09:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1796051400; bh=gB13Q6mHLSFvZMXpRliOnKjXgK1eqxwEfRGk+90BWcQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=j2qwUt6FBe5sGo3p8tya/N6BwESmJWqjgg0CpHHF0GPJzTIJQ4GR0Pn8RWYB8Cc7x inB/sQxCJWDHS9sv8AYn4Q2tx5x5mXMXxNtMtj7nZ4XAxUccGDBxQayLfFUeutOzYb gVsYvbdW1qG5GaNOxPEPrC04ybmNC2Sr4QD7/fJU= Date: Tue, 1 Dec 2026 00:12:32 +0900 From: Laurent Pinchart To: Guoniu Zhou Cc: Frank Li , Mauro Carvalho Chehab , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Loic Poulain , linux-media@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH v5 07/11] media: imx8-isi: Select MSB-aligned RAW input from pixel link on i.MX95 Message-ID: <20261130151232.GC57763@killaraus.ideasonboard.com> References: <20261116-isi_imx952-v5-0-46de1d24efd4@oss.nxp.com> <20261116-isi_imx952-v5-7-46de1d24efd4@oss.nxp.com> X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20261116-isi_imx952-v5-7-46de1d24efd4@oss.nxp.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261130_071240_347355_A5B263CB X-CRM114-Status: GOOD ( 26.61 ) X-Spam-Score: -2.1 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-15.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Mon, Nov 16, 2026 at 11:28:25AM +0800, Guoniu Zhou wrote: > The ISI receives RAW data from the Pixel Link, whose alignment is > determined by the SoC integration. Before i.MX93, the Pixel Link > provides LSB-aligned RAW data to the ISI. Starting with i.MX93, both > LSB and MSB alignment are supported and can be selected via > CHNL_CTRL_RAW_IN_MSB_ALIGN, with the default keeping LSB alignment > for backward compatibility. From i.MX95 onwards, the CSI formatter > replaces the gasket and only provides MSB-aligned RAW data. > > Set CHNL_CTRL_RAW_IN_MSB_ALIGN on i.MX95 so the ISI selects RAW > samples from the high bits of the Pixel Link bus. > > Signed-off-by: Guoniu Zhou I think this patch should go after 08/11. > --- > Changes in v4: > - New patch > --- > drivers/media/platform/nxp/imx8-isi/imx8-isi-hw.c | 20 ++++++++++++++++++++ > drivers/media/platform/nxp/imx8-isi/imx8-isi-regs.h | 1 + > 2 files changed, 21 insertions(+) > > diff --git a/drivers/media/platform/nxp/imx8-isi/imx8-isi-hw.c b/drivers/media/platform/nxp/imx8-isi/imx8-isi-hw.c > index cc52a90c2477..b3f32b9796d5 100644 > --- a/drivers/media/platform/nxp/imx8-isi/imx8-isi-hw.c > +++ b/drivers/media/platform/nxp/imx8-isi/imx8-isi-hw.c > @@ -303,6 +303,22 @@ static void mxc_isi_channel_set_panic_threshold(struct mxc_isi_pipe *pipe) > mxc_isi_write(pipe, CHNL_OUT_BUF_CTRL, val); > } > > +/* > + * The ISI receives RAW data from the Pixel Link, whose alignment is > + * determined by the SoC integration. It originally selected RAW samples > + * from the low bits of the Pixel Link bus. Starting with i.MX93, > + * CHNL_CTRL_RAW_IN_MSB_ALIGN was introduced to allow the ISI to select > + * RAW samples from either the high or low bits, as both LSB and MSB > + * alignment can be selected in the gasket. > + * > + * On i.MX95, the CSI formatter provides MSB-aligned RAW data, so the ISI > + * must select RAW samples from the high bits of the Pixel Link bus. This comment is too verbose. It copies most of the information from the commit messages while that's not useful for the reader here. See below for a shortened message. > + */ > +static bool isi_raw_in_msb(const struct mxc_isi_plat_data *pdata) > +{ > + return pdata->model == MXC_ISI_IMX95; > +} > + > static void mxc_isi_channel_set_control(struct mxc_isi_pipe *pipe, > enum mxc_isi_input_id input, > unsigned int vc, > @@ -357,6 +373,10 @@ static void mxc_isi_channel_set_control(struct mxc_isi_pipe *pipe, > val |= CHNL_CTRL_VC_ID_1(vc >> 2); > } > > + /* Select MSB-aligned RAW data from the Pixel Link when needed. */ > + if (isi_raw_in_msb(pipe->isi->pdata)) > + val |= CHNL_CTRL_RAW_IN_MSB_ALIGN; The helper function is used here only, you can just inline it. /* * Starting on i.MX95, the ISI gasket is replaced by a Pixel Formatter * that unconditionally aligns data to the MSB. Configure the ISI to * select MSB-aligned data. */ if (isi->pdata->model == MXC_ISI_IMX95) val |= CHNL_CTRL_RAW_IN_MSB_ALIGN; > + > mxc_isi_write(pipe, CHNL_CTRL, val); > > mutex_unlock(&pipe->lock); > diff --git a/drivers/media/platform/nxp/imx8-isi/imx8-isi-regs.h b/drivers/media/platform/nxp/imx8-isi/imx8-isi-regs.h > index 5f66b7c9cd1c..35438abf3172 100644 > --- a/drivers/media/platform/nxp/imx8-isi/imx8-isi-regs.h > +++ b/drivers/media/platform/nxp/imx8-isi/imx8-isi-regs.h > @@ -20,6 +20,7 @@ > #define CHNL_CTRL_CHAIN_BUF_NO_CHAIN 0 > #define CHNL_CTRL_CHAIN_BUF_2_CHAIN 1 > #define CHNL_CTRL_SW_RST BIT(24) > +#define CHNL_CTRL_RAW_IN_MSB_ALIGN BIT(22) /* i.MX{91,93,95} */ > /* > * CHNL_CTRL_BLANK_PXL: i.MX8{QM,QXP} only > * CHNL_CTRL_VC_ID_1, CHNL_CTRL_VC_ID_1_MASK: i.MX95 only -- Regards, Laurent Pinchart