From: Charvi Mehta <charvi.mehta@arm.com>
To: Nicolas Dufresne <nicolas@ndufresne.ca>,
linux-media@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Philipp Zabel <p.zabel@pengutronix.de>,
Vincenzo Frascino <vincenzo.frascino@arm.com>,
Rathinavel Sankaralingam <rath.sankaralingam@arm.com>,
Shobhit Pandey <shobhit.pandey@arm.com>
Subject: Re: [RFC PATCH 08/28] media: mali-vpu: register V76 decoder controls and introduce UAPI controls
Date: Tue, 24 Nov 2026 16:27:36 +0000 [thread overview]
Message-ID: <39619b6c-7330-459b-aed3-9e8bf303f7dc@arm.com> (raw)
In-Reply-To: <0cb2cae4075d3854ebb9c051d169ca121a8a360d.camel@ndufresne.ca>
On 11/19/26 21:06, Nicolas Dufresne wrote:
>> Add Mali VPU userspace controls for NALU layout, stream escaping,
>> intermediate buffer size, stream-header handling, frame reordering and
>> firmware debug output. Also expose the standard read-only
>> V4L2_CID_MIN_BUFFERS_FOR_CAPTURE control.
> I would strongly recommend to keep each vendor control in its own patch. These
> are API, and they need documentation. In practice, you'll prefer to not
> introduce vendor control as a first introduction of your driver, its just a bad
> idea. You completely missed Documentation/
I had planned to add the documentation for these subsequently, but, I agree,
it should accompany the controls. The initial driver series may not be
the right
place for these vendor controls, so I’ll remove them and their UAPI
definitions
from this patchset.
>> + .cid = V4L2_CID_MALI_VPU_NALU_FORMAT,
>> + .type = V4L2_CTRL_TYPE_MENU,
>> + .name = "NALU format",
>> + .qmenu = mali_v76_nalu_format_qmenu,
>> + .min_val = MALI_VPU_NALU_FORMAT_START_CODES,
>> + .max_val = MALI_VPU_NALU_FORMAT_FOUR_BYTE_LENGTH_FIELD,
>> + .default_val = MALI_VPU_NALU_FORMAT_START_CODES,
>> + .step_or_mask = BIT(MALI_VPU_NALU_FORMAT_START_CODES) |
>> + BIT(MALI_VPU_NALU_FORMAT_ONE_NALU_PER_BUFFER) |
>> + BIT(MALI_VPU_NALU_FORMAT_ONE_BYTE_LENGTH_FIELD) |
>> + BIT(MALI_VPU_NALU_FORMAT_TWO_BYTE_LENGTH_FIELD) |
>> + BIT(MALI_VPU_NALU_FORMAT_FOUR_BYTE_LENGTH_FIELD),
> This mixes alignment and NAL format. Its historical, but the format is bound to
> V4L2_PIX_FMT_H264 and is documented as Annex B. If you want to add something
> such as AVCc formata instead, you'd need a new pixel format. There is
> V4L2_PIX_FMT_H264_SC, but its hill define, nobody knows what it was originally
> suppose to do. Venus (Qualcomm) maps it as if it was the same, perhaps they have
> a clue, but I would stay away.
>
> For the alignment, V4L2_CID_MPEG_VIDEO_HEADER_MODE does not cover your 1 buffer
> per nalue case, it only does the split header like OMX IL was doing (sometimes,
> interoperanility killed OMX).
The firmware defaults to Annex B, which matches V4L2_PIX_FMT_H264, so
this control is not needed for that input format. I'll drop this completely.
>> + .cid = V4L2_CID_MALI_VPU_INTBUF_SIZE,
>> + .type = V4L2_CTRL_TYPE_INTEGER,
>> + .name = "Internal buffer size",
> No general equivalent, and to be fair, that seems like something the driver
> should get correctly by itself, I'd say drop.
The firmware already calculates the intermediate working-buffer size when
no override is supplied. I’ll remove this control completely.
>> + },
>> + {
>> + .cid = V4L2_CID_MALI_VPU_STREAM_ESCAPING,
> No doc, I suppose it was about emulation bytes. Nobody needs that drop.
Yes, this controls emulation-prevention byte handling.
Agreed that this can be dropped.
>> + {
>> + .cid = V4L2_CID_MALI_VPU_HOST_PRINT_ENABLE,
> Debugging goes into sysfs or debugfs, drop.
Ack. I’ll use an appropriate interface as suggested when I reintroduce this.
>> + },
>> + {
>> + .cid = V4L2_CID_MALI_VPU_IGNORE_STREAM_HEADERS,
> If userspace want that, it can just strip the headers itself. Its not like a
> stateful decoder can work without headers according to the spec. It will always
> break one way or another.
This does not skip the initial headers; it retains existing SPS/PPS
entries rather
than accepting replacements with the same ID. It was intended to prevent
a heavily
corrupted stream from replacing valid settings, but it would also ignore
legitimate
changes. Agreed to drop it.
>> + },
>> + {
>> + .cid = V4L2_CID_MALI_VPU_FRAME_REORDERING,
> You can thank Samsung, instead you need
> V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY_ENABLE and add support for
> V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY 0. That will effectively disable
> reordering. Some vendors calls this the thumbnail mode to add to the fun.
Agreed, I’ll drop the vendor control. I’ll use the suggested standard
controls with a
delay of zero, when I reintroduce this in subsequent patches.
>> +/*
>> + * The base for Arm Mali-VPU driver controls.
>> + * We reserve 64 controls for this driver.
>> + */
>> +#define V4L2_CID_USER_MALI_VPU_BASE (V4L2_CID_USER_BASE + 0x1260)
>> +
>> /* MPEG-class control IDs */
>> /* The MPEG controls are applicable to all codec controls
>> * and the 'MPEG' part of the define is historical */
> My recommendation, drop all the vendor controls, legacy users can use your
> downstream kernels.
I’ll drop the vendor controls from this series.
Regards,
Charvi
next prev parent reply other threads:[~2026-11-24 16:27 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 15:37 [RFC PATCH 00/28] media: add arm Mali-V76 video decoder driver Charvi Mehta
2026-11-19 15:37 ` [RFC PATCH 01/28] dt-bindings: media: add Arm Mali-V76 VPU Charvi Mehta
2026-11-19 15:37 ` [RFC PATCH 02/28] media: mali-vpu: add Mali VPU platform driver Charvi Mehta
2026-11-19 20:04 ` Nicolas Dufresne
2026-11-24 9:56 ` Charvi Mehta
2026-11-20 11:48 ` Uwe Kleine-König
2026-11-24 10:17 ` Charvi Mehta
2026-11-24 13:15 ` Uwe Kleine-König
2026-11-19 15:37 ` [RFC PATCH 03/28] media: mali-vpu: register V4L2 decoder device and add querycap ioctl Charvi Mehta
2026-11-19 20:10 ` Nicolas Dufresne
2026-11-24 10:29 ` Charvi Mehta
2026-11-19 15:37 ` [RFC PATCH 04/28] media: mali-vpu: initialize decoder format state Charvi Mehta
2026-11-19 20:30 ` Nicolas Dufresne
2026-11-24 14:56 ` Charvi Mehta
2026-11-19 15:37 ` [RFC PATCH 05/28] media: mali-vpu: add V4L2 mem2mem and VB2 queue support Charvi Mehta
2026-11-19 15:37 ` [RFC PATCH 06/28] media: mali-vpu: implement format query ioctls Charvi Mehta
2026-11-19 15:37 ` [RFC PATCH 07/28] media: mali-vpu: implement TRY_FMT and S_FMT ioctls Charvi Mehta
2026-11-19 15:55 ` sashiko-bot
2026-11-19 20:44 ` Nicolas Dufresne
2026-11-23 17:26 ` Charvi Mehta
2026-11-19 15:37 ` [RFC PATCH 08/28] media: mali-vpu: register V76 decoder controls and introduce UAPI controls Charvi Mehta
2026-11-19 21:06 ` Nicolas Dufresne
2026-11-24 16:27 ` Charvi Mehta [this message]
2026-11-19 15:37 ` [RFC PATCH 09/28] media: mali-vpu: add MMU software page table manager Charvi Mehta
2026-11-19 15:59 ` sashiko-bot
2026-11-19 15:37 ` [RFC PATCH 10/28] media: mali-vpu: add firmware cache infrastructure Charvi Mehta
2026-11-19 15:50 ` sashiko-bot
2026-11-19 21:34 ` Nicolas Dufresne
2026-11-19 15:37 ` [RFC PATCH 11/28] media: mali-vpu: load firmware for decoder sessions Charvi Mehta
2026-11-19 15:37 ` [RFC PATCH 12/28] media: mali-vpu: prepare firmware address space Charvi Mehta
2026-11-19 15:57 ` sashiko-bot
2026-11-19 15:37 ` [RFC PATCH 13/28] media: mali-vpu: add firmware message transport Charvi Mehta
2026-11-19 15:37 ` [RFC PATCH 14/28] media: mali-vpu: route decoder controls to firmware Charvi Mehta
2026-11-19 15:37 ` [RFC PATCH 15/28] media: mali-vpu: handle firmware RPC requests Charvi Mehta
2026-11-19 15:51 ` sashiko-bot
2026-11-19 15:37 ` [RFC PATCH 16/28] media: mali-vpu: add LSID hardware support Charvi Mehta
2026-11-19 15:37 ` [RFC PATCH 17/28] media: mali-vpu: add single session scheduler Charvi Mehta
2026-11-19 15:37 ` [RFC PATCH 18/28] media: mali-vpu: handle firmware interrupts Charvi Mehta
2026-11-19 15:37 ` [RFC PATCH 19/28] media: mali-vpu: start decoder firmware through LSID scheduling Charvi Mehta
2026-11-19 16:03 ` sashiko-bot
2026-11-19 15:37 ` [RFC PATCH 20/28] media: mali-vpu: implement vb2 buffer queue handling Charvi Mehta
2026-11-19 16:06 ` sashiko-bot
2026-11-19 15:37 ` [RFC PATCH 21/28] media: mali-vpu: handle firmware buffer exchange Charvi Mehta
2026-11-19 15:58 ` sashiko-bot
2026-11-19 15:37 ` [RFC PATCH 22/28] media: mali-vpu: handle fatal firmware error Charvi Mehta
2026-11-19 16:07 ` sashiko-bot
2026-11-19 15:37 ` [RFC PATCH 23/28] media: mali-vpu: propagate buffer metadata Charvi Mehta
2026-11-19 15:37 ` [RFC PATCH 24/28] media: mali-vpu: add decoder EOS and DRC handling Charvi Mehta
2026-11-19 16:18 ` sashiko-bot
2026-11-19 15:37 ` [RFC PATCH 25/28] media: mali-vpu: handle firmware buffer parameters Charvi Mehta
2026-11-19 15:37 ` [RFC PATCH 26/28] media: mali-vpu: handle firmware event responses Charvi Mehta
2026-11-19 15:37 ` [RFC PATCH 27/28] media: mali-vpu: add stateful decoder state machine Charvi Mehta
2026-11-19 16:10 ` sashiko-bot
2026-11-19 15:37 ` [RFC PATCH 28/28] media: MAINTAINERS: add Arm Mali-V76 VPU driver Charvi Mehta
2026-11-19 19:44 ` [RFC PATCH 00/28] media: add arm Mali-V76 video decoder driver Nicolas Dufresne
2026-11-23 15:57 ` Charvi Mehta
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=39619b6c-7330-459b-aed3-9e8bf303f7dc@arm.com \
--to=charvi.mehta@arm.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=nicolas@ndufresne.ca \
--cc=p.zabel@pengutronix.de \
--cc=rath.sankaralingam@arm.com \
--cc=robh@kernel.org \
--cc=shobhit.pandey@arm.com \
--cc=vincenzo.frascino@arm.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