[PATCH v4 0/3] add MBR type rate control for encoder
From: Sachin Kumar Garg
Date: Mon Nov 16 2026 - 12:06:06 EST
This series adds support for the MBR rate-control mode in the Iris driver.
Patch 1 reserves a control range for the iris driver in
v4l2-controls.h.
Patch 2 adds the control to a new uapi header,
include/uapi/linux/media/qcom/iris-config.h, and documents it in
Documentation/userspace-api/media/drivers/qcom-iris.rst.
Patch 3 implements the control in the driver. MBR is currently supported on
sc7280 only.
Changes in v4:
- Move V4L2_CID_QCOM_MBR_RATE_CONTROL from the driver to a new uapi
header, include/uapi/linux/media/qcom/iris-config.h, so userspace
can use it.
- Ignore MBR when frame-level rate control is disabled.
- Don't program the peak bitrate when MBR is enabled.
- Link to v3: https://lore.kernel.org/r/20261030-b4-add_sc7280_mbr-v3-0-8fadcc873953@xxxxxxxxxxxxxxxx
Changes in v3:
- Split into two patches: add V4L2_CID_USER_QCOM_IRIS_BASE to
v4l2-controls.h (patch 1), and base V4L2_CID_QCOM_MBR_RATE_CONTROL
on it (patch 2).
- Reserve 64 controls for the iris control base instead of 16, to
leave room for future iris encoder controls.
- Link to v2: https://lore.kernel.org/r/20260720-b4-add_sc7280_mbr-v2-1-a2a86f630f57@xxxxxxxxxxxxxxxx
Changes in v2:
- Per upstream review feedback, convert MBR enablement from the
generic V4L2_MPEG_VIDEO_BITRATE_MODE_MBR menu value to a new
Qualcomm IRIS vendor-specific boolean control,
V4L2_CID_QCOM_MBR_RATE_CONTROL.
- Drop the now-unneeded generic V4L2_MPEG_VIDEO_BITRATE_MODE_MBR
enum, its "Maximum Bitrate" menu string, and its documentation
(previously sent as a separate patch 1/2).
- Drop the separate inst_fw_cap_sc7280_enc[] table (a near-complete
duplicate of inst_fw_cap_sm8250_enc[]); sc7280 now reuses the
shared encoder cap table and layers in only the MBR-specific cap
entry via the new mbr_rc_supported flag.
- Link to v1: https://lore.kernel.org/linux-media/20260213-b4-add_sc7280_mbr-v1-0-e8d95b4e4809@xxxxxxxxxxxxxxxx/
Signed-off-by: Sachin Kumar Garg <sachin.garg@xxxxxxxxxxxxxxxx>
---
Sachin Kumar Garg (3):
media: uapi: v4l2-controls: Add control base for Qualcomm iris driver
media: uapi: Add Qualcomm iris MBR rate control
media: iris: add new rate control type MBR for encoder
.../userspace-api/media/drivers/index.rst | 1 +
.../userspace-api/media/drivers/qcom-iris.rst | 28 ++++++
MAINTAINERS | 2 +
drivers/media/platform/qcom/iris/iris_ctrls.c | 108 +++++++++++++++++----
.../platform/qcom/iris/iris_hfi_gen1_command.c | 1 +
.../platform/qcom/iris/iris_hfi_gen1_defines.h | 1 +
.../platform/qcom/iris/iris_hfi_gen2_defines.h | 1 +
.../platform/qcom/iris/iris_platform_common.h | 2 +
.../media/platform/qcom/iris/iris_platform_vpu2.c | 1 +
include/uapi/linux/media/qcom/iris-config.h | 15 +++
include/uapi/linux/v4l2-controls.h | 6 ++
11 files changed, 147 insertions(+), 19 deletions(-)
---
base-commit: d7e7bca7169873b46e857c025c10f3336c1258d8
change-id: 20260212-b4-add_sc7280_mbr-597ac615b931
Best regards,
--
Sachin Kumar Garg <sachin.garg@xxxxxxxxxxxxxxxx>