* [PATCH v2 0/3] Add support for QC08C format in iris driver
@ 2025-10-08 9:52 Dikshita Agarwal
2025-10-08 9:52 ` [PATCH v2 1/3] media: iris: Add support for HFI_PROP_OPB_ENABLE to control split mode Dikshita Agarwal
` (3 more replies)
0 siblings, 4 replies; 15+ messages in thread
From: Dikshita Agarwal @ 2025-10-08 9:52 UTC (permalink / raw)
To: Vikash Garodia, Abhinav Kumar, Bryan O'Donoghue,
Mauro Carvalho Chehab
Cc: linux-media, linux-arm-msm, linux-kernel, Dmitry Baryshkov,
Dikshita Agarwal
Add support for the QC08C color format in both the encoder and decoder
paths of the iris driver. The changes include:
- Adding QC08C format handling in the driver for both encoding and
decoding.
- Updating format enumeration to properly return supported formats.
- Ensuring the correct HFI format is set for firmware communication.
-Making all related changes required for seamless integration of QC08C
support.
The changes have been validated using v4l2-ctl, compliance, and GStreamer (GST) tests.
Both GST and v4l2-ctl tests were performed using the NV12 format, as
these clients do not support the QCOM-specific QC08C format, and all
tests passed successfully.
During v4l2-ctl testing, a regression was observed when using the NV12
color format after adding QC08C support. A fix for this regression has
also been posted [1].
[1]: https://lore.kernel.org/linux-media/20250918103235.4066441-1-dikshita.agarwal@oss.qualcomm.com/T/#u
Changes in v2:
- Added separate patch to add support for HFI_PROP_OPB_ENABLE (Bryan)
- Updated commit text to indicate QC08C is NV12 with UBWC compression (Bryan, Dmitry)
- Renamed IRIS_FMT_UBWC to IRIS_FMT_QC08C (Dmitry)
- Link to v1: https://lore.kernel.org/r/20250919-video-iris-ubwc-enable-v1-0-000d11edafd8@oss.qualcomm.com
Signed-off-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
---
Dikshita Agarwal (3):
media: iris: Add support for HFI_PROP_OPB_ENABLE to control split mode
media: iris: Add support for QC08C format for decoder
media: iris: Add support for QC08C format for encoder
drivers/media/platform/qcom/iris/iris_buffer.c | 17 ++++--
.../platform/qcom/iris/iris_hfi_gen1_command.c | 15 ++++--
.../platform/qcom/iris/iris_hfi_gen2_command.c | 21 +++++++-
.../platform/qcom/iris/iris_hfi_gen2_defines.h | 1 +
drivers/media/platform/qcom/iris/iris_instance.h | 7 ++-
.../media/platform/qcom/iris/iris_platform_gen2.c | 1 +
drivers/media/platform/qcom/iris/iris_utils.c | 3 +-
drivers/media/platform/qcom/iris/iris_vdec.c | 61 ++++++++++++++++++----
drivers/media/platform/qcom/iris/iris_venc.c | 59 +++++++++++++++++----
9 files changed, 152 insertions(+), 33 deletions(-)
---
base-commit: 40b7a19f321e65789612ebaca966472055dab48c
change-id: 20250918-video-iris-ubwc-enable-87eac6f41fa4
Best regards,
--
Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v2 1/3] media: iris: Add support for HFI_PROP_OPB_ENABLE to control split mode
2025-10-08 9:52 [PATCH v2 0/3] Add support for QC08C format in iris driver Dikshita Agarwal
@ 2025-10-08 9:52 ` Dikshita Agarwal
2025-10-28 11:25 ` Vikash Garodia
2025-10-08 9:52 ` [PATCH v2 2/3] media: iris: Add support for QC08C format for decoder Dikshita Agarwal
` (2 subsequent siblings)
3 siblings, 1 reply; 15+ messages in thread
From: Dikshita Agarwal @ 2025-10-08 9:52 UTC (permalink / raw)
To: Vikash Garodia, Abhinav Kumar, Bryan O'Donoghue,
Mauro Carvalho Chehab
Cc: linux-media, linux-arm-msm, linux-kernel, Dmitry Baryshkov,
Dikshita Agarwal
Add handling for the HFI_PROP_OPB_ENABLE property, which allows enabling
or disabling split mode in the firmware. When HFI_PROP_OPB_ENABLE is set
to true, the firmware activates split mode for output picture buffers
(OPB). The OPB format is determined by the HFI_PROP_COLOR_FORMAT
property, supporting NV12 or QC08C formats.
Signed-off-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
---
drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c | 15 +++++++++++++++
drivers/media/platform/qcom/iris/iris_hfi_gen2_defines.h | 1 +
drivers/media/platform/qcom/iris/iris_platform_gen2.c | 1 +
3 files changed, 17 insertions(+)
diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c b/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c
index 4ce71a14250832440099e4cf3835b4aedfb749e8..56ced61de924eff3388c7df096f8235136bf473d 100644
--- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c
+++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c
@@ -422,6 +422,20 @@ static int iris_hfi_gen2_set_level(struct iris_inst *inst, u32 plane)
sizeof(u32));
}
+static int iris_hfi_gen2_set_opb_enable(struct iris_inst *inst, u32 plane)
+{
+ u32 port = iris_hfi_gen2_get_port(inst, plane);
+ u32 opb_enable = iris_split_mode_enabled(inst);
+
+ return iris_hfi_gen2_session_set_property(inst,
+ HFI_PROP_OPB_ENABLE,
+ HFI_HOST_FLAGS_NONE,
+ port,
+ HFI_PAYLOAD_U32,
+ &opb_enable,
+ sizeof(u32));
+}
+
static int iris_hfi_gen2_set_colorformat(struct iris_inst *inst, u32 plane)
{
u32 port = iris_hfi_gen2_get_port(inst, plane);
@@ -527,6 +541,7 @@ static int iris_hfi_gen2_session_set_config_params(struct iris_inst *inst, u32 p
{HFI_PROP_SIGNAL_COLOR_INFO, iris_hfi_gen2_set_colorspace },
{HFI_PROP_PROFILE, iris_hfi_gen2_set_profile },
{HFI_PROP_LEVEL, iris_hfi_gen2_set_level },
+ {HFI_PROP_OPB_ENABLE, iris_hfi_gen2_set_opb_enable },
{HFI_PROP_COLOR_FORMAT, iris_hfi_gen2_set_colorformat },
{HFI_PROP_LINEAR_STRIDE_SCANLINE, iris_hfi_gen2_set_linear_stride_scanline },
{HFI_PROP_TIER, iris_hfi_gen2_set_tier },
diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_defines.h b/drivers/media/platform/qcom/iris/iris_hfi_gen2_defines.h
index aa1f795f5626c1f76a32dd650302633877ce67be..1b6a4dbac828ffea53c1be0d3624a033c283c972 100644
--- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_defines.h
+++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_defines.h
@@ -91,6 +91,7 @@ enum hfi_seq_header_mode {
#define HFI_PROP_BUFFER_MARK 0x0300016c
#define HFI_PROP_RAW_RESOLUTION 0x03000178
#define HFI_PROP_TOTAL_PEAK_BITRATE 0x0300017C
+#define HFI_PROP_OPB_ENABLE 0x03000184
#define HFI_PROP_COMV_BUFFER_COUNT 0x03000193
#define HFI_PROP_END 0x03FFFFFF
diff --git a/drivers/media/platform/qcom/iris/iris_platform_gen2.c b/drivers/media/platform/qcom/iris/iris_platform_gen2.c
index 36d69cc73986b74534a2912524c8553970fd862e..69c952c68e939f305f25511e2e4763487ec8e0de 100644
--- a/drivers/media/platform/qcom/iris/iris_platform_gen2.c
+++ b/drivers/media/platform/qcom/iris/iris_platform_gen2.c
@@ -691,6 +691,7 @@ static const u32 sm8550_venc_input_config_params[] = {
};
static const u32 sm8550_vdec_output_config_params[] = {
+ HFI_PROP_OPB_ENABLE,
HFI_PROP_COLOR_FORMAT,
HFI_PROP_LINEAR_STRIDE_SCANLINE,
};
--
2.34.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v2 2/3] media: iris: Add support for QC08C format for decoder
2025-10-08 9:52 [PATCH v2 0/3] Add support for QC08C format in iris driver Dikshita Agarwal
2025-10-08 9:52 ` [PATCH v2 1/3] media: iris: Add support for HFI_PROP_OPB_ENABLE to control split mode Dikshita Agarwal
@ 2025-10-08 9:52 ` Dikshita Agarwal
2025-10-28 11:26 ` Vikash Garodia
2025-10-08 9:52 ` [PATCH v2 3/3] media: iris: Add support for QC08C format for encoder Dikshita Agarwal
2026-01-15 8:08 ` [PATCH v2 0/3] Add support for QC08C format in iris driver Dmitry Baryshkov
3 siblings, 1 reply; 15+ messages in thread
From: Dikshita Agarwal @ 2025-10-08 9:52 UTC (permalink / raw)
To: Vikash Garodia, Abhinav Kumar, Bryan O'Donoghue,
Mauro Carvalho Chehab
Cc: linux-media, linux-arm-msm, linux-kernel, Dmitry Baryshkov,
Dikshita Agarwal
Introduce handling for the QC08C format in the decoder. QC08C format is
NV12 with UBWC compression. Update format checks and configuration to
enable decoding of QC08C streams.
Signed-off-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
---
drivers/media/platform/qcom/iris/iris_buffer.c | 5 +-
.../platform/qcom/iris/iris_hfi_gen1_command.c | 12 +++--
.../platform/qcom/iris/iris_hfi_gen2_command.c | 3 +-
drivers/media/platform/qcom/iris/iris_instance.h | 7 ++-
drivers/media/platform/qcom/iris/iris_utils.c | 3 +-
drivers/media/platform/qcom/iris/iris_vdec.c | 61 ++++++++++++++++++----
6 files changed, 72 insertions(+), 19 deletions(-)
diff --git a/drivers/media/platform/qcom/iris/iris_buffer.c b/drivers/media/platform/qcom/iris/iris_buffer.c
index c0900038e7defccf7de3cb60e17c71e36a0e8ead..83dcf49e57ec1473bc4edd26c48ab0b247d23818 100644
--- a/drivers/media/platform/qcom/iris/iris_buffer.c
+++ b/drivers/media/platform/qcom/iris/iris_buffer.c
@@ -261,7 +261,10 @@ int iris_get_buffer_size(struct iris_inst *inst,
case BUF_INPUT:
return iris_dec_bitstream_buffer_size(inst);
case BUF_OUTPUT:
- return iris_yuv_buffer_size_nv12(inst);
+ if (inst->fmt_dst->fmt.pix_mp.pixelformat == V4L2_PIX_FMT_QC08C)
+ return iris_yuv_buffer_size_qc08c(inst);
+ else
+ return iris_yuv_buffer_size_nv12(inst);
case BUF_DPB:
return iris_yuv_buffer_size_qc08c(inst);
default:
diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c b/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c
index e1788c266bb1080921f17248fd5ee60156b3143d..e458d3349ce09aadb75d056ae84e3aab95f03078 100644
--- a/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c
+++ b/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c
@@ -774,20 +774,21 @@ static int iris_hfi_gen1_set_raw_format(struct iris_inst *inst, u32 plane)
pixelformat = inst->fmt_dst->fmt.pix_mp.pixelformat;
if (iris_split_mode_enabled(inst)) {
fmt.buffer_type = HFI_BUFFER_OUTPUT;
- fmt.format = pixelformat == V4L2_PIX_FMT_NV12 ?
- HFI_COLOR_FORMAT_NV12_UBWC : 0;
+ fmt.format = HFI_COLOR_FORMAT_NV12_UBWC;
ret = hfi_gen1_set_property(inst, ptype, &fmt, sizeof(fmt));
if (ret)
return ret;
fmt.buffer_type = HFI_BUFFER_OUTPUT2;
- fmt.format = pixelformat == V4L2_PIX_FMT_NV12 ? HFI_COLOR_FORMAT_NV12 : 0;
+ fmt.format = pixelformat == V4L2_PIX_FMT_NV12 ?
+ HFI_COLOR_FORMAT_NV12 : HFI_COLOR_FORMAT_NV12_UBWC;
ret = hfi_gen1_set_property(inst, ptype, &fmt, sizeof(fmt));
} else {
fmt.buffer_type = HFI_BUFFER_OUTPUT;
- fmt.format = pixelformat == V4L2_PIX_FMT_NV12 ? HFI_COLOR_FORMAT_NV12 : 0;
+ fmt.format = pixelformat == V4L2_PIX_FMT_NV12 ?
+ HFI_COLOR_FORMAT_NV12 : HFI_COLOR_FORMAT_NV12_UBWC;
ret = hfi_gen1_set_property(inst, ptype, &fmt, sizeof(fmt));
}
@@ -806,6 +807,9 @@ static int iris_hfi_gen1_set_format_constraints(struct iris_inst *inst, u32 plan
const u32 ptype = HFI_PROPERTY_PARAM_UNCOMPRESSED_PLANE_ACTUAL_CONSTRAINTS_INFO;
struct hfi_uncompressed_plane_actual_constraints_info pconstraint;
+ if (inst->fmt_dst->fmt.pix_mp.pixelformat == V4L2_PIX_FMT_QC08C)
+ return 0;
+
pconstraint.buffer_type = HFI_BUFFER_OUTPUT2;
pconstraint.num_planes = 2;
pconstraint.plane_format[0].stride_multiples = 128;
diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c b/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c
index 56ced61de924eff3388c7df096f8235136bf473d..5ad202d3fcdc57a2b7b43de15763a686ce0f7bd7 100644
--- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c
+++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c
@@ -443,7 +443,8 @@ static int iris_hfi_gen2_set_colorformat(struct iris_inst *inst, u32 plane)
if (inst->domain == DECODER) {
pixelformat = inst->fmt_dst->fmt.pix_mp.pixelformat;
- hfi_colorformat = pixelformat == V4L2_PIX_FMT_NV12 ? HFI_COLOR_FMT_NV12 : 0;
+ hfi_colorformat = pixelformat == V4L2_PIX_FMT_NV12 ?
+ HFI_COLOR_FMT_NV12 : HFI_COLOR_FMT_NV12_UBWC;
} else {
pixelformat = inst->fmt_src->fmt.pix_mp.pixelformat;
hfi_colorformat = pixelformat == V4L2_PIX_FMT_NV12 ? HFI_COLOR_FMT_NV12 : 0;
diff --git a/drivers/media/platform/qcom/iris/iris_instance.h b/drivers/media/platform/qcom/iris/iris_instance.h
index 5982d7adefeab80905478b32cddba7bd4651a691..62fbb30691ff967212022308fa53ff221fa24ce9 100644
--- a/drivers/media/platform/qcom/iris/iris_instance.h
+++ b/drivers/media/platform/qcom/iris/iris_instance.h
@@ -15,12 +15,17 @@
#define DEFAULT_WIDTH 320
#define DEFAULT_HEIGHT 240
-enum iris_fmt_type {
+enum iris_fmt_type_out {
IRIS_FMT_H264,
IRIS_FMT_HEVC,
IRIS_FMT_VP9,
};
+enum iris_fmt_type_cap {
+ IRIS_FMT_NV12,
+ IRIS_FMT_QC08C,
+};
+
struct iris_fmt {
u32 pixfmt;
u32 type;
diff --git a/drivers/media/platform/qcom/iris/iris_utils.c b/drivers/media/platform/qcom/iris/iris_utils.c
index 85c70a62b1fd2c409fc18b28f64771cb0097a7fd..e2f1131de43128254d8211343771e657e425541e 100644
--- a/drivers/media/platform/qcom/iris/iris_utils.c
+++ b/drivers/media/platform/qcom/iris/iris_utils.c
@@ -34,7 +34,8 @@ int iris_get_mbpf(struct iris_inst *inst)
bool iris_split_mode_enabled(struct iris_inst *inst)
{
- return inst->fmt_dst->fmt.pix_mp.pixelformat == V4L2_PIX_FMT_NV12;
+ return inst->fmt_dst->fmt.pix_mp.pixelformat == V4L2_PIX_FMT_NV12 ||
+ inst->fmt_dst->fmt.pix_mp.pixelformat == V4L2_PIX_FMT_QC08C;
}
void iris_helper_buffers_done(struct iris_inst *inst, unsigned int type,
diff --git a/drivers/media/platform/qcom/iris/iris_vdec.c b/drivers/media/platform/qcom/iris/iris_vdec.c
index ae13c3e1b426bfd81a7b46dc6c3ff5eb5c4860cb..96844325b24e25497f1d59750f34c67177fdddc7 100644
--- a/drivers/media/platform/qcom/iris/iris_vdec.c
+++ b/drivers/media/platform/qcom/iris/iris_vdec.c
@@ -67,7 +67,7 @@ void iris_vdec_inst_deinit(struct iris_inst *inst)
kfree(inst->fmt_src);
}
-static const struct iris_fmt iris_vdec_formats[] = {
+static const struct iris_fmt iris_vdec_formats_out[] = {
[IRIS_FMT_H264] = {
.pixfmt = V4L2_PIX_FMT_H264,
.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
@@ -82,12 +82,35 @@ static const struct iris_fmt iris_vdec_formats[] = {
},
};
+static const struct iris_fmt iris_vdec_formats_cap[] = {
+ [IRIS_FMT_NV12] = {
+ .pixfmt = V4L2_PIX_FMT_NV12,
+ .type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
+ },
+ [IRIS_FMT_QC08C] = {
+ .pixfmt = V4L2_PIX_FMT_QC08C,
+ .type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
+ },
+};
+
static const struct iris_fmt *
find_format(struct iris_inst *inst, u32 pixfmt, u32 type)
{
- unsigned int size = ARRAY_SIZE(iris_vdec_formats);
- const struct iris_fmt *fmt = iris_vdec_formats;
+ const struct iris_fmt *fmt = NULL;
+ unsigned int size = 0;
unsigned int i;
+ switch (type) {
+ case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
+ fmt = iris_vdec_formats_out;
+ size = ARRAY_SIZE(iris_vdec_formats_out);
+ break;
+ case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
+ fmt = iris_vdec_formats_cap;
+ size = ARRAY_SIZE(iris_vdec_formats_cap);
+ break;
+ default:
+ return NULL;
+ }
for (i = 0; i < size; i++) {
if (fmt[i].pixfmt == pixfmt)
@@ -103,8 +126,21 @@ find_format(struct iris_inst *inst, u32 pixfmt, u32 type)
static const struct iris_fmt *
find_format_by_index(struct iris_inst *inst, u32 index, u32 type)
{
- const struct iris_fmt *fmt = iris_vdec_formats;
- unsigned int size = ARRAY_SIZE(iris_vdec_formats);
+ const struct iris_fmt *fmt = NULL;
+ unsigned int size = 0;
+
+ switch (type) {
+ case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
+ fmt = iris_vdec_formats_out;
+ size = ARRAY_SIZE(iris_vdec_formats_out);
+ break;
+ case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
+ fmt = iris_vdec_formats_cap;
+ size = ARRAY_SIZE(iris_vdec_formats_cap);
+ break;
+ default:
+ return NULL;
+ }
if (index >= size || fmt[index].type != type)
return NULL;
@@ -126,9 +162,10 @@ int iris_vdec_enum_fmt(struct iris_inst *inst, struct v4l2_fmtdesc *f)
f->flags = V4L2_FMT_FLAG_COMPRESSED | V4L2_FMT_FLAG_DYN_RESOLUTION;
break;
case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
- if (f->index)
+ fmt = find_format_by_index(inst, f->index, f->type);
+ if (!fmt)
return -EINVAL;
- f->pixelformat = V4L2_PIX_FMT_NV12;
+ f->pixelformat = fmt->pixfmt;
break;
default:
return -EINVAL;
@@ -157,7 +194,7 @@ int iris_vdec_try_fmt(struct iris_inst *inst, struct v4l2_format *f)
}
break;
case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
- if (f->fmt.pix_mp.pixelformat != V4L2_PIX_FMT_NV12) {
+ if (!fmt) {
f_inst = inst->fmt_dst;
f->fmt.pix_mp.pixelformat = f_inst->fmt.pix_mp.pixelformat;
f->fmt.pix_mp.width = f_inst->fmt.pix_mp.width;
@@ -238,10 +275,11 @@ int iris_vdec_s_fmt(struct iris_inst *inst, struct v4l2_format *f)
inst->crop.height = f->fmt.pix_mp.height;
break;
case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
+ if (!(find_format(inst, f->fmt.pix_mp.pixelformat, f->type)))
+ return -EINVAL;
+
fmt = inst->fmt_dst;
fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
- if (fmt->fmt.pix_mp.pixelformat != V4L2_PIX_FMT_NV12)
- return -EINVAL;
fmt->fmt.pix_mp.pixelformat = f->fmt.pix_mp.pixelformat;
fmt->fmt.pix_mp.width = ALIGN(f->fmt.pix_mp.width, 128);
fmt->fmt.pix_mp.height = ALIGN(f->fmt.pix_mp.height, 32);
@@ -268,7 +306,8 @@ int iris_vdec_validate_format(struct iris_inst *inst, u32 pixelformat)
{
const struct iris_fmt *fmt = NULL;
- if (pixelformat != V4L2_PIX_FMT_NV12) {
+ fmt = find_format(inst, pixelformat, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE);
+ if (!fmt) {
fmt = find_format(inst, pixelformat, V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE);
if (!fmt)
return -EINVAL;
--
2.34.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v2 3/3] media: iris: Add support for QC08C format for encoder
2025-10-08 9:52 [PATCH v2 0/3] Add support for QC08C format in iris driver Dikshita Agarwal
2025-10-08 9:52 ` [PATCH v2 1/3] media: iris: Add support for HFI_PROP_OPB_ENABLE to control split mode Dikshita Agarwal
2025-10-08 9:52 ` [PATCH v2 2/3] media: iris: Add support for QC08C format for decoder Dikshita Agarwal
@ 2025-10-08 9:52 ` Dikshita Agarwal
2025-10-28 11:26 ` Vikash Garodia
2026-01-09 14:28 ` Neil Armstrong
2026-01-15 8:08 ` [PATCH v2 0/3] Add support for QC08C format in iris driver Dmitry Baryshkov
3 siblings, 2 replies; 15+ messages in thread
From: Dikshita Agarwal @ 2025-10-08 9:52 UTC (permalink / raw)
To: Vikash Garodia, Abhinav Kumar, Bryan O'Donoghue,
Mauro Carvalho Chehab
Cc: linux-media, linux-arm-msm, linux-kernel, Dmitry Baryshkov,
Dikshita Agarwal
Introduce handling for the QC08C format in the encoder. QC08C
format is NV12 with UBWC compression. Update format checks and
configuration to enable encoding to QC08C streams.
Signed-off-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
---
drivers/media/platform/qcom/iris/iris_buffer.c | 12 ++++-
.../platform/qcom/iris/iris_hfi_gen1_command.c | 3 +-
.../platform/qcom/iris/iris_hfi_gen2_command.c | 3 +-
drivers/media/platform/qcom/iris/iris_venc.c | 59 ++++++++++++++++++----
4 files changed, 63 insertions(+), 14 deletions(-)
diff --git a/drivers/media/platform/qcom/iris/iris_buffer.c b/drivers/media/platform/qcom/iris/iris_buffer.c
index 83dcf49e57ec1473bc4edd26c48ab0b247d23818..b89b1ee06cce151e7c04a80956380d154643c116 100644
--- a/drivers/media/platform/qcom/iris/iris_buffer.c
+++ b/drivers/media/platform/qcom/iris/iris_buffer.c
@@ -171,9 +171,14 @@ static u32 iris_yuv_buffer_size_nv12(struct iris_inst *inst)
static u32 iris_yuv_buffer_size_qc08c(struct iris_inst *inst)
{
u32 y_plane, uv_plane, y_stride, uv_stride;
- struct v4l2_format *f = inst->fmt_dst;
u32 uv_meta_stride, uv_meta_plane;
u32 y_meta_stride, y_meta_plane;
+ struct v4l2_format *f = NULL;
+
+ if (inst->domain == DECODER)
+ f = inst->fmt_dst;
+ else
+ f = inst->fmt_src;
y_meta_stride = ALIGN(DIV_ROUND_UP(f->fmt.pix_mp.width, META_STRIDE_ALIGNED >> 1),
META_STRIDE_ALIGNED);
@@ -273,7 +278,10 @@ int iris_get_buffer_size(struct iris_inst *inst,
} else {
switch (buffer_type) {
case BUF_INPUT:
- return iris_yuv_buffer_size_nv12(inst);
+ if (inst->fmt_src->fmt.pix_mp.pixelformat == V4L2_PIX_FMT_QC08C)
+ return iris_yuv_buffer_size_qc08c(inst);
+ else
+ return iris_yuv_buffer_size_nv12(inst);
case BUF_OUTPUT:
return iris_enc_bitstream_buffer_size(inst);
default:
diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c b/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c
index e458d3349ce09aadb75d056ae84e3aab95f03078..52da7ef7bab08fb1cb2ac804ccc6e3c7f9677890 100644
--- a/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c
+++ b/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c
@@ -795,7 +795,8 @@ static int iris_hfi_gen1_set_raw_format(struct iris_inst *inst, u32 plane)
} else {
pixelformat = inst->fmt_src->fmt.pix_mp.pixelformat;
fmt.buffer_type = HFI_BUFFER_INPUT;
- fmt.format = pixelformat == V4L2_PIX_FMT_NV12 ? HFI_COLOR_FORMAT_NV12 : 0;
+ fmt.format = pixelformat == V4L2_PIX_FMT_NV12 ?
+ HFI_COLOR_FORMAT_NV12 : HFI_COLOR_FORMAT_NV12_UBWC;
ret = hfi_gen1_set_property(inst, ptype, &fmt, sizeof(fmt));
}
diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c b/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c
index 5ad202d3fcdc57a2b7b43de15763a686ce0f7bd7..6a772db2ec33fb002d8884753a41dc98b3a8439d 100644
--- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c
+++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c
@@ -447,7 +447,8 @@ static int iris_hfi_gen2_set_colorformat(struct iris_inst *inst, u32 plane)
HFI_COLOR_FMT_NV12 : HFI_COLOR_FMT_NV12_UBWC;
} else {
pixelformat = inst->fmt_src->fmt.pix_mp.pixelformat;
- hfi_colorformat = pixelformat == V4L2_PIX_FMT_NV12 ? HFI_COLOR_FMT_NV12 : 0;
+ hfi_colorformat = pixelformat == V4L2_PIX_FMT_NV12 ?
+ HFI_COLOR_FMT_NV12 : HFI_COLOR_FMT_NV12_UBWC;
}
return iris_hfi_gen2_session_set_property(inst,
diff --git a/drivers/media/platform/qcom/iris/iris_venc.c b/drivers/media/platform/qcom/iris/iris_venc.c
index 099bd5ed4ae0294725860305254c4cad1ec88d7e..95e3ceb22d8c3a46c1bf3eb87e7c1cc5ccf3039f 100644
--- a/drivers/media/platform/qcom/iris/iris_venc.c
+++ b/drivers/media/platform/qcom/iris/iris_venc.c
@@ -80,7 +80,7 @@ void iris_venc_inst_deinit(struct iris_inst *inst)
kfree(inst->fmt_src);
}
-static const struct iris_fmt iris_venc_formats[] = {
+static const struct iris_fmt iris_venc_formats_cap[] = {
[IRIS_FMT_H264] = {
.pixfmt = V4L2_PIX_FMT_H264,
.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
@@ -91,12 +91,35 @@ static const struct iris_fmt iris_venc_formats[] = {
},
};
+static const struct iris_fmt iris_venc_formats_out[] = {
+ [IRIS_FMT_NV12] = {
+ .pixfmt = V4L2_PIX_FMT_NV12,
+ .type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
+ },
+ [IRIS_FMT_QC08C] = {
+ .pixfmt = V4L2_PIX_FMT_QC08C,
+ .type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
+ },
+};
+
static const struct iris_fmt *
find_format(struct iris_inst *inst, u32 pixfmt, u32 type)
{
- const struct iris_fmt *fmt = iris_venc_formats;
- unsigned int size = ARRAY_SIZE(iris_venc_formats);
+ const struct iris_fmt *fmt = NULL;
+ unsigned int size = 0;
unsigned int i;
+ switch (type) {
+ case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
+ fmt = iris_venc_formats_out;
+ size = ARRAY_SIZE(iris_venc_formats_out);
+ break;
+ case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
+ fmt = iris_venc_formats_cap;
+ size = ARRAY_SIZE(iris_venc_formats_cap);
+ break;
+ default:
+ return NULL;
+ }
for (i = 0; i < size; i++) {
if (fmt[i].pixfmt == pixfmt)
@@ -112,8 +135,21 @@ find_format(struct iris_inst *inst, u32 pixfmt, u32 type)
static const struct iris_fmt *
find_format_by_index(struct iris_inst *inst, u32 index, u32 type)
{
- const struct iris_fmt *fmt = iris_venc_formats;
- unsigned int size = ARRAY_SIZE(iris_venc_formats);
+ const struct iris_fmt *fmt = NULL;
+ unsigned int size = 0;
+
+ switch (type) {
+ case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
+ fmt = iris_venc_formats_out;
+ size = ARRAY_SIZE(iris_venc_formats_out);
+ break;
+ case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
+ fmt = iris_venc_formats_cap;
+ size = ARRAY_SIZE(iris_venc_formats_cap);
+ break;
+ default:
+ return NULL;
+ }
if (index >= size || fmt[index].type != type)
return NULL;
@@ -127,9 +163,11 @@ int iris_venc_enum_fmt(struct iris_inst *inst, struct v4l2_fmtdesc *f)
switch (f->type) {
case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
- if (f->index)
+ fmt = find_format_by_index(inst, f->index, f->type);
+ if (!fmt)
return -EINVAL;
- f->pixelformat = V4L2_PIX_FMT_NV12;
+
+ f->pixelformat = fmt->pixfmt;
break;
case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
fmt = find_format_by_index(inst, f->index, f->type);
@@ -156,7 +194,7 @@ int iris_venc_try_fmt(struct iris_inst *inst, struct v4l2_format *f)
fmt = find_format(inst, pixmp->pixelformat, f->type);
switch (f->type) {
case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
- if (f->fmt.pix_mp.pixelformat != V4L2_PIX_FMT_NV12) {
+ if (!fmt) {
f_inst = inst->fmt_src;
f->fmt.pix_mp.width = f_inst->fmt.pix_mp.width;
f->fmt.pix_mp.height = f_inst->fmt.pix_mp.height;
@@ -221,7 +259,7 @@ static int iris_venc_s_fmt_input(struct iris_inst *inst, struct v4l2_format *f)
iris_venc_try_fmt(inst, f);
- if (f->fmt.pix_mp.pixelformat != V4L2_PIX_FMT_NV12)
+ if (!(find_format(inst, f->fmt.pix_mp.pixelformat, f->type)))
return -EINVAL;
fmt = inst->fmt_src;
@@ -289,7 +327,8 @@ int iris_venc_validate_format(struct iris_inst *inst, u32 pixelformat)
{
const struct iris_fmt *fmt = NULL;
- if (pixelformat != V4L2_PIX_FMT_NV12) {
+ fmt = find_format(inst, pixelformat, V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE);
+ if (!fmt) {
fmt = find_format(inst, pixelformat, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE);
if (!fmt)
return -EINVAL;
--
2.34.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH v2 1/3] media: iris: Add support for HFI_PROP_OPB_ENABLE to control split mode
2025-10-08 9:52 ` [PATCH v2 1/3] media: iris: Add support for HFI_PROP_OPB_ENABLE to control split mode Dikshita Agarwal
@ 2025-10-28 11:25 ` Vikash Garodia
0 siblings, 0 replies; 15+ messages in thread
From: Vikash Garodia @ 2025-10-28 11:25 UTC (permalink / raw)
To: Dikshita Agarwal, Abhinav Kumar, Bryan O'Donoghue,
Mauro Carvalho Chehab
Cc: linux-media, linux-arm-msm, linux-kernel, Dmitry Baryshkov
On 10/8/2025 3:22 PM, Dikshita Agarwal wrote:
> Add handling for the HFI_PROP_OPB_ENABLE property, which allows enabling
> or disabling split mode in the firmware. When HFI_PROP_OPB_ENABLE is set
> to true, the firmware activates split mode for output picture buffers
> (OPB). The OPB format is determined by the HFI_PROP_COLOR_FORMAT
> property, supporting NV12 or QC08C formats.
>
> Signed-off-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
> ---
> drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c | 15 +++++++++++++++
> drivers/media/platform/qcom/iris/iris_hfi_gen2_defines.h | 1 +
> drivers/media/platform/qcom/iris/iris_platform_gen2.c | 1 +
> 3 files changed, 17 insertions(+)
Reviewed-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 2/3] media: iris: Add support for QC08C format for decoder
2025-10-08 9:52 ` [PATCH v2 2/3] media: iris: Add support for QC08C format for decoder Dikshita Agarwal
@ 2025-10-28 11:26 ` Vikash Garodia
0 siblings, 0 replies; 15+ messages in thread
From: Vikash Garodia @ 2025-10-28 11:26 UTC (permalink / raw)
To: Dikshita Agarwal, Abhinav Kumar, Bryan O'Donoghue,
Mauro Carvalho Chehab
Cc: linux-media, linux-arm-msm, linux-kernel, Dmitry Baryshkov
On 10/8/2025 3:22 PM, Dikshita Agarwal wrote:
> Introduce handling for the QC08C format in the decoder. QC08C format is
> NV12 with UBWC compression. Update format checks and configuration to
> enable decoding of QC08C streams.
>
> Signed-off-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
> ---
> drivers/media/platform/qcom/iris/iris_buffer.c | 5 +-
> .../platform/qcom/iris/iris_hfi_gen1_command.c | 12 +++--
> .../platform/qcom/iris/iris_hfi_gen2_command.c | 3 +-
> drivers/media/platform/qcom/iris/iris_instance.h | 7 ++-
> drivers/media/platform/qcom/iris/iris_utils.c | 3 +-
> drivers/media/platform/qcom/iris/iris_vdec.c | 61 ++++++++++++++++++----
> 6 files changed, 72 insertions(+), 19 deletions(-)
Reviewed-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 3/3] media: iris: Add support for QC08C format for encoder
2025-10-08 9:52 ` [PATCH v2 3/3] media: iris: Add support for QC08C format for encoder Dikshita Agarwal
@ 2025-10-28 11:26 ` Vikash Garodia
2026-01-09 14:28 ` Neil Armstrong
1 sibling, 0 replies; 15+ messages in thread
From: Vikash Garodia @ 2025-10-28 11:26 UTC (permalink / raw)
To: Dikshita Agarwal, Abhinav Kumar, Bryan O'Donoghue,
Mauro Carvalho Chehab
Cc: linux-media, linux-arm-msm, linux-kernel, Dmitry Baryshkov
On 10/8/2025 3:22 PM, Dikshita Agarwal wrote:
> Introduce handling for the QC08C format in the encoder. QC08C
> format is NV12 with UBWC compression. Update format checks and
> configuration to enable encoding to QC08C streams.
>
> Signed-off-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
> ---
> drivers/media/platform/qcom/iris/iris_buffer.c | 12 ++++-
> .../platform/qcom/iris/iris_hfi_gen1_command.c | 3 +-
> .../platform/qcom/iris/iris_hfi_gen2_command.c | 3 +-
> drivers/media/platform/qcom/iris/iris_venc.c | 59 ++++++++++++++++++----
> 4 files changed, 63 insertions(+), 14 deletions(-)
Reviewed-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 3/3] media: iris: Add support for QC08C format for encoder
2025-10-08 9:52 ` [PATCH v2 3/3] media: iris: Add support for QC08C format for encoder Dikshita Agarwal
2025-10-28 11:26 ` Vikash Garodia
@ 2026-01-09 14:28 ` Neil Armstrong
2026-01-13 8:39 ` Neil Armstrong
1 sibling, 1 reply; 15+ messages in thread
From: Neil Armstrong @ 2026-01-09 14:28 UTC (permalink / raw)
To: Dikshita Agarwal, Vikash Garodia, Abhinav Kumar,
Bryan O'Donoghue, Mauro Carvalho Chehab
Cc: linux-media, linux-arm-msm, linux-kernel, Dmitry Baryshkov
Hi,
On 10/8/25 11:52, Dikshita Agarwal wrote:
> Introduce handling for the QC08C format in the encoder. QC08C
> format is NV12 with UBWC compression. Update format checks and
> configuration to enable encoding to QC08C streams.
I'm late to the party but I've been trying the new encoder features patchset
on top of v6.19-rc4 on the SM8650-HDK, but the result was wrong like if something
was wrong in the planes offsets, leading the the UV colors moving in the background.
The encoding was fine on v6.18 final release.
Here's a screenshot:
https://pasteboard.co/t8HmeNaIFMDR.png
The command I use are:
ffmpeg -f lavfi -i testsrc=duration=10:size=1920x1080:rate=30 -pix_fmt nv12 test_video_1080_10s.yuv
v4l2-ctl --verbose --set-fmt-video-out=width=1920,height=1080,pixelformat=NV12 --set-selection-output target=crop,top=0,left=0,width=1920,height=1080 --set-fmt-video=pixelformat=H264 --stream-mmap --stream-out-mmap --stream-from=test_video_1080_10s.yuv --stream-to=test_video_1080_10s.h264 -d /dev/video1
I did a bisect and it did lead to the very change:
# bad: [9ace4753a5202b02191d54e9fdf7f9e3d02b85eb] Linux 6.19-rc4
# good: [7d0a66e4bb9081d75c82ec4957c50034cb0ea449] Linux 6.18
git bisect start 'v6.19-rc4' 'v6.18' 'drivers/media/platform/qcom/iris/'
# bad: [6dfafbd0299a60bfb5d5e277fdf100037c7ded07] Merge tag 'drm-next-2025-12-03' of https://gitlab.freedesktop.org/drm/kernel
git bisect bad 6dfafbd0299a60bfb5d5e277fdf100037c7ded07
# good: [8f7aa3d3c7323f4ca2768a9e74ebbe359c4f8f88] Merge tag 'net-next-6.19' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next
git bisect good 8f7aa3d3c7323f4ca2768a9e74ebbe359c4f8f88
# good: [490fd9336650a39c57ce2a652676a8cb9dc6c842] Merge tag 'drm-misc-next-2025-11-14-1' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-next
git bisect good 490fd9336650a39c57ce2a652676a8cb9dc6c842
# good: [559e608c46553c107dbba19dae0854af7b219400] Merge tag 'ntfs3_for_6.19' of https://github.com/Paragon-Software-Group/linux-ntfs3
git bisect good 559e608c46553c107dbba19dae0854af7b219400
# good: [b3239df349c2c2c94686674489c9629c89ca49a1] Merge tag 'drm-misc-next-2025-12-01-1' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-next
git bisect good b3239df349c2c2c94686674489c9629c89ca49a1
# good: [6e971cfe62e7a56593b22ab1ad0050ac49551696] media: venus: drop bogus probe deferrals
git bisect good 6e971cfe62e7a56593b22ab1ad0050ac49551696
# bad: [f53fb31a388901cfe11b95a3a2cf1594355321e4] media: rockchip: add driver for the rockchip camera interface
git bisect bad f53fb31a388901cfe11b95a3a2cf1594355321e4
# bad: [e687f5cae591dba4a0a968c24cbe7b6141027d93] media: imx-mipi-csis: Support active data lanes differing from maximum
git bisect bad e687f5cae591dba4a0a968c24cbe7b6141027d93
# bad: [c33f7e61a1c9e9255597102e61add4b4fe91668c] media: qcom: camss: Add CSIPHY 2.2.0 lane configuration for SM8650
git bisect bad c33f7e61a1c9e9255597102e61add4b4fe91668c
# bad: [542e3540ddd75f0a46dd365978476bcc1dda5b5a] media: iris: enable support for SC7280 platform
git bisect bad 542e3540ddd75f0a46dd365978476bcc1dda5b5a
# bad: [e5894eeefdebf5a6d7512cd23efec78071985738] media: iris: turn platform caps into constants
git bisect bad e5894eeefdebf5a6d7512cd23efec78071985738
# good: [7c1f3bd58fa02f427ff4ef611fa49b56bc6f8f76] media: iris: Add support for HFI_PROP_OPB_ENABLE to control split mode
git bisect good 7c1f3bd58fa02f427ff4ef611fa49b56bc6f8f76
# bad: [456c99da41cb6f39c5c8420710b72fb9fd1450b4] media: iris: Add support for QC08C format for encoder
git bisect bad 456c99da41cb6f39c5c8420710b72fb9fd1450b4
# good: [cfd71b14b0d6f62d97338a524c858c63cf699c3f] media: iris: Add support for QC08C format for decoder
git bisect good cfd71b14b0d6f62d97338a524c858c63cf699c3f
# first bad commit: [456c99da41cb6f39c5c8420710b72fb9fd1450b4] media: iris: Add support for QC08C format for encoder
I don't see what would be causing this.
Thanks,
Neil
>
> Signed-off-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
> ---
> drivers/media/platform/qcom/iris/iris_buffer.c | 12 ++++-
> .../platform/qcom/iris/iris_hfi_gen1_command.c | 3 +-
> .../platform/qcom/iris/iris_hfi_gen2_command.c | 3 +-
> drivers/media/platform/qcom/iris/iris_venc.c | 59 ++++++++++++++++++----
> 4 files changed, 63 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/media/platform/qcom/iris/iris_buffer.c b/drivers/media/platform/qcom/iris/iris_buffer.c
> index 83dcf49e57ec1473bc4edd26c48ab0b247d23818..b89b1ee06cce151e7c04a80956380d154643c116 100644
> --- a/drivers/media/platform/qcom/iris/iris_buffer.c
> +++ b/drivers/media/platform/qcom/iris/iris_buffer.c
> @@ -171,9 +171,14 @@ static u32 iris_yuv_buffer_size_nv12(struct iris_inst *inst)
> static u32 iris_yuv_buffer_size_qc08c(struct iris_inst *inst)
> {
> u32 y_plane, uv_plane, y_stride, uv_stride;
> - struct v4l2_format *f = inst->fmt_dst;
> u32 uv_meta_stride, uv_meta_plane;
> u32 y_meta_stride, y_meta_plane;
> + struct v4l2_format *f = NULL;
> +
> + if (inst->domain == DECODER)
> + f = inst->fmt_dst;
> + else
> + f = inst->fmt_src;
>
> y_meta_stride = ALIGN(DIV_ROUND_UP(f->fmt.pix_mp.width, META_STRIDE_ALIGNED >> 1),
> META_STRIDE_ALIGNED);
> @@ -273,7 +278,10 @@ int iris_get_buffer_size(struct iris_inst *inst,
> } else {
> switch (buffer_type) {
> case BUF_INPUT:
> - return iris_yuv_buffer_size_nv12(inst);
> + if (inst->fmt_src->fmt.pix_mp.pixelformat == V4L2_PIX_FMT_QC08C)
> + return iris_yuv_buffer_size_qc08c(inst);
> + else
> + return iris_yuv_buffer_size_nv12(inst);
> case BUF_OUTPUT:
> return iris_enc_bitstream_buffer_size(inst);
> default:
> diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c b/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c
> index e458d3349ce09aadb75d056ae84e3aab95f03078..52da7ef7bab08fb1cb2ac804ccc6e3c7f9677890 100644
> --- a/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c
> +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c
> @@ -795,7 +795,8 @@ static int iris_hfi_gen1_set_raw_format(struct iris_inst *inst, u32 plane)
> } else {
> pixelformat = inst->fmt_src->fmt.pix_mp.pixelformat;
> fmt.buffer_type = HFI_BUFFER_INPUT;
> - fmt.format = pixelformat == V4L2_PIX_FMT_NV12 ? HFI_COLOR_FORMAT_NV12 : 0;
> + fmt.format = pixelformat == V4L2_PIX_FMT_NV12 ?
> + HFI_COLOR_FORMAT_NV12 : HFI_COLOR_FORMAT_NV12_UBWC;
> ret = hfi_gen1_set_property(inst, ptype, &fmt, sizeof(fmt));
> }
>
> diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c b/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c
> index 5ad202d3fcdc57a2b7b43de15763a686ce0f7bd7..6a772db2ec33fb002d8884753a41dc98b3a8439d 100644
> --- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c
> +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c
> @@ -447,7 +447,8 @@ static int iris_hfi_gen2_set_colorformat(struct iris_inst *inst, u32 plane)
> HFI_COLOR_FMT_NV12 : HFI_COLOR_FMT_NV12_UBWC;
> } else {
> pixelformat = inst->fmt_src->fmt.pix_mp.pixelformat;
> - hfi_colorformat = pixelformat == V4L2_PIX_FMT_NV12 ? HFI_COLOR_FMT_NV12 : 0;
> + hfi_colorformat = pixelformat == V4L2_PIX_FMT_NV12 ?
> + HFI_COLOR_FMT_NV12 : HFI_COLOR_FMT_NV12_UBWC;
> }
>
> return iris_hfi_gen2_session_set_property(inst,
> diff --git a/drivers/media/platform/qcom/iris/iris_venc.c b/drivers/media/platform/qcom/iris/iris_venc.c
> index 099bd5ed4ae0294725860305254c4cad1ec88d7e..95e3ceb22d8c3a46c1bf3eb87e7c1cc5ccf3039f 100644
> --- a/drivers/media/platform/qcom/iris/iris_venc.c
> +++ b/drivers/media/platform/qcom/iris/iris_venc.c
> @@ -80,7 +80,7 @@ void iris_venc_inst_deinit(struct iris_inst *inst)
> kfree(inst->fmt_src);
> }
>
> -static const struct iris_fmt iris_venc_formats[] = {
> +static const struct iris_fmt iris_venc_formats_cap[] = {
> [IRIS_FMT_H264] = {
> .pixfmt = V4L2_PIX_FMT_H264,
> .type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
> @@ -91,12 +91,35 @@ static const struct iris_fmt iris_venc_formats[] = {
> },
> };
>
> +static const struct iris_fmt iris_venc_formats_out[] = {
> + [IRIS_FMT_NV12] = {
> + .pixfmt = V4L2_PIX_FMT_NV12,
> + .type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
> + },
> + [IRIS_FMT_QC08C] = {
> + .pixfmt = V4L2_PIX_FMT_QC08C,
> + .type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
> + },
> +};
> +
> static const struct iris_fmt *
> find_format(struct iris_inst *inst, u32 pixfmt, u32 type)
> {
> - const struct iris_fmt *fmt = iris_venc_formats;
> - unsigned int size = ARRAY_SIZE(iris_venc_formats);
> + const struct iris_fmt *fmt = NULL;
> + unsigned int size = 0;
> unsigned int i;
> + switch (type) {
> + case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
> + fmt = iris_venc_formats_out;
> + size = ARRAY_SIZE(iris_venc_formats_out);
> + break;
> + case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
> + fmt = iris_venc_formats_cap;
> + size = ARRAY_SIZE(iris_venc_formats_cap);
> + break;
> + default:
> + return NULL;
> + }
>
> for (i = 0; i < size; i++) {
> if (fmt[i].pixfmt == pixfmt)
> @@ -112,8 +135,21 @@ find_format(struct iris_inst *inst, u32 pixfmt, u32 type)
> static const struct iris_fmt *
> find_format_by_index(struct iris_inst *inst, u32 index, u32 type)
> {
> - const struct iris_fmt *fmt = iris_venc_formats;
> - unsigned int size = ARRAY_SIZE(iris_venc_formats);
> + const struct iris_fmt *fmt = NULL;
> + unsigned int size = 0;
> +
> + switch (type) {
> + case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
> + fmt = iris_venc_formats_out;
> + size = ARRAY_SIZE(iris_venc_formats_out);
> + break;
> + case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
> + fmt = iris_venc_formats_cap;
> + size = ARRAY_SIZE(iris_venc_formats_cap);
> + break;
> + default:
> + return NULL;
> + }
>
> if (index >= size || fmt[index].type != type)
> return NULL;
> @@ -127,9 +163,11 @@ int iris_venc_enum_fmt(struct iris_inst *inst, struct v4l2_fmtdesc *f)
>
> switch (f->type) {
> case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
> - if (f->index)
> + fmt = find_format_by_index(inst, f->index, f->type);
> + if (!fmt)
> return -EINVAL;
> - f->pixelformat = V4L2_PIX_FMT_NV12;
> +
> + f->pixelformat = fmt->pixfmt;
> break;
> case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
> fmt = find_format_by_index(inst, f->index, f->type);
> @@ -156,7 +194,7 @@ int iris_venc_try_fmt(struct iris_inst *inst, struct v4l2_format *f)
> fmt = find_format(inst, pixmp->pixelformat, f->type);
> switch (f->type) {
> case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
> - if (f->fmt.pix_mp.pixelformat != V4L2_PIX_FMT_NV12) {
> + if (!fmt) {
> f_inst = inst->fmt_src;
> f->fmt.pix_mp.width = f_inst->fmt.pix_mp.width;
> f->fmt.pix_mp.height = f_inst->fmt.pix_mp.height;
> @@ -221,7 +259,7 @@ static int iris_venc_s_fmt_input(struct iris_inst *inst, struct v4l2_format *f)
>
> iris_venc_try_fmt(inst, f);
>
> - if (f->fmt.pix_mp.pixelformat != V4L2_PIX_FMT_NV12)
> + if (!(find_format(inst, f->fmt.pix_mp.pixelformat, f->type)))
> return -EINVAL;
>
> fmt = inst->fmt_src;
> @@ -289,7 +327,8 @@ int iris_venc_validate_format(struct iris_inst *inst, u32 pixelformat)
> {
> const struct iris_fmt *fmt = NULL;
>
> - if (pixelformat != V4L2_PIX_FMT_NV12) {
> + fmt = find_format(inst, pixelformat, V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE);
> + if (!fmt) {
> fmt = find_format(inst, pixelformat, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE);
> if (!fmt)
> return -EINVAL;
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 3/3] media: iris: Add support for QC08C format for encoder
2026-01-09 14:28 ` Neil Armstrong
@ 2026-01-13 8:39 ` Neil Armstrong
2026-01-13 10:39 ` Dikshita Agarwal
0 siblings, 1 reply; 15+ messages in thread
From: Neil Armstrong @ 2026-01-13 8:39 UTC (permalink / raw)
To: Dikshita Agarwal, Vikash Garodia, Abhinav Kumar,
Bryan O'Donoghue, Mauro Carvalho Chehab
Cc: linux-media, linux-arm-msm, linux-kernel, Dmitry Baryshkov
Hi,
On 1/9/26 15:28, Neil Armstrong wrote:
> Hi,
>
> On 10/8/25 11:52, Dikshita Agarwal wrote:
>> Introduce handling for the QC08C format in the encoder. QC08C
>> format is NV12 with UBWC compression. Update format checks and
>> configuration to enable encoding to QC08C streams.
>
> I'm late to the party but I've been trying the new encoder features patchset
> on top of v6.19-rc4 on the SM8650-HDK, but the result was wrong like if something
> was wrong in the planes offsets, leading the the UV colors moving in the background.
Gentle ping, I've trying to understand what causes this, could you help fix this ?
Thanks,
Neil
>
> The encoding was fine on v6.18 final release.
>
> Here's a screenshot:
> https://pasteboard.co/t8HmeNaIFMDR.png
>
> The command I use are:
>
> ffmpeg -f lavfi -i testsrc=duration=10:size=1920x1080:rate=30 -pix_fmt nv12 test_video_1080_10s.yuv
> v4l2-ctl --verbose --set-fmt-video-out=width=1920,height=1080,pixelformat=NV12 --set-selection-output target=crop,top=0,left=0,width=1920,height=1080 --set-fmt-video=pixelformat=H264 --stream-mmap --stream-out-mmap --stream-from=test_video_1080_10s.yuv --stream-to=test_video_1080_10s.h264 -d /dev/video1
>
>
> I did a bisect and it did lead to the very change:
> # bad: [9ace4753a5202b02191d54e9fdf7f9e3d02b85eb] Linux 6.19-rc4
> # good: [7d0a66e4bb9081d75c82ec4957c50034cb0ea449] Linux 6.18
> git bisect start 'v6.19-rc4' 'v6.18' 'drivers/media/platform/qcom/iris/'
> # bad: [6dfafbd0299a60bfb5d5e277fdf100037c7ded07] Merge tag 'drm-next-2025-12-03' of https://gitlab.freedesktop.org/drm/kernel
> git bisect bad 6dfafbd0299a60bfb5d5e277fdf100037c7ded07
> # good: [8f7aa3d3c7323f4ca2768a9e74ebbe359c4f8f88] Merge tag 'net-next-6.19' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next
> git bisect good 8f7aa3d3c7323f4ca2768a9e74ebbe359c4f8f88
> # good: [490fd9336650a39c57ce2a652676a8cb9dc6c842] Merge tag 'drm-misc-next-2025-11-14-1' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-next
> git bisect good 490fd9336650a39c57ce2a652676a8cb9dc6c842
> # good: [559e608c46553c107dbba19dae0854af7b219400] Merge tag 'ntfs3_for_6.19' of https://github.com/Paragon-Software-Group/linux-ntfs3
> git bisect good 559e608c46553c107dbba19dae0854af7b219400
> # good: [b3239df349c2c2c94686674489c9629c89ca49a1] Merge tag 'drm-misc-next-2025-12-01-1' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-next
> git bisect good b3239df349c2c2c94686674489c9629c89ca49a1
> # good: [6e971cfe62e7a56593b22ab1ad0050ac49551696] media: venus: drop bogus probe deferrals
> git bisect good 6e971cfe62e7a56593b22ab1ad0050ac49551696
> # bad: [f53fb31a388901cfe11b95a3a2cf1594355321e4] media: rockchip: add driver for the rockchip camera interface
> git bisect bad f53fb31a388901cfe11b95a3a2cf1594355321e4
> # bad: [e687f5cae591dba4a0a968c24cbe7b6141027d93] media: imx-mipi-csis: Support active data lanes differing from maximum
> git bisect bad e687f5cae591dba4a0a968c24cbe7b6141027d93
> # bad: [c33f7e61a1c9e9255597102e61add4b4fe91668c] media: qcom: camss: Add CSIPHY 2.2.0 lane configuration for SM8650
> git bisect bad c33f7e61a1c9e9255597102e61add4b4fe91668c
> # bad: [542e3540ddd75f0a46dd365978476bcc1dda5b5a] media: iris: enable support for SC7280 platform
> git bisect bad 542e3540ddd75f0a46dd365978476bcc1dda5b5a
> # bad: [e5894eeefdebf5a6d7512cd23efec78071985738] media: iris: turn platform caps into constants
> git bisect bad e5894eeefdebf5a6d7512cd23efec78071985738
> # good: [7c1f3bd58fa02f427ff4ef611fa49b56bc6f8f76] media: iris: Add support for HFI_PROP_OPB_ENABLE to control split mode
> git bisect good 7c1f3bd58fa02f427ff4ef611fa49b56bc6f8f76
> # bad: [456c99da41cb6f39c5c8420710b72fb9fd1450b4] media: iris: Add support for QC08C format for encoder
> git bisect bad 456c99da41cb6f39c5c8420710b72fb9fd1450b4
> # good: [cfd71b14b0d6f62d97338a524c858c63cf699c3f] media: iris: Add support for QC08C format for decoder
> git bisect good cfd71b14b0d6f62d97338a524c858c63cf699c3f
> # first bad commit: [456c99da41cb6f39c5c8420710b72fb9fd1450b4] media: iris: Add support for QC08C format for encoder
>
> I don't see what would be causing this.
>
> Thanks,
> Neil
>
>>
>> Signed-off-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
>> ---
>> drivers/media/platform/qcom/iris/iris_buffer.c | 12 ++++-
>> .../platform/qcom/iris/iris_hfi_gen1_command.c | 3 +-
>> .../platform/qcom/iris/iris_hfi_gen2_command.c | 3 +-
>> drivers/media/platform/qcom/iris/iris_venc.c | 59 ++++++++++++++++++----
>> 4 files changed, 63 insertions(+), 14 deletions(-)
>>
>> diff --git a/drivers/media/platform/qcom/iris/iris_buffer.c b/drivers/media/platform/qcom/iris/iris_buffer.c
>> index 83dcf49e57ec1473bc4edd26c48ab0b247d23818..b89b1ee06cce151e7c04a80956380d154643c116 100644
>> --- a/drivers/media/platform/qcom/iris/iris_buffer.c
>> +++ b/drivers/media/platform/qcom/iris/iris_buffer.c
>> @@ -171,9 +171,14 @@ static u32 iris_yuv_buffer_size_nv12(struct iris_inst *inst)
>> static u32 iris_yuv_buffer_size_qc08c(struct iris_inst *inst)
>> {
>> u32 y_plane, uv_plane, y_stride, uv_stride;
>> - struct v4l2_format *f = inst->fmt_dst;
>> u32 uv_meta_stride, uv_meta_plane;
>> u32 y_meta_stride, y_meta_plane;
>> + struct v4l2_format *f = NULL;
>> +
>> + if (inst->domain == DECODER)
>> + f = inst->fmt_dst;
>> + else
>> + f = inst->fmt_src;
>> y_meta_stride = ALIGN(DIV_ROUND_UP(f->fmt.pix_mp.width, META_STRIDE_ALIGNED >> 1),
>> META_STRIDE_ALIGNED);
>> @@ -273,7 +278,10 @@ int iris_get_buffer_size(struct iris_inst *inst,
>> } else {
>> switch (buffer_type) {
>> case BUF_INPUT:
>> - return iris_yuv_buffer_size_nv12(inst);
>> + if (inst->fmt_src->fmt.pix_mp.pixelformat == V4L2_PIX_FMT_QC08C)
>> + return iris_yuv_buffer_size_qc08c(inst);
>> + else
>> + return iris_yuv_buffer_size_nv12(inst);
>> case BUF_OUTPUT:
>> return iris_enc_bitstream_buffer_size(inst);
>> default:
>> diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c b/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c
>> index e458d3349ce09aadb75d056ae84e3aab95f03078..52da7ef7bab08fb1cb2ac804ccc6e3c7f9677890 100644
>> --- a/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c
>> +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c
>> @@ -795,7 +795,8 @@ static int iris_hfi_gen1_set_raw_format(struct iris_inst *inst, u32 plane)
>> } else {
>> pixelformat = inst->fmt_src->fmt.pix_mp.pixelformat;
>> fmt.buffer_type = HFI_BUFFER_INPUT;
>> - fmt.format = pixelformat == V4L2_PIX_FMT_NV12 ? HFI_COLOR_FORMAT_NV12 : 0;
>> + fmt.format = pixelformat == V4L2_PIX_FMT_NV12 ?
>> + HFI_COLOR_FORMAT_NV12 : HFI_COLOR_FORMAT_NV12_UBWC;
>> ret = hfi_gen1_set_property(inst, ptype, &fmt, sizeof(fmt));
>> }
>> diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c b/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c
>> index 5ad202d3fcdc57a2b7b43de15763a686ce0f7bd7..6a772db2ec33fb002d8884753a41dc98b3a8439d 100644
>> --- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c
>> +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c
>> @@ -447,7 +447,8 @@ static int iris_hfi_gen2_set_colorformat(struct iris_inst *inst, u32 plane)
>> HFI_COLOR_FMT_NV12 : HFI_COLOR_FMT_NV12_UBWC;
>> } else {
>> pixelformat = inst->fmt_src->fmt.pix_mp.pixelformat;
>> - hfi_colorformat = pixelformat == V4L2_PIX_FMT_NV12 ? HFI_COLOR_FMT_NV12 : 0;
>> + hfi_colorformat = pixelformat == V4L2_PIX_FMT_NV12 ?
>> + HFI_COLOR_FMT_NV12 : HFI_COLOR_FMT_NV12_UBWC;
>> }
>> return iris_hfi_gen2_session_set_property(inst,
>> diff --git a/drivers/media/platform/qcom/iris/iris_venc.c b/drivers/media/platform/qcom/iris/iris_venc.c
>> index 099bd5ed4ae0294725860305254c4cad1ec88d7e..95e3ceb22d8c3a46c1bf3eb87e7c1cc5ccf3039f 100644
>> --- a/drivers/media/platform/qcom/iris/iris_venc.c
>> +++ b/drivers/media/platform/qcom/iris/iris_venc.c
>> @@ -80,7 +80,7 @@ void iris_venc_inst_deinit(struct iris_inst *inst)
>> kfree(inst->fmt_src);
>> }
>> -static const struct iris_fmt iris_venc_formats[] = {
>> +static const struct iris_fmt iris_venc_formats_cap[] = {
>> [IRIS_FMT_H264] = {
>> .pixfmt = V4L2_PIX_FMT_H264,
>> .type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
>> @@ -91,12 +91,35 @@ static const struct iris_fmt iris_venc_formats[] = {
>> },
>> };
>> +static const struct iris_fmt iris_venc_formats_out[] = {
>> + [IRIS_FMT_NV12] = {
>> + .pixfmt = V4L2_PIX_FMT_NV12,
>> + .type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
>> + },
>> + [IRIS_FMT_QC08C] = {
>> + .pixfmt = V4L2_PIX_FMT_QC08C,
>> + .type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
>> + },
>> +};
>> +
>> static const struct iris_fmt *
>> find_format(struct iris_inst *inst, u32 pixfmt, u32 type)
>> {
>> - const struct iris_fmt *fmt = iris_venc_formats;
>> - unsigned int size = ARRAY_SIZE(iris_venc_formats);
>> + const struct iris_fmt *fmt = NULL;
>> + unsigned int size = 0;
>> unsigned int i;
>> + switch (type) {
>> + case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
>> + fmt = iris_venc_formats_out;
>> + size = ARRAY_SIZE(iris_venc_formats_out);
>> + break;
>> + case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
>> + fmt = iris_venc_formats_cap;
>> + size = ARRAY_SIZE(iris_venc_formats_cap);
>> + break;
>> + default:
>> + return NULL;
>> + }
>> for (i = 0; i < size; i++) {
>> if (fmt[i].pixfmt == pixfmt)
>> @@ -112,8 +135,21 @@ find_format(struct iris_inst *inst, u32 pixfmt, u32 type)
>> static const struct iris_fmt *
>> find_format_by_index(struct iris_inst *inst, u32 index, u32 type)
>> {
>> - const struct iris_fmt *fmt = iris_venc_formats;
>> - unsigned int size = ARRAY_SIZE(iris_venc_formats);
>> + const struct iris_fmt *fmt = NULL;
>> + unsigned int size = 0;
>> +
>> + switch (type) {
>> + case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
>> + fmt = iris_venc_formats_out;
>> + size = ARRAY_SIZE(iris_venc_formats_out);
>> + break;
>> + case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
>> + fmt = iris_venc_formats_cap;
>> + size = ARRAY_SIZE(iris_venc_formats_cap);
>> + break;
>> + default:
>> + return NULL;
>> + }
>> if (index >= size || fmt[index].type != type)
>> return NULL;
>> @@ -127,9 +163,11 @@ int iris_venc_enum_fmt(struct iris_inst *inst, struct v4l2_fmtdesc *f)
>> switch (f->type) {
>> case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
>> - if (f->index)
>> + fmt = find_format_by_index(inst, f->index, f->type);
>> + if (!fmt)
>> return -EINVAL;
>> - f->pixelformat = V4L2_PIX_FMT_NV12;
>> +
>> + f->pixelformat = fmt->pixfmt;
>> break;
>> case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
>> fmt = find_format_by_index(inst, f->index, f->type);
>> @@ -156,7 +194,7 @@ int iris_venc_try_fmt(struct iris_inst *inst, struct v4l2_format *f)
>> fmt = find_format(inst, pixmp->pixelformat, f->type);
>> switch (f->type) {
>> case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
>> - if (f->fmt.pix_mp.pixelformat != V4L2_PIX_FMT_NV12) {
>> + if (!fmt) {
>> f_inst = inst->fmt_src;
>> f->fmt.pix_mp.width = f_inst->fmt.pix_mp.width;
>> f->fmt.pix_mp.height = f_inst->fmt.pix_mp.height;
>> @@ -221,7 +259,7 @@ static int iris_venc_s_fmt_input(struct iris_inst *inst, struct v4l2_format *f)
>> iris_venc_try_fmt(inst, f);
>> - if (f->fmt.pix_mp.pixelformat != V4L2_PIX_FMT_NV12)
>> + if (!(find_format(inst, f->fmt.pix_mp.pixelformat, f->type)))
>> return -EINVAL;
>> fmt = inst->fmt_src;
>> @@ -289,7 +327,8 @@ int iris_venc_validate_format(struct iris_inst *inst, u32 pixelformat)
>> {
>> const struct iris_fmt *fmt = NULL;
>> - if (pixelformat != V4L2_PIX_FMT_NV12) {
>> + fmt = find_format(inst, pixelformat, V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE);
>> + if (!fmt) {
>> fmt = find_format(inst, pixelformat, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE);
>> if (!fmt)
>> return -EINVAL;
>>
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 3/3] media: iris: Add support for QC08C format for encoder
2026-01-13 8:39 ` Neil Armstrong
@ 2026-01-13 10:39 ` Dikshita Agarwal
0 siblings, 0 replies; 15+ messages in thread
From: Dikshita Agarwal @ 2026-01-13 10:39 UTC (permalink / raw)
To: Neil Armstrong, Dikshita Agarwal, Vikash Garodia, Abhinav Kumar,
Bryan O'Donoghue, Mauro Carvalho Chehab
Cc: linux-media, linux-arm-msm, linux-kernel, Dmitry Baryshkov
On 1/13/2026 2:09 PM, Neil Armstrong wrote:
> Hi,
>
> On 1/9/26 15:28, Neil Armstrong wrote:
>> Hi,
>>
>> On 10/8/25 11:52, Dikshita Agarwal wrote:
>>> Introduce handling for the QC08C format in the encoder. QC08C
>>> format is NV12 with UBWC compression. Update format checks and
>>> configuration to enable encoding to QC08C streams.
>>
>> I'm late to the party but I've been trying the new encoder features patchset
>> on top of v6.19-rc4 on the SM8650-HDK, but the result was wrong like if
>> something
>> was wrong in the planes offsets, leading the the UV colors moving in the
>> background.
>
> Gentle ping, I've trying to understand what causes this, could you help fix
> this ?
Sorry, I missed your earlier email.
Are you using the updated v4l2 utils code, I have posted a fix [1] for
regression caused for NV12 after adding QC08C support. Same was mentioned
in the cover letter [2] as well.
[1]
https://lore.kernel.org/linux-media/20250918103235.4066441-1-dikshita.agarwal@oss.qualcomm.com/T/#u
[2]
https://lore.kernel.org/linux-media/20251008-video-iris-ubwc-enable-v2-0-478ba2d96427@oss.qualcomm.com/
Thanks,
Dikshita
>
> Thanks,
> Neil
>
>>
>> The encoding was fine on v6.18 final release.
>>
>> Here's a screenshot:
>> https://pasteboard.co/t8HmeNaIFMDR.png
>>
>> The command I use are:
>>
>> ffmpeg -f lavfi -i testsrc=duration=10:size=1920x1080:rate=30 -pix_fmt
>> nv12 test_video_1080_10s.yuv
>> v4l2-ctl --verbose
>> --set-fmt-video-out=width=1920,height=1080,pixelformat=NV12
>> --set-selection-output target=crop,top=0,left=0,width=1920,height=1080
>> --set-fmt-video=pixelformat=H264 --stream-mmap --stream-out-mmap
>> --stream-from=test_video_1080_10s.yuv
>> --stream-to=test_video_1080_10s.h264 -d /dev/video1
>>
>>
>> I did a bisect and it did lead to the very change:
>> # bad: [9ace4753a5202b02191d54e9fdf7f9e3d02b85eb] Linux 6.19-rc4
>> # good: [7d0a66e4bb9081d75c82ec4957c50034cb0ea449] Linux 6.18
>> git bisect start 'v6.19-rc4' 'v6.18' 'drivers/media/platform/qcom/iris/'
>> # bad: [6dfafbd0299a60bfb5d5e277fdf100037c7ded07] Merge tag
>> 'drm-next-2025-12-03' of https://gitlab.freedesktop.org/drm/kernel
>> git bisect bad 6dfafbd0299a60bfb5d5e277fdf100037c7ded07
>> # good: [8f7aa3d3c7323f4ca2768a9e74ebbe359c4f8f88] Merge tag
>> 'net-next-6.19' of
>> git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next
>> git bisect good 8f7aa3d3c7323f4ca2768a9e74ebbe359c4f8f88
>> # good: [490fd9336650a39c57ce2a652676a8cb9dc6c842] Merge tag
>> 'drm-misc-next-2025-11-14-1' of
>> https://gitlab.freedesktop.org/drm/misc/kernel into drm-next
>> git bisect good 490fd9336650a39c57ce2a652676a8cb9dc6c842
>> # good: [559e608c46553c107dbba19dae0854af7b219400] Merge tag
>> 'ntfs3_for_6.19' of https://github.com/Paragon-Software-Group/linux-ntfs3
>> git bisect good 559e608c46553c107dbba19dae0854af7b219400
>> # good: [b3239df349c2c2c94686674489c9629c89ca49a1] Merge tag
>> 'drm-misc-next-2025-12-01-1' of
>> https://gitlab.freedesktop.org/drm/misc/kernel into drm-next
>> git bisect good b3239df349c2c2c94686674489c9629c89ca49a1
>> # good: [6e971cfe62e7a56593b22ab1ad0050ac49551696] media: venus: drop
>> bogus probe deferrals
>> git bisect good 6e971cfe62e7a56593b22ab1ad0050ac49551696
>> # bad: [f53fb31a388901cfe11b95a3a2cf1594355321e4] media: rockchip: add
>> driver for the rockchip camera interface
>> git bisect bad f53fb31a388901cfe11b95a3a2cf1594355321e4
>> # bad: [e687f5cae591dba4a0a968c24cbe7b6141027d93] media: imx-mipi-csis:
>> Support active data lanes differing from maximum
>> git bisect bad e687f5cae591dba4a0a968c24cbe7b6141027d93
>> # bad: [c33f7e61a1c9e9255597102e61add4b4fe91668c] media: qcom: camss: Add
>> CSIPHY 2.2.0 lane configuration for SM8650
>> git bisect bad c33f7e61a1c9e9255597102e61add4b4fe91668c
>> # bad: [542e3540ddd75f0a46dd365978476bcc1dda5b5a] media: iris: enable
>> support for SC7280 platform
>> git bisect bad 542e3540ddd75f0a46dd365978476bcc1dda5b5a
>> # bad: [e5894eeefdebf5a6d7512cd23efec78071985738] media: iris: turn
>> platform caps into constants
>> git bisect bad e5894eeefdebf5a6d7512cd23efec78071985738
>> # good: [7c1f3bd58fa02f427ff4ef611fa49b56bc6f8f76] media: iris: Add
>> support for HFI_PROP_OPB_ENABLE to control split mode
>> git bisect good 7c1f3bd58fa02f427ff4ef611fa49b56bc6f8f76
>> # bad: [456c99da41cb6f39c5c8420710b72fb9fd1450b4] media: iris: Add
>> support for QC08C format for encoder
>> git bisect bad 456c99da41cb6f39c5c8420710b72fb9fd1450b4
>> # good: [cfd71b14b0d6f62d97338a524c858c63cf699c3f] media: iris: Add
>> support for QC08C format for decoder
>> git bisect good cfd71b14b0d6f62d97338a524c858c63cf699c3f
>> # first bad commit: [456c99da41cb6f39c5c8420710b72fb9fd1450b4] media:
>> iris: Add support for QC08C format for encoder
>>
>> I don't see what would be causing this.
>>
>> Thanks,
>> Neil
>>
>>>
>>> Signed-off-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
>>> ---
>>> drivers/media/platform/qcom/iris/iris_buffer.c | 12 ++++-
>>> .../platform/qcom/iris/iris_hfi_gen1_command.c | 3 +-
>>> .../platform/qcom/iris/iris_hfi_gen2_command.c | 3 +-
>>> drivers/media/platform/qcom/iris/iris_venc.c | 59
>>> ++++++++++++++++++----
>>> 4 files changed, 63 insertions(+), 14 deletions(-)
>>>
>>> diff --git a/drivers/media/platform/qcom/iris/iris_buffer.c
>>> b/drivers/media/platform/qcom/iris/iris_buffer.c
>>> index
>>> 83dcf49e57ec1473bc4edd26c48ab0b247d23818..b89b1ee06cce151e7c04a80956380d154643c116 100644
>>> --- a/drivers/media/platform/qcom/iris/iris_buffer.c
>>> +++ b/drivers/media/platform/qcom/iris/iris_buffer.c
>>> @@ -171,9 +171,14 @@ static u32 iris_yuv_buffer_size_nv12(struct
>>> iris_inst *inst)
>>> static u32 iris_yuv_buffer_size_qc08c(struct iris_inst *inst)
>>> {
>>> u32 y_plane, uv_plane, y_stride, uv_stride;
>>> - struct v4l2_format *f = inst->fmt_dst;
>>> u32 uv_meta_stride, uv_meta_plane;
>>> u32 y_meta_stride, y_meta_plane;
>>> + struct v4l2_format *f = NULL;
>>> +
>>> + if (inst->domain == DECODER)
>>> + f = inst->fmt_dst;
>>> + else
>>> + f = inst->fmt_src;
>>> y_meta_stride = ALIGN(DIV_ROUND_UP(f->fmt.pix_mp.width,
>>> META_STRIDE_ALIGNED >> 1),
>>> META_STRIDE_ALIGNED);
>>> @@ -273,7 +278,10 @@ int iris_get_buffer_size(struct iris_inst *inst,
>>> } else {
>>> switch (buffer_type) {
>>> case BUF_INPUT:
>>> - return iris_yuv_buffer_size_nv12(inst);
>>> + if (inst->fmt_src->fmt.pix_mp.pixelformat ==
>>> V4L2_PIX_FMT_QC08C)
>>> + return iris_yuv_buffer_size_qc08c(inst);
>>> + else
>>> + return iris_yuv_buffer_size_nv12(inst);
>>> case BUF_OUTPUT:
>>> return iris_enc_bitstream_buffer_size(inst);
>>> default:
>>> diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c
>>> b/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c
>>> index
>>> e458d3349ce09aadb75d056ae84e3aab95f03078..52da7ef7bab08fb1cb2ac804ccc6e3c7f9677890 100644
>>> --- a/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c
>>> +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c
>>> @@ -795,7 +795,8 @@ static int iris_hfi_gen1_set_raw_format(struct
>>> iris_inst *inst, u32 plane)
>>> } else {
>>> pixelformat = inst->fmt_src->fmt.pix_mp.pixelformat;
>>> fmt.buffer_type = HFI_BUFFER_INPUT;
>>> - fmt.format = pixelformat == V4L2_PIX_FMT_NV12 ?
>>> HFI_COLOR_FORMAT_NV12 : 0;
>>> + fmt.format = pixelformat == V4L2_PIX_FMT_NV12 ?
>>> + HFI_COLOR_FORMAT_NV12 : HFI_COLOR_FORMAT_NV12_UBWC;
>>> ret = hfi_gen1_set_property(inst, ptype, &fmt, sizeof(fmt));
>>> }
>>> diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c
>>> b/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c
>>> index
>>> 5ad202d3fcdc57a2b7b43de15763a686ce0f7bd7..6a772db2ec33fb002d8884753a41dc98b3a8439d 100644
>>> --- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c
>>> +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c
>>> @@ -447,7 +447,8 @@ static int iris_hfi_gen2_set_colorformat(struct
>>> iris_inst *inst, u32 plane)
>>> HFI_COLOR_FMT_NV12 : HFI_COLOR_FMT_NV12_UBWC;
>>> } else {
>>> pixelformat = inst->fmt_src->fmt.pix_mp.pixelformat;
>>> - hfi_colorformat = pixelformat == V4L2_PIX_FMT_NV12 ?
>>> HFI_COLOR_FMT_NV12 : 0;
>>> + hfi_colorformat = pixelformat == V4L2_PIX_FMT_NV12 ?
>>> + HFI_COLOR_FMT_NV12 : HFI_COLOR_FMT_NV12_UBWC;
>>> }
>>> return iris_hfi_gen2_session_set_property(inst,
>>> diff --git a/drivers/media/platform/qcom/iris/iris_venc.c
>>> b/drivers/media/platform/qcom/iris/iris_venc.c
>>> index
>>> 099bd5ed4ae0294725860305254c4cad1ec88d7e..95e3ceb22d8c3a46c1bf3eb87e7c1cc5ccf3039f 100644
>>> --- a/drivers/media/platform/qcom/iris/iris_venc.c
>>> +++ b/drivers/media/platform/qcom/iris/iris_venc.c
>>> @@ -80,7 +80,7 @@ void iris_venc_inst_deinit(struct iris_inst *inst)
>>> kfree(inst->fmt_src);
>>> }
>>> -static const struct iris_fmt iris_venc_formats[] = {
>>> +static const struct iris_fmt iris_venc_formats_cap[] = {
>>> [IRIS_FMT_H264] = {
>>> .pixfmt = V4L2_PIX_FMT_H264,
>>> .type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
>>> @@ -91,12 +91,35 @@ static const struct iris_fmt iris_venc_formats[] = {
>>> },
>>> };
>>> +static const struct iris_fmt iris_venc_formats_out[] = {
>>> + [IRIS_FMT_NV12] = {
>>> + .pixfmt = V4L2_PIX_FMT_NV12,
>>> + .type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
>>> + },
>>> + [IRIS_FMT_QC08C] = {
>>> + .pixfmt = V4L2_PIX_FMT_QC08C,
>>> + .type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
>>> + },
>>> +};
>>> +
>>> static const struct iris_fmt *
>>> find_format(struct iris_inst *inst, u32 pixfmt, u32 type)
>>> {
>>> - const struct iris_fmt *fmt = iris_venc_formats;
>>> - unsigned int size = ARRAY_SIZE(iris_venc_formats);
>>> + const struct iris_fmt *fmt = NULL;
>>> + unsigned int size = 0;
>>> unsigned int i;
>>> + switch (type) {
>>> + case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
>>> + fmt = iris_venc_formats_out;
>>> + size = ARRAY_SIZE(iris_venc_formats_out);
>>> + break;
>>> + case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
>>> + fmt = iris_venc_formats_cap;
>>> + size = ARRAY_SIZE(iris_venc_formats_cap);
>>> + break;
>>> + default:
>>> + return NULL;
>>> + }
>>> for (i = 0; i < size; i++) {
>>> if (fmt[i].pixfmt == pixfmt)
>>> @@ -112,8 +135,21 @@ find_format(struct iris_inst *inst, u32 pixfmt, u32
>>> type)
>>> static const struct iris_fmt *
>>> find_format_by_index(struct iris_inst *inst, u32 index, u32 type)
>>> {
>>> - const struct iris_fmt *fmt = iris_venc_formats;
>>> - unsigned int size = ARRAY_SIZE(iris_venc_formats);
>>> + const struct iris_fmt *fmt = NULL;
>>> + unsigned int size = 0;
>>> +
>>> + switch (type) {
>>> + case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
>>> + fmt = iris_venc_formats_out;
>>> + size = ARRAY_SIZE(iris_venc_formats_out);
>>> + break;
>>> + case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
>>> + fmt = iris_venc_formats_cap;
>>> + size = ARRAY_SIZE(iris_venc_formats_cap);
>>> + break;
>>> + default:
>>> + return NULL;
>>> + }
>>> if (index >= size || fmt[index].type != type)
>>> return NULL;
>>> @@ -127,9 +163,11 @@ int iris_venc_enum_fmt(struct iris_inst *inst,
>>> struct v4l2_fmtdesc *f)
>>> switch (f->type) {
>>> case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
>>> - if (f->index)
>>> + fmt = find_format_by_index(inst, f->index, f->type);
>>> + if (!fmt)
>>> return -EINVAL;
>>> - f->pixelformat = V4L2_PIX_FMT_NV12;
>>> +
>>> + f->pixelformat = fmt->pixfmt;
>>> break;
>>> case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
>>> fmt = find_format_by_index(inst, f->index, f->type);
>>> @@ -156,7 +194,7 @@ int iris_venc_try_fmt(struct iris_inst *inst, struct
>>> v4l2_format *f)
>>> fmt = find_format(inst, pixmp->pixelformat, f->type);
>>> switch (f->type) {
>>> case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
>>> - if (f->fmt.pix_mp.pixelformat != V4L2_PIX_FMT_NV12) {
>>> + if (!fmt) {
>>> f_inst = inst->fmt_src;
>>> f->fmt.pix_mp.width = f_inst->fmt.pix_mp.width;
>>> f->fmt.pix_mp.height = f_inst->fmt.pix_mp.height;
>>> @@ -221,7 +259,7 @@ static int iris_venc_s_fmt_input(struct iris_inst
>>> *inst, struct v4l2_format *f)
>>> iris_venc_try_fmt(inst, f);
>>> - if (f->fmt.pix_mp.pixelformat != V4L2_PIX_FMT_NV12)
>>> + if (!(find_format(inst, f->fmt.pix_mp.pixelformat, f->type)))
>>> return -EINVAL;
>>> fmt = inst->fmt_src;
>>> @@ -289,7 +327,8 @@ int iris_venc_validate_format(struct iris_inst
>>> *inst, u32 pixelformat)
>>> {
>>> const struct iris_fmt *fmt = NULL;
>>> - if (pixelformat != V4L2_PIX_FMT_NV12) {
>>> + fmt = find_format(inst, pixelformat,
>>> V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE);
>>> + if (!fmt) {
>>> fmt = find_format(inst, pixelformat,
>>> V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE);
>>> if (!fmt)
>>> return -EINVAL;
>>>
>>
>
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 0/3] Add support for QC08C format in iris driver
2025-10-08 9:52 [PATCH v2 0/3] Add support for QC08C format in iris driver Dikshita Agarwal
` (2 preceding siblings ...)
2025-10-08 9:52 ` [PATCH v2 3/3] media: iris: Add support for QC08C format for encoder Dikshita Agarwal
@ 2026-01-15 8:08 ` Dmitry Baryshkov
2026-01-15 14:02 ` Nicolas Dufresne
3 siblings, 1 reply; 15+ messages in thread
From: Dmitry Baryshkov @ 2026-01-15 8:08 UTC (permalink / raw)
To: Dikshita Agarwal
Cc: Vikash Garodia, Abhinav Kumar, Bryan O'Donoghue,
Mauro Carvalho Chehab, linux-media, linux-arm-msm, linux-kernel
On Wed, Oct 08, 2025 at 03:22:24PM +0530, Dikshita Agarwal wrote:
> Add support for the QC08C color format in both the encoder and decoder
> paths of the iris driver. The changes include:
>
> - Adding QC08C format handling in the driver for both encoding and
> decoding.
> - Updating format enumeration to properly return supported formats.
> - Ensuring the correct HFI format is set for firmware communication.
> -Making all related changes required for seamless integration of QC08C
> support.
>
> The changes have been validated using v4l2-ctl, compliance, and GStreamer (GST) tests.
> Both GST and v4l2-ctl tests were performed using the NV12 format, as
> these clients do not support the QCOM-specific QC08C format, and all
> tests passed successfully.
>
> During v4l2-ctl testing, a regression was observed when using the NV12
> color format after adding QC08C support. A fix for this regression has
> also been posted [1].
>
> [1]: https://lore.kernel.org/linux-media/20250918103235.4066441-1-dikshita.agarwal@oss.qualcomm.com/T/#u
>
> Changes in v2:
> - Added separate patch to add support for HFI_PROP_OPB_ENABLE (Bryan)
> - Updated commit text to indicate QC08C is NV12 with UBWC compression (Bryan, Dmitry)
> - Renamed IRIS_FMT_UBWC to IRIS_FMT_QC08C (Dmitry)
> - Link to v1: https://lore.kernel.org/r/20250919-video-iris-ubwc-enable-v1-0-000d11edafd8@oss.qualcomm.com
>
> Signed-off-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
> ---
> Dikshita Agarwal (3):
> media: iris: Add support for HFI_PROP_OPB_ENABLE to control split mode
> media: iris: Add support for QC08C format for decoder
> media: iris: Add support for QC08C format for encoder
>
Looking at the series again... What is the definition of V4L formats?
Are they expected to be self-compatible? Transferable between machines?
In DRM world we made a mistake, making use of a single non-parametrized
UBWC modifier, and then later we had to introduce OOB values to
represent different params of UBWC compressed images.
So, I wanted to ask, is single "UBWC-compressed NV12" enough for V4L2 or
should we have different format values (at least for different swizzle
and macrotile modes)?
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 0/3] Add support for QC08C format in iris driver
2026-01-15 8:08 ` [PATCH v2 0/3] Add support for QC08C format in iris driver Dmitry Baryshkov
@ 2026-01-15 14:02 ` Nicolas Dufresne
2026-01-15 19:46 ` Dmitry Baryshkov
0 siblings, 1 reply; 15+ messages in thread
From: Nicolas Dufresne @ 2026-01-15 14:02 UTC (permalink / raw)
To: Dmitry Baryshkov, Dikshita Agarwal
Cc: Vikash Garodia, Abhinav Kumar, Bryan O'Donoghue,
Mauro Carvalho Chehab, linux-media, linux-arm-msm, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 3484 bytes --]
Le jeudi 15 janvier 2026 à 10:08 +0200, Dmitry Baryshkov a écrit :
> On Wed, Oct 08, 2025 at 03:22:24PM +0530, Dikshita Agarwal wrote:
> > Add support for the QC08C color format in both the encoder and decoder
> > paths of the iris driver. The changes include:
> >
> > - Adding QC08C format handling in the driver for both encoding and
> > decoding.
> > - Updating format enumeration to properly return supported formats.
> > - Ensuring the correct HFI format is set for firmware communication.
> > -Making all related changes required for seamless integration of QC08C
> > support.
> >
> > The changes have been validated using v4l2-ctl, compliance, and GStreamer
> > (GST) tests.
> > Both GST and v4l2-ctl tests were performed using the NV12 format, as
> > these clients do not support the QCOM-specific QC08C format, and all
> > tests passed successfully.
> >
> > During v4l2-ctl testing, a regression was observed when using the NV12
> > color format after adding QC08C support. A fix for this regression has
> > also been posted [1].
> >
> > [1]:
> > https://lore.kernel.org/linux-media/20250918103235.4066441-1-dikshita.agarwal@oss.qualcomm.com/T/#u
> >
> >
> > Changes in v2:
> > - Added separate patch to add support for HFI_PROP_OPB_ENABLE (Bryan)
> > - Updated commit text to indicate QC08C is NV12 with UBWC compression
> > (Bryan, Dmitry)
> > - Renamed IRIS_FMT_UBWC to IRIS_FMT_QC08C (Dmitry)
> > - Link to v1:
> > https://lore.kernel.org/r/20250919-video-iris-ubwc-enable-v1-0-000d11edafd8@oss.qualcomm.com
> >
> > Signed-off-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
> > ---
> > Dikshita Agarwal (3):
> > media: iris: Add support for HFI_PROP_OPB_ENABLE to control split mode
> > media: iris: Add support for QC08C format for decoder
> > media: iris: Add support for QC08C format for encoder
> >
>
> Looking at the series again... What is the definition of V4L formats?
> Are they expected to be self-compatible? Transferable between machines?
> In DRM world we made a mistake, making use of a single non-parametrized
> UBWC modifier, and then later we had to introduce OOB values to
> represent different params of UBWC compressed images.
>
> So, I wanted to ask, is single "UBWC-compressed NV12" enough for V4L2 or
> should we have different format values (at least for different swizzle
> and macrotile modes)?
Our expectation is that the decoder will produce the same format regardless the
resolution. And that format should be shareable, so that same format coming from
two drivers means the same thing without out of band data, except that
resolution and strides are needed oob anyway and can obviously be used as an
acceptable workaround the issue you describe. It should also have a single
translation to DRM fourcc + modifier, and hopefully the other way around is
possible too, otherwise its a bit broken and unusable.
So bottom line, since V4L2 does not have modifiers, you have to treat one V4L2
format as a pair of DRM fourcc + modifier. Decoders typically only support a
subset, or hardware engineers can generally pick a handful of performant
configurations that works for all cases (its all 2D with similarly sized
macroblocks). Since these formats are only usable when consumed by GPU or
display controllers, its important that all party uses the same convention for
the limited information available.
Nicolas
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 0/3] Add support for QC08C format in iris driver
2026-01-15 14:02 ` Nicolas Dufresne
@ 2026-01-15 19:46 ` Dmitry Baryshkov
2026-01-22 5:59 ` Vikash Garodia
0 siblings, 1 reply; 15+ messages in thread
From: Dmitry Baryshkov @ 2026-01-15 19:46 UTC (permalink / raw)
To: Nicolas Dufresne, Rob Clark, Sean Paul, Akhil P Oommen,
Jessica Zhang
Cc: Dikshita Agarwal, Vikash Garodia, Abhinav Kumar,
Bryan O'Donoghue, Mauro Carvalho Chehab, linux-media,
linux-arm-msm, linux-kernel, freedreno, dri-devel
I should have added GPU maintainers and ML beforehand. Fixing it now.
On Thu, Jan 15, 2026 at 09:02:07AM -0500, Nicolas Dufresne wrote:
> Le jeudi 15 janvier 2026 à 10:08 +0200, Dmitry Baryshkov a écrit :
> > On Wed, Oct 08, 2025 at 03:22:24PM +0530, Dikshita Agarwal wrote:
> > > Add support for the QC08C color format in both the encoder and decoder
> > > paths of the iris driver. The changes include:
> > >
> > > - Adding QC08C format handling in the driver for both encoding and
> > > decoding.
> > > - Updating format enumeration to properly return supported formats.
> > > - Ensuring the correct HFI format is set for firmware communication.
> > > -Making all related changes required for seamless integration of QC08C
> > > support.
> > >
> > > The changes have been validated using v4l2-ctl, compliance, and GStreamer
> > > (GST) tests.
> > > Both GST and v4l2-ctl tests were performed using the NV12 format, as
> > > these clients do not support the QCOM-specific QC08C format, and all
> > > tests passed successfully.
> > >
> > > During v4l2-ctl testing, a regression was observed when using the NV12
> > > color format after adding QC08C support. A fix for this regression has
> > > also been posted [1].
> > >
> > > [1]:
> > > https://lore.kernel.org/linux-media/20250918103235.4066441-1-dikshita.agarwal@oss.qualcomm.com/T/#u
> > >
> > >
> > > Changes in v2:
> > > - Added separate patch to add support for HFI_PROP_OPB_ENABLE (Bryan)
> > > - Updated commit text to indicate QC08C is NV12 with UBWC compression
> > > (Bryan, Dmitry)
> > > - Renamed IRIS_FMT_UBWC to IRIS_FMT_QC08C (Dmitry)
> > > - Link to v1:
> > > https://lore.kernel.org/r/20250919-video-iris-ubwc-enable-v1-0-000d11edafd8@oss.qualcomm.com
> > >
> > > Signed-off-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
> > > ---
> > > Dikshita Agarwal (3):
> > > media: iris: Add support for HFI_PROP_OPB_ENABLE to control split mode
> > > media: iris: Add support for QC08C format for decoder
> > > media: iris: Add support for QC08C format for encoder
> > >
> >
> > Looking at the series again... What is the definition of V4L formats?
> > Are they expected to be self-compatible? Transferable between machines?
> > In DRM world we made a mistake, making use of a single non-parametrized
> > UBWC modifier, and then later we had to introduce OOB values to
> > represent different params of UBWC compressed images.
> >
> > So, I wanted to ask, is single "UBWC-compressed NV12" enough for V4L2 or
> > should we have different format values (at least for different swizzle
> > and macrotile modes)?
>
> Our expectation is that the decoder will produce the same format regardless the
> resolution. And that format should be shareable, so that same format coming from
> two drivers means the same thing without out of band data, except that
> resolution and strides are needed oob anyway and can obviously be used as an
> acceptable workaround the issue you describe. It should also have a single
> translation to DRM fourcc + modifier, and hopefully the other way around is
> possible too, otherwise its a bit broken and unusable.
Well... As I wrote, we made a certain decision several years go: there
is only one DRM modifier. At that point the decision was made by
open-source people which had a very limited information about hardware
internals. We can probably try deprecating it and shifting towards
multiple entries. On the other side, most of the blocks would only be
able to support only one of very few possible configurations.
>
> So bottom line, since V4L2 does not have modifiers, you have to treat one V4L2
> format as a pair of DRM fourcc + modifier. Decoders typically only support a
> subset, or hardware engineers can generally pick a handful of performant
> configurations that works for all cases (its all 2D with similarly sized
> macroblocks).
This is not quite applicable: even if we try to fix all other settings,
the format differs from platform to platform because of the memory
organisation (highest_bank_bit in drivers/soc/qcom/ubwc_config.c).
There is a description of swizzling in Mesa ([1])
[1] https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/src/freedreno/fdl/fd6_tiled_memcpy.cc
> Since these formats are only usable when consumed by GPU or
> display controllers, its important that all party uses the same convention for
> the limited information available.
Yes, we added UBWC config database in order to have a single source of
information for the kernel.
So... On the practical side there can be:
- UBWC 1.0, 2.0, 3.0, 4.0, etc.
- swizzle 1-2-3, 2-3 and 3, partially depends on UBWC version.
- HBB or 13, 14, 15, 16
- bank spreading (true or false)
From the practical point of view, drivers/soc/qcom/ubwc.c defines the
following formats (currently, I'd like to cross-check some of them):
- linear
- 1.0_123_14
- 1.0_123_14_spread
- 1.0_123_15
- 2.0_23_14
- 2.0_23_14_spread
- 2.0_23_15
- 3.0_23_13_spread
- 3.0_23_14_spread
- 3.0_23_15
- 3.0_23_16
- 4.0_23_15_spread
- 4.0_23_16_spread
- 4.0_3_13_spread
- 5.0_23_15_spread
- 5.0_23_16_spread
- 6.0_23_16_spread
Would it be benefitable to define separate DRM modifiers (and NV12
compressed variant for V4L2) for each of them?
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 0/3] Add support for QC08C format in iris driver
2026-01-15 19:46 ` Dmitry Baryshkov
@ 2026-01-22 5:59 ` Vikash Garodia
2026-01-22 11:04 ` Dmitry Baryshkov
0 siblings, 1 reply; 15+ messages in thread
From: Vikash Garodia @ 2026-01-22 5:59 UTC (permalink / raw)
To: Dmitry Baryshkov, Nicolas Dufresne, Rob Clark, Sean Paul,
Akhil P Oommen, Jessica Zhang
Cc: Dikshita Agarwal, Abhinav Kumar, Bryan O'Donoghue,
Mauro Carvalho Chehab, linux-media, linux-arm-msm, linux-kernel,
freedreno, dri-devel
On 1/16/2026 1:16 AM, Dmitry Baryshkov wrote:
> I should have added GPU maintainers and ML beforehand. Fixing it now.
>
> On Thu, Jan 15, 2026 at 09:02:07AM -0500, Nicolas Dufresne wrote:
>> Le jeudi 15 janvier 2026 à 10:08 +0200, Dmitry Baryshkov a écrit :
>>> On Wed, Oct 08, 2025 at 03:22:24PM +0530, Dikshita Agarwal wrote:
>>>> Add support for the QC08C color format in both the encoder and decoder
>>>> paths of the iris driver. The changes include:
>>>>
>>>> - Adding QC08C format handling in the driver for both encoding and
>>>> decoding.
>>>> - Updating format enumeration to properly return supported formats.
>>>> - Ensuring the correct HFI format is set for firmware communication.
>>>> -Making all related changes required for seamless integration of QC08C
>>>> support.
>>>>
>>>> The changes have been validated using v4l2-ctl, compliance, and GStreamer
>>>> (GST) tests.
>>>> Both GST and v4l2-ctl tests were performed using the NV12 format, as
>>>> these clients do not support the QCOM-specific QC08C format, and all
>>>> tests passed successfully.
>>>>
>>>> During v4l2-ctl testing, a regression was observed when using the NV12
>>>> color format after adding QC08C support. A fix for this regression has
>>>> also been posted [1].
>>>>
>>>> [1]:
>>>> https://lore.kernel.org/linux-media/20250918103235.4066441-1-dikshita.agarwal@oss.qualcomm.com/T/#u
>>>>
>>>>
>>>> Changes in v2:
>>>> - Added separate patch to add support for HFI_PROP_OPB_ENABLE (Bryan)
>>>> - Updated commit text to indicate QC08C is NV12 with UBWC compression
>>>> (Bryan, Dmitry)
>>>> - Renamed IRIS_FMT_UBWC to IRIS_FMT_QC08C (Dmitry)
>>>> - Link to v1:
>>>> https://lore.kernel.org/r/20250919-video-iris-ubwc-enable-v1-0-000d11edafd8@oss.qualcomm.com
>>>>
>>>> Signed-off-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
>>>> ---
>>>> Dikshita Agarwal (3):
>>>> media: iris: Add support for HFI_PROP_OPB_ENABLE to control split mode
>>>> media: iris: Add support for QC08C format for decoder
>>>> media: iris: Add support for QC08C format for encoder
>>>>
>>>
>>> Looking at the series again... What is the definition of V4L formats?
>>> Are they expected to be self-compatible? Transferable between machines?
>>> In DRM world we made a mistake, making use of a single non-parametrized
>>> UBWC modifier, and then later we had to introduce OOB values to
>>> represent different params of UBWC compressed images.
>>>
>>> So, I wanted to ask, is single "UBWC-compressed NV12" enough for V4L2 or
>>> should we have different format values (at least for different swizzle
>>> and macrotile modes)?
>>
>> Our expectation is that the decoder will produce the same format regardless the
>> resolution. And that format should be shareable, so that same format coming from
>> two drivers means the same thing without out of band data, except that
>> resolution and strides are needed oob anyway and can obviously be used as an
>> acceptable workaround the issue you describe. It should also have a single
>> translation to DRM fourcc + modifier, and hopefully the other way around is
>> possible too, otherwise its a bit broken and unusable.
>
> Well... As I wrote, we made a certain decision several years go: there
> is only one DRM modifier. At that point the decision was made by
> open-source people which had a very limited information about hardware
> internals. We can probably try deprecating it and shifting towards
> multiple entries. On the other side, most of the blocks would only be
> able to support only one of very few possible configurations.
>
>>
>> So bottom line, since V4L2 does not have modifiers, you have to treat one V4L2
>> format as a pair of DRM fourcc + modifier. Decoders typically only support a
>> subset, or hardware engineers can generally pick a handful of performant
>> configurations that works for all cases (its all 2D with similarly sized
>> macroblocks).
>
> This is not quite applicable: even if we try to fix all other settings,
> the format differs from platform to platform because of the memory
> organisation (highest_bank_bit in drivers/soc/qcom/ubwc_config.c).
>
> There is a description of swizzling in Mesa ([1])
>
> [1] https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/src/freedreno/fdl/fd6_tiled_memcpy.cc
>
>> Since these formats are only usable when consumed by GPU or
>> display controllers, its important that all party uses the same convention for
>> the limited information available.
Would there be a need for any client, other than GPU/display, to peek
into the data OR to validate it, it need to decompress it. For that as
well, it would need all the associated info to decompress it.
Again in same SOC, camera can produce compressed YUV with different
parameter while VPU different, it would again need the associated info
alongwith single "UBWC-compressed NV12" to decompress it.
>
> Yes, we added UBWC config database in order to have a single source of
> information for the kernel.
>
> So... On the practical side there can be:
> - UBWC 1.0, 2.0, 3.0, 4.0, etc.
>
> - swizzle 1-2-3, 2-3 and 3, partially depends on UBWC version.
>
> - HBB or 13, 14, 15, 16
>
> - bank spreading (true or false)
>
> From the practical point of view, drivers/soc/qcom/ubwc.c defines the
> following formats (currently, I'd like to cross-check some of them):
>
> - linear
> - 1.0_123_14
> - 1.0_123_14_spread
> - 1.0_123_15
> - 2.0_23_14
> - 2.0_23_14_spread
> - 2.0_23_15
> - 3.0_23_13_spread
> - 3.0_23_14_spread
> - 3.0_23_15
> - 3.0_23_16
> - 4.0_23_15_spread
> - 4.0_23_16_spread
> - 4.0_3_13_spread
> - 5.0_23_15_spread
> - 5.0_23_16_spread
> - 6.0_23_16_spread
>
> Would it be benefitable to define separate DRM modifiers (and NV12
> compressed variant for V4L2) for each of them?
>
Regards,
Vikash
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 0/3] Add support for QC08C format in iris driver
2026-01-22 5:59 ` Vikash Garodia
@ 2026-01-22 11:04 ` Dmitry Baryshkov
0 siblings, 0 replies; 15+ messages in thread
From: Dmitry Baryshkov @ 2026-01-22 11:04 UTC (permalink / raw)
To: Vikash Garodia
Cc: Nicolas Dufresne, Rob Clark, Sean Paul, Akhil P Oommen,
Jessica Zhang, Dikshita Agarwal, Abhinav Kumar,
Bryan O'Donoghue, Mauro Carvalho Chehab, linux-media,
linux-arm-msm, linux-kernel, freedreno, dri-devel
On Thu, Jan 22, 2026 at 11:29:32AM +0530, Vikash Garodia wrote:
>
> On 1/16/2026 1:16 AM, Dmitry Baryshkov wrote:
> > I should have added GPU maintainers and ML beforehand. Fixing it now.
> >
> > On Thu, Jan 15, 2026 at 09:02:07AM -0500, Nicolas Dufresne wrote:
> > > Le jeudi 15 janvier 2026 à 10:08 +0200, Dmitry Baryshkov a écrit :
> > > > On Wed, Oct 08, 2025 at 03:22:24PM +0530, Dikshita Agarwal wrote:
> > > > > Add support for the QC08C color format in both the encoder and decoder
> > > > > paths of the iris driver. The changes include:
> > > > >
> > > > > - Adding QC08C format handling in the driver for both encoding and
> > > > > decoding.
> > > > > - Updating format enumeration to properly return supported formats.
> > > > > - Ensuring the correct HFI format is set for firmware communication.
> > > > > -Making all related changes required for seamless integration of QC08C
> > > > > support.
> > > > >
> > > > > The changes have been validated using v4l2-ctl, compliance, and GStreamer
> > > > > (GST) tests.
> > > > > Both GST and v4l2-ctl tests were performed using the NV12 format, as
> > > > > these clients do not support the QCOM-specific QC08C format, and all
> > > > > tests passed successfully.
> > > > >
> > > > > During v4l2-ctl testing, a regression was observed when using the NV12
> > > > > color format after adding QC08C support. A fix for this regression has
> > > > > also been posted [1].
> > > > >
> > > > > [1]:
> > > > > https://lore.kernel.org/linux-media/20250918103235.4066441-1-dikshita.agarwal@oss.qualcomm.com/T/#u
> > > > >
> > > > > Changes in v2:
> > > > > - Added separate patch to add support for HFI_PROP_OPB_ENABLE (Bryan)
> > > > > - Updated commit text to indicate QC08C is NV12 with UBWC compression
> > > > > (Bryan, Dmitry)
> > > > > - Renamed IRIS_FMT_UBWC to IRIS_FMT_QC08C (Dmitry)
> > > > > - Link to v1:
> > > > > https://lore.kernel.org/r/20250919-video-iris-ubwc-enable-v1-0-000d11edafd8@oss.qualcomm.com
> > > > >
> > > > > Signed-off-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
> > > > > ---
> > > > > Dikshita Agarwal (3):
> > > > > media: iris: Add support for HFI_PROP_OPB_ENABLE to control split mode
> > > > > media: iris: Add support for QC08C format for decoder
> > > > > media: iris: Add support for QC08C format for encoder
> > > > >
> > > >
> > > > Looking at the series again... What is the definition of V4L formats?
> > > > Are they expected to be self-compatible? Transferable between machines?
> > > > In DRM world we made a mistake, making use of a single non-parametrized
> > > > UBWC modifier, and then later we had to introduce OOB values to
> > > > represent different params of UBWC compressed images.
> > > >
> > > > So, I wanted to ask, is single "UBWC-compressed NV12" enough for V4L2 or
> > > > should we have different format values (at least for different swizzle
> > > > and macrotile modes)?
> > >
> > > Our expectation is that the decoder will produce the same format regardless the
> > > resolution. And that format should be shareable, so that same format coming from
> > > two drivers means the same thing without out of band data, except that
> > > resolution and strides are needed oob anyway and can obviously be used as an
> > > acceptable workaround the issue you describe. It should also have a single
> > > translation to DRM fourcc + modifier, and hopefully the other way around is
> > > possible too, otherwise its a bit broken and unusable.
> >
> > Well... As I wrote, we made a certain decision several years go: there
> > is only one DRM modifier. At that point the decision was made by
> > open-source people which had a very limited information about hardware
> > internals. We can probably try deprecating it and shifting towards
> > multiple entries. On the other side, most of the blocks would only be
> > able to support only one of very few possible configurations.
> >
> > >
> > > So bottom line, since V4L2 does not have modifiers, you have to treat one V4L2
> > > format as a pair of DRM fourcc + modifier. Decoders typically only support a
> > > subset, or hardware engineers can generally pick a handful of performant
> > > configurations that works for all cases (its all 2D with similarly sized
> > > macroblocks).
> >
> > This is not quite applicable: even if we try to fix all other settings,
> > the format differs from platform to platform because of the memory
> > organisation (highest_bank_bit in drivers/soc/qcom/ubwc_config.c).
> >
> > There is a description of swizzling in Mesa ([1])
> >
> > [1] https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/src/freedreno/fdl/fd6_tiled_memcpy.cc
> >
> > > Since these formats are only usable when consumed by GPU or
> > > display controllers, its important that all party uses the same convention for
> > > the limited information available.
>
> Would there be a need for any client, other than GPU/display, to peek into
> the data OR to validate it, it need to decompress it. For that as well, it
> would need all the associated info to decompress it.
It doesn't really matter. This is uAPI. There might be no such client
now, but there might be one later. Also, with the tiling format being
defined, userspace apps can start poking into the meta / color buffers
(e.g. for the sake of clipping / blitting the part of the image).
> Again in same SOC, camera can produce compressed YUV with different
> parameter while VPU different, it would again need the associated info
> alongwith single "UBWC-compressed NV12" to decompress it.
Yes. It's actually a good point, it clearly shows a need to describe the
stream rather than stating that it is "just UBWC".
>
> >
> > Yes, we added UBWC config database in order to have a single source of
> > information for the kernel.
> >
> > So... On the practical side there can be:
> > - UBWC 1.0, 2.0, 3.0, 4.0, etc.
> >
> > - swizzle 1-2-3, 2-3 and 3, partially depends on UBWC version.
> >
> > - HBB or 13, 14, 15, 16
> >
> > - bank spreading (true or false)
> >
> > From the practical point of view, drivers/soc/qcom/ubwc.c defines the
> > following formats (currently, I'd like to cross-check some of them):
> >
> > - linear
> > - 1.0_123_14
> > - 1.0_123_14_spread
> > - 1.0_123_15
> > - 2.0_23_14
> > - 2.0_23_14_spread
> > - 2.0_23_15
> > - 3.0_23_13_spread
> > - 3.0_23_14_spread
> > - 3.0_23_15
> > - 3.0_23_16
> > - 4.0_23_15_spread
> > - 4.0_23_16_spread
> > - 4.0_3_13_spread
> > - 5.0_23_15_spread
> > - 5.0_23_16_spread
> > - 6.0_23_16_spread
> >
> > Would it be benefitable to define separate DRM modifiers (and NV12
> > compressed variant for V4L2) for each of them?
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2026-01-22 11:04 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-08 9:52 [PATCH v2 0/3] Add support for QC08C format in iris driver Dikshita Agarwal
2025-10-08 9:52 ` [PATCH v2 1/3] media: iris: Add support for HFI_PROP_OPB_ENABLE to control split mode Dikshita Agarwal
2025-10-28 11:25 ` Vikash Garodia
2025-10-08 9:52 ` [PATCH v2 2/3] media: iris: Add support for QC08C format for decoder Dikshita Agarwal
2025-10-28 11:26 ` Vikash Garodia
2025-10-08 9:52 ` [PATCH v2 3/3] media: iris: Add support for QC08C format for encoder Dikshita Agarwal
2025-10-28 11:26 ` Vikash Garodia
2026-01-09 14:28 ` Neil Armstrong
2026-01-13 8:39 ` Neil Armstrong
2026-01-13 10:39 ` Dikshita Agarwal
2026-01-15 8:08 ` [PATCH v2 0/3] Add support for QC08C format in iris driver Dmitry Baryshkov
2026-01-15 14:02 ` Nicolas Dufresne
2026-01-15 19:46 ` Dmitry Baryshkov
2026-01-22 5:59 ` Vikash Garodia
2026-01-22 11:04 ` Dmitry Baryshkov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox