From: Neil Armstrong <neil.armstrong@linaro.org>
To: Vikash Garodia <vikash.garodia@oss.qualcomm.com>,
Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>,
Abhinav Kumar <abhinav.kumar@linux.dev>,
Bryan O'Donoghue <bod@kernel.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
nicolas Dufresne <nicolas@ndufresne.ca>,
Hans Verkuil <hverkuil+cisco@kernel.org>
Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 5/6] media: qcom: iris: vdec: update find_format to handle 8bit and 10bit formats
Date: Thu, 21 May 2026 09:18:51 +0200 [thread overview]
Message-ID: <f8273eaf-1eb5-4f9e-aca2-ebbe4bd2e361@linaro.org> (raw)
In-Reply-To: <209f8a94-957f-4362-9e17-40e74eed4d7c@oss.qualcomm.com>
On 5/20/26 17:47, Vikash Garodia wrote:
>
> On 5/20/2026 9:09 PM, Neil Armstrong wrote:
>> On 5/20/26 17:30, Vikash Garodia wrote:
>>>
>>> On 5/18/2026 1:06 PM, Neil Armstrong wrote:
>>>> On 5/13/26 21:27, Vikash Garodia wrote:
>>>>>
>>>>>
>>>>> On 5/11/2026 2:50 PM, Neil Armstrong wrote:
>>>>>> The 10bit pixel format can be only used when the decoder identifies the
>>>>>> stream as decoding into 10bit pixel format buffers, so update the
>>>>>> find_format helper to filter the formats and only allow the proper
>>>>>> formats when setting or trying a capture format.
>>>>>>
>>>>>> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
>>>>>> ---
>>>>>> drivers/media/platform/qcom/iris/iris_platform_common.h | 1 +
>>>>>> drivers/media/platform/qcom/iris/iris_vdec.c | 10 ++++ ++ ++++
>>>>>> 2 files changed, 11 insertions(+)
>>>>>>
>>>>>> diff --git a/drivers/media/platform/qcom/iris/ iris_platform_common.h b/drivers/media/platform/qcom/iris/ iris_platform_common.h
>>>>>> index 5a489917580e..cd3509da4b75 100644
>>>>>> --- a/drivers/media/platform/qcom/iris/iris_platform_common.h
>>>>>> +++ b/drivers/media/platform/qcom/iris/iris_platform_common.h
>>>>>> @@ -18,6 +18,7 @@ struct iris_inst;
>>>>>> #define REGISTER_BIT_DEPTH(luma, chroma) ((luma) << 16 | (chroma))
>>>>>> #define BIT_DEPTH_8 REGISTER_BIT_DEPTH(8, 8)
>>>>>> +#define BIT_DEPTH_10 REGISTER_BIT_DEPTH(10, 10)
>>>>>> #define CODED_FRAMES_PROGRESSIVE 0x0
>>>>>> #define DEFAULT_MAX_HOST_BUF_COUNT 64
>>>>>> #define DEFAULT_MAX_HOST_BURST_BUF_COUNT 256
>>>>>> diff --git a/drivers/media/platform/qcom/iris/iris_vdec.c b/ drivers/ media/platform/qcom/iris/iris_vdec.c
>>>>>> index eea69f937147..f4d9951ed04c 100644
>>>>>> --- a/drivers/media/platform/qcom/iris/iris_vdec.c
>>>>>> +++ b/drivers/media/platform/qcom/iris/iris_vdec.c
>>>>>> @@ -99,6 +99,16 @@ find_format(struct iris_inst *inst, u32 pixfmt, u32 type)
>>>>>> if (i == size || fmt[i].type != type)
>>>>>> return NULL;
>>>>>> + if (type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
>>>>>> + if (iris_fmt_is_8bit(fmt[i].pixfmt) &&
>>>>>> + inst->fw_caps[BIT_DEPTH].value == BIT_DEPTH_10)
>>>>>> + return NULL;
>>>>>> +
>>>>>> + if (iris_fmt_is_10bit(fmt[i].pixfmt) &&
>>>>>> + inst->fw_caps[BIT_DEPTH].value != BIT_DEPTH_10)
>>>>>> + return NULL;
>>>>>> + }
>>>>>
>>>>> similar logic would be now needed while enumerating fmt.
>>>>>
>>>>> VIDIOC_ENUM_FMT will now enumerate all capture formats (NV12, QC08C, QC10C..) regardless of the stream's bit depth, while VIDIOC_S_FMT will reject the wrong-depth formats.
>>>>>
>>>>> userspace will see formats via ENUM_FMT that it cannot successfully set with S_FMT.
>>>>
>>>> So initially I did that, but I reverted since it broke decoding with gstreamer when trying
>>>> to use QC10C since it requires negociating the src/sink before sending the fist buffer
>>>> and then get the source format change to switch to 10bit.
>>>
>>> Does that mean that src is still producing the data in Q10c, while sink is configured to NV12 (8bit) ?
>>
>> No, it's early src/sink negociation capabilities with the special DRM DMABUF format to handle the QC10c, way before playback starts and starts the v4l2 dance.
>>
>
> How will it know its Q10c, even before the playback starts ?
So in the way upstream gstreamer wants to support QC8C/QC10C, the format must be specified like:
gst-launch-1.0 -v -m filesrc location=Big_Buck_Bunny_1080_10s_30MB.h265 ! h265parse ! v4l2h265dec ! "video/x-raw(memory:DMABuf), format=DMA_DRM, drm-format=NV12:0x0500000000000001" ! kmssink
or
gst-launch-1.0 -v -m filesrc location=Big_Buck_Bunny_1080_10s_30MB_main10.h265 ! h265parse ! v4l2h265dec ! "video/x-raw(memory:DMABuf), format=DMA_DRM, drm-format=P010:0x0500000000000001" ! kmssink
so this means the QC8C/QC10C format must be listed in the VIDIOC_ENUM_FMT so the v4l2h265dec element can enums them as supported (and translated as drm-format=NV12:0x0500000000000001/drm-format=P010:0x0500000000000001)
Neil
>
>>>
>>>>
>>>> I checked and none of the other v4l2 drivers supporting 10bit does that, so it seems right
>>>> to allow enumerating all possibly supported formats and only accept the session supported
>>>> one with S_FMT.
>>>
>>> I was reading the documentation on this aspects, and it says to keep all the supported ones, instead of changing runtime and limit it to 10bit ones, in this case.
>>
>> Hmm, so my change is correct ?
>
> Yes, to me.
>
>>
>>>
>>> +ing Nico and Hans incase they would like to comment on this.
>>>
>>>>
>>>>>
>>>>>> +
>>>>>> return &fmt[i];
>>>>>> }
>>>>>>
>>>>>
>>>>> Regards,
>>>>> Vikash
>>>>>
>>>>
>>>
>>
>
next prev parent reply other threads:[~2026-05-21 7:18 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <5Yg7em0Xca9girDZT52cxZaTg93xJtZD7C2ExswhAkholGSsMsWXMWxtbtsWmkGeJWjp56SmJlLhj55vO4e0nw==@protonmail.internalid>
2026-05-11 9:20 ` [PATCH v3 0/6] media: qcom: iris: add support for decoding " Neil Armstrong
2026-05-11 9:20 ` [PATCH v3 1/6] media: qcom: iris: add helpers for 8bit and " Neil Armstrong
2026-05-13 10:25 ` Dmitry Baryshkov
2026-05-13 18:25 ` Vikash Garodia
2026-05-11 9:20 ` [PATCH v3 2/6] media: qcom: iris: add QC10C & P010 buffer size calculations Neil Armstrong
2026-05-13 18:43 ` Vikash Garodia
2026-05-21 8:50 ` Neil Armstrong
2026-05-11 9:20 ` [PATCH v3 3/6] media: qcom: iris: gen2: add support for 10bit decoding Neil Armstrong
2026-05-13 10:38 ` Dmitry Baryshkov
2026-05-13 18:50 ` Vikash Garodia
2026-05-18 7:32 ` Neil Armstrong
2026-05-21 9:44 ` Vikash Garodia
2026-05-21 12:57 ` Neil Armstrong
2026-05-11 9:20 ` [PATCH v3 4/6] media: qcom: iris: vdec: update size and stride calculations for 10bit formats Neil Armstrong
2026-05-13 10:39 ` Dmitry Baryshkov
2026-05-13 19:05 ` Vikash Garodia
2026-05-18 7:33 ` Neil Armstrong
2026-05-20 15:55 ` Vikash Garodia
2026-05-11 9:20 ` [PATCH v3 5/6] media: qcom: iris: vdec: update find_format to handle 8bit and " Neil Armstrong
2026-05-13 10:47 ` Dmitry Baryshkov
2026-05-13 19:27 ` Vikash Garodia
2026-05-18 7:36 ` Neil Armstrong
2026-05-20 15:30 ` Vikash Garodia
2026-05-20 15:39 ` Neil Armstrong
2026-05-20 15:47 ` Vikash Garodia
2026-05-21 7:18 ` Neil Armstrong [this message]
2026-05-15 9:37 ` Bryan O'Donoghue
2026-05-15 9:42 ` Bryan O'Donoghue
2026-05-11 9:20 ` [PATCH v3 6/6] media: qcom: iris: vdec: allow GEN2 decoding into 10bit format Neil Armstrong
2026-05-13 10:45 ` Dmitry Baryshkov
2026-05-13 11:59 ` Neil Armstrong
2026-05-13 12:04 ` Dmitry Baryshkov
2026-05-13 19:39 ` Vikash Garodia
2026-05-18 7:39 ` Neil Armstrong
2026-05-20 15:55 ` Vikash Garodia
2026-05-21 7:27 ` Neil Armstrong
2026-05-21 9:52 ` Vikash Garodia
2026-05-13 8:50 ` [PATCH v3 0/6] media: qcom: iris: add support for decoding 10bit formats Wangao Wang
2026-05-13 12:11 ` Neil Armstrong
2026-05-13 16:02 ` Neil Armstrong
2026-05-13 16:04 ` Dmitry Baryshkov
2026-05-13 17:33 ` Vikash Garodia
2026-05-18 7:42 ` Neil Armstrong
2026-05-20 15:44 ` Vikash Garodia
2026-05-21 7:24 ` Neil Armstrong
2026-05-21 9:33 ` Vikash Garodia
2026-05-15 9:35 ` Bryan O'Donoghue
2026-05-15 9:38 ` Vikash Garodia
2026-05-21 8:56 ` Neil Armstrong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f8273eaf-1eb5-4f9e-aca2-ebbe4bd2e361@linaro.org \
--to=neil.armstrong@linaro.org \
--cc=abhinav.kumar@linux.dev \
--cc=bod@kernel.org \
--cc=dikshita.agarwal@oss.qualcomm.com \
--cc=hverkuil+cisco@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=nicolas@ndufresne.ca \
--cc=vikash.garodia@oss.qualcomm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome