* [PATCH v2 0/4] Minor V4L2 Headers and Codec Doc Cleanups
@ 2025-08-24 18:07 Paul Kocialkowski
2025-08-24 18:07 ` [PATCH v2 1/4] media: uapi: Move colorimetry controls at the end of the file Paul Kocialkowski
` (4 more replies)
0 siblings, 5 replies; 12+ messages in thread
From: Paul Kocialkowski @ 2025-08-24 18:07 UTC (permalink / raw)
To: linux-media, linux-kernel
Cc: Mauro Carvalho Chehab, Hans Verkuil, Laurent Pinchart,
Nicolas Dufresne, Paul Kocialkowski
Changes since v1:
- Added minor codec control cleanups;
- Added documentation about h.264 frame-wide type flags
Paul Kocialkowski (4):
media: uapi: Move colorimetry controls at the end of the file
media: uapi: Cleanup tab after define in headers
media: uapi: v4l2-controls: Cleanup codec definitions
Documentation: media: Document
V4L2_H264_DECODE_PARAM_FLAG_PFRAME/BFRAME
.../media/v4l/ext-ctrls-codec-stateless.rst | 8 +-
include/uapi/linux/v4l2-controls.h | 121 +++++++++---------
include/uapi/linux/videodev2.h | 18 +--
3 files changed, 75 insertions(+), 72 deletions(-)
--
2.50.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v2 1/4] media: uapi: Move colorimetry controls at the end of the file
2025-08-24 18:07 [PATCH v2 0/4] Minor V4L2 Headers and Codec Doc Cleanups Paul Kocialkowski
@ 2025-08-24 18:07 ` Paul Kocialkowski
2025-08-28 18:45 ` Nicolas Dufresne
2025-08-24 18:07 ` [PATCH v2 2/4] media: uapi: Cleanup tab after define in headers Paul Kocialkowski
` (3 subsequent siblings)
4 siblings, 1 reply; 12+ messages in thread
From: Paul Kocialkowski @ 2025-08-24 18:07 UTC (permalink / raw)
To: linux-media, linux-kernel
Cc: Mauro Carvalho Chehab, Hans Verkuil, Laurent Pinchart,
Nicolas Dufresne, Paul Kocialkowski
The colorimetry controls class is defined after the stateless codec
class at the top of the controls header. It is currently defined in
the middle of stateless codec controls.
Move the colorimetry controls after the stateless codec controls,
at the end of the file.
Signed-off-by: Paul Kocialkowski <paulk@sys-base.io>
---
include/uapi/linux/v4l2-controls.h | 68 +++++++++++++++---------------
1 file changed, 34 insertions(+), 34 deletions(-)
diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h
index f836512e9deb..4a483ff1c418 100644
--- a/include/uapi/linux/v4l2-controls.h
+++ b/include/uapi/linux/v4l2-controls.h
@@ -2549,40 +2549,6 @@ struct v4l2_ctrl_hevc_scaling_matrix {
__u8 scaling_list_dc_coef_32x32[2];
};
-#define V4L2_CID_COLORIMETRY_CLASS_BASE (V4L2_CTRL_CLASS_COLORIMETRY | 0x900)
-#define V4L2_CID_COLORIMETRY_CLASS (V4L2_CTRL_CLASS_COLORIMETRY | 1)
-
-#define V4L2_CID_COLORIMETRY_HDR10_CLL_INFO (V4L2_CID_COLORIMETRY_CLASS_BASE + 0)
-
-struct v4l2_ctrl_hdr10_cll_info {
- __u16 max_content_light_level;
- __u16 max_pic_average_light_level;
-};
-
-#define V4L2_CID_COLORIMETRY_HDR10_MASTERING_DISPLAY (V4L2_CID_COLORIMETRY_CLASS_BASE + 1)
-
-#define V4L2_HDR10_MASTERING_PRIMARIES_X_LOW 5
-#define V4L2_HDR10_MASTERING_PRIMARIES_X_HIGH 37000
-#define V4L2_HDR10_MASTERING_PRIMARIES_Y_LOW 5
-#define V4L2_HDR10_MASTERING_PRIMARIES_Y_HIGH 42000
-#define V4L2_HDR10_MASTERING_WHITE_POINT_X_LOW 5
-#define V4L2_HDR10_MASTERING_WHITE_POINT_X_HIGH 37000
-#define V4L2_HDR10_MASTERING_WHITE_POINT_Y_LOW 5
-#define V4L2_HDR10_MASTERING_WHITE_POINT_Y_HIGH 42000
-#define V4L2_HDR10_MASTERING_MAX_LUMA_LOW 50000
-#define V4L2_HDR10_MASTERING_MAX_LUMA_HIGH 100000000
-#define V4L2_HDR10_MASTERING_MIN_LUMA_LOW 1
-#define V4L2_HDR10_MASTERING_MIN_LUMA_HIGH 50000
-
-struct v4l2_ctrl_hdr10_mastering_display {
- __u16 display_primaries_x[3];
- __u16 display_primaries_y[3];
- __u16 white_point_x;
- __u16 white_point_y;
- __u32 max_display_mastering_luminance;
- __u32 min_display_mastering_luminance;
-};
-
/* Stateless VP9 controls */
#define V4L2_VP9_LOOP_FILTER_FLAG_DELTA_ENABLED 0x1
@@ -3515,4 +3481,38 @@ struct v4l2_ctrl_av1_film_grain {
#define V4L2_CID_MPEG_MFC51_BASE V4L2_CID_CODEC_MFC51_BASE
#endif
+#define V4L2_CID_COLORIMETRY_CLASS_BASE (V4L2_CTRL_CLASS_COLORIMETRY | 0x900)
+#define V4L2_CID_COLORIMETRY_CLASS (V4L2_CTRL_CLASS_COLORIMETRY | 1)
+
+#define V4L2_CID_COLORIMETRY_HDR10_CLL_INFO (V4L2_CID_COLORIMETRY_CLASS_BASE + 0)
+
+struct v4l2_ctrl_hdr10_cll_info {
+ __u16 max_content_light_level;
+ __u16 max_pic_average_light_level;
+};
+
+#define V4L2_CID_COLORIMETRY_HDR10_MASTERING_DISPLAY (V4L2_CID_COLORIMETRY_CLASS_BASE + 1)
+
+#define V4L2_HDR10_MASTERING_PRIMARIES_X_LOW 5
+#define V4L2_HDR10_MASTERING_PRIMARIES_X_HIGH 37000
+#define V4L2_HDR10_MASTERING_PRIMARIES_Y_LOW 5
+#define V4L2_HDR10_MASTERING_PRIMARIES_Y_HIGH 42000
+#define V4L2_HDR10_MASTERING_WHITE_POINT_X_LOW 5
+#define V4L2_HDR10_MASTERING_WHITE_POINT_X_HIGH 37000
+#define V4L2_HDR10_MASTERING_WHITE_POINT_Y_LOW 5
+#define V4L2_HDR10_MASTERING_WHITE_POINT_Y_HIGH 42000
+#define V4L2_HDR10_MASTERING_MAX_LUMA_LOW 50000
+#define V4L2_HDR10_MASTERING_MAX_LUMA_HIGH 100000000
+#define V4L2_HDR10_MASTERING_MIN_LUMA_LOW 1
+#define V4L2_HDR10_MASTERING_MIN_LUMA_HIGH 50000
+
+struct v4l2_ctrl_hdr10_mastering_display {
+ __u16 display_primaries_x[3];
+ __u16 display_primaries_y[3];
+ __u16 white_point_x;
+ __u16 white_point_y;
+ __u32 max_display_mastering_luminance;
+ __u32 min_display_mastering_luminance;
+};
+
#endif
--
2.50.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v2 2/4] media: uapi: Cleanup tab after define in headers
2025-08-24 18:07 [PATCH v2 0/4] Minor V4L2 Headers and Codec Doc Cleanups Paul Kocialkowski
2025-08-24 18:07 ` [PATCH v2 1/4] media: uapi: Move colorimetry controls at the end of the file Paul Kocialkowski
@ 2025-08-24 18:07 ` Paul Kocialkowski
2025-08-28 18:46 ` Nicolas Dufresne
2025-08-24 18:07 ` [PATCH v2 3/4] media: uapi: v4l2-controls: Cleanup codec definitions Paul Kocialkowski
` (2 subsequent siblings)
4 siblings, 1 reply; 12+ messages in thread
From: Paul Kocialkowski @ 2025-08-24 18:07 UTC (permalink / raw)
To: linux-media, linux-kernel
Cc: Mauro Carvalho Chehab, Hans Verkuil, Laurent Pinchart,
Nicolas Dufresne, Paul Kocialkowski
Some definitions use a tab after the define keyword instead of the
usual single space. Replace it for better consistency.
Signed-off-by: Paul Kocialkowski <paulk@sys-base.io>
---
include/uapi/linux/v4l2-controls.h | 30 +++++++++++++++---------------
include/uapi/linux/videodev2.h | 18 +++++++++---------
2 files changed, 24 insertions(+), 24 deletions(-)
diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h
index 4a483ff1c418..7aef88465d04 100644
--- a/include/uapi/linux/v4l2-controls.h
+++ b/include/uapi/linux/v4l2-controls.h
@@ -1193,7 +1193,7 @@ enum v4l2_flash_strobe_source {
#define V4L2_CID_JPEG_CLASS_BASE (V4L2_CTRL_CLASS_JPEG | 0x900)
#define V4L2_CID_JPEG_CLASS (V4L2_CTRL_CLASS_JPEG | 1)
-#define V4L2_CID_JPEG_CHROMA_SUBSAMPLING (V4L2_CID_JPEG_CLASS_BASE + 1)
+#define V4L2_CID_JPEG_CHROMA_SUBSAMPLING (V4L2_CID_JPEG_CLASS_BASE + 1)
enum v4l2_jpeg_chroma_subsampling {
V4L2_JPEG_CHROMA_SUBSAMPLING_444 = 0,
V4L2_JPEG_CHROMA_SUBSAMPLING_422 = 1,
@@ -1202,15 +1202,15 @@ enum v4l2_jpeg_chroma_subsampling {
V4L2_JPEG_CHROMA_SUBSAMPLING_410 = 4,
V4L2_JPEG_CHROMA_SUBSAMPLING_GRAY = 5,
};
-#define V4L2_CID_JPEG_RESTART_INTERVAL (V4L2_CID_JPEG_CLASS_BASE + 2)
-#define V4L2_CID_JPEG_COMPRESSION_QUALITY (V4L2_CID_JPEG_CLASS_BASE + 3)
+#define V4L2_CID_JPEG_RESTART_INTERVAL (V4L2_CID_JPEG_CLASS_BASE + 2)
+#define V4L2_CID_JPEG_COMPRESSION_QUALITY (V4L2_CID_JPEG_CLASS_BASE + 3)
-#define V4L2_CID_JPEG_ACTIVE_MARKER (V4L2_CID_JPEG_CLASS_BASE + 4)
-#define V4L2_JPEG_ACTIVE_MARKER_APP0 (1 << 0)
-#define V4L2_JPEG_ACTIVE_MARKER_APP1 (1 << 1)
-#define V4L2_JPEG_ACTIVE_MARKER_COM (1 << 16)
-#define V4L2_JPEG_ACTIVE_MARKER_DQT (1 << 17)
-#define V4L2_JPEG_ACTIVE_MARKER_DHT (1 << 18)
+#define V4L2_CID_JPEG_ACTIVE_MARKER (V4L2_CID_JPEG_CLASS_BASE + 4)
+#define V4L2_JPEG_ACTIVE_MARKER_APP0 (1 << 0)
+#define V4L2_JPEG_ACTIVE_MARKER_APP1 (1 << 1)
+#define V4L2_JPEG_ACTIVE_MARKER_COM (1 << 16)
+#define V4L2_JPEG_ACTIVE_MARKER_DQT (1 << 17)
+#define V4L2_JPEG_ACTIVE_MARKER_DHT (1 << 18)
/* Image source controls */
@@ -1243,10 +1243,10 @@ enum v4l2_jpeg_chroma_subsampling {
#define V4L2_CID_DV_CLASS_BASE (V4L2_CTRL_CLASS_DV | 0x900)
#define V4L2_CID_DV_CLASS (V4L2_CTRL_CLASS_DV | 1)
-#define V4L2_CID_DV_TX_HOTPLUG (V4L2_CID_DV_CLASS_BASE + 1)
-#define V4L2_CID_DV_TX_RXSENSE (V4L2_CID_DV_CLASS_BASE + 2)
-#define V4L2_CID_DV_TX_EDID_PRESENT (V4L2_CID_DV_CLASS_BASE + 3)
-#define V4L2_CID_DV_TX_MODE (V4L2_CID_DV_CLASS_BASE + 4)
+#define V4L2_CID_DV_TX_HOTPLUG (V4L2_CID_DV_CLASS_BASE + 1)
+#define V4L2_CID_DV_TX_RXSENSE (V4L2_CID_DV_CLASS_BASE + 2)
+#define V4L2_CID_DV_TX_EDID_PRESENT (V4L2_CID_DV_CLASS_BASE + 3)
+#define V4L2_CID_DV_TX_MODE (V4L2_CID_DV_CLASS_BASE + 4)
enum v4l2_dv_tx_mode {
V4L2_DV_TX_MODE_DVI_D = 0,
V4L2_DV_TX_MODE_HDMI = 1,
@@ -1267,7 +1267,7 @@ enum v4l2_dv_it_content_type {
V4L2_DV_IT_CONTENT_TYPE_NO_ITC = 4,
};
-#define V4L2_CID_DV_RX_POWER_PRESENT (V4L2_CID_DV_CLASS_BASE + 100)
+#define V4L2_CID_DV_RX_POWER_PRESENT (V4L2_CID_DV_CLASS_BASE + 100)
#define V4L2_CID_DV_RX_RGB_RANGE (V4L2_CID_DV_CLASS_BASE + 101)
#define V4L2_CID_DV_RX_IT_CONTENT_TYPE (V4L2_CID_DV_CLASS_BASE + 102)
@@ -2552,7 +2552,7 @@ struct v4l2_ctrl_hevc_scaling_matrix {
/* Stateless VP9 controls */
#define V4L2_VP9_LOOP_FILTER_FLAG_DELTA_ENABLED 0x1
-#define V4L2_VP9_LOOP_FILTER_FLAG_DELTA_UPDATE 0x2
+#define V4L2_VP9_LOOP_FILTER_FLAG_DELTA_UPDATE 0x2
/**
* struct v4l2_vp9_loop_filter - VP9 loop filter parameters
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 3dd9fa45dde1..64943f1a6149 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -1607,8 +1607,8 @@ struct v4l2_bt_timings {
} __attribute__ ((packed));
/* Interlaced or progressive format */
-#define V4L2_DV_PROGRESSIVE 0
-#define V4L2_DV_INTERLACED 1
+#define V4L2_DV_PROGRESSIVE 0
+#define V4L2_DV_INTERLACED 1
/* Polarities. If bit is not set, it is assumed to be negative polarity */
#define V4L2_DV_VSYNC_POS_POL 0x00000001
@@ -2788,15 +2788,15 @@ struct v4l2_remove_buffers {
* Only implemented if CONFIG_VIDEO_ADV_DEBUG is defined.
* You must be root to use these ioctls. Never use these in applications!
*/
-#define VIDIOC_DBG_S_REGISTER _IOW('V', 79, struct v4l2_dbg_register)
-#define VIDIOC_DBG_G_REGISTER _IOWR('V', 80, struct v4l2_dbg_register)
+#define VIDIOC_DBG_S_REGISTER _IOW('V', 79, struct v4l2_dbg_register)
+#define VIDIOC_DBG_G_REGISTER _IOWR('V', 80, struct v4l2_dbg_register)
#define VIDIOC_S_HW_FREQ_SEEK _IOW('V', 82, struct v4l2_hw_freq_seek)
-#define VIDIOC_S_DV_TIMINGS _IOWR('V', 87, struct v4l2_dv_timings)
-#define VIDIOC_G_DV_TIMINGS _IOWR('V', 88, struct v4l2_dv_timings)
-#define VIDIOC_DQEVENT _IOR('V', 89, struct v4l2_event)
-#define VIDIOC_SUBSCRIBE_EVENT _IOW('V', 90, struct v4l2_event_subscription)
-#define VIDIOC_UNSUBSCRIBE_EVENT _IOW('V', 91, struct v4l2_event_subscription)
+#define VIDIOC_S_DV_TIMINGS _IOWR('V', 87, struct v4l2_dv_timings)
+#define VIDIOC_G_DV_TIMINGS _IOWR('V', 88, struct v4l2_dv_timings)
+#define VIDIOC_DQEVENT _IOR('V', 89, struct v4l2_event)
+#define VIDIOC_SUBSCRIBE_EVENT _IOW('V', 90, struct v4l2_event_subscription)
+#define VIDIOC_UNSUBSCRIBE_EVENT _IOW('V', 91, struct v4l2_event_subscription)
#define VIDIOC_CREATE_BUFS _IOWR('V', 92, struct v4l2_create_buffers)
#define VIDIOC_PREPARE_BUF _IOWR('V', 93, struct v4l2_buffer)
#define VIDIOC_G_SELECTION _IOWR('V', 94, struct v4l2_selection)
--
2.50.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v2 3/4] media: uapi: v4l2-controls: Cleanup codec definitions
2025-08-24 18:07 [PATCH v2 0/4] Minor V4L2 Headers and Codec Doc Cleanups Paul Kocialkowski
2025-08-24 18:07 ` [PATCH v2 1/4] media: uapi: Move colorimetry controls at the end of the file Paul Kocialkowski
2025-08-24 18:07 ` [PATCH v2 2/4] media: uapi: Cleanup tab after define in headers Paul Kocialkowski
@ 2025-08-24 18:07 ` Paul Kocialkowski
2025-08-28 18:46 ` Nicolas Dufresne
2025-08-24 18:07 ` [PATCH v2 4/4] Documentation: media: Document V4L2_H264_DECODE_PARAM_FLAG_PFRAME/BFRAME Paul Kocialkowski
2025-08-29 20:40 ` [PATCH v2 0/4] Minor V4L2 Headers and Codec Doc Cleanups Nicolas Dufresne
4 siblings, 1 reply; 12+ messages in thread
From: Paul Kocialkowski @ 2025-08-24 18:07 UTC (permalink / raw)
To: linux-media, linux-kernel
Cc: Mauro Carvalho Chehab, Hans Verkuil, Laurent Pinchart,
Nicolas Dufresne, Paul Kocialkowski
Move some fields closer to where they are used, add missing tabs
and remove an extra newline.
Signed-off-by: Paul Kocialkowski <paulk@sys-base.io>
---
include/uapi/linux/v4l2-controls.h | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h
index 7aef88465d04..2d30107e047e 100644
--- a/include/uapi/linux/v4l2-controls.h
+++ b/include/uapi/linux/v4l2-controls.h
@@ -1537,15 +1537,6 @@ struct v4l2_ctrl_h264_pred_weights {
struct v4l2_h264_weight_factors weight_factors[2];
};
-#define V4L2_H264_SLICE_TYPE_P 0
-#define V4L2_H264_SLICE_TYPE_B 1
-#define V4L2_H264_SLICE_TYPE_I 2
-#define V4L2_H264_SLICE_TYPE_SP 3
-#define V4L2_H264_SLICE_TYPE_SI 4
-
-#define V4L2_H264_SLICE_FLAG_DIRECT_SPATIAL_MV_PRED 0x01
-#define V4L2_H264_SLICE_FLAG_SP_FOR_SWITCH 0x02
-
#define V4L2_H264_TOP_FIELD_REF 0x1
#define V4L2_H264_BOTTOM_FIELD_REF 0x2
#define V4L2_H264_FRAME_REF 0x3
@@ -1566,8 +1557,17 @@ struct v4l2_h264_reference {
* Maximum DPB size, as specified by section 'A.3.1 Level limits
* common to the Baseline, Main, and Extended profiles'.
*/
-#define V4L2_H264_NUM_DPB_ENTRIES 16
-#define V4L2_H264_REF_LIST_LEN (2 * V4L2_H264_NUM_DPB_ENTRIES)
+#define V4L2_H264_NUM_DPB_ENTRIES 16
+#define V4L2_H264_REF_LIST_LEN (2 * V4L2_H264_NUM_DPB_ENTRIES)
+
+#define V4L2_H264_SLICE_TYPE_P 0
+#define V4L2_H264_SLICE_TYPE_B 1
+#define V4L2_H264_SLICE_TYPE_I 2
+#define V4L2_H264_SLICE_TYPE_SP 3
+#define V4L2_H264_SLICE_TYPE_SI 4
+
+#define V4L2_H264_SLICE_FLAG_DIRECT_SPATIAL_MV_PRED 0x01
+#define V4L2_H264_SLICE_FLAG_SP_FOR_SWITCH 0x02
#define V4L2_CID_STATELESS_H264_SLICE_PARAMS (V4L2_CID_CODEC_STATELESS_BASE + 6)
/**
@@ -1707,7 +1707,6 @@ struct v4l2_ctrl_h264_decode_params {
__u32 flags;
};
-
/* Stateless FWHT control, used by the vicodec driver */
/* Current FWHT version */
--
2.50.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v2 4/4] Documentation: media: Document V4L2_H264_DECODE_PARAM_FLAG_PFRAME/BFRAME
2025-08-24 18:07 [PATCH v2 0/4] Minor V4L2 Headers and Codec Doc Cleanups Paul Kocialkowski
` (2 preceding siblings ...)
2025-08-24 18:07 ` [PATCH v2 3/4] media: uapi: v4l2-controls: Cleanup codec definitions Paul Kocialkowski
@ 2025-08-24 18:07 ` Paul Kocialkowski
2025-08-28 20:42 ` Nicolas Dufresne
2025-08-29 20:40 ` [PATCH v2 0/4] Minor V4L2 Headers and Codec Doc Cleanups Nicolas Dufresne
4 siblings, 1 reply; 12+ messages in thread
From: Paul Kocialkowski @ 2025-08-24 18:07 UTC (permalink / raw)
To: linux-media, linux-kernel
Cc: Mauro Carvalho Chehab, Hans Verkuil, Laurent Pinchart,
Nicolas Dufresne, Paul Kocialkowski
These flags are meant for a very specific use-case, add a mention of it.
Signed-off-by: Paul Kocialkowski <paulk@sys-base.io>
---
.../userspace-api/media/v4l/ext-ctrls-codec-stateless.rst | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-codec-stateless.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-codec-stateless.rst
index 0da635691fdc..de1e3873385c 100644
--- a/Documentation/userspace-api/media/v4l/ext-ctrls-codec-stateless.rst
+++ b/Documentation/userspace-api/media/v4l/ext-ctrls-codec-stateless.rst
@@ -618,10 +618,14 @@ Stateless Codec Control ID
-
* - ``V4L2_H264_DECODE_PARAM_FLAG_PFRAME``
- 0x00000008
- -
+ - All submitted slices for the frame are P slices. This is a compability
+ flag required for decoders that only support decoding such frames, but
+ should not be required for slice-based decoders.
* - ``V4L2_H264_DECODE_PARAM_FLAG_BFRAME``
- 0x00000010
- -
+ - All submitted slices for the frame are B slices. This is a compability
+ flag required for decoders that only support decoding such frames, but
+ should not be required for slice-based decoders.
.. raw:: latex
--
2.50.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH v2 1/4] media: uapi: Move colorimetry controls at the end of the file
2025-08-24 18:07 ` [PATCH v2 1/4] media: uapi: Move colorimetry controls at the end of the file Paul Kocialkowski
@ 2025-08-28 18:45 ` Nicolas Dufresne
0 siblings, 0 replies; 12+ messages in thread
From: Nicolas Dufresne @ 2025-08-28 18:45 UTC (permalink / raw)
To: Paul Kocialkowski, linux-media, linux-kernel
Cc: Mauro Carvalho Chehab, Hans Verkuil, Laurent Pinchart
[-- Attachment #1: Type: text/plain, Size: 4047 bytes --]
Le dimanche 24 août 2025 à 20:07 +0200, Paul Kocialkowski a écrit :
> The colorimetry controls class is defined after the stateless codec
> class at the top of the controls header. It is currently defined in
> the middle of stateless codec controls.
>
> Move the colorimetry controls after the stateless codec controls,
> at the end of the file.
>
> Signed-off-by: Paul Kocialkowski <paulk@sys-base.io>
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
> ---
> include/uapi/linux/v4l2-controls.h | 68 +++++++++++++++---------------
> 1 file changed, 34 insertions(+), 34 deletions(-)
>
> diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-
> controls.h
> index f836512e9deb..4a483ff1c418 100644
> --- a/include/uapi/linux/v4l2-controls.h
> +++ b/include/uapi/linux/v4l2-controls.h
> @@ -2549,40 +2549,6 @@ struct v4l2_ctrl_hevc_scaling_matrix {
> __u8 scaling_list_dc_coef_32x32[2];
> };
>
> -#define V4L2_CID_COLORIMETRY_CLASS_BASE (V4L2_CTRL_CLASS_COLORIMETRY
> | 0x900)
> -#define V4L2_CID_COLORIMETRY_CLASS (V4L2_CTRL_CLASS_COLORIMETRY | 1)
> -
> -#define
> V4L2_CID_COLORIMETRY_HDR10_CLL_INFO (V4L2_CID_COLORIMETRY_CLASS_BASE + 0)
> -
> -struct v4l2_ctrl_hdr10_cll_info {
> - __u16 max_content_light_level;
> - __u16 max_pic_average_light_level;
> -};
> -
> -#define
> V4L2_CID_COLORIMETRY_HDR10_MASTERING_DISPLAY (V4L2_CID_COLORIMETRY_CLASS_BASE +1)
> -
> -#define V4L2_HDR10_MASTERING_PRIMARIES_X_LOW 5
> -#define V4L2_HDR10_MASTERING_PRIMARIES_X_HIGH 37000
> -#define V4L2_HDR10_MASTERING_PRIMARIES_Y_LOW 5
> -#define V4L2_HDR10_MASTERING_PRIMARIES_Y_HIGH 42000
> -#define V4L2_HDR10_MASTERING_WHITE_POINT_X_LOW 5
> -#define V4L2_HDR10_MASTERING_WHITE_POINT_X_HIGH 37000
> -#define V4L2_HDR10_MASTERING_WHITE_POINT_Y_LOW 5
> -#define V4L2_HDR10_MASTERING_WHITE_POINT_Y_HIGH 42000
> -#define V4L2_HDR10_MASTERING_MAX_LUMA_LOW 50000
> -#define V4L2_HDR10_MASTERING_MAX_LUMA_HIGH 100000000
> -#define V4L2_HDR10_MASTERING_MIN_LUMA_LOW 1
> -#define V4L2_HDR10_MASTERING_MIN_LUMA_HIGH 50000
> -
> -struct v4l2_ctrl_hdr10_mastering_display {
> - __u16 display_primaries_x[3];
> - __u16 display_primaries_y[3];
> - __u16 white_point_x;
> - __u16 white_point_y;
> - __u32 max_display_mastering_luminance;
> - __u32 min_display_mastering_luminance;
> -};
> -
> /* Stateless VP9 controls */
>
> #define V4L2_VP9_LOOP_FILTER_FLAG_DELTA_ENABLED 0x1
> @@ -3515,4 +3481,38 @@ struct v4l2_ctrl_av1_film_grain {
> #define V4L2_CID_MPEG_MFC51_BASE V4L2_CID_CODEC_MFC51_BASE
> #endif
>
> +#define V4L2_CID_COLORIMETRY_CLASS_BASE (V4L2_CTRL_CLASS_COLORIMETRY
> | 0x900)
> +#define V4L2_CID_COLORIMETRY_CLASS (V4L2_CTRL_CLASS_COLORIMETRY | 1)
> +
> +#define
> V4L2_CID_COLORIMETRY_HDR10_CLL_INFO (V4L2_CID_COLORIMETRY_CLASS_BASE + 0)
> +
> +struct v4l2_ctrl_hdr10_cll_info {
> + __u16 max_content_light_level;
> + __u16 max_pic_average_light_level;
> +};
> +
> +#define
> V4L2_CID_COLORIMETRY_HDR10_MASTERING_DISPLAY (V4L2_CID_COLORIMETRY_CLASS_BASE +1)
> +
> +#define V4L2_HDR10_MASTERING_PRIMARIES_X_LOW 5
> +#define V4L2_HDR10_MASTERING_PRIMARIES_X_HIGH 37000
> +#define V4L2_HDR10_MASTERING_PRIMARIES_Y_LOW 5
> +#define V4L2_HDR10_MASTERING_PRIMARIES_Y_HIGH 42000
> +#define V4L2_HDR10_MASTERING_WHITE_POINT_X_LOW 5
> +#define V4L2_HDR10_MASTERING_WHITE_POINT_X_HIGH 37000
> +#define V4L2_HDR10_MASTERING_WHITE_POINT_Y_LOW 5
> +#define V4L2_HDR10_MASTERING_WHITE_POINT_Y_HIGH 42000
> +#define V4L2_HDR10_MASTERING_MAX_LUMA_LOW 50000
> +#define V4L2_HDR10_MASTERING_MAX_LUMA_HIGH 100000000
> +#define V4L2_HDR10_MASTERING_MIN_LUMA_LOW 1
> +#define V4L2_HDR10_MASTERING_MIN_LUMA_HIGH 50000
> +
> +struct v4l2_ctrl_hdr10_mastering_display {
> + __u16 display_primaries_x[3];
> + __u16 display_primaries_y[3];
> + __u16 white_point_x;
> + __u16 white_point_y;
> + __u32 max_display_mastering_luminance;
> + __u32 min_display_mastering_luminance;
> +};
> +
> #endif
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 2/4] media: uapi: Cleanup tab after define in headers
2025-08-24 18:07 ` [PATCH v2 2/4] media: uapi: Cleanup tab after define in headers Paul Kocialkowski
@ 2025-08-28 18:46 ` Nicolas Dufresne
0 siblings, 0 replies; 12+ messages in thread
From: Nicolas Dufresne @ 2025-08-28 18:46 UTC (permalink / raw)
To: Paul Kocialkowski, linux-media, linux-kernel
Cc: Mauro Carvalho Chehab, Hans Verkuil, Laurent Pinchart
[-- Attachment #1: Type: text/plain, Size: 6214 bytes --]
Le dimanche 24 août 2025 à 20:07 +0200, Paul Kocialkowski a écrit :
> Some definitions use a tab after the define keyword instead of the
> usual single space. Replace it for better consistency.
>
> Signed-off-by: Paul Kocialkowski <paulk@sys-base.io>
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
> ---
> include/uapi/linux/v4l2-controls.h | 30 +++++++++++++++---------------
> include/uapi/linux/videodev2.h | 18 +++++++++---------
> 2 files changed, 24 insertions(+), 24 deletions(-)
>
> diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-
> controls.h
> index 4a483ff1c418..7aef88465d04 100644
> --- a/include/uapi/linux/v4l2-controls.h
> +++ b/include/uapi/linux/v4l2-controls.h
> @@ -1193,7 +1193,7 @@ enum v4l2_flash_strobe_source {
> #define V4L2_CID_JPEG_CLASS_BASE (V4L2_CTRL_CLASS_JPEG |
> 0x900)
> #define V4L2_CID_JPEG_CLASS (V4L2_CTRL_CLASS_JPEG | 1)
>
> -
> #define V4L2_CID_JPEG_CHROMA_SUBSAMPLING (V4L2_CID_JPEG_CLASS_BASE + 1)
> +#define V4L2_CID_JPEG_CHROMA_SUBSAMPLING (V4L2_CID_JPEG_CLASS_BASE +
> 1)
> enum v4l2_jpeg_chroma_subsampling {
> V4L2_JPEG_CHROMA_SUBSAMPLING_444 = 0,
> V4L2_JPEG_CHROMA_SUBSAMPLING_422 = 1,
> @@ -1202,15 +1202,15 @@ enum v4l2_jpeg_chroma_subsampling {
> V4L2_JPEG_CHROMA_SUBSAMPLING_410 = 4,
> V4L2_JPEG_CHROMA_SUBSAMPLING_GRAY = 5,
> };
> -
> #define V4L2_CID_JPEG_RESTART_INTERVAL (V4L2_CID_JPEG_CLASS_BASE + 2)
> -
> #define V4L2_CID_JPEG_COMPRESSION_QUALITY (V4L2_CID_JPEG_CLASS_BASE + 3)
> +#define V4L2_CID_JPEG_RESTART_INTERVAL (V4L2_CID_JPEG_CLASS_BASE +
> 2)
> +#define V4L2_CID_JPEG_COMPRESSION_QUALITY (V4L2_CID_JPEG_CLASS_BASE +
> 3)
>
> -
> #define V4L2_CID_JPEG_ACTIVE_MARKER (V4L2_CID_JPEG_CLASS_BASE + 4)
> -#define V4L2_JPEG_ACTIVE_MARKER_APP0 (1 << 0)
> -#define V4L2_JPEG_ACTIVE_MARKER_APP1 (1 << 1)
> -#define V4L2_JPEG_ACTIVE_MARKER_COM (1 << 16)
> -#define V4L2_JPEG_ACTIVE_MARKER_DQT (1 << 17)
> -#define V4L2_JPEG_ACTIVE_MARKER_DHT (1 << 18)
> +#define V4L2_CID_JPEG_ACTIVE_MARKER (V4L2_CID_JPEG_CLASS_BASE +
> 4)
> +#define V4L2_JPEG_ACTIVE_MARKER_APP0 (1 << 0)
> +#define V4L2_JPEG_ACTIVE_MARKER_APP1 (1 << 1)
> +#define V4L2_JPEG_ACTIVE_MARKER_COM (1 << 16)
> +#define V4L2_JPEG_ACTIVE_MARKER_DQT (1 << 17)
> +#define V4L2_JPEG_ACTIVE_MARKER_DHT (1 << 18)
>
>
> /* Image source controls */
> @@ -1243,10 +1243,10 @@ enum v4l2_jpeg_chroma_subsampling {
> #define V4L2_CID_DV_CLASS_BASE (V4L2_CTRL_CLASS_DV | 0x900)
> #define V4L2_CID_DV_CLASS (V4L2_CTRL_CLASS_DV | 1)
>
> -
> #define V4L2_CID_DV_TX_HOTPLUG (V4L2_CID_DV_CLASS_BASE + 1)
> -
> #define V4L2_CID_DV_TX_RXSENSE (V4L2_CID_DV_CLASS_BASE + 2)
> -
> #define V4L2_CID_DV_TX_EDID_PRESENT (V4L2_CID_DV_CLASS_BASE + 3)
> -
> #define V4L2_CID_DV_TX_MODE (V4L2_CID_DV_CLASS_BASE + 4)
> +#define V4L2_CID_DV_TX_HOTPLUG (V4L2_CID_DV_CLASS_BASE + 1)
> +#define V4L2_CID_DV_TX_RXSENSE (V4L2_CID_DV_CLASS_BASE + 2)
> +#define V4L2_CID_DV_TX_EDID_PRESENT (V4L2_CID_DV_CLASS_BASE + 3)
> +#define V4L2_CID_DV_TX_MODE (V4L2_CID_DV_CLASS_BASE + 4)
> enum v4l2_dv_tx_mode {
> V4L2_DV_TX_MODE_DVI_D = 0,
> V4L2_DV_TX_MODE_HDMI = 1,
> @@ -1267,7 +1267,7 @@ enum v4l2_dv_it_content_type {
> V4L2_DV_IT_CONTENT_TYPE_NO_ITC = 4,
> };
>
> -
> #define V4L2_CID_DV_RX_POWER_PRESENT (V4L2_CID_DV_CLASS_BASE + 100)
> +#define V4L2_CID_DV_RX_POWER_PRESENT (V4L2_CID_DV_CLASS_BASE +
> 100)
> #define V4L2_CID_DV_RX_RGB_RANGE (V4L2_CID_DV_CLASS_BASE +
> 101)
> #define V4L2_CID_DV_RX_IT_CONTENT_TYPE (V4L2_CID_DV_CLASS_BASE +
> 102)
>
> @@ -2552,7 +2552,7 @@ struct v4l2_ctrl_hevc_scaling_matrix {
> /* Stateless VP9 controls */
>
> #define V4L2_VP9_LOOP_FILTER_FLAG_DELTA_ENABLED 0x1
> -#define V4L2_VP9_LOOP_FILTER_FLAG_DELTA_UPDATE 0x2
> +#define V4L2_VP9_LOOP_FILTER_FLAG_DELTA_UPDATE 0x2
>
> /**
> * struct v4l2_vp9_loop_filter - VP9 loop filter parameters
> diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
> index 3dd9fa45dde1..64943f1a6149 100644
> --- a/include/uapi/linux/videodev2.h
> +++ b/include/uapi/linux/videodev2.h
> @@ -1607,8 +1607,8 @@ struct v4l2_bt_timings {
> } __attribute__ ((packed));
>
> /* Interlaced or progressive format */
> -#define V4L2_DV_PROGRESSIVE 0
> -#define V4L2_DV_INTERLACED 1
> +#define V4L2_DV_PROGRESSIVE 0
> +#define V4L2_DV_INTERLACED 1
>
> /* Polarities. If bit is not set, it is assumed to be negative polarity */
> #define V4L2_DV_VSYNC_POS_POL 0x00000001
> @@ -2788,15 +2788,15 @@ struct v4l2_remove_buffers {
> * Only implemented if CONFIG_VIDEO_ADV_DEBUG is defined.
> * You must be root to use these ioctls. Never use these in applications!
> */
> -#define VIDIOC_DBG_S_REGISTER _IOW('V', 79, struct
> v4l2_dbg_register)
> -#define VIDIOC_DBG_G_REGISTER _IOWR('V', 80, struct
> v4l2_dbg_register)
> +#define VIDIOC_DBG_S_REGISTER _IOW('V', 79, struct v4l2_dbg_register)
> +#define VIDIOC_DBG_G_REGISTER _IOWR('V', 80, struct v4l2_dbg_register)
>
> #define VIDIOC_S_HW_FREQ_SEEK _IOW('V', 82, struct v4l2_hw_freq_seek)
> -#define VIDIOC_S_DV_TIMINGS _IOWR('V', 87, struct
> v4l2_dv_timings)
> -#define VIDIOC_G_DV_TIMINGS _IOWR('V', 88, struct
> v4l2_dv_timings)
> -#define VIDIOC_DQEVENT _IOR('V', 89, struct v4l2_event)
> -#define VIDIOC_SUBSCRIBE_EVENT _IOW('V', 90, struct
> v4l2_event_subscription)
> -#define VIDIOC_UNSUBSCRIBE_EVENT _IOW('V', 91, struct
> v4l2_event_subscription)
> +#define VIDIOC_S_DV_TIMINGS _IOWR('V', 87, struct v4l2_dv_timings)
> +#define VIDIOC_G_DV_TIMINGS _IOWR('V', 88, struct v4l2_dv_timings)
> +#define VIDIOC_DQEVENT _IOR('V', 89, struct v4l2_event)
> +#define VIDIOC_SUBSCRIBE_EVENT _IOW('V', 90, struct
> v4l2_event_subscription)
> +#define VIDIOC_UNSUBSCRIBE_EVENT _IOW('V', 91, struct
> v4l2_event_subscription)
> #define VIDIOC_CREATE_BUFS _IOWR('V', 92, struct v4l2_create_buffers)
> #define VIDIOC_PREPARE_BUF _IOWR('V', 93, struct v4l2_buffer)
> #define VIDIOC_G_SELECTION _IOWR('V', 94, struct v4l2_selection)
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 3/4] media: uapi: v4l2-controls: Cleanup codec definitions
2025-08-24 18:07 ` [PATCH v2 3/4] media: uapi: v4l2-controls: Cleanup codec definitions Paul Kocialkowski
@ 2025-08-28 18:46 ` Nicolas Dufresne
0 siblings, 0 replies; 12+ messages in thread
From: Nicolas Dufresne @ 2025-08-28 18:46 UTC (permalink / raw)
To: Paul Kocialkowski, linux-media, linux-kernel
Cc: Mauro Carvalho Chehab, Hans Verkuil, Laurent Pinchart
[-- Attachment #1: Type: text/plain, Size: 2300 bytes --]
Le dimanche 24 août 2025 à 20:07 +0200, Paul Kocialkowski a écrit :
> Move some fields closer to where they are used, add missing tabs
> and remove an extra newline.
>
> Signed-off-by: Paul Kocialkowski <paulk@sys-base.io>
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
> ---
> include/uapi/linux/v4l2-controls.h | 23 +++++++++++------------
> 1 file changed, 11 insertions(+), 12 deletions(-)
>
> diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-
> controls.h
> index 7aef88465d04..2d30107e047e 100644
> --- a/include/uapi/linux/v4l2-controls.h
> +++ b/include/uapi/linux/v4l2-controls.h
> @@ -1537,15 +1537,6 @@ struct v4l2_ctrl_h264_pred_weights {
> struct v4l2_h264_weight_factors weight_factors[2];
> };
>
> -#define V4L2_H264_SLICE_TYPE_P 0
> -#define V4L2_H264_SLICE_TYPE_B 1
> -#define V4L2_H264_SLICE_TYPE_I 2
> -#define V4L2_H264_SLICE_TYPE_SP 3
> -#define V4L2_H264_SLICE_TYPE_SI 4
> -
> -#define V4L2_H264_SLICE_FLAG_DIRECT_SPATIAL_MV_PRED 0x01
> -#define V4L2_H264_SLICE_FLAG_SP_FOR_SWITCH 0x02
> -
> #define V4L2_H264_TOP_FIELD_REF 0x1
> #define V4L2_H264_BOTTOM_FIELD_REF 0x2
> #define V4L2_H264_FRAME_REF 0x3
> @@ -1566,8 +1557,17 @@ struct v4l2_h264_reference {
> * Maximum DPB size, as specified by section 'A.3.1 Level limits
> * common to the Baseline, Main, and Extended profiles'.
> */
> -#define V4L2_H264_NUM_DPB_ENTRIES 16
> -#define V4L2_H264_REF_LIST_LEN (2 * V4L2_H264_NUM_DPB_ENTRIES)
> +#define V4L2_H264_NUM_DPB_ENTRIES 16
> +#define V4L2_H264_REF_LIST_LEN (2 *
> V4L2_H264_NUM_DPB_ENTRIES)
> +
> +#define V4L2_H264_SLICE_TYPE_P 0
> +#define V4L2_H264_SLICE_TYPE_B 1
> +#define V4L2_H264_SLICE_TYPE_I 2
> +#define V4L2_H264_SLICE_TYPE_SP 3
> +#define V4L2_H264_SLICE_TYPE_SI 4
> +
> +#define V4L2_H264_SLICE_FLAG_DIRECT_SPATIAL_MV_PRED 0x01
> +#define V4L2_H264_SLICE_FLAG_SP_FOR_SWITCH 0x02
>
> #define
> V4L2_CID_STATELESS_H264_SLICE_PARAMS (V4L2_CID_CODEC_STATELESS_BASE + 6)
> /**
> @@ -1707,7 +1707,6 @@ struct v4l2_ctrl_h264_decode_params {
> __u32 flags;
> };
>
> -
> /* Stateless FWHT control, used by the vicodec driver */
>
> /* Current FWHT version */
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 4/4] Documentation: media: Document V4L2_H264_DECODE_PARAM_FLAG_PFRAME/BFRAME
2025-08-24 18:07 ` [PATCH v2 4/4] Documentation: media: Document V4L2_H264_DECODE_PARAM_FLAG_PFRAME/BFRAME Paul Kocialkowski
@ 2025-08-28 20:42 ` Nicolas Dufresne
2025-08-29 14:15 ` Paul Kocialkowski
0 siblings, 1 reply; 12+ messages in thread
From: Nicolas Dufresne @ 2025-08-28 20:42 UTC (permalink / raw)
To: Paul Kocialkowski, linux-media, linux-kernel
Cc: Mauro Carvalho Chehab, Hans Verkuil, Laurent Pinchart
[-- Attachment #1: Type: text/plain, Size: 1862 bytes --]
Le dimanche 24 août 2025 à 20:07 +0200, Paul Kocialkowski a écrit :
> These flags are meant for a very specific use-case, add a mention of it.
>
> Signed-off-by: Paul Kocialkowski <paulk@sys-base.io>
> ---
> .../userspace-api/media/v4l/ext-ctrls-codec-stateless.rst | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-codec-stateless.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-codec-stateless.rst
> index 0da635691fdc..de1e3873385c 100644
> --- a/Documentation/userspace-api/media/v4l/ext-ctrls-codec-stateless.rst
> +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-codec-stateless.rst
> @@ -618,10 +618,14 @@ Stateless Codec Control ID
> -
> * - ``V4L2_H264_DECODE_PARAM_FLAG_PFRAME``
> - 0x00000008
> - -
> + - All submitted slices for the frame are P slices. This is a compability
> + flag required for decoders that only support decoding such frames, but
> + should not be required for slice-based decoders.
Seems to match the comment in Tegra driver, and related to a hardware
limitation. Shall we also recommend not to use this unless similar limitation
exists ?
Note that mix of P and I, or, B and I, should still work on Tegra, its mixing P
and B that will fail since one of the reference list will be missing. At least,
this is my understanding.
Nicolas
> * - ``V4L2_H264_DECODE_PARAM_FLAG_BFRAME``
> - 0x00000010
> - -
> + - All submitted slices for the frame are B slices. This is a compability
> + flag required for decoders that only support decoding such frames, but
> + should not be required for slice-based decoders.
>
> .. raw:: latex
>
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 4/4] Documentation: media: Document V4L2_H264_DECODE_PARAM_FLAG_PFRAME/BFRAME
2025-08-28 20:42 ` Nicolas Dufresne
@ 2025-08-29 14:15 ` Paul Kocialkowski
2025-08-30 11:29 ` Dmitry Osipenko
0 siblings, 1 reply; 12+ messages in thread
From: Paul Kocialkowski @ 2025-08-29 14:15 UTC (permalink / raw)
To: Nicolas Dufresne
Cc: linux-media, linux-kernel, Mauro Carvalho Chehab, Hans Verkuil,
Laurent Pinchart, Dmitry Osipenko
[-- Attachment #1: Type: text/plain, Size: 3654 bytes --]
Hi,
+ Adding Dmitry in the loop (whom I forgot, sorry).
Dmitry, we're discussing the precise meaning of the Tegra VDE H.264 decode
flags that indicate PFRAME/BFRAME.
On Thu 28 Aug 25, 16:42, Nicolas Dufresne wrote:
> Le dimanche 24 août 2025 à 20:07 +0200, Paul Kocialkowski a écrit :
> > These flags are meant for a very specific use-case, add a mention of it.
> >
> > Signed-off-by: Paul Kocialkowski <paulk@sys-base.io>
> > ---
> > .../userspace-api/media/v4l/ext-ctrls-codec-stateless.rst | 8 ++++++--
> > 1 file changed, 6 insertions(+), 2 deletions(-)
> >
> > diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-codec-stateless.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-codec-stateless.rst
> > index 0da635691fdc..de1e3873385c 100644
> > --- a/Documentation/userspace-api/media/v4l/ext-ctrls-codec-stateless.rst
> > +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-codec-stateless.rst
> > @@ -618,10 +618,14 @@ Stateless Codec Control ID
> > -
> > * - ``V4L2_H264_DECODE_PARAM_FLAG_PFRAME``
> > - 0x00000008
> > - -
> > + - All submitted slices for the frame are P slices. This is a compability
> > + flag required for decoders that only support decoding such frames, but
> > + should not be required for slice-based decoders.
>
> Seems to match the comment in Tegra driver, and related to a hardware
> limitation. Shall we also recommend not to use this unless similar limitation
> exists ?
I think the flag should only be allowed for frame-based decode mode and indeed
it would be good to say that drivers should only check this flag if they have
such limitations.
Userspace on the other hand cannot really know if it will be used or not so it
should set the flags when applicable.
> Note that mix of P and I, or, B and I, should still work on Tegra, its mixing P
> and B that will fail since one of the reference list will be missing. At least,
> this is my understanding.
Well the comment in the driver mandates that "frame consists of the same type
slices" and "decoding of a non-uniform frames isn't supported by hardware".
But looking at the code these statements seem exaggerated and I concur to your
understanding that at least mixing I and P should work, since it only sets up
the L0 reference list. There's an explicit hardware flag for "B frames" that
could have a more restrictive meaning. Maybe it also allows I frames and/or
P frames, maybe not.
So perhaps we could relax the definitions to an indication that the L0/L1
reference lists will be used by the frame slices, which implicitly allows mixing
different types of slices.
After all it is likely that decoders in that situation just really care about
having the required ref lists prepared and don't particularly need each
slice_type to be the same. After all they're still parsing the slice headers so
they do have all the slice-specific info.
Paul
> Nicolas
>
> > * - ``V4L2_H264_DECODE_PARAM_FLAG_BFRAME``
> > - 0x00000010
> > - -
> > + - All submitted slices for the frame are B slices. This is a compability
> > + flag required for decoders that only support decoding such frames, but
> > + should not be required for slice-based decoders.
> >
> > .. raw:: latex
> >
--
Paul Kocialkowski,
Independent contractor - sys-base - https://www.sys-base.io/
Free software developer - https://www.paulk.fr/
Expert in multimedia, graphics and embedded hardware support with Linux.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 0/4] Minor V4L2 Headers and Codec Doc Cleanups
2025-08-24 18:07 [PATCH v2 0/4] Minor V4L2 Headers and Codec Doc Cleanups Paul Kocialkowski
` (3 preceding siblings ...)
2025-08-24 18:07 ` [PATCH v2 4/4] Documentation: media: Document V4L2_H264_DECODE_PARAM_FLAG_PFRAME/BFRAME Paul Kocialkowski
@ 2025-08-29 20:40 ` Nicolas Dufresne
4 siblings, 0 replies; 12+ messages in thread
From: Nicolas Dufresne @ 2025-08-29 20:40 UTC (permalink / raw)
To: Paul Kocialkowski, linux-media, linux-kernel
Cc: Mauro Carvalho Chehab, Hans Verkuil, Laurent Pinchart
[-- Attachment #1: Type: text/plain, Size: 881 bytes --]
Le dimanche 24 août 2025 à 20:07 +0200, Paul Kocialkowski a écrit :
> Changes since v1:
> - Added minor codec control cleanups;
> - Added documentation about h.264 frame-wide type flags
>
> Paul Kocialkowski (4):
> media: uapi: Move colorimetry controls at the end of the file
> media: uapi: Cleanup tab after define in headers
> media: uapi: v4l2-controls: Cleanup codec definitions
I've picked the 3 above.
> Documentation: media: Document
> V4L2_H264_DECODE_PARAM_FLAG_PFRAME/BFRAME
So you will only have to update this one.
cheers,
Nicolas
>
> .../media/v4l/ext-ctrls-codec-stateless.rst | 8 +-
> include/uapi/linux/v4l2-controls.h | 121 +++++++++---------
> include/uapi/linux/videodev2.h | 18 +--
> 3 files changed, 75 insertions(+), 72 deletions(-)
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 4/4] Documentation: media: Document V4L2_H264_DECODE_PARAM_FLAG_PFRAME/BFRAME
2025-08-29 14:15 ` Paul Kocialkowski
@ 2025-08-30 11:29 ` Dmitry Osipenko
0 siblings, 0 replies; 12+ messages in thread
From: Dmitry Osipenko @ 2025-08-30 11:29 UTC (permalink / raw)
To: Paul Kocialkowski, Nicolas Dufresne
Cc: linux-media, linux-kernel, Mauro Carvalho Chehab, Hans Verkuil,
Laurent Pinchart
29.08.2025 17:15, Paul Kocialkowski пишет:
>>> + - All submitted slices for the frame are P slices. This is a compability
>>> + flag required for decoders that only support decoding such frames, but
>>> + should not be required for slice-based decoders.
>> Seems to match the comment in Tegra driver, and related to a hardware
>> limitation. Shall we also recommend not to use this unless similar limitation
>> exists ?
> I think the flag should only be allowed for frame-based decode mode and indeed
> it would be good to say that drivers should only check this flag if they have
> such limitations.
>
> Userspace on the other hand cannot really know if it will be used or not so it
> should set the flags when applicable.
IIRC, Tegra dec driver doesn't support decoding frames consisting of
multiple slices, it can only decode frames consisting of a single slice.
Tegra dec can handle multi-slice frames using a "macroblock by
macroblock" decoding mode with a lot of CPU processing, like classic old
hw decoders did it, this is not supported by upstream driver.
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2025-08-30 11:29 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-24 18:07 [PATCH v2 0/4] Minor V4L2 Headers and Codec Doc Cleanups Paul Kocialkowski
2025-08-24 18:07 ` [PATCH v2 1/4] media: uapi: Move colorimetry controls at the end of the file Paul Kocialkowski
2025-08-28 18:45 ` Nicolas Dufresne
2025-08-24 18:07 ` [PATCH v2 2/4] media: uapi: Cleanup tab after define in headers Paul Kocialkowski
2025-08-28 18:46 ` Nicolas Dufresne
2025-08-24 18:07 ` [PATCH v2 3/4] media: uapi: v4l2-controls: Cleanup codec definitions Paul Kocialkowski
2025-08-28 18:46 ` Nicolas Dufresne
2025-08-24 18:07 ` [PATCH v2 4/4] Documentation: media: Document V4L2_H264_DECODE_PARAM_FLAG_PFRAME/BFRAME Paul Kocialkowski
2025-08-28 20:42 ` Nicolas Dufresne
2025-08-29 14:15 ` Paul Kocialkowski
2025-08-30 11:29 ` Dmitry Osipenko
2025-08-29 20:40 ` [PATCH v2 0/4] Minor V4L2 Headers and Codec Doc Cleanups Nicolas Dufresne
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).