]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: qcom: iris: vdec: allow GEN2 decoding into 10bit format
authorNeil Armstrong <neil.armstrong@linaro.org>
Tue, 2 Jun 2026 08:39:21 +0000 (10:39 +0200)
committerBryan O'Donoghue <bod@kernel.org>
Tue, 2 Jun 2026 21:12:10 +0000 (22:12 +0100)
Add the necessary bits into the gen2 platforms tables and handlers
to allow decoding streams into 10bit pixel formats.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
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>
drivers/media/platform/qcom/iris/iris_hfi_gen2.c
drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c
drivers/media/platform/qcom/iris/iris_instance.h
drivers/media/platform/qcom/iris/iris_vdec.c

index 7a85c1d4e5e699dc7c615865035b43d94217ce16..acc0ed8adda1ae726c94ab6346b0b4b2b3db1d7b 100644 (file)
@@ -31,9 +31,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,
                .step_or_mask = BIT(V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN) |
-                               BIT(V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE),
+                               BIT(V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE) |
+                               BIT(V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10),
                .value = V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN,
                .hfi_id = HFI_PROP_PROFILE,
                .flags = CAP_FLAG_OUTPUT_PORT | CAP_FLAG_MENU,
@@ -262,7 +263,7 @@ static const struct platform_inst_fw_cap inst_fw_cap_sm8550_dec[] = {
        {
                .cap_id = BIT_DEPTH,
                .min = BIT_DEPTH_8,
-               .max = BIT_DEPTH_8,
+               .max = BIT_DEPTH_10,
                .step_or_mask = 1,
                .value = BIT_DEPTH_8,
                .hfi_id = HFI_PROP_LUMA_CHROMA_BIT_DEPTH,
@@ -996,6 +997,7 @@ static const u32 sm8550_vdec_output_config_params[] = {
        HFI_PROP_OPB_ENABLE,
        HFI_PROP_COLOR_FORMAT,
        HFI_PROP_LINEAR_STRIDE_SCANLINE,
+       HFI_PROP_UBWC_STRIDE_SCANLINE,
 };
 
 static const u32 sm8550_venc_output_config_params[] = {
index aca90aab8548efed6458f444b355388058086a54..25162ae71357482b065fe8e3b0a0664138447c4c 100644 (file)
@@ -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);
index c54d8ec8562a0943ec0950dde077edfb6d82909e..a770331d167571d83f536f0699454e6b9d8a9893 100644 (file)
@@ -27,6 +27,8 @@ enum iris_fmt_type_out {
 enum iris_fmt_type_cap {
        IRIS_FMT_NV12,
        IRIS_FMT_QC08C,
+       IRIS_FMT_TP10,
+       IRIS_FMT_QC10C,
 };
 
 /**
index d55671340600526c5405b87e670def3949a35376..a8d6354bee28fe23adc3739664a5d14cdcd603da 100644 (file)
@@ -71,6 +71,8 @@ void iris_vdec_inst_deinit(struct iris_inst *inst)
 static const u32 iris_vdec_formats_cap[] = {
        [IRIS_FMT_NV12] = V4L2_PIX_FMT_NV12,
        [IRIS_FMT_QC08C] = V4L2_PIX_FMT_QC08C,
+       [IRIS_FMT_TP10] =  V4L2_PIX_FMT_P010,
+       [IRIS_FMT_QC10C] =  V4L2_PIX_FMT_QC10C,
 };
 
 static bool check_format(struct iris_inst *inst, u32 pixfmt, u32 type)