public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Alexander Stein <alexander.stein@ew.tq-group.com>
To: Tim Harvey <tharvey@gateworks.com>
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>,
	NXP Linux Team <linux-imx@nxp.com>,
	linux-media <linux-media@vger.kernel.org>,
	Linux ARM Mailing List <linux-arm-kernel@lists.infradead.org>,
	Fabio Estevam <festevam@gmail.com>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Rui Miguel Silva <rmfrfs@gmail.com>,
	Shawn Guo <shawnguo@kernel.org>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Schrempf Frieder <frieder.schrempf@kontron.de>
Subject: Re: media: imx: imx7-media-csi: Get rid of superfluous call to imx7_csi_mbus_fm t_to_pix_fmt
Date: Mon, 17 Jul 2023 11:57:26 +0200	[thread overview]
Message-ID: <2290635.ElGaqSPkdT@steina-w> (raw)
In-Reply-To: <CAJ+vNU0BOVLTL17ofgHwtexbpuMYwH_aGUC==EXABUtHHiv_ag@mail.gmail.com>

Hi Tim,

Am Freitag, 14. Juli 2023, 03:34:15 CEST schrieb Tim Harvey:
> Alexander,
> 
> I found that commit 6f482c4729d9: ("media: imx: imx7-media-csi: Get
> rid of superfluous call to imx7_csi_mbus_fmt_to_pix_fmt") introduced
> an issue causing me to not be able to capture anymore on an imx8mm
> with an imx219 camera.
> 
> I'm using a RaspberryPi Camera v2 which has an IMX219 8MP camera module:
> - https://datasheets.raspberrypi.com/camera/camera-v2-schematics.pdf
> - has its own on-board 24MHz osc so no clock required from baseboard
> - pin 11 enables 1.8V and 2.8V LDO which is connected to a GPIO I use
> as a regulator enable
> 
> I'm using the imx8mm-venice-gw72xx-0x-imx219 dt overlay [1] to test this.
> 
> Here is some additional information about how I'm using the camera module:
> # cat /sys/bus/media/devices/media*/model
> imx-media
> hantro-vpu
> hantro-vpu
> # cat /sys/class/video4linux/video*/name
> csi capture
> nxp,imx8mm-vpu-g1-dec
> nxp,imx8mq-vpu-g2-dec
> # enable imx219 to csi link
> media-ctl --reset
> media-ctl -l "'imx219 2-0010':0 -> 'csis-32e30000.mipi-csi':0 [1]"
> # configure for 640x480 raw8
> media-ctl -v -V "'imx219 2-0010':0 [fmt:SRGGB8/640x480 field:none]"
> media-ctl -v -V "'csis-32e30000.mipi-csi':0 [fmt:SRGGB8/640x480 field:none]"
> media-ctl -v -V "'csi':0 [fmt:SRGGB8/640x480 field:none]"
> # configure for RGGB (8-bit bayer), 640x480 resolution
> v4l2-ctl --device /dev/video0
> --set-fmt-video=width=640,height=480,pixelformat=RGGB --verbose
> 
> before commit 6f482c4729d9: ("media: imx: imx7-media-csi: Get rid of
> superfluous call to imx7_csi_mbus_fmt_to_pix_fmt") this would report
> back 640x480 resolution:
> VIDIOC_QUERYCAP: ok
> VIDIOC_G_FMT: ok
> VIDIOC_S_FMT: ok
> Format Video Capture:
>         Width/Height      : 640/480
>         Pixel Format      : 'RGGB' (8-bit Bayer RGRG/GBGB)
>         Field             : None
>         Bytes per Line    : 640
>         Size Image        : 307200
>         Colorspace        : Default
>         Transfer Function : Default (maps to Rec. 709)
>         YCbCr/HSV Encoding: Default (maps to ITU-R 601)
>         Quantization      : Default (maps to Full Range)
>         Flags             :
> 
> And after the commit it reports back an invalid 768x480 resolution:
> VIDIOC_QUERYCAP: ok
> VIDIOC_G_FMT: ok
> VIDIOC_S_FMT: ok
> Format Video Capture:
>         Width/Height      : 768/480
>         Pixel Format      : 'RGGB' (8-bit Bayer RGRG/GBGB)
>         Field             : None
>         Bytes per Line    : 768
>         Size Image        : 368640
>         Colorspace        : Default
>         Transfer Function : Default (maps to Rec. 709)
>         YCbCr/HSV Encoding: Default (maps to ITU-R 601)
>         Quantization      : Default (maps to Full Range)
>         Flags             :
> 
> This resolution and frame size mis-match causes issues for example
> when using gstreamer to capture and stream frames.

Oh, that's weird. Can you check what the call to v4l_bound_align_image() 
inside __imx7_csi_video_try_fmt() is actually doing? Check walign, width 
before and after the call. From a glance that seems to be the only way width 
could be modified.

> I noticed you have several outstanding patches pending for
> imx7-media-csi... perhaps there is something there you already know of
> that addresses this issue?

There nothing pending AFAICS. Everything has been integrated into linux-next 
at least.

Best regards,
Alexander

> best regards,
> 
> Tim
> [1]
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arc
> h/arm64/boot/dts/freescale/imx8mm-venice-gw72xx-0x-imx219.dtso


-- 
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
http://www.tq-group.com/



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

       reply	other threads:[~2023-07-17  9:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAJ+vNU0BOVLTL17ofgHwtexbpuMYwH_aGUC==EXABUtHHiv_ag@mail.gmail.com>
2023-07-17  9:57 ` Alexander Stein [this message]
2023-07-19 17:27   ` media: imx: imx7-media-csi: Get rid of superfluous call to imx7_csi_mbus_fm t_to_pix_fmt Tim Harvey
2023-07-20  6:49     ` Alexander Stein
2023-07-20 15:12       ` Tim Harvey
2023-07-20 15:52         ` Fabio Estevam
2023-07-20 16:04           ` Fabio Estevam
2023-07-20 18:47         ` Fabio Estevam
2023-07-20 19:09           ` Fabio Estevam

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=2290635.ElGaqSPkdT@steina-w \
    --to=alexander.stein@ew.tq-group.com \
    --cc=festevam@gmail.com \
    --cc=frieder.schrempf@kontron.de \
    --cc=kernel@pengutronix.de \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=rmfrfs@gmail.com \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=tharvey@gateworks.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