mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michael Riesch <michael.riesch@collabora.com>
To: Mehdi Djait <mehdi.djait@linux.intel.com>
Cc: "Maxime Chevallier" <maxime.chevallier@bootlin.com>,
	"Théo Lebrun" <theo.lebrun@bootlin.com>,
	"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	"Gerald Loacker" <gerald.loacker@wolfvision.net>,
	"Bryan O'Donoghue" <bryan.odonoghue@linaro.org>,
	"Markus Elfring" <Markus.Elfring@web.de>,
	"Laurent Pinchart" <laurent.pinchart@ideasonboard.com>,
	"Mauro Carvalho Chehab" <mchehab@kernel.org>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Heiko Stuebner" <heiko@sntech.de>,
	"Kever Yang" <kever.yang@rock-chips.com>,
	"Nicolas Dufresne" <nicolas.dufresne@collabora.com>,
	"Sebastian Reichel" <sebastian.reichel@collabora.com>,
	"Collabora Kernel Team" <kernel@collabora.com>,
	"Paul Kocialkowski" <paulk@sys-base.io>,
	"Alexander Shiyan" <eagle.alexander923@gmail.com>,
	"Val Packett" <val@packett.cool>, "Rob Herring" <robh@kernel.org>,
	"Philipp Zabel" <p.zabel@pengutronix.de>,
	"Sakari Ailus" <sakari.ailus@linux.intel.com>,
	linux-media@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org,
	"Mehdi Djait" <mehdi.djait@bootlin.com>
Subject: Re: [PATCH v8 06/13] media: rockchip: add a driver for the rockchip camera interface
Date: Wed, 18 Jun 2025 14:21:51 +0200	[thread overview]
Message-ID: <5d3418a3-70f5-46d8-a538-72e6958d5d02@collabora.com> (raw)
In-Reply-To: <656zxutvwytnd5i5l3nknni47r3wofmmwtxycleekjtrkbgfeo@xm7xbzirh3ce>

Hi Mehdi,

On 6/13/25 14:33, Mehdi Djait wrote:
> Hi Michael,
> 
> [...]

Let's cut the long story short, shall we :-)

>> +static void rkcif_stream_fill_format(struct rkcif_stream *stream,
>> +				     struct v4l2_pix_format_mplane *pix)
>> +{
>> +	const struct rkcif_output_fmt *fmt;
>> +	u32 height, width;
>> +
>> +	fmt = rkcif_stream_find_output_fmt(stream, true, pix->pixelformat);
>> +	height = clamp_t(u32, pix->height, CIF_MIN_HEIGHT, CIF_MAX_HEIGHT);
>> +	width = clamp_t(u32, pix->width, CIF_MIN_WIDTH, CIF_MAX_WIDTH);
>> +	v4l2_fill_pixfmt_mp(pix, fmt->fourcc, width, height);
> 
> The rkcif supports the SRGGB10P: the packed version of the SRGGB10.
> 
> When you try to capture with SRGGB10P, the following fails in
> v4l2_fill_pixfmt_mp()
> 
> 	info = v4l2_format_info(pixelformat);
> 	if (!info)
> 		return -EINVAL;
> 
> The return value is not checked in rkcif_stream_fill_format() resulting
> in a call to queue_setup returning with sizes[0] = 0

Thanks for pointing that out. I failed to realize that this helper
function may return an error. What I can do is to implement the error
propagation correctly. Of course this will only avoid the kernel
warning, you still won't be able to stream.

> This will cause a kernel Warning in the vb2_core_reqbufs() because
> plane_size = 0
> 
> Exactly here:
> 
> 	for (i = 0; i < num_planes; i++)
> 		if (WARN_ON(!plane_sizes[i])) {
> 			ret = -EINVAL;
> 			goto error;
> 		}
> 
> I still don't have the solution here but wanted to let you know about
> it.

I only had a quick look at it, but apparently the compact formats are
missing in the format list here:
https://elixir.bootlin.com/linux/v6.16-rc2/source/drivers/media/v4l2-core/v4l2-common.c#L244
for whatever reason.

Have you by chance tried adding a line like
{
	.format = V4L2_PIX_FMT_SRGGB10P,
	.pixel_enc = V4L2_PIXEL_ENC_BAYER,
	.mem_planes = 1,
	.comp_planes = 1,
	.bpp = { 5, 0, 0, 0 },
	.bpp_div = { 4, 1, 1, 1 },
	.hdiv = 1,
	.vdiv = 1,
}
?


Maybe we can fix this, but please note that this issue should not block
merging this patch series.

Best regards,
Michael

  reply	other threads:[~2025-06-18 12:21 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-11 17:06 [PATCH v8 00/13] " Michael Riesch via B4 Relay
2025-06-11 17:06 ` [PATCH v8 01/13] Documentation: admin-guide: media: add " Michael Riesch via B4 Relay
2025-06-11 17:06 ` [PATCH v8 02/13] media: dt-bindings: video-interfaces: add defines for sampling modes Michael Riesch via B4 Relay
2025-06-11 17:06 ` [PATCH v8 03/13] media: dt-bindings: add rockchip px30 vip Michael Riesch via B4 Relay
2025-06-11 17:06 ` [PATCH v8 04/13] media: dt-bindings: add rockchip rk3568 vicap Michael Riesch via B4 Relay
2025-06-11 17:06 ` [PATCH v8 05/13] media: dt-bindings: add rockchip rk3568 mipi csi-2 receiver Michael Riesch via B4 Relay
2025-06-11 17:06 ` [PATCH v8 06/13] media: rockchip: add a driver for the rockchip camera interface Michael Riesch via B4 Relay
2025-06-13 12:33   ` Mehdi Djait
2025-06-18 12:21     ` Michael Riesch [this message]
2025-06-20  8:22       ` Mehdi Djait
2025-06-11 17:06 ` [PATCH v8 07/13] media: rockchip: add driver for mipi csi-2 receiver Michael Riesch via B4 Relay
2025-06-20 11:34   ` Bryan O'Donoghue
2025-06-11 17:06 ` [PATCH v8 08/13] media: rockchip: rkcif: add support for mipi csi-2 capture Michael Riesch via B4 Relay
2025-06-11 17:06 ` [PATCH v8 09/13] arm64: defconfig: enable rockchip camera interface and mipi csi-2 receiver Michael Riesch via B4 Relay
2025-06-11 17:06 ` [PATCH v8 10/13] arm64: dts: rockchip: add the vip node to px30 Michael Riesch via B4 Relay
2025-06-11 17:06 ` [PATCH v8 11/13] arm64: dts: rockchip: add vicap node to rk356x Michael Riesch via B4 Relay
2025-06-11 17:06 ` [PATCH v8 12/13] arm64: dts: rockchip: add mipi csi-2 receiver " Michael Riesch via B4 Relay
2025-06-11 17:06 ` [PATCH v8 13/13] arm64: dts: rockchip: enable vicap dvp on wolfvision pf5 io expander Michael Riesch via B4 Relay

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=5d3418a3-70f5-46d8-a538-72e6958d5d02@collabora.com \
    --to=michael.riesch@collabora.com \
    --cc=Markus.Elfring@web.de \
    --cc=bryan.odonoghue@linaro.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=eagle.alexander923@gmail.com \
    --cc=gerald.loacker@wolfvision.net \
    --cc=heiko@sntech.de \
    --cc=kernel@collabora.com \
    --cc=kever.yang@rock-chips.com \
    --cc=krzk+dt@kernel.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --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=maxime.chevallier@bootlin.com \
    --cc=mchehab@kernel.org \
    --cc=mehdi.djait@bootlin.com \
    --cc=mehdi.djait@linux.intel.com \
    --cc=nicolas.dufresne@collabora.com \
    --cc=p.zabel@pengutronix.de \
    --cc=paulk@sys-base.io \
    --cc=robh+dt@kernel.org \
    --cc=robh@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=sebastian.reichel@collabora.com \
    --cc=theo.lebrun@bootlin.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=val@packett.cool \
    /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

all inboxes | Powered by JetHome®