From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751683AbdBXBlV (ORCPT ); Thu, 23 Feb 2017 20:41:21 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:35306 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751242AbdBXBlR (ORCPT ); Thu, 23 Feb 2017 20:41:17 -0500 Subject: Re: [PATCH v4 33/36] media: imx: redo pixel format enumeration and negotiation To: Philipp Zabel References: <1487211578-11360-1-git-send-email-steve_longerbeam@mentor.com> <1487211578-11360-34-git-send-email-steve_longerbeam@mentor.com> <1487244744.2377.38.camel@pengutronix.de> <9a4a4da7-418e-860e-05ec-da44b3c945cc@gmail.com> <1487841019.2916.7.camel@pengutronix.de> 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, shuah@kernel.org, sakari.ailus@linux.intel.com, pavel@ucw.cz, 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 From: Steve Longerbeam Message-ID: <9d4fe000-f694-7d3d-34f2-a89cd637b3f0@gmail.com> Date: Thu, 23 Feb 2017 17:30:57 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <1487841019.2916.7.camel@pengutronix.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/23/2017 01:10 AM, Philipp Zabel wrote: > Hi Steve, > > On Wed, 2017-02-22 at 15:52 -0800, Steve Longerbeam wrote: >> Hi Philipp, >> >> >> On 02/16/2017 03:32 AM, Philipp Zabel wrote: >>> On Wed, 2017-02-15 at 18:19 -0800, Steve Longerbeam wrote: >>>> The previous API and negotiation of mbus codes and pixel formats >>>> was broken, and has been completely redone. >>>> >>>> The negotiation of media bus codes should be as follows: >>>> >>>> CSI: >>>> >>>> sink pad direct src pad IDMAC src pad >>>> -------- ---------------- ------------- >>>> RGB (any) IPU RGB RGB (any) >>>> YUV (any) IPU YUV YUV (any) >>>> Bayer N/A must be same bayer code as sink >>> >>> The IDMAC src pad should also use the internal 32-bit RGB / YUV format, >>> except if bayer/raw mode is selected, in which case the attached capture >>> video device should only allow a single mode corresponding to the output >>> pad media bus format. >> >> The IDMAC source pad is going to memory, so it has left the IPU. >> Are you sure it should be an internal IPU format? I realize it >> is linked to a capture device node, and the IPU format could then >> be translated to a v4l2 fourcc by the capture device, but IMHO this >> pad is external to the IPU. > > The CSI IDMAC source pad should describe the format at the connection > between the CSI and the IDMAC, just as the icprpvf and icprpenc source > pads. > The format outside of the IPU is the memory format written by the IDMAC, > but that is a memory pixel format and not a media bus format at all. > True, it is a memory format. I don't really mind if the CSI and PRP ENC/VF source pads are characterized as IPU internal formats, since they are only used to indicate the colorspace to the capture device. And yes it did simplify the enumeration and try_fmt code a bit. So I went ahead and made the change. Steve > That would also make it more straightforward to enumerate the memory > pixel formats in the capture device: If the source pad media bus format > is 32-bit YUV, enumerate all YUV formats, if it is 32-bit RGB or RGB565, > enumerate all rgb formats, otherwise (bayer/raw mode) only allow the > specific memory format matching the bus format. > > From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steve Longerbeam Subject: Re: [PATCH v4 33/36] media: imx: redo pixel format enumeration and negotiation Date: Thu, 23 Feb 2017 17:30:57 -0800 Message-ID: <9d4fe000-f694-7d3d-34f2-a89cd637b3f0@gmail.com> References: <1487211578-11360-1-git-send-email-steve_longerbeam@mentor.com> <1487211578-11360-34-git-send-email-steve_longerbeam@mentor.com> <1487244744.2377.38.camel@pengutronix.de> <9a4a4da7-418e-860e-05ec-da44b3c945cc@gmail.com> <1487841019.2916.7.camel@pengutronix.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1487841019.2916.7.camel@pengutronix.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" To: Philipp Zabel Cc: mark.rutland@arm.com, andrew-ct.chen@mediatek.com, minghsiu.tsai@mediatek.com, nick@shmanahar.org, songjun.wu@microchip.com, hverkuil@xs4all.nl, Steve Longerbeam , pavel@ucw.cz, robert.jarzmik@free.fr, devel@driverdev.osuosl.org, markus.heiser@darmarIT.de, laurent.pinchart+renesas@ideasonboard.com, shuah@kernel.org, linux@armlinux.org.uk, geert@linux-m68k.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, sakari.ailus@linux.intel.com, arnd@arndb.de, mchehab@kernel.org, bparrot@ti.com, robh+dt@kernel.org, horms+renesas@verge.net.au, tiffany.lin@mediatek.com, linux-arm-kernel@lists.infradead.org, niklas.soderlund+renesas@ragnatech.se, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, jean-christophe.trotin@st.com, kernel@pengutronix.de, fabio.estevam@nxp.com, shawnguo@kernel.org, sudipm.mukherjee@gmail.com List-Id: devicetree@vger.kernel.org On 02/23/2017 01:10 AM, Philipp Zabel wrote: > Hi Steve, > > On Wed, 2017-02-22 at 15:52 -0800, Steve Longerbeam wrote: >> Hi Philipp, >> >> >> On 02/16/2017 03:32 AM, Philipp Zabel wrote: >>> On Wed, 2017-02-15 at 18:19 -0800, Steve Longerbeam wrote: >>>> The previous API and negotiation of mbus codes and pixel formats >>>> was broken, and has been completely redone. >>>> >>>> The negotiation of media bus codes should be as follows: >>>> >>>> CSI: >>>> >>>> sink pad direct src pad IDMAC src pad >>>> -------- ---------------- ------------- >>>> RGB (any) IPU RGB RGB (any) >>>> YUV (any) IPU YUV YUV (any) >>>> Bayer N/A must be same bayer code as sink >>> >>> The IDMAC src pad should also use the internal 32-bit RGB / YUV format, >>> except if bayer/raw mode is selected, in which case the attached capture >>> video device should only allow a single mode corresponding to the output >>> pad media bus format. >> >> The IDMAC source pad is going to memory, so it has left the IPU. >> Are you sure it should be an internal IPU format? I realize it >> is linked to a capture device node, and the IPU format could then >> be translated to a v4l2 fourcc by the capture device, but IMHO this >> pad is external to the IPU. > > The CSI IDMAC source pad should describe the format at the connection > between the CSI and the IDMAC, just as the icprpvf and icprpenc source > pads. > The format outside of the IPU is the memory format written by the IDMAC, > but that is a memory pixel format and not a media bus format at all. > True, it is a memory format. I don't really mind if the CSI and PRP ENC/VF source pads are characterized as IPU internal formats, since they are only used to indicate the colorspace to the capture device. And yes it did simplify the enumeration and try_fmt code a bit. So I went ahead and made the change. Steve > That would also make it more straightforward to enumerate the memory > pixel formats in the capture device: If the source pad media bus format > is 32-bit YUV, enumerate all YUV formats, if it is 32-bit RGB or RGB565, > enumerate all rgb formats, otherwise (bayer/raw mode) only allow the > specific memory format matching the bus format. > > From mboxrd@z Thu Jan 1 00:00:00 1970 From: slongerbeam@gmail.com (Steve Longerbeam) Date: Thu, 23 Feb 2017 17:30:57 -0800 Subject: [PATCH v4 33/36] media: imx: redo pixel format enumeration and negotiation In-Reply-To: <1487841019.2916.7.camel@pengutronix.de> References: <1487211578-11360-1-git-send-email-steve_longerbeam@mentor.com> <1487211578-11360-34-git-send-email-steve_longerbeam@mentor.com> <1487244744.2377.38.camel@pengutronix.de> <9a4a4da7-418e-860e-05ec-da44b3c945cc@gmail.com> <1487841019.2916.7.camel@pengutronix.de> Message-ID: <9d4fe000-f694-7d3d-34f2-a89cd637b3f0@gmail.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 02/23/2017 01:10 AM, Philipp Zabel wrote: > Hi Steve, > > On Wed, 2017-02-22 at 15:52 -0800, Steve Longerbeam wrote: >> Hi Philipp, >> >> >> On 02/16/2017 03:32 AM, Philipp Zabel wrote: >>> On Wed, 2017-02-15 at 18:19 -0800, Steve Longerbeam wrote: >>>> The previous API and negotiation of mbus codes and pixel formats >>>> was broken, and has been completely redone. >>>> >>>> The negotiation of media bus codes should be as follows: >>>> >>>> CSI: >>>> >>>> sink pad direct src pad IDMAC src pad >>>> -------- ---------------- ------------- >>>> RGB (any) IPU RGB RGB (any) >>>> YUV (any) IPU YUV YUV (any) >>>> Bayer N/A must be same bayer code as sink >>> >>> The IDMAC src pad should also use the internal 32-bit RGB / YUV format, >>> except if bayer/raw mode is selected, in which case the attached capture >>> video device should only allow a single mode corresponding to the output >>> pad media bus format. >> >> The IDMAC source pad is going to memory, so it has left the IPU. >> Are you sure it should be an internal IPU format? I realize it >> is linked to a capture device node, and the IPU format could then >> be translated to a v4l2 fourcc by the capture device, but IMHO this >> pad is external to the IPU. > > The CSI IDMAC source pad should describe the format at the connection > between the CSI and the IDMAC, just as the icprpvf and icprpenc source > pads. > The format outside of the IPU is the memory format written by the IDMAC, > but that is a memory pixel format and not a media bus format at all. > True, it is a memory format. I don't really mind if the CSI and PRP ENC/VF source pads are characterized as IPU internal formats, since they are only used to indicate the colorspace to the capture device. And yes it did simplify the enumeration and try_fmt code a bit. So I went ahead and made the change. Steve > That would also make it more straightforward to enumerate the memory > pixel formats in the capture device: If the source pad media bus format > is 32-bit YUV, enumerate all YUV formats, if it is 32-bit RGB or RGB565, > enumerate all rgb formats, otherwise (bayer/raw mode) only allow the > specific memory format matching the bus format. > >