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>
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: Mon, 18 May 2026 09:36:56 +0200 [thread overview]
Message-ID: <08eff436-4221-4bc2-9fac-2ac1b6a091ae@linaro.org> (raw)
In-Reply-To: <5fc62574-fae1-4bf0-b6b9-fb6fb33041f8@oss.qualcomm.com>
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.
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.
>
>> +
>> return &fmt[i];
>> }
>>
>
> Regards,
> Vikash
>
next prev parent reply other threads:[~2026-05-18 7:36 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 [this message]
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
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=08eff436-4221-4bc2-9fac-2ac1b6a091ae@linaro.org \
--to=neil.armstrong@linaro.org \
--cc=abhinav.kumar@linux.dev \
--cc=bod@kernel.org \
--cc=dikshita.agarwal@oss.qualcomm.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--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