Merge "msm: vidc: Add platform capabilities for scuba"

This commit is contained in:
qctecmdr 2021-08-03 18:08:25 -07:00 committed by Gerrit - the friendly Code Review server
commit 0c5245b9cc

View File

@ -88,6 +88,14 @@ static struct msm_vidc_codec_data holi_codec_data[] = {
CODEC_ENTRY(V4L2_PIX_FMT_VP9, MSM_VIDC_DECODER, 0, 440, 440),
};
static struct msm_vidc_codec_data scuba_codec_data[] = {
CODEC_ENTRY(V4L2_PIX_FMT_H264, MSM_VIDC_ENCODER, 0, 675, 320),
CODEC_ENTRY(V4L2_PIX_FMT_HEVC, MSM_VIDC_ENCODER, 0, 675, 320),
CODEC_ENTRY(V4L2_PIX_FMT_H264, MSM_VIDC_DECODER, 0, 440, 440),
CODEC_ENTRY(V4L2_PIX_FMT_HEVC, MSM_VIDC_DECODER, 0, 440, 440),
CODEC_ENTRY(V4L2_PIX_FMT_VP9, MSM_VIDC_DECODER, 0, 440, 440),
};
static struct msm_vidc_codec_data yupik_codec_data[] = {
CODEC_ENTRY(V4L2_PIX_FMT_H264, MSM_VIDC_ENCODER, 25, 675, 320),
CODEC_ENTRY(V4L2_PIX_FMT_HEVC, MSM_VIDC_ENCODER, 25, 675, 320),
@ -125,6 +133,12 @@ static struct msm_vidc_codec holi_codecs[] = {
{ENC, H264}, {ENC, HEVC},
};
static struct msm_vidc_codec scuba_codecs[] = {
/* {domain, codec} */
{DEC, H264}, {DEC, HEVC}, {DEC, VP9},
{ENC, H264}, {ENC, HEVC},
};
static struct msm_vidc_codec default_codecs[] = {
/* {domain, codec} */
{DEC, H264}, {DEC, HEVC}, {DEC, VP9}, {DEC, MPEG2},
@ -328,6 +342,75 @@ static struct msm_vidc_codec_capability holi_capabilities[] = {
V4L2_MPEG_VIDEO_HEVC_LEVEL_4_1},
};
static struct msm_vidc_codec_capability scuba_capabilities[] = {
/* {cap_type, domains, codecs, min, max, step_size, default_value} */
{CAP_FRAME_WIDTH, DEC, CODECS_ALL, 96, 1920, 1, 1920},
{CAP_FRAME_HEIGHT, DEC, CODECS_ALL, 96, 1920, 1, 1080},
{CAP_FRAME_WIDTH, ENC, CODECS_ALL, 128, 1920, 2, 1920},
{CAP_FRAME_HEIGHT, ENC, CODECS_ALL, 128, 1920, 2, 1080},
/* ((1920 * 1088) / 256) */
{CAP_MBS_PER_FRAME, DEC, CODECS_ALL, 36, 8160, 1, 8160},
{CAP_MBS_PER_FRAME, ENC, CODECS_ALL, 64, 8160, 1, 8160},
/* 1080@30 decode + 1080@30 encode */
{CAP_MBS_PER_SECOND, DEC, CODECS_ALL, 36, 489600, 1, 244800},
{CAP_MBS_PER_SECOND, ENC, CODECS_ALL, 64, 489600, 1, 244800},
{CAP_FRAMERATE, DOMAINS_ALL, CODECS_ALL, 1, 120, 1, 30},
{CAP_BITRATE, DOMAINS_ALL, CODECS_ALL, 1, 60000000, 1, 20000000},
{CAP_CABAC_BITRATE, ENC, H264, 1, 60000000, 1, 20000000},
{CAP_HIER_P_NUM_ENH_LAYERS, ENC, H264|HEVC, 0, 6, 1, 0},
{CAP_LTR_COUNT, ENC, H264|HEVC, 0, 4, 1, 0},
/* ((1920 * 1088) / 256) * 30 fps */
{CAP_MBS_PER_SECOND_POWER_SAVE, ENC, CODECS_ALL,
0, 244800, 1, 244800},
{CAP_I_FRAME_QP, ENC, H264|HEVC, 0, 51, 1, 10},
{CAP_P_FRAME_QP, ENC, H264|HEVC, 0, 51, 1, 20},
{CAP_B_FRAME_QP, ENC, H264|HEVC, 0, 51, 1, 20},
/* 10 slices */
{CAP_SLICE_BYTE, ENC, H264|HEVC, 1, 10, 1, 10},
{CAP_SLICE_MB, ENC, H264|HEVC, 1, 10, 1, 10},
{CAP_MAX_VIDEOCORES, DOMAINS_ALL, CODECS_ALL, 0, 1, 1, 1},
/* Secure usecase specific */
{CAP_SECURE_FRAME_WIDTH, DEC, CODECS_ALL, 96, 1920, 1, 1920},
{CAP_SECURE_FRAME_HEIGHT, DEC, CODECS_ALL, 96, 1920, 1, 1080},
{CAP_SECURE_FRAME_WIDTH, ENC, CODECS_ALL, 128, 1920, 2, 1920},
{CAP_SECURE_FRAME_HEIGHT, ENC, CODECS_ALL, 128, 1920, 2, 1080},
/* (1920 * 1088) / 256 */
{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},
{CAP_HEIC_IMAGE_FRAME_WIDTH, ENC, HEVC, 512, 8192, 2, 8192},
{CAP_HEIC_IMAGE_FRAME_HEIGHT, ENC, HEVC, 512, 8192, 2, 8192},
/* Level for AVC and HEVC encoder specific.
* Default for levels is UNKNOWN value. But if we use unknown
* value here to set as default, max value needs to be set to
* unknown as well, which creates a problem of allowing client
* to set higher level than supported
*/
{CAP_H264_LEVEL, ENC, 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, ENC, HEVC, V4L2_MPEG_VIDEO_HEVC_LEVEL_1,
V4L2_MPEG_VIDEO_HEVC_LEVEL_5, 1,
V4L2_MPEG_VIDEO_HEVC_LEVEL_4_1},
/* Level for AVC and HEVC 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},
};
static struct msm_vidc_codec_capability lahaina_capabilities[] = {
/* {cap_type, domains, codecs, min, max, step_size, default_value,} */
{CAP_FRAME_WIDTH, DEC, CODECS_ALL, 96, 8192, 1, 1920},
@ -1971,6 +2054,65 @@ static struct msm_vidc_common_data holi_common_data[] = {
},
};
static struct msm_vidc_common_data scuba_common_data[] = {
{
.key = "qcom,never-unload-fw",
.value = 1,
},
{
.key = "qcom,fw-unload-delay",
.value = 1000,
},
{
.key = "qcom,sw-power-collapse",
.value = 1,
},
{
.key = "qcom,domain-attr-non-fatal-faults",
.value = 1,
},
{
.key = "qcom,max-secure-instances",
.value = 3,
},
{
.key = "qcom,max-hw-load",
.value = 489600, /* ((1088x1920)/256)@60fps */
},
{
.key = "qcom,max-image-load",
.value = 262144, /* ((8192x8192)/256)@1fps */
},
{
.key = "qcom,max-mbpf",
.value = 65280,/* ((3840x2176)/256) x 2 */
},
{
.key = "qcom,power-collapse-delay",
.value = 1500,
},
{
.key = "qcom,hw-resp-timeout",
.value = 1000,
},
{
.key = "qcom,dcvs",
.value = 1,
},
{
.key = "qcom,fw-cycles",
.value = 733003,
},
{
.key = "qcom,fw-vpp-cycles",
.value = 225975,
},
{
.key = "qcom,no-cvp",
.value = 1,
},
};
static struct msm_vidc_efuse_data yupik_efuse_data[] = {
/* IRIS_PLL_FMAX - max 4K@30 */
EFUSE_ENTRY(0x007801E8, 4, 0x00200000, 0x15, SKU_VERSION),
@ -2140,6 +2282,30 @@ static struct msm_vidc_platform_data holi_data = {
.max_inst_count = MAX_SUPPORTED_INSTANCES,
};
static struct msm_vidc_platform_data scuba_data = {
.codec_data = scuba_codec_data,
.codec_data_length = ARRAY_SIZE(scuba_codec_data),
.clock_data = NULL,
.clock_data_length = 0,
.common_data = scuba_common_data,
.common_data_length = ARRAY_SIZE(scuba_common_data),
.csc_data.vpe_csc_custom_bias_coeff = vpe_csc_custom_bias_coeff,
.csc_data.vpe_csc_custom_matrix_coeff = vpe_csc_custom_matrix_coeff,
.csc_data.vpe_csc_custom_limit_coeff = vpe_csc_custom_limit_coeff,
.efuse_data = NULL,
.efuse_data_length = 0,
.sku_version = 0,
.vpu_ver = VPU_VERSION_AR50_LITE,
.num_vpp_pipes = 0x1,
.ubwc_config = 0x0,
.codecs = scuba_codecs,
.codecs_count = ARRAY_SIZE(scuba_codecs),
.codec_caps = scuba_capabilities,
.codec_caps_count = ARRAY_SIZE(scuba_capabilities),
.vpss_caps = NULL,
.vpss_caps_count = 0,
};
static const struct of_device_id msm_vidc_dt_device[] = {
{
.compatible = "qcom,lahaina-vidc",
@ -2153,6 +2319,10 @@ static const struct of_device_id msm_vidc_dt_device[] = {
.compatible = "qcom,bengal-vidc",
.data = &bengal_data,
},
{
.compatible = "qcom,scuba-vidc",
.data = &scuba_data,
},
{
.compatible = "qcom,holi-vidc",
.data = &holi_data,