From: Eugen Hristev <ehristev@kernel.org>
To: Jean-Michel Hautbois <jeanmichel.hautbois@yoseli.org>,
Raspberry Pi Kernel Maintenance <kernel-list@raspberrypi.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Florian Fainelli <florian.fainelli@broadcom.com>,
Ray Jui <rjui@broadcom.com>,
Scott Branden <sbranden@broadcom.com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@broadcom.com>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Dave Stevenson <dave.stevenson@raspberrypi.com>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Naushir Patuck <naush@raspberrypi.com>
Cc: Hans Verkuil <hverkuil@kernel.org>,
linux-media@vger.kernel.org,
linux-rpi-kernel@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: {Spam?} Re: [PATCH] media: bcm2835-unicam: Fix querycap multiple caps
Date: Thu, 11 Jun 2026 20:19:21 +0300 [thread overview]
Message-ID: <104fd807-e041-4458-9e3e-b9dedd77361c@kernel.org> (raw)
In-Reply-To: <b549ea8a-76cc-4a7a-bab6-710fddeaeebd@yoseli.org>
On 6/11/26 09:51, Jean-Michel Hautbois wrote:
> Hi Eugen,
>
> Thank you for the patch.
>
> Two issues with this one, I'm afraid.
>
> Le 11/06/2026 à 08:09, Eugen Hristev a écrit :
>> The unicam exposes two video nodes, one for image, another for metadata.
>> Querycap should return the right caps for the respective node, not both.
>>
>> video0:
>>
>> Capabilities : 0xa4200001
>> Video Capture
>> I/O MC
>> Streaming
>> Extended Pix Format
>> Device Capabilities
>> Device Caps : 0x24200001
>> Video Capture
>> I/O MC
>> Streaming
>> Extended Pix Format
>>
>> video1:
>>
>> Capabilities : 0xa4a00000
>> Metadata Capture
>> I/O MC
>> Streaming
>> Extended Pix Format
>> Device Capabilities
>> Device Caps : 0x24a00000
>> Metadata Capture
>> I/O MC
>> Streaming
>> Extended Pix Format
>>
>> Fixes: 392cd78d495f ("media: bcm2835-unicam: Add support for CCP2/CSI2 camera interface")
>> Signed-off-by: Eugen Hristev <ehristev@kernel.org>
>> ---
>> drivers/media/platform/broadcom/bcm2835-unicam.c | 5 ++++-
>> 1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/media/platform/broadcom/bcm2835-unicam.c b/drivers/media/platform/broadcom/bcm2835-unicam.c
>> index 8d28ba0b59a3..4bf36ce80047 100644
>> --- a/drivers/media/platform/broadcom/bcm2835-unicam.c
>> +++ b/drivers/media/platform/broadcom/bcm2835-unicam.c
>> @@ -1833,7 +1833,10 @@ static int unicam_querycap(struct file *file, void *priv,
>> strscpy(cap->driver, UNICAM_MODULE_NAME, sizeof(cap->driver));
>> strscpy(cap->card, UNICAM_MODULE_NAME, sizeof(cap->card));
>>
>> - cap->capabilities |= V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_META_CAPTURE;
>> + if (is_image_node(node))
>
> First, it does not compile, as node is not declared here.
> 'struct unicam_node *node = video_drvdata(file);' would be needed.
Sorry, my brain must have been sleeping
>
>> + cap->capabilities |= V4L2_CAP_VIDEO_CAPTURE;
>> + else
>> + cap->capabilities |= V4L2_CAP_META_CAPTURE;
>>
>> return 0;
>> }
>>
>
> Second, and more important, I don't think the current behaviour is a bug.
> Documentation/userspace-api/media/v4l/vidioc-querycap.rst states about
> the 'capabilities' field:
>
> "The capabilities field should contain a union of all capabilities
> available around the several V4L2 devices exported to userspace.
> For all those devices the capabilities field returns the same set of
> capabilities."
>
> Per-node differentiation is the job of 'device_caps', which unicam
> already sets correctly when registering each video device (your
> v4l2-ctl output shows the Device Caps are already right).
>
> So this looks like working as intended to me, and the patch should be
> dropped.
Thanks for taking the time to explain.
Let's drop the patch.
Eugen
>
> Thanks,
> JM
>
>> ---
>> base-commit: a87737435cfa134f9cdcc696ba3080759d04cf72
>> change-id: 20260611-bcmpiqcap-f893a9ea2da9
>>
>> Best regards,
>> --
>> Eugen Hristev <ehristev@kernel.org>
>>
>
prev parent reply other threads:[~2026-06-11 17:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-11 6:09 [PATCH] media: bcm2835-unicam: Fix querycap multiple caps Eugen Hristev
2026-06-11 6:51 ` Jean-Michel Hautbois
2026-06-11 17:19 ` Eugen Hristev [this message]
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=104fd807-e041-4458-9e3e-b9dedd77361c@kernel.org \
--to=ehristev@kernel.org \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=dave.stevenson@raspberrypi.com \
--cc=florian.fainelli@broadcom.com \
--cc=hverkuil@kernel.org \
--cc=jeanmichel.hautbois@yoseli.org \
--cc=kernel-list@raspberrypi.com \
--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-rpi-kernel@lists.infradead.org \
--cc=mchehab@kernel.org \
--cc=naush@raspberrypi.com \
--cc=rjui@broadcom.com \
--cc=sakari.ailus@linux.intel.com \
--cc=sbranden@broadcom.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