Linux-Rockchip Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Adam Ford <aford173@gmail.com>
Cc: Paul Elder <paul.elder@ideasonboard.com>,
	linux-media@vger.kernel.org,
	Dafna Hirschfeld <dafna@fastmail.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Heiko Stuebner <heiko@sntech.de>,
	Helen Koike <helen.koike@collabora.com>,
	linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 00/14] media: rkisp1: Add support for i.MX8MP
Date: Thu, 23 Feb 2023 18:25:18 +0200	[thread overview]
Message-ID: <Y/eTbnfsq2VtgK3q@pendragon.ideasonboard.com> (raw)
In-Reply-To: <CAHCN7xLXz4iSKcTQgyW=E0c4eLZSAYAiuoTKpQBWz8GsfZ2GCA@mail.gmail.com>

Hi Adam,

On Thu, Feb 23, 2023 at 10:10:28AM -0600, Adam Ford wrote:
> On Thu, Feb 23, 2023 at 8:26 AM Laurent Pinchart wrote:
> > On Wed, Feb 22, 2023 at 05:39:30PM -0600, Adam Ford wrote:
> > > On Fri, Nov 18, 2022 at 3:44 AM Paul Elder wrote:
> > > >
> > > > This series depends on v3 of "dt-bindings: media: Add macros for video
> > > > interface bus types" [1].
> > > >
> > > > This series extends the rkisp1 driver to support the ISP found in the
> > > > NXP i.MX8MP SoC.
> > > >
> > > > The ISP IP cores in the Rockchip RK3399 (known as the "Rockchip ISP1")
> > > > and in the NXP i.MX8MP have the same origin, and have slightly diverged
> > > > over time as they are now independently developed (afaik) by Rockchip
> > > > and VeriSilicon. The latter is marketed under the name "ISP8000Nano",
> > > > and is close enough to the RK3399 ISP that it can easily be supported by
> > > > the same driver.
> > > >
> > > > The last two patches add support for UYVY output format, which can be
> > > > implemented on the ISP version in the i.MX8MP but not in the one in the
> > > > RK3399.
> > > >
> > > > This version of the series specifically has been tested on a Polyhex
> > > > Debix model A with an imx219 (Raspberry Pi cam v2).
> > > >
> > > > [1] https://lore.kernel.org/linux-media/20220615221410.27459-2-laurent.pinchart@ideasonboard.com/
> > > >
> > > > Laurent Pinchart (3):
> > > >   dt-bindings: media: rkisp1: Add i.MX8MP ISP example
> > > >   media: rkisp1: Add and use rkisp1_has_feature() macro
> > > >   media: rkisp1: Configure gasket on i.MX8MP
> > > >
> > > > Paul Elder (11):
> > > >   dt-bindings: media: rkisp1: Add i.MX8MP ISP to compatible
> > > >   media: rkisp1: Add match data for i.MX8MP ISP
> > > >   media: rkisp1: Add and set registers for crop for i.MX8MP
> > > >   media: rkisp1: Add and set registers for output size config on i.MX8MP
> > > >   media: rkisp1: Add i.MX8MP-specific registers for MI and resizer
> > > >   media: rkisp1: Shift DMA buffer addresses on i.MX8MP
> > > >   media: rkisp1: Add register definitions for the test pattern generator
> > > >   media: rkisp1: Fix RSZ_CTRL bits for i.MX8MP
> > > >   media: rkisp1: Support devices without self path
> > > >   media: rkisp1: Add YC swap capability
> > > >   media: rkisp1: Add UYVY as an output format
> > >
> > > Paul / Laurent,
> > >
> > > I noticed an unexpected behaviour on the imx8mp.
> > >
> > > If I setup my pipeline for 640x480, it works just fine using an imx219
> > > camera configured for SRGGB10_1X10.
> > >
> > > However, when I try to configure the pipeline to use the same camera
> > > at 1920x1080 (no resizing), the ISP source keeps defaulting to 640x480
> > >
> > > Media device information
> > > ------------------------
> > > driver          rkisp1
> > > model           rkisp1
> > > serial
> > > bus info        platform:rkisp1
> > > hw revision     0xe
> > > driver version  6.2.0
> > >
> > > Device topology
> > > - entity 1: rkisp1_isp (4 pads, 4 links)
> > >             type V4L2 subdev subtype Unknown flags 0
> > >             device node name /dev/v4l-subdev0
> > > pad0: Sink [fmt:SRGGB10_1X10/1920x1080 field:none colorspace:raw xfer:none ycbcr:601 quantization:full-range crop.bounds:(0,0)/1920x1080 crop:(0,0)/640x480]
> >
> > You're cropping the image to 640x480 here. You need to set the crop
> > rectangle to 1920x1080.
> >
> > As Jacopo mentioned, I wouldn't recommend exercising the ISP directly.
> > Not only do you need to setup the pipeline, but you would also need to
> > implement all the imaging algorithms in userspace. libcamera will do all
> > this for you.
> 
> I'll give that a try.  My current employer has a v4l2src requirement,
> but I can likely make an argument to switch to libcamera.  I didn't
> catch the cropping part. Thanks for that.

libcamera has a GStreamer source element called libcamerasrc which is
aimed to be a drop-in replacement for v4l2src. Some features may be
missing, let us know and we can discuss how to add them.

> > > <- "csis-32e40000.csi":1 [ENABLED]
> > > pad1: Sink [fmt:unknown/0x0 field:none]
> > > <- "rkisp1_params":0 [ENABLED,IMMUTABLE]
> > > pad2: Source [fmt:YUYV8_2X8/640x480 field:none colorspace:raw xfer:none ycbcr:601 quantization:lim-range crop.bounds:(0,0)/640x480 crop:(0,0)/640x480]
> > > -> "rkisp1_resizer_mainpath":0 [ENABLED]
> > > pad3: Source [fmt:unknown/0x0 field:none]
> > > -> "rkisp1_stats":0 [ENABLED,IMMUTABLE]
> > >
> > > - entity 6: rkisp1_resizer_mainpath (2 pads, 2 links)
> > >             type V4L2 subdev subtype Unknown flags 0
> > >             device node name /dev/v4l-subdev1
> > > pad0: Sink [fmt:YUYV8_2X8/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range crop.bounds:(0,0)/1920x1080 crop:(0,0)/640x480]
> > > <- "rkisp1_isp":2 [ENABLED]
> > > pad1: Source [fmt:YUYV8_2X8/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
> > > -> "rkisp1_mainpath":0 [ENABLED,IMMUTABLE]
> > >
> > > - entity 9: rkisp1_mainpath (1 pad, 1 link)
> > >             type Node subtype V4L flags 0
> > >             device node name /dev/video0
> > > pad0: Sink
> > > <- "rkisp1_resizer_mainpath":1 [ENABLED,IMMUTABLE]
> > >
> > > - entity 13: rkisp1_stats (1 pad, 1 link)
> > >              type Node subtype V4L flags 0
> > >              device node name /dev/video1
> > > pad0: Sink
> > > <- "rkisp1_isp":3 [ENABLED,IMMUTABLE]
> > >
> > > - entity 17: rkisp1_params (1 pad, 1 link)
> > >              type Node subtype V4L flags 0
> > >              device node name /dev/video2
> > > pad0: Source
> > > -> "rkisp1_isp":1 [ENABLED,IMMUTABLE]
> > >
> > > - entity 29: csis-32e40000.csi (2 pads, 2 links)
> > >              type V4L2 subdev subtype Unknown flags 0
> > >              device node name /dev/v4l-subdev2
> > > pad0: Sink [fmt:SRGGB10_1X10/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range]
> > > <- "imx219 1-0010":0 [ENABLED]
> > > pad1: Source [fmt:SRGGB10_1X10/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range]
> > > -> "rkisp1_isp":0 [ENABLED]
> > >
> > > - entity 34: imx219 1-0010 (1 pad, 1 link)
> > >              type V4L2 subdev subtype Sensor flags 0
> > >              device node name /dev/v4l-subdev3
> > > pad0: Source [fmt:SRGGB10_1X10/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range crop.bounds:(8,8)/3280x2464 crop:(688,700)/1920x1080]
> > > -> "csis-32e40000.csi":0 [ENABLED]
> > >
> > > It's at this point that everything except the ISP source is 1920x1080.
> > >
> > > When I try to set the ISP sink to 1080, it ends up being 640x480 and
> > > the resizer sink is also changed to 640x480
> > >
> > > root@beacon-imx8mp-kit:~# media-ctl -v -V "'rkisp1_isp':2
> > > [fmt:YUYV8_2X8/1920x1080 field:none]"
> > > Opening media device /dev/media0
> > > Enumerating entities
> > > looking up device: 81:3
> > > looking up device: 81:4
> > > looking up device: 81:0
> > > looking up device: 81:1
> > > looking up device: 81:2
> > > looking up device: 81:5
> > > looking up device: 81:6
> > > Found 7 entities
> > > Enumerating pads and links
> > > Setting up format YUYV8_2X8 1920x1080 on pad rkisp1_isp/2
> > > Format set: YUYV8_2X8 640x480
> > > Setting up format YUYV8_2X8 640x480 on pad rkisp1_resizer_mainpath/0
> > > Format set: YUYV8_2X8 640x480
> > >
> > >
> > > It's my understanding that the ISP should be able to handle 1920x1080,
> > > and the resizer sink should match the ISP source.
> > >
> > > With the pipeline improperly setup, the capture fails.
> > >
> > > >  .../bindings/media/rockchip-isp1.yaml         |  79 ++++++++++-
> > > >  .../platform/rockchip/rkisp1/rkisp1-capture.c | 102 +++++++++++---
> > > >  .../platform/rockchip/rkisp1/rkisp1-common.h  |  32 +++++
> > > >  .../platform/rockchip/rkisp1/rkisp1-debug.c   |  14 +-
> > > >  .../platform/rockchip/rkisp1/rkisp1-dev.c     |  67 +++++++--
> > > >  .../platform/rockchip/rkisp1/rkisp1-isp.c     | 128 +++++++++++++++++-
> > > >  .../platform/rockchip/rkisp1/rkisp1-regs.h    |  90 ++++++++++++
> > > >  .../platform/rockchip/rkisp1/rkisp1-resizer.c |  35 ++++-
> > > >  include/uapi/linux/rkisp1-config.h            |   2 +
> > > >  9 files changed, 509 insertions(+), 40 deletions(-)

-- 
Regards,

Laurent Pinchart

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

  reply	other threads:[~2023-02-23 16:26 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-18  9:39 [PATCH v3 00/14] media: rkisp1: Add support for i.MX8MP Paul Elder
2022-11-18  9:39 ` [PATCH v3 01/14] dt-bindings: media: rkisp1: Add i.MX8MP ISP to compatible Paul Elder
2022-11-18 13:02   ` Krzysztof Kozlowski
2022-11-19  6:31     ` Paul Elder
2022-11-18  9:39 ` [PATCH v3 02/14] dt-bindings: media: rkisp1: Add i.MX8MP ISP example Paul Elder
2022-11-18 13:06   ` Krzysztof Kozlowski
2022-11-19  6:55     ` Paul Elder
2022-11-20 10:36       ` Krzysztof Kozlowski
2022-11-21  5:09         ` Paul Elder
2022-11-21  8:04           ` Krzysztof Kozlowski
2022-11-21 10:38             ` Laurent Pinchart
2022-11-21 11:16               ` Krzysztof Kozlowski
2022-11-21 13:50                 ` Laurent Pinchart
2022-11-21 16:37                   ` Krzysztof Kozlowski
2022-11-21 16:39                     ` Krzysztof Kozlowski
2022-11-21 16:48                     ` Laurent Pinchart
2022-11-19 16:59     ` Laurent Pinchart
2022-11-20 10:34       ` Krzysztof Kozlowski
2022-11-18 13:31   ` Rob Herring
2022-11-19  6:33     ` Paul Elder
2022-11-18  9:39 ` [PATCH v3 03/14] media: rkisp1: Add and use rkisp1_has_feature() macro Paul Elder
2022-11-19 11:03   ` Dafna Hirschfeld
2022-11-19 17:18     ` Laurent Pinchart
2022-11-18  9:39 ` [PATCH v3 04/14] media: rkisp1: Add match data for i.MX8MP ISP Paul Elder
2023-10-18 17:41   ` Adam Ford
2022-11-18  9:39 ` [PATCH v3 05/14] media: rkisp1: Configure gasket on i.MX8MP Paul Elder
2022-11-18  9:39 ` [PATCH v3 06/14] media: rkisp1: Add and set registers for crop for i.MX8MP Paul Elder
2022-11-18  9:39 ` [PATCH v3 07/14] media: rkisp1: Add and set registers for output size config on i.MX8MP Paul Elder
2022-11-18  9:39 ` [PATCH v3 08/14] media: rkisp1: Add i.MX8MP-specific registers for MI and resizer Paul Elder
2022-11-18  9:39 ` [PATCH v3 09/14] media: rkisp1: Shift DMA buffer addresses on i.MX8MP Paul Elder
2022-11-18  9:39 ` [PATCH v3 10/14] media: rkisp1: Add register definitions for the test pattern generator Paul Elder
2022-11-18  9:39 ` [PATCH v3 11/14] media: rkisp1: Fix RSZ_CTRL bits for i.MX8MP Paul Elder
2022-11-18  9:39 ` [PATCH v3 12/14] media: rkisp1: Support devices without self path Paul Elder
2022-11-18  9:39 ` [PATCH v3 13/14] media: rkisp1: Add YC swap capability Paul Elder
2022-11-18  9:39 ` [PATCH v3 14/14] media: rkisp1: Add UYVY as an output format Paul Elder
     [not found] ` <CAHCN7x+9E8qcBVOQZKTKagDkvkKVnqDtjvpNX-iNFYwCLRoYug@mail.gmail.com>
2023-02-15 23:55   ` [PATCH v3 00/14] media: rkisp1: Add support for i.MX8MP Laurent Pinchart
2023-02-18 16:14     ` Adam Ford
2023-02-23 10:58       ` Jacopo Mondi
2023-02-22 23:39 ` Adam Ford
2023-02-23 13:57   ` Jacopo Mondi
2023-02-23 14:26   ` Laurent Pinchart
2023-02-23 16:10     ` Adam Ford
2023-02-23 16:25       ` Laurent Pinchart [this message]
2023-02-24 18:24       ` Nicolas Dufresne
2023-02-24 18:46         ` Adam Ford
2023-03-21 14:43 ` Tommaso Merciai
2023-07-18  8:31 ` Hans Verkuil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y/eTbnfsq2VtgK3q@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=aford173@gmail.com \
    --cc=dafna@fastmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=heiko@sntech.de \
    --cc=helen.koike@collabora.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=mchehab@kernel.org \
    --cc=paul.elder@ideasonboard.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox