Re: [PATCH v3 6/6] media: qcom: iris: vdec: allow GEN2 decoding into 10bit format

From: Vikash Garodia

Date: Thu May 21 2026 - 06:24:26 EST



On 5/21/2026 12:57 PM, Neil Armstrong wrote:
On 5/20/26 17:55, Vikash Garodia wrote:

On 5/18/2026 1:09 PM, Neil Armstrong wrote:
On 5/13/26 21:39, Vikash Garodia wrote:

On 5/11/2026 2:50 PM, Neil Armstrong wrote:
Add the necessary bits into the gen2 platforms tables and handlers
to allow decoding streams into 10bit pixel formats.

Signed-off-by: Neil Armstrong <neil.armstrong@xxxxxxxxxx>
---
  .../media/platform/qcom/iris/iris_hfi_gen2_response.c    | 16 +++ ++ ++++++++++-
  drivers/media/platform/qcom/iris/iris_instance.h         |  2 ++
  drivers/media/platform/qcom/iris/iris_platform_gen2.c    |  8 +++ ++---
  drivers/media/platform/qcom/iris/iris_vdec.c             |  8 +++ +++++
  4 files changed, 30 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/qcom/iris/ iris_hfi_gen2_response.c b/drivers/media/platform/qcom/iris/ iris_hfi_gen2_response.c
index 0541e02d7507..b6d815c01f1d 100644
--- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c
+++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c
@@ -542,6 +542,15 @@ static void iris_hfi_gen2_read_input_subcr_params(struct iris_inst *inst)
      pixmp_ip->width = width;
      pixmp_ip->height = height;
+    if (subsc_params.bit_depth == BIT_DEPTH_8 &&
+        pixmp_op->pixelformat != V4L2_PIX_FMT_NV12 &&
+        pixmp_op->pixelformat != V4L2_PIX_FMT_QC08C)
+        pixmp_op->pixelformat = V4L2_PIX_FMT_NV12;
+    else if (subsc_params.bit_depth == BIT_DEPTH_10 &&
+         pixmp_op->pixelformat != V4L2_PIX_FMT_P010 &&
+         pixmp_op->pixelformat != V4L2_PIX_FMT_QC10C)
+        pixmp_op->pixelformat = V4L2_PIX_FMT_P010;
+
      switch (pixmp_op->pixelformat) {
      case V4L2_PIX_FMT_P010:
          pixmp_op->width = ALIGN(width, 128);
@@ -625,7 +634,12 @@ static void iris_hfi_gen2_read_input_subcr_params(struct iris_inst *inst)
      inst->fw_caps[POC].value = subsc_params.pic_order_cnt;
      inst->fw_caps[TIER].value = subsc_params.tier;
-    if (subsc_params.bit_depth != BIT_DEPTH_8 ||
+    if (subsc_params.bit_depth == BIT_DEPTH_8)
+        inst->fw_caps[BIT_DEPTH].value = BIT_DEPTH_8;
+    else
+        inst->fw_caps[BIT_DEPTH].value = BIT_DEPTH_10;
+
+    if ((subsc_params.bit_depth != BIT_DEPTH_8 && subsc_params.bit_depth != BIT_DEPTH_10) ||
          !(subsc_params.coded_frames & HFI_BITMASK_FRAME_MBS_ONLY_FLAG)) {
          dev_err(core->dev, "unsupported content, bit depth: %x, pic_struct = %x\n",
              subsc_params.bit_depth, subsc_params.coded_frames);
diff --git a/drivers/media/platform/qcom/iris/iris_instance.h b/ drivers/media/platform/qcom/iris/iris_instance.h
index 16965150f427..16424d1e94a6 100644
--- a/drivers/media/platform/qcom/iris/iris_instance.h
+++ b/drivers/media/platform/qcom/iris/iris_instance.h
@@ -25,6 +25,8 @@ enum iris_fmt_type_out {
  enum iris_fmt_type_cap {
      IRIS_FMT_NV12,
      IRIS_FMT_QC08C,
+    IRIS_FMT_TP10,
+    IRIS_FMT_QC10C,
  };
  struct iris_fmt {
diff --git a/drivers/media/platform/qcom/iris/iris_platform_gen2.c b/ drivers/media/platform/qcom/iris/iris_platform_gen2.c
index 5da90d47f9c6..ceed4b5d96ca 100644
--- a/drivers/media/platform/qcom/iris/iris_platform_gen2.c
+++ b/drivers/media/platform/qcom/iris/iris_platform_gen2.c
@@ -56,9 +56,10 @@ static const struct platform_inst_fw_cap inst_fw_cap_sm8550_dec[] = {
      {
          .cap_id = PROFILE_HEVC,
          .min = V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN,
-        .max = V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE,
+        .max = V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10,

what about gen1 platforms ?

With this patchset gen platforms will reject 10bit since all the
plumbing in the HFI response handling is missing.

Once the Gen1 HFI gets the bit_depth and calculates the buffer sizes, it
should work. But looking at Venus, the 10bit buffer calculation seems much
more complex in Gen1.

Is it more than accommodating higher buffer size by adding 25% extra for higher bits for decode scenario ?

No idea, I haven't looked closely how to implement 10bit on gen1, I just checked if this patchset
wouldn't cause any regressions.

It may show P010 and QC10C in enum_fmt, but the PROFILE_HEVC and would not expose MAIN10 on gen1.


I can sense this could lead to compliance failure on gen1 as the driver exposes 10bit as supported format but does not allow the configuration. I could be wrong here though.

Regards,
Vikash