From 548cf4ba5640be54f20325ed435dd82edee3b21b Mon Sep 17 00:00:00 2001 From: Fudong Zhang Date: Wed, 18 Aug 2021 20:24:57 +0800 Subject: [PATCH 1/3] msm: vidc: Enable v4l2 for bengal Enable v4l2 enc/dec for bengal target. Change-Id: I06411b9cf1a6ae846ec3243bd5e8e8bd9c9189a7 --- msm/vidc/msm_vidc_platform.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/msm/vidc/msm_vidc_platform.c b/msm/vidc/msm_vidc_platform.c index 740c5d0587ff..7bdbab3cc94b 100644 --- a/msm/vidc/msm_vidc_platform.c +++ b/msm/vidc/msm_vidc_platform.c @@ -181,6 +181,9 @@ static struct msm_vidc_codec_capability bengal_capabilities_v0[] = { {CAP_SECURE_MBS_PER_FRAME, DOMAINS_ALL, CODECS_ALL, 64, 8160, 1, 8160}, {CAP_SECURE_BITRATE, DOMAINS_ALL, CODECS_ALL, 1, 35000000, 1, 20000000}, + /* All intra encoding usecase specific */ + {CAP_ALLINTRA_MAX_FPS, ENC, H264|HEVC, 1, 60, 1, 30}, + /* Image specific */ {CAP_HEVC_IMAGE_FRAME_WIDTH, ENC, HEVC, 128, 512, 2, 512}, {CAP_HEVC_IMAGE_FRAME_HEIGHT, ENC, HEVC, 128, 512, 2, 512}, @@ -245,6 +248,9 @@ static struct msm_vidc_codec_capability bengal_capabilities_v1[] = { {CAP_SECURE_MBS_PER_FRAME, DOMAINS_ALL, CODECS_ALL, 64, 8160, 1, 8160}, {CAP_SECURE_BITRATE, DOMAINS_ALL, CODECS_ALL, 1, 35000000, 1, 20000000}, + /* All intra encoding usecase specific */ + {CAP_ALLINTRA_MAX_FPS, ENC, H264|HEVC, 1, 60, 1, 30}, + /* Image specific */ {CAP_HEVC_IMAGE_FRAME_WIDTH, ENC, HEVC, 128, 512, 2, 512}, {CAP_HEVC_IMAGE_FRAME_HEIGHT, ENC, HEVC, 128, 512, 2, 512}, @@ -1538,6 +1544,10 @@ static struct msm_vidc_common_data bengal_common_data_v0[] = { .key = "qcom,max-image-load", .value = 262144, /* ((8192x8192)/256)@1fps */ }, + { + .key = "qcom,max-mbpf", + .value = 65280,/* ((3840x2176)/256) x 2 */ + }, { .key = "qcom,max-hq-mbs-per-frame", .value = 8160, @@ -1574,6 +1584,10 @@ static struct msm_vidc_common_data bengal_common_data_v0[] = { .key = "qcom,vpp_delay_supported", .value = 0, }, + { + .key = "qcom,no-cvp", + .value = 1, + }, }; static struct msm_vidc_common_data bengal_common_data_v1[] = { @@ -1605,6 +1619,10 @@ static struct msm_vidc_common_data bengal_common_data_v1[] = { .key = "qcom,max-image-load", .value = 262144, /* ((8192x8192)/256)@1fps */ }, + { + .key = "qcom,max-mbpf", + .value = 65280,/* ((3840x2176)/256) x 2 */ + }, { .key = "qcom,max-hq-mbs-per-frame", .value = 8160, @@ -1641,6 +1659,10 @@ static struct msm_vidc_common_data bengal_common_data_v1[] = { .key = "qcom,vpp_delay_supported", .value = 0, }, + { + .key = "qcom,no-cvp", + .value = 1, + }, }; static struct msm_vidc_common_data shima_common_data_v0[] = { From ebf28bcfef0d430b15b3796d0cacc463beb1efd8 Mon Sep 17 00:00:00 2001 From: Fudong Zhang Date: Thu, 19 Aug 2021 15:10:09 +0800 Subject: [PATCH 2/3] msm: vidc: Add max supported instances for scuba target Add MAX_SUPPORTED_INSTANCES Change-Id: I615745e486155b156ba2637ccd2ab89f4adee1bf --- msm/vidc/msm_vidc_platform.c | 1 + 1 file changed, 1 insertion(+) diff --git a/msm/vidc/msm_vidc_platform.c b/msm/vidc/msm_vidc_platform.c index 7bdbab3cc94b..ecc6d3ca781f 100644 --- a/msm/vidc/msm_vidc_platform.c +++ b/msm/vidc/msm_vidc_platform.c @@ -2326,6 +2326,7 @@ static struct msm_vidc_platform_data scuba_data = { .codec_caps_count = ARRAY_SIZE(scuba_capabilities), .vpss_caps = NULL, .vpss_caps_count = 0, + .max_inst_count = MAX_SUPPORTED_INSTANCES, }; static const struct of_device_id msm_vidc_dt_device[] = { From 446693d0b9aad6553dce2f31a8a96ca613f37035 Mon Sep 17 00:00:00 2001 From: Gaviraju Doddabettahalli Bettegowda Date: Tue, 7 Sep 2021 14:43:43 +0530 Subject: [PATCH 3/3] msm: vidc: update VP9 level ranges Added changes to update decoder VP9 level ranges According to the platform specific. Change-Id: Ie0115bf255fa2edc2ebed047d095e086cb18b3e0 --- msm/vidc/msm_vidc_common.c | 3 +++ msm/vidc/msm_vidc_platform.c | 50 ++++++++++++++++++++++++++++-------- msm/vidc/vidc_hfi_api.h | 1 + 3 files changed, 44 insertions(+), 10 deletions(-) diff --git a/msm/vidc/msm_vidc_common.c b/msm/vidc/msm_vidc_common.c index b8a97f53c778..32cd6f6a1f04 100644 --- a/msm/vidc/msm_vidc_common.c +++ b/msm/vidc/msm_vidc_common.c @@ -1407,6 +1407,9 @@ static void msm_vidc_comm_update_ctrl_limits(struct msm_vidc_inst *inst) msm_vidc_comm_update_ctrl(inst, V4L2_CID_MPEG_VIDEO_HEVC_LEVEL, &inst->capability.cap[CAP_HEVC_LEVEL]); + msm_vidc_comm_update_ctrl(inst, + V4L2_CID_MPEG_VIDC_VIDEO_VP9_LEVEL, + &inst->capability.cap[CAP_VP9_LEVEL]); /* * Default value of level is unknown, but since we are not * using unknown value while updating level controls, we need diff --git a/msm/vidc/msm_vidc_platform.c b/msm/vidc/msm_vidc_platform.c index ecc6d3ca781f..1abab9cf22bc 100644 --- a/msm/vidc/msm_vidc_platform.c +++ b/msm/vidc/msm_vidc_platform.c @@ -203,13 +203,16 @@ static struct msm_vidc_codec_capability bengal_capabilities_v0[] = { V4L2_MPEG_VIDEO_HEVC_LEVEL_5, 1, V4L2_MPEG_VIDEO_HEVC_LEVEL_4_1}, - /* Level for AVC and HEVC decoder specific */ + /* Level for AVC, HEVC and VP9 decoder specific */ {CAP_H264_LEVEL, DEC, H264, V4L2_MPEG_VIDEO_H264_LEVEL_1_0, V4L2_MPEG_VIDEO_H264_LEVEL_5_0, 1, V4L2_MPEG_VIDEO_H264_LEVEL_4_1}, {CAP_HEVC_LEVEL, DEC, HEVC, V4L2_MPEG_VIDEO_HEVC_LEVEL_1, V4L2_MPEG_VIDEO_HEVC_LEVEL_5, 1, V4L2_MPEG_VIDEO_HEVC_LEVEL_4_1}, + {CAP_VP9_LEVEL, DEC, VP9, V4L2_MPEG_VIDC_VIDEO_VP9_LEVEL_UNUSED, + V4L2_MPEG_VIDC_VIDEO_VP9_LEVEL_5, 1, + V4L2_MPEG_VIDC_VIDEO_VP9_LEVEL_5}, }; static struct msm_vidc_codec_capability bengal_capabilities_v1[] = { @@ -270,13 +273,16 @@ static struct msm_vidc_codec_capability bengal_capabilities_v1[] = { V4L2_MPEG_VIDEO_HEVC_LEVEL_5, 1, V4L2_MPEG_VIDEO_HEVC_LEVEL_4_1}, - /* Level for AVC and HEVC decoder specific */ + /* Level for AVC, HEVC and VP9 decoder specific */ {CAP_H264_LEVEL, DEC, H264, V4L2_MPEG_VIDEO_H264_LEVEL_1_0, V4L2_MPEG_VIDEO_H264_LEVEL_5_0, 1, V4L2_MPEG_VIDEO_H264_LEVEL_4_1}, {CAP_HEVC_LEVEL, DEC, HEVC, V4L2_MPEG_VIDEO_HEVC_LEVEL_1, V4L2_MPEG_VIDEO_HEVC_LEVEL_5, 1, V4L2_MPEG_VIDEO_HEVC_LEVEL_4_1}, + {CAP_VP9_LEVEL, DEC, VP9, V4L2_MPEG_VIDC_VIDEO_VP9_LEVEL_UNUSED, + V4L2_MPEG_VIDC_VIDEO_VP9_LEVEL_5, 1, + V4L2_MPEG_VIDC_VIDEO_VP9_LEVEL_5}, }; static struct msm_vidc_codec_capability holi_capabilities[] = { @@ -339,13 +345,16 @@ static struct msm_vidc_codec_capability holi_capabilities[] = { V4L2_MPEG_VIDEO_HEVC_LEVEL_5, 1, V4L2_MPEG_VIDEO_HEVC_LEVEL_4_1}, - /* Level for AVC and HEVC decoder specific */ + /* Level for AVC, HEVC and VP9 decoder specific */ {CAP_H264_LEVEL, DEC, H264, V4L2_MPEG_VIDEO_H264_LEVEL_1_0, V4L2_MPEG_VIDEO_H264_LEVEL_5_0, 1, V4L2_MPEG_VIDEO_H264_LEVEL_4_1}, {CAP_HEVC_LEVEL, DEC, HEVC, V4L2_MPEG_VIDEO_HEVC_LEVEL_1, V4L2_MPEG_VIDEO_HEVC_LEVEL_5, 1, V4L2_MPEG_VIDEO_HEVC_LEVEL_4_1}, + {CAP_VP9_LEVEL, DEC, VP9, V4L2_MPEG_VIDC_VIDEO_VP9_LEVEL_UNUSED, + V4L2_MPEG_VIDC_VIDEO_VP9_LEVEL_5, 1, + V4L2_MPEG_VIDC_VIDEO_VP9_LEVEL_5}, }; static struct msm_vidc_codec_capability scuba_capabilities[] = { @@ -408,13 +417,16 @@ static struct msm_vidc_codec_capability scuba_capabilities[] = { V4L2_MPEG_VIDEO_HEVC_LEVEL_5, 1, V4L2_MPEG_VIDEO_HEVC_LEVEL_4_1}, - /* Level for AVC and HEVC decoder specific */ + /* Level for AVC, HEVC and VP9 decoder specific */ {CAP_H264_LEVEL, DEC, H264, V4L2_MPEG_VIDEO_H264_LEVEL_1_0, V4L2_MPEG_VIDEO_H264_LEVEL_5_0, 1, V4L2_MPEG_VIDEO_H264_LEVEL_4_1}, {CAP_HEVC_LEVEL, DEC, HEVC, V4L2_MPEG_VIDEO_HEVC_LEVEL_1, V4L2_MPEG_VIDEO_HEVC_LEVEL_5, 1, V4L2_MPEG_VIDEO_HEVC_LEVEL_4_1}, + {CAP_VP9_LEVEL, DEC, VP9, V4L2_MPEG_VIDC_VIDEO_VP9_LEVEL_UNUSED, + V4L2_MPEG_VIDC_VIDEO_VP9_LEVEL_5, 1, + V4L2_MPEG_VIDC_VIDEO_VP9_LEVEL_5}, }; static struct msm_vidc_codec_capability lahaina_capabilities[] = { @@ -518,13 +530,16 @@ static struct msm_vidc_codec_capability lahaina_capabilities[] = { V4L2_MPEG_VIDEO_HEVC_LEVEL_6, 1, V4L2_MPEG_VIDEO_HEVC_LEVEL_6}, - /* Level for AVC and HEVC decoder specific */ + /* Level for AVC, HEVC and VP9 decoder specific */ {CAP_H264_LEVEL, DEC, H264, V4L2_MPEG_VIDEO_H264_LEVEL_1_0, V4L2_MPEG_VIDEO_H264_LEVEL_6_1, 1, V4L2_MPEG_VIDEO_H264_LEVEL_5_0}, {CAP_HEVC_LEVEL, DEC, HEVC, V4L2_MPEG_VIDEO_HEVC_LEVEL_1, V4L2_MPEG_VIDEO_HEVC_LEVEL_6_1, 1, V4L2_MPEG_VIDEO_HEVC_LEVEL_5}, + {CAP_VP9_LEVEL, DEC, VP9, V4L2_MPEG_VIDC_VIDEO_VP9_LEVEL_UNUSED, + V4L2_MPEG_VIDC_VIDEO_VP9_LEVEL_51, 1, + V4L2_MPEG_VIDC_VIDEO_VP9_LEVEL_51}, }; static struct msm_vidc_codec_capability yupik_capabilities_v0[] = { @@ -633,13 +648,16 @@ static struct msm_vidc_codec_capability yupik_capabilities_v0[] = { V4L2_MPEG_VIDEO_HEVC_LEVEL_5, 1, V4L2_MPEG_VIDEO_HEVC_LEVEL_4}, - /* Level for AVC and HEVC decoder specific */ + /* Level for AVC, HEVC and VP9 decoder specific */ {CAP_H264_LEVEL, DEC, H264, V4L2_MPEG_VIDEO_H264_LEVEL_1_0, V4L2_MPEG_VIDEO_H264_LEVEL_5_2, 1, V4L2_MPEG_VIDEO_H264_LEVEL_4_0}, {CAP_HEVC_LEVEL, DEC, HEVC, V4L2_MPEG_VIDEO_HEVC_LEVEL_1, V4L2_MPEG_VIDEO_HEVC_LEVEL_5_1, 1, V4L2_MPEG_VIDEO_HEVC_LEVEL_4}, + {CAP_VP9_LEVEL, DEC, VP9, V4L2_MPEG_VIDC_VIDEO_VP9_LEVEL_UNUSED, + V4L2_MPEG_VIDC_VIDEO_VP9_LEVEL_51, 1, + V4L2_MPEG_VIDC_VIDEO_VP9_LEVEL_51}, }; static struct msm_vidc_codec_capability yupik_capabilities_v1[] = { @@ -741,13 +759,16 @@ static struct msm_vidc_codec_capability yupik_capabilities_v1[] = { V4L2_MPEG_VIDEO_HEVC_LEVEL_5, 1, V4L2_MPEG_VIDEO_HEVC_LEVEL_4}, - /* Level for AVC and HEVC decoder specific */ + /* Level for AVC, HEVC and VP9 decoder specific */ {CAP_H264_LEVEL, DEC, H264, V4L2_MPEG_VIDEO_H264_LEVEL_1_0, V4L2_MPEG_VIDEO_H264_LEVEL_5_2, 1, V4L2_MPEG_VIDEO_H264_LEVEL_4_0}, {CAP_HEVC_LEVEL, DEC, HEVC, V4L2_MPEG_VIDEO_HEVC_LEVEL_1, V4L2_MPEG_VIDEO_HEVC_LEVEL_5, 1, V4L2_MPEG_VIDEO_HEVC_LEVEL_4}, + {CAP_VP9_LEVEL, DEC, VP9, V4L2_MPEG_VIDC_VIDEO_VP9_LEVEL_UNUSED, + V4L2_MPEG_VIDC_VIDEO_VP9_LEVEL_5, 1, + V4L2_MPEG_VIDC_VIDEO_VP9_LEVEL_5}, }; static struct msm_vidc_codec_capability shima_capabilities_v0[] = { @@ -854,13 +875,16 @@ static struct msm_vidc_codec_capability shima_capabilities_v0[] = { V4L2_MPEG_VIDEO_HEVC_LEVEL_5_1, 1, V4L2_MPEG_VIDEO_HEVC_LEVEL_4}, - /* Level for AVC and HEVC decoder specific */ + /* Level for AVC, HEVC and VP9 decoder specific */ {CAP_H264_LEVEL, DEC, H264, V4L2_MPEG_VIDEO_H264_LEVEL_1_0, V4L2_MPEG_VIDEO_H264_LEVEL_6_0, 1, V4L2_MPEG_VIDEO_H264_LEVEL_4_0}, {CAP_HEVC_LEVEL, DEC, HEVC, V4L2_MPEG_VIDEO_HEVC_LEVEL_1, V4L2_MPEG_VIDEO_HEVC_LEVEL_6, 1, V4L2_MPEG_VIDEO_HEVC_LEVEL_4}, + {CAP_VP9_LEVEL, DEC, VP9, V4L2_MPEG_VIDC_VIDEO_VP9_LEVEL_UNUSED, + V4L2_MPEG_VIDC_VIDEO_VP9_LEVEL_51, 1, + V4L2_MPEG_VIDC_VIDEO_VP9_LEVEL_51}, }; static struct msm_vidc_codec_capability shima_capabilities_v1[] = { @@ -961,13 +985,16 @@ static struct msm_vidc_codec_capability shima_capabilities_v1[] = { V4L2_MPEG_VIDEO_HEVC_LEVEL_5_1, 1, V4L2_MPEG_VIDEO_HEVC_LEVEL_4}, - /* Level for AVC and HEVC decoder specific */ + /* Level for AVC, HEVC and VP9 decoder specific */ {CAP_H264_LEVEL, DEC, H264, V4L2_MPEG_VIDEO_H264_LEVEL_1_0, V4L2_MPEG_VIDEO_H264_LEVEL_5_2, 1, V4L2_MPEG_VIDEO_H264_LEVEL_4_0}, {CAP_HEVC_LEVEL, DEC, HEVC, V4L2_MPEG_VIDEO_HEVC_LEVEL_1, V4L2_MPEG_VIDEO_HEVC_LEVEL_5_1, 1, V4L2_MPEG_VIDEO_HEVC_LEVEL_4}, + {CAP_VP9_LEVEL, DEC, VP9, V4L2_MPEG_VIDC_VIDEO_VP9_LEVEL_UNUSED, + V4L2_MPEG_VIDC_VIDEO_VP9_LEVEL_51, 1, + V4L2_MPEG_VIDC_VIDEO_VP9_LEVEL_51}, }; static struct msm_vidc_codec_capability shima_capabilities_v2[] = { @@ -1067,13 +1094,16 @@ static struct msm_vidc_codec_capability shima_capabilities_v2[] = { V4L2_MPEG_VIDEO_HEVC_LEVEL_5, 1, V4L2_MPEG_VIDEO_HEVC_LEVEL_4}, - /* Level for AVC and HEVC decoder specific */ + /* Level for AVC, HEVC and VP9 decoder specific */ {CAP_H264_LEVEL, DEC, H264, V4L2_MPEG_VIDEO_H264_LEVEL_1_0, V4L2_MPEG_VIDEO_H264_LEVEL_5_1, 1, V4L2_MPEG_VIDEO_H264_LEVEL_4_0}, {CAP_HEVC_LEVEL, DEC, HEVC, V4L2_MPEG_VIDEO_HEVC_LEVEL_1, V4L2_MPEG_VIDEO_HEVC_LEVEL_5, 1, V4L2_MPEG_VIDEO_HEVC_LEVEL_4}, + {CAP_VP9_LEVEL, DEC, VP9, V4L2_MPEG_VIDC_VIDEO_VP9_LEVEL_UNUSED, + V4L2_MPEG_VIDC_VIDEO_VP9_LEVEL_51, 1, + V4L2_MPEG_VIDC_VIDEO_VP9_LEVEL_51}, }; /* Generally Iris2 VPSS only support 8 multiple encoding if diff --git a/msm/vidc/vidc_hfi_api.h b/msm/vidc/vidc_hfi_api.h index 230c217d3db6..069185c1b0d8 100644 --- a/msm/vidc/vidc_hfi_api.h +++ b/msm/vidc/vidc_hfi_api.h @@ -257,6 +257,7 @@ enum hal_capability { CAP_HEIC_IMAGE_FRAME_HEIGHT, CAP_H264_LEVEL, CAP_HEVC_LEVEL, + CAP_VP9_LEVEL, CAP_MAX, };