* [PATCH v4l-utils] v4l2-tracer: trace: serialize all mplane planes
@ 2026-02-25 12:00 yehudis9982
2026-02-26 19:22 ` Nicolas Dufresne
0 siblings, 1 reply; 4+ messages in thread
From: yehudis9982 @ 2026-02-25 12:00 UTC (permalink / raw)
To: linux-media; +Cc: yehudis9982
For V4L2_BUF_TYPE_*_MPLANE buffers, trace_v4l2_buffer() only serialized the first plane.
Serialize all planes by iterating over buf->length and appending each entry to m.planes in the JSON trace output.
Signed-off-by: yehudis9982 <y0533159982@gmail.com>
---
utils/v4l2-tracer/trace.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/utils/v4l2-tracer/trace.cpp b/utils/v4l2-tracer/trace.cpp
index 996fb043..8e9039ef 100644
--- a/utils/v4l2-tracer/trace.cpp
+++ b/utils/v4l2-tracer/trace.cpp
@@ -252,8 +252,8 @@ void trace_v4l2_buffer(void *arg, json_object *ioctl_args)
if (buf->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE ||
buf->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
json_object *planes_obj = json_object_new_array();
- /* TODO add planes > 0 */
- json_object_array_add(planes_obj, trace_v4l2_plane(buf->m.planes, buf->memory));
+ for (__u32 i = 0; i < buf->length; i++)
+ json_object_array_add(planes_obj, trace_v4l2_plane(&buf->m.planes[i], buf->memory));
json_object_object_add(m_obj, "planes", planes_obj);
}
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v4l-utils] v4l2-tracer: trace: serialize all mplane planes
2026-02-25 12:00 [PATCH v4l-utils] v4l2-tracer: trace: serialize all mplane planes yehudis9982
@ 2026-02-26 19:22 ` Nicolas Dufresne
2026-03-03 11:17 ` Yehudis Safern
0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Dufresne @ 2026-02-26 19:22 UTC (permalink / raw)
To: yehudis9982, linux-media
[-- Attachment #1: Type: text/plain, Size: 1313 bytes --]
Le mercredi 25 février 2026 à 14:00 +0200, yehudis9982 a écrit :
> For V4L2_BUF_TYPE_*_MPLANE buffers, trace_v4l2_buffer() only serialized the first plane.
> Serialize all planes by iterating over buf->length and appending each entry to m.planes in the JSON trace output.
>
> Signed-off-by: yehudis9982 <y0533159982@gmail.com>
> ---
> utils/v4l2-tracer/trace.cpp | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/utils/v4l2-tracer/trace.cpp b/utils/v4l2-tracer/trace.cpp
> index 996fb043..8e9039ef 100644
> --- a/utils/v4l2-tracer/trace.cpp
> +++ b/utils/v4l2-tracer/trace.cpp
> @@ -252,8 +252,8 @@ void trace_v4l2_buffer(void *arg, json_object *ioctl_args)
> if (buf->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE ||
> buf->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
> json_object *planes_obj = json_object_new_array();
> - /* TODO add planes > 0 */
> - json_object_array_add(planes_obj, trace_v4l2_plane(buf->m.planes, buf->memory));
> + for (__u32 i = 0; i < buf->length; i++)
> + json_object_array_add(planes_obj, trace_v4l2_plane(&buf->m.planes[i], buf->memory));
Have you verified that it works with the deserializer ? (retrace function).
Nicolas
> json_object_object_add(m_obj, "planes", planes_obj);
> }
>
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v4l-utils] v4l2-tracer: trace: serialize all mplane planes
2026-02-26 19:22 ` Nicolas Dufresne
@ 2026-03-03 11:17 ` Yehudis Safern
2026-03-06 14:45 ` Nicolas Dufresne
0 siblings, 1 reply; 4+ messages in thread
From: Yehudis Safern @ 2026-03-03 11:17 UTC (permalink / raw)
To: Nicolas Dufresne; +Cc: linux-media
בתאריך יום ה׳, 26 בפבר׳ 2026 ב-21:22 מאת Nicolas Dufresne
<nicolas@ndufresne.ca>:
>
> Le mercredi 25 février 2026 à 14:00 +0200, yehudis9982 a écrit :
> > For V4L2_BUF_TYPE_*_MPLANE buffers, trace_v4l2_buffer() only serialized the first plane.
> > Serialize all planes by iterating over buf->length and appending each entry to m.planes in the JSON trace output.
> >
> > Signed-off-by: yehudis9982 <y0533159982@gmail.com>
> > ---
> > utils/v4l2-tracer/trace.cpp | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/utils/v4l2-tracer/trace.cpp b/utils/v4l2-tracer/trace.cpp
> > index 996fb043..8e9039ef 100644
> > --- a/utils/v4l2-tracer/trace.cpp
> > +++ b/utils/v4l2-tracer/trace.cpp
> > @@ -252,8 +252,8 @@ void trace_v4l2_buffer(void *arg, json_object *ioctl_args)
> > if (buf->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE ||
> > buf->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
> > json_object *planes_obj = json_object_new_array();
> > - /* TODO add planes > 0 */
> > - json_object_array_add(planes_obj, trace_v4l2_plane(buf->m.planes, buf->memory));
> > + for (__u32 i = 0; i < buf->length; i++)
> > + json_object_array_add(planes_obj, trace_v4l2_plane(&buf->m.planes[i], buf->memory));
>
> Have you verified that it works with the deserializer ? (retrace function).
>
> Nicolas
The current retrace implementation follows a different execution path
and currently handles a single plane only.
This change updates the tracing (serialization) side to correctly
serialize all planes for multi-planar buffers. Retrace support for
multiple planes will be addressed in a separate follow-up patch to
extend the deserialization logic accordingly.
>
> > json_object_object_add(m_obj, "planes", planes_obj);
> > }
> >
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v4l-utils] v4l2-tracer: trace: serialize all mplane planes
2026-03-03 11:17 ` Yehudis Safern
@ 2026-03-06 14:45 ` Nicolas Dufresne
0 siblings, 0 replies; 4+ messages in thread
From: Nicolas Dufresne @ 2026-03-06 14:45 UTC (permalink / raw)
To: Yehudis Safern; +Cc: linux-media
[-- Attachment #1: Type: text/plain, Size: 2356 bytes --]
Le mardi 03 mars 2026 à 13:17 +0200, Yehudis Safern a écrit :
> בתאריך יום ה׳, 26 בפבר׳ 2026 ב-21:22 מאת Nicolas Dufresne
> <nicolas@ndufresne.ca>:
> >
> > Le mercredi 25 février 2026 à 14:00 +0200, yehudis9982 a écrit :
> > > For V4L2_BUF_TYPE_*_MPLANE buffers, trace_v4l2_buffer() only serialized the first plane.
> > > Serialize all planes by iterating over buf->length and appending each entry to m.planes in the JSON trace output.
> > >
> > > Signed-off-by: yehudis9982 <y0533159982@gmail.com>
nit: I'd expect "Yehudis Safern <y0533159982@gmail.com>" here instead.
> > > ---
> > > utils/v4l2-tracer/trace.cpp | 4 ++--
> > > 1 file changed, 2 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/utils/v4l2-tracer/trace.cpp b/utils/v4l2-tracer/trace.cpp
> > > index 996fb043..8e9039ef 100644
> > > --- a/utils/v4l2-tracer/trace.cpp
> > > +++ b/utils/v4l2-tracer/trace.cpp
> > > @@ -252,8 +252,8 @@ void trace_v4l2_buffer(void *arg, json_object *ioctl_args)
> > > if (buf->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE ||
> > > buf->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
> > > json_object *planes_obj = json_object_new_array();
> > > - /* TODO add planes > 0 */
> > > - json_object_array_add(planes_obj, trace_v4l2_plane(buf->m.planes, buf->memory));
> > > + for (__u32 i = 0; i < buf->length; i++)
> > > + json_object_array_add(planes_obj, trace_v4l2_plane(&buf->m.planes[i], buf->memory));
> >
> > Have you verified that it works with the deserializer ? (retrace function).
> >
> > Nicolas
>
> The current retrace implementation follows a different execution path
> and currently handles a single plane only.
>
> This change updates the tracing (serialization) side to correctly
> serialize all planes for multi-planar buffers. Retrace support for
> multiple planes will be addressed in a separate follow-up patch to
> extend the deserialization logic accordingly.
>
> >
> > > json_object_object_add(m_obj, "planes", planes_obj);
> > > }
> > >
Acked-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
cheers,
Nicolas
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-03-06 14:45 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-25 12:00 [PATCH v4l-utils] v4l2-tracer: trace: serialize all mplane planes yehudis9982
2026-02-26 19:22 ` Nicolas Dufresne
2026-03-03 11:17 ` Yehudis Safern
2026-03-06 14:45 ` Nicolas Dufresne
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox