[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <b8248626-b5c2-d301-fc5d-8023ff70cb6e@oss.qualcomm.com>
Date: Tue, 13 Jan 2026 16:09:36 +0530
From: Dikshita Agarwal <dikshita.agarwal@....qualcomm.com>
To: Neil Armstrong <neil.armstrong@...aro.org>,
Dikshita Agarwal <dikshita.agarwal@....qualcomm.com>,
Vikash Garodia <vikash.garodia@....qualcomm.com>,
Abhinav Kumar <abhinav.kumar@...ux.dev>,
Bryan O'Donoghue <bod@...nel.org>,
Mauro Carvalho Chehab <mchehab@...nel.org>
Cc: linux-media@...r.kernel.org, linux-arm-msm@...r.kernel.org,
linux-kernel@...r.kernel.org,
Dmitry Baryshkov <dmitry.baryshkov@....qualcomm.com>
Subject: Re: [PATCH v2 3/3] media: iris: Add support for QC08C format for
encoder
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@....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;
>>>
>>
>
>
Powered by blists - more mailing lists