From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752777AbdBIJoq (ORCPT ); Thu, 9 Feb 2017 04:44:46 -0500 Received: from metis.ext.4.pengutronix.de ([92.198.50.35]:37219 "EHLO metis.ext.4.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752637AbdBIJoN (ORCPT ); Thu, 9 Feb 2017 04:44:13 -0500 Message-ID: <1486633391.2284.9.camel@pengutronix.de> Subject: Re: [PATCH v3 21/24] media: imx: Add MIPI CSI-2 Receiver subdev driver From: Philipp Zabel To: Steve Longerbeam Cc: robh+dt@kernel.org, mark.rutland@arm.com, shawnguo@kernel.org, kernel@pengutronix.de, fabio.estevam@nxp.com, linux@armlinux.org.uk, mchehab@kernel.org, hverkuil@xs4all.nl, nick@shmanahar.org, markus.heiser@darmarIT.de, laurent.pinchart+renesas@ideasonboard.com, bparrot@ti.com, geert@linux-m68k.org, arnd@arndb.de, sudipm.mukherjee@gmail.com, minghsiu.tsai@mediatek.com, tiffany.lin@mediatek.com, jean-christophe.trotin@st.com, horms+renesas@verge.net.au, niklas.soderlund+renesas@ragnatech.se, robert.jarzmik@free.fr, songjun.wu@microchip.com, andrew-ct.chen@mediatek.com, gregkh@linuxfoundation.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, devel@driverdev.osuosl.org, Steve Longerbeam Date: Thu, 09 Feb 2017 10:43:11 +0100 In-Reply-To: References: <1483755102-24785-1-git-send-email-steve_longerbeam@mentor.com> <1483755102-24785-22-git-send-email-steve_longerbeam@mentor.com> <1486036237.2289.37.camel@pengutronix.de> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.9-1+b1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2001:67c:670:100:3ad5:47ff:feaf:1a17 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2017-02-08 at 15:23 -0800, Steve Longerbeam wrote: [...] > >> + > >> +static int imxcsi2_get_fmt(struct v4l2_subdev *sd, > >> + struct v4l2_subdev_pad_config *cfg, > >> + struct v4l2_subdev_format *sdformat) > >> +{ > >> + struct imxcsi2_dev *csi2 = sd_to_dev(sd); > >> + > >> + sdformat->format = csi2->format_mbus; > > The output formats are different from the input formats, see the media > > bus format discussion in the other thread. The input pad is the MIPI > > CSI-2 bus, but the four output pads are connected to the muxes / CSIs > > via a 16-bit parallel bus. > > > > So if the input format is UYVY8_1X16, for example, the output should be > > set to UYVY8_2X8. > > Since the output buses from the CSI2IPU gasket are 16-bit > parallel buses, shouldn't an input format UYVY8_1X16 also be > the same at the output? I looked at the reference manual again, and I think I have read this incorrectly, probably confused by the coloring in Figure 19-10 "YUV422-8 data reception" in the CSI2IPU chapter. It looks like indeed the 16-bit bus carries UYVY8_1X16, whereas the internal 32-bit bus between MIPI CSI-2 decoder and the CSI2IPU carries two samples (complete UYVY) per pixel clock. So UYVY is straight forward. It's the YUV420, RGB, and RAW formats that would be interesting to describe correctly. regards Philipp From mboxrd@z Thu Jan 1 00:00:00 1970 From: Philipp Zabel Subject: Re: [PATCH v3 21/24] media: imx: Add MIPI CSI-2 Receiver subdev driver Date: Thu, 09 Feb 2017 10:43:11 +0100 Message-ID: <1486633391.2284.9.camel@pengutronix.de> References: <1483755102-24785-1-git-send-email-steve_longerbeam@mentor.com> <1483755102-24785-22-git-send-email-steve_longerbeam@mentor.com> <1486036237.2289.37.camel@pengutronix.de> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: linux-media-owner@vger.kernel.org To: Steve Longerbeam Cc: robh+dt@kernel.org, mark.rutland@arm.com, shawnguo@kernel.org, kernel@pengutronix.de, fabio.estevam@nxp.com, linux@armlinux.org.uk, mchehab@kernel.org, hverkuil@xs4all.nl, nick@shmanahar.org, markus.heiser@darmarIT.de, laurent.pinchart+renesas@ideasonboard.com, bparrot@ti.com, geert@linux-m68k.org, arnd@arndb.de, sudipm.mukherjee@gmail.com, minghsiu.tsai@mediatek.com, tiffany.lin@mediatek.com, jean-christophe.trotin@st.com, horms+renesas@verge.net.au, niklas.soderlund+renesas@ragnatech.se, robert.jarzmik@free.fr, songjun.wu@microchip.com, andrew-ct.chen@mediatek.com, gregkh@linuxfoundation.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, devel@driverdev.osuosl.org, Steve Longerbeam List-Id: devicetree@vger.kernel.org On Wed, 2017-02-08 at 15:23 -0800, Steve Longerbeam wrote: [...] > >> + > >> +static int imxcsi2_get_fmt(struct v4l2_subdev *sd, > >> + struct v4l2_subdev_pad_config *cfg, > >> + struct v4l2_subdev_format *sdformat) > >> +{ > >> + struct imxcsi2_dev *csi2 = sd_to_dev(sd); > >> + > >> + sdformat->format = csi2->format_mbus; > > The output formats are different from the input formats, see the media > > bus format discussion in the other thread. The input pad is the MIPI > > CSI-2 bus, but the four output pads are connected to the muxes / CSIs > > via a 16-bit parallel bus. > > > > So if the input format is UYVY8_1X16, for example, the output should be > > set to UYVY8_2X8. > > Since the output buses from the CSI2IPU gasket are 16-bit > parallel buses, shouldn't an input format UYVY8_1X16 also be > the same at the output? I looked at the reference manual again, and I think I have read this incorrectly, probably confused by the coloring in Figure 19-10 "YUV422-8 data reception" in the CSI2IPU chapter. It looks like indeed the 16-bit bus carries UYVY8_1X16, whereas the internal 32-bit bus between MIPI CSI-2 decoder and the CSI2IPU carries two samples (complete UYVY) per pixel clock. So UYVY is straight forward. It's the YUV420, RGB, and RAW formats that would be interesting to describe correctly. regards Philipp From mboxrd@z Thu Jan 1 00:00:00 1970 From: p.zabel@pengutronix.de (Philipp Zabel) Date: Thu, 09 Feb 2017 10:43:11 +0100 Subject: [PATCH v3 21/24] media: imx: Add MIPI CSI-2 Receiver subdev driver In-Reply-To: References: <1483755102-24785-1-git-send-email-steve_longerbeam@mentor.com> <1483755102-24785-22-git-send-email-steve_longerbeam@mentor.com> <1486036237.2289.37.camel@pengutronix.de> Message-ID: <1486633391.2284.9.camel@pengutronix.de> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Wed, 2017-02-08 at 15:23 -0800, Steve Longerbeam wrote: [...] > >> + > >> +static int imxcsi2_get_fmt(struct v4l2_subdev *sd, > >> + struct v4l2_subdev_pad_config *cfg, > >> + struct v4l2_subdev_format *sdformat) > >> +{ > >> + struct imxcsi2_dev *csi2 = sd_to_dev(sd); > >> + > >> + sdformat->format = csi2->format_mbus; > > The output formats are different from the input formats, see the media > > bus format discussion in the other thread. The input pad is the MIPI > > CSI-2 bus, but the four output pads are connected to the muxes / CSIs > > via a 16-bit parallel bus. > > > > So if the input format is UYVY8_1X16, for example, the output should be > > set to UYVY8_2X8. > > Since the output buses from the CSI2IPU gasket are 16-bit > parallel buses, shouldn't an input format UYVY8_1X16 also be > the same at the output? I looked at the reference manual again, and I think I have read this incorrectly, probably confused by the coloring in Figure 19-10 "YUV422-8 data reception" in the CSI2IPU chapter. It looks like indeed the 16-bit bus carries UYVY8_1X16, whereas the internal 32-bit bus between MIPI CSI-2 decoder and the CSI2IPU carries two samples (complete UYVY) per pixel clock. So UYVY is straight forward. It's the YUV420, RGB, and RAW formats that would be interesting to describe correctly. regards Philipp