summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Armstrong <neil.armstrong@linaro.org>2026-06-02 11:39:20 +0300
committerBryan O'Donoghue <bod@kernel.org>2026-06-03 00:12:10 +0300
commit20c3ef4c7cae76d4e15f31c812aa7761def2207a (patch)
treeee4c4d1db4e63dd2890116ed27e705ee6f2819a4
parent2f2f76d43314a8ae86aedae28f908a6a03e22521 (diff)
downloadlinux-20c3ef4c7cae76d4e15f31c812aa7761def2207a.tar.xz
media: qcom: iris: vdec: update find_format to handle 8bit and 10bit formats
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. Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Tested-by: Wangao Wang <wangao.wang@oss.qualcomm.com> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
-rw-r--r--drivers/media/platform/qcom/iris/iris_platform_common.h1
-rw-r--r--drivers/media/platform/qcom/iris/iris_vdec.c17
2 files changed, 16 insertions, 2 deletions
diff --git a/drivers/media/platform/qcom/iris/iris_platform_common.h b/drivers/media/platform/qcom/iris/iris_platform_common.h
index 6d69a1e3dcd3..c9256f2323dc 100644
--- a/drivers/media/platform/qcom/iris/iris_platform_common.h
+++ b/drivers/media/platform/qcom/iris/iris_platform_common.h
@@ -17,6 +17,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 92e9201cd3a4..d55671340600 100644
--- a/drivers/media/platform/qcom/iris/iris_vdec.c
+++ b/drivers/media/platform/qcom/iris/iris_vdec.c
@@ -93,10 +93,23 @@ static bool check_format(struct iris_inst *inst, u32 pixfmt, u32 type)
for (i = 0; i < size; i++) {
if (fmt[i] == pixfmt)
- return true;
+ break;
+ }
+
+ if (i == size)
+ return false;
+
+ if (type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
+ if (iris_fmt_is_8bit(pixfmt) &&
+ inst->fw_caps[BIT_DEPTH].value == BIT_DEPTH_10)
+ return false;
+
+ if (iris_fmt_is_10bit(pixfmt) &&
+ inst->fw_caps[BIT_DEPTH].value != BIT_DEPTH_10)
+ return false;
}
- return false;
+ return true;
}
static u32 find_format_by_index(struct iris_inst *inst, u32 index, u32 type)