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,
Neil Armstrong <neil.armstrong@linaro.org>
Subject: [PATCH v2 5/6] media: qcom: iris: vdec: update find_format to handle 8bit and 10bit formats
Date: Fri, 17 Apr 2026 11:37:45 +0200 [thread overview]
Message-ID: <20260417-topic-sm8x50-iris-10bit-decoding-v2-5-c987b65a31d5@linaro.org> (raw)
In-Reply-To: <20260417-topic-sm8x50-iris-10bit-decoding-v2-0-c987b65a31d5@linaro.org>
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 32cb75757f2e..55c4acf1aba3 100644
--- a/drivers/media/platform/qcom/iris/iris_vdec.c
+++ b/drivers/media/platform/qcom/iris/iris_vdec.c
@@ -105,6 +105,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;
+ }
+
return &fmt[i];
}
--
2.34.1
next prev parent reply other threads:[~2026-04-17 9:37 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-17 9:37 [PATCH v2 0/6] media: qcom: iris: add support for decoding 10bit formats Neil Armstrong
2026-04-17 9:37 ` [PATCH v2 1/6] media: qcom: iris: add helpers for 8bit and " Neil Armstrong
2026-04-22 9:19 ` Dikshita Agarwal
2026-04-17 9:37 ` [PATCH v2 2/6] media: qcom: iris: add QC10C & P010 buffer size calculations Neil Armstrong
2026-04-17 9:37 ` [PATCH v2 3/6] media: qcom: iris: gen2: add support for 10bit decoding Neil Armstrong
2026-04-22 9:13 ` Dikshita Agarwal
2026-04-22 13:43 ` Neil Armstrong
2026-04-30 7:38 ` Neil Armstrong
2026-04-17 9:37 ` [PATCH v2 4/6] media: qcom: iris: vdec: update size and stride calculations for 10bit formats Neil Armstrong
2026-04-17 9:37 ` Neil Armstrong [this message]
2026-04-17 9:37 ` [PATCH v2 6/6] media: qcom: iris: vdec: allow GEN2 decoding into 10bit format Neil Armstrong
2026-04-17 9:59 ` [PATCH v2 0/6] media: qcom: iris: add support for decoding 10bit formats 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=20260417-topic-sm8x50-iris-10bit-decoding-v2-5-c987b65a31d5@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