Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: venus: core: Add qcm2290 DT compatible and resource data

Add a qcm2290 compatible binding to the Venus core.

The maximum concurrency is video decode at 1920x1080 (FullHD) with video
encode at 1280x720 (HD).

The driver is not available to firmware versions below 6.0.55 due to an
internal requirement for secure buffers.

The bandwidth tables incorporate a conservative safety margin to ensure
stability under peak DDR and interconnect load conditions.

Co-developed-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
Signed-off-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez@oss.qualcomm.com>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>

authored by

Jorge Ramirez-Ortiz and committed by
Mauro Carvalho Chehab
fc2aaf2d a9551290

+50
+50
drivers/media/platform/qcom/venus/core.c
··· 1070 1070 .enc_nodename = "video-encoder", 1071 1071 }; 1072 1072 1073 + static const struct bw_tbl qcm2290_bw_table_dec[] = { 1074 + { 352800, 597000, 0, 746000, 0 }, /* 1080p@30 + 720p@30 */ 1075 + { 244800, 413000, 0, 516000, 0 }, /* 1080p@30 */ 1076 + { 216000, 364000, 0, 454000, 0 }, /* 720p@60 */ 1077 + { 108000, 182000, 0, 227000, 0 }, /* 720p@30 */ 1078 + }; 1079 + 1080 + static const struct bw_tbl qcm2290_bw_table_enc[] = { 1081 + { 352800, 396000, 0, 0, 0 }, /* 1080p@30 + 720p@30 */ 1082 + { 244800, 275000, 0, 0, 0 }, /* 1080p@30 */ 1083 + { 216000, 242000, 0, 0, 0 }, /* 720p@60 */ 1084 + { 108000, 121000, 0, 0, 0 }, /* 720p@30 */ 1085 + }; 1086 + 1087 + static const struct firmware_version min_fw = { 1088 + .major = 6, .minor = 0, .rev = 55, 1089 + }; 1090 + 1091 + static const struct venus_resources qcm2290_res = { 1092 + .bw_tbl_dec = qcm2290_bw_table_dec, 1093 + .bw_tbl_dec_size = ARRAY_SIZE(qcm2290_bw_table_dec), 1094 + .bw_tbl_enc = qcm2290_bw_table_enc, 1095 + .bw_tbl_enc_size = ARRAY_SIZE(qcm2290_bw_table_enc), 1096 + .clks = { "core", "iface", "bus", "throttle" }, 1097 + .clks_num = 4, 1098 + .vcodec0_clks = { "vcodec0_core", "vcodec0_bus" }, 1099 + .vcodec_clks_num = 2, 1100 + .vcodec_pmdomains = (const char *[]) { "venus", "vcodec0" }, 1101 + .vcodec_pmdomains_num = 2, 1102 + .opp_pmdomain = (const char *[]) { "cx" }, 1103 + .vcodec_num = 1, 1104 + .hfi_version = HFI_VERSION_4XX, 1105 + .vpu_version = VPU_VERSION_AR50_LITE, 1106 + .max_load = 352800, 1107 + .num_vpp_pipes = 1, 1108 + .vmem_id = VIDC_RESOURCE_NONE, 1109 + .vmem_size = 0, 1110 + .vmem_addr = 0, 1111 + .cp_start = 0, 1112 + .cp_size = 0x70800000, 1113 + .cp_nonpixel_start = 0x1000000, 1114 + .cp_nonpixel_size = 0x24800000, 1115 + .dma_mask = 0xe0000000 - 1, 1116 + .fwname = "qcom/venus-6.0/venus.mbn", 1117 + .dec_nodename = "video-decoder", 1118 + .enc_nodename = "video-encoder", 1119 + .min_fw = &min_fw, 1120 + }; 1121 + 1073 1122 static const struct of_device_id venus_dt_match[] = { 1074 1123 { .compatible = "qcom,msm8916-venus", .data = &msm8916_res, }, 1075 1124 { .compatible = "qcom,msm8996-venus", .data = &msm8996_res, }, 1076 1125 { .compatible = "qcom,msm8998-venus", .data = &msm8998_res, }, 1126 + { .compatible = "qcom,qcm2290-venus", .data = &qcm2290_res, }, 1077 1127 { .compatible = "qcom,sc7180-venus", .data = &sc7180_res, }, 1078 1128 { .compatible = "qcom,sc7280-venus", .data = &sc7280_res, }, 1079 1129 { .compatible = "qcom,sdm660-venus", .data = &sdm660_res, },