Skip to content

Commit fe72068

Browse files
superna9999gouravk-qualcomm
authored andcommitted
FROMGIT: media: qcom: iris: vdec: allow GEN2 decoding into 10bit format
Add the necessary bits into the gen2 platforms tables and handlers to allow decoding streams into 10bit pixel formats. Link: https://lore.kernel.org/all/20260602-topic-sm8x50-iris-10bit-decoding-v5-6-c2b32474ed67@linaro.org/ 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>
1 parent 816b3e8 commit fe72068

4 files changed

Lines changed: 24 additions & 4 deletions

File tree

drivers/media/platform/qcom/iris/iris_hfi_gen2.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@ static const struct platform_inst_fw_cap inst_fw_cap_sm8550_dec[] = {
3333
{
3434
.cap_id = PROFILE_HEVC,
3535
.min = V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN,
36-
.max = V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE,
36+
.max = V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10,
3737
.step_or_mask = BIT(V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN) |
38-
BIT(V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE),
38+
BIT(V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE) |
39+
BIT(V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10),
3940
.value = V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN,
4041
.hfi_id = HFI_PROP_PROFILE,
4142
.flags = CAP_FLAG_OUTPUT_PORT | CAP_FLAG_MENU,
@@ -264,7 +265,7 @@ static const struct platform_inst_fw_cap inst_fw_cap_sm8550_dec[] = {
264265
{
265266
.cap_id = BIT_DEPTH,
266267
.min = BIT_DEPTH_8,
267-
.max = BIT_DEPTH_8,
268+
.max = BIT_DEPTH_10,
268269
.step_or_mask = 1,
269270
.value = BIT_DEPTH_8,
270271
.hfi_id = HFI_PROP_LUMA_CHROMA_BIT_DEPTH,
@@ -998,6 +999,7 @@ static const u32 sm8550_vdec_output_config_params[] = {
998999
HFI_PROP_OPB_ENABLE,
9991000
HFI_PROP_COLOR_FORMAT,
10001001
HFI_PROP_LINEAR_STRIDE_SCANLINE,
1002+
HFI_PROP_UBWC_STRIDE_SCANLINE,
10011003
};
10021004

10031005
static const u32 sm8550_venc_output_config_params[] = {

drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,15 @@ static void iris_hfi_gen2_read_input_subcr_params(struct iris_inst *inst)
542542
pixmp_ip->width = width;
543543
pixmp_ip->height = height;
544544

545+
if (subsc_params.bit_depth == BIT_DEPTH_8 &&
546+
pixmp_op->pixelformat != V4L2_PIX_FMT_NV12 &&
547+
pixmp_op->pixelformat != V4L2_PIX_FMT_QC08C)
548+
pixmp_op->pixelformat = V4L2_PIX_FMT_NV12;
549+
else if (subsc_params.bit_depth == BIT_DEPTH_10 &&
550+
pixmp_op->pixelformat != V4L2_PIX_FMT_P010 &&
551+
pixmp_op->pixelformat != V4L2_PIX_FMT_QC10C)
552+
pixmp_op->pixelformat = V4L2_PIX_FMT_P010;
553+
545554
switch (pixmp_op->pixelformat) {
546555
case V4L2_PIX_FMT_P010:
547556
pixmp_op->width = ALIGN(width, 128);
@@ -625,7 +634,12 @@ static void iris_hfi_gen2_read_input_subcr_params(struct iris_inst *inst)
625634
inst->fw_caps[POC].value = subsc_params.pic_order_cnt;
626635
inst->fw_caps[TIER].value = subsc_params.tier;
627636

628-
if (subsc_params.bit_depth != BIT_DEPTH_8 ||
637+
if (subsc_params.bit_depth == BIT_DEPTH_8)
638+
inst->fw_caps[BIT_DEPTH].value = BIT_DEPTH_8;
639+
else
640+
inst->fw_caps[BIT_DEPTH].value = BIT_DEPTH_10;
641+
642+
if ((subsc_params.bit_depth != BIT_DEPTH_8 && subsc_params.bit_depth != BIT_DEPTH_10) ||
629643
!(subsc_params.coded_frames & HFI_BITMASK_FRAME_MBS_ONLY_FLAG)) {
630644
dev_err(core->dev, "unsupported content, bit depth: %x, pic_struct = %x\n",
631645
subsc_params.bit_depth, subsc_params.coded_frames);

drivers/media/platform/qcom/iris/iris_instance.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ enum iris_fmt_type_out {
2727
enum iris_fmt_type_cap {
2828
IRIS_FMT_NV12,
2929
IRIS_FMT_QC08C,
30+
IRIS_FMT_TP10,
31+
IRIS_FMT_QC10C,
3032
};
3133

3234
/**

drivers/media/platform/qcom/iris/iris_vdec.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ void iris_vdec_inst_deinit(struct iris_inst *inst)
7272
static const u32 iris_vdec_formats_cap[] = {
7373
[IRIS_FMT_NV12] = V4L2_PIX_FMT_NV12,
7474
[IRIS_FMT_QC08C] = V4L2_PIX_FMT_QC08C,
75+
[IRIS_FMT_TP10] = V4L2_PIX_FMT_P010,
76+
[IRIS_FMT_QC10C] = V4L2_PIX_FMT_QC10C,
7577
};
7678

7779
static bool check_format(struct iris_inst *inst, u32 pixfmt, u32 type)

0 commit comments

Comments
 (0)