public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Petko Manolov <petko.manolov@konsulko.com>
Cc: Alexander Stein <alexander.stein@ew.tq-group.com>,
	linux-media@vger.kernel.org, jacopo@jmondi.org
Subject: Re: Re: Re: hooking Sony 47MPixel sensor to NXP imx8m-mini MIPI CSI2
Date: Wed, 6 Jul 2022 16:51:26 +0300	[thread overview]
Message-ID: <YsWTXnTpeM+mCImc@pendragon.ideasonboard.com> (raw)
In-Reply-To: <YsWJBEPhp9WhiYe1@p310.k.g>

Hi Petko,

On Wed, Jul 06, 2022 at 04:07:16PM +0300, Petko Manolov wrote:
> On 22-07-06 08:18:20, Alexander Stein wrote:
> > 
> > Thanks! Indeed at a first glance it looks straight forward. I was trying to 
> > get an imx327 running on a imx8mm, called TQMa8MxML. See [1] for some details. 
> > The cover letter describes the config setup. The media-ctl commands might help 
> > your setup. Note the settle times are an ugly bitch and are crucial to be set 
> > on my board, but I'm not sure why they have to be that way. Patch 1-8 are 
> > obsolete by now with the updates to drivers/media/platform/nxp/ 
> > imx-mipi-csis.c. Patch 9 might help you configure the DT.
> 
> Right, media-ctl is it.  In fact the pipelines have been properly set up so i 
> only had to change the format.  The attached media graph is below
> 
> Now, there are two problems i'm stumbling upon.  One is related to the capture 
> device not actually supporting imx492 format(s), which are:
> 
> 	MEDIA_BUS_FMT_SGBRG10_1X10
> 	MEDIA_BUS_FMT_SGBRG12_1X12
> 
> which i guess is why i am being greeted with (when using v4l2-ctl):
> 
> 	imx7-csi 32e20000.csi: capture format not valid
> 
> When i manually force it to something that is actually supported, 
> MEDIA_BUS_FMT_SGBRG16_1X16, i get:
> 
> 	imx7-csi 32e20000.csi: pipeline start failed with -67
> 
> Since this isn't one of the usual error numbers i guess it comes from within the 
> driver code.  I might be getting this error because the source is 12 bit while 
> the sink is 16 and i am breaking something, dunno.
> 
> Shall i go ahead and add MEDIA_BUS_FMT_SGBRG12_1X12 to the capture driver or i 
> am missing something here?

I had a quick look at the imx7-media-csi driver, and I think it supports
1-bit bayer correctly. You need to use the MEDIA_BUS_FMT_SGBRG10_1X10
or MEDIA_BUS_FMT_SGBRG12_1X12 media bus formats through the pipeline,
and the V4L2_PIX_FMT_SGBRG16 pixel format on the video captude node. If
that doesn't work, have a look at capture_validate_fmt() in
drivers/staging/media/imx/imx-media-capture.c to see which check fails.

> The other problem is when v4l2 tries to allocate buffer for even a single frame.  
> This is 8192x5556 10/12bit bayer sensor and, maybe not surprisingly i get 
> "buffer allocation failed".  Is it possible that i'm the first to step on this 
> issue on imx8m-mini or in general?

You may want to increase the size of the CMA in the kernel configuration
(or on the kernel command line).

> Media controller API version 5.19.0
> 
> Media device information
> ------------------------
> driver          imx7-csi
> model           imx-media
> serial          
> bus info        platform:32e20000.csi
> hw revision     0x0
> driver version  5.19.0
> 
> Device topology
> - entity 1: csi (2 pads, 2 links)
>             type V4L2 subdev subtype Unknown flags 0
>             device node name /dev/v4l-subdev0
> 	pad0: Sink
> 		[fmt:SGBRG12_1X12/4096x2048 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range]
> 		<- "csis-32e30000.mipi-csi":1 [ENABLED,IMMUTABLE]
> 	pad1: Source
> 		[fmt:SGBRG12_1X12/4096x2048 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range]
> 		-> "csi capture":0 [ENABLED,IMMUTABLE]
> 
> - entity 4: csi capture (1 pad, 1 link)
>             type Node subtype V4L flags 0
>             device node name /dev/video0
> 	pad0: Sink
> 		<- "csi":1 [ENABLED,IMMUTABLE]
> 
> - entity 10: csis-32e30000.mipi-csi (2 pads, 2 links)
>              type V4L2 subdev subtype Unknown flags 0
>              device node name /dev/v4l-subdev1
> 	pad0: Sink
> 		[fmt:SGBRG12_1X12/4096x2048 field:none]
> 		<- "imx492 1-0010":0 []
> 	pad1: Source
> 		[fmt:SGBRG12_1X12/4096x2048 field:none]
> 		-> "csi":0 [ENABLED,IMMUTABLE]
> 
> - entity 15: imx492 1-0010 (1 pad, 1 link)
>              type V4L2 subdev subtype Sensor flags 0
>              device node name /dev/v4l-subdev2
> 	pad0: Source
> 		[fmt:SGBRG12_1X12/4096x2048 field:none colorspace:raw xfer:none]
> 		-> "csis-32e30000.mipi-csi":0 []
> 


-- 
Regards,

Laurent Pinchart

  parent reply	other threads:[~2022-07-06 13:52 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-29  7:55 hooking Sony 47MPixel sensor to NXP imx8m-mini MIPI CSI2 Petko Manolov
2022-06-29  8:28 ` Laurent Pinchart
2022-06-29  8:45   ` Petko Manolov
2022-06-30  0:50     ` Laurent Pinchart
2022-06-30 18:52       ` Petko Manolov
2022-06-30 19:42         ` Laurent Pinchart
2022-07-05  9:43           ` Petko Manolov
2022-07-05 12:30             ` Petko Manolov
2022-07-05 14:42             ` Alexander Stein
2022-07-05 15:13               ` Petko Manolov
2022-07-06  6:18                 ` Alexander Stein
2022-07-06 13:07                   ` Petko Manolov
2022-07-06 13:12                     ` Alexander Stein
2022-07-06 13:51                     ` Laurent Pinchart [this message]
2022-07-06 19:26                       ` Petko Manolov
2022-07-06 20:07                         ` Petko Manolov
2022-07-06 21:48                           ` Laurent Pinchart
2022-07-07 12:20                             ` Petko Manolov
2022-07-06 21:47                         ` Laurent Pinchart
2022-07-07 12:17                           ` Petko Manolov
2022-07-07 21:47                             ` Laurent Pinchart

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=YsWTXnTpeM+mCImc@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=alexander.stein@ew.tq-group.com \
    --cc=jacopo@jmondi.org \
    --cc=linux-media@vger.kernel.org \
    --cc=petko.manolov@konsulko.com \
    /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