1 /* 2 * Copyright 2020 Rockchip Electronics Co. LTD 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef __MPP_SOC_H__ 18 #define __MPP_SOC_H__ 19 20 #include "mpp_dev_defs.h" 21 22 /* Do NOT use this outside MPP it may be changed in new version */ 23 typedef enum RockchipSocType_e { 24 ROCKCHIP_SOC_AUTO, 25 ROCKCHIP_SOC_RK3036, 26 ROCKCHIP_SOC_RK3066, 27 ROCKCHIP_SOC_RK3188, 28 ROCKCHIP_SOC_RK3288, 29 ROCKCHIP_SOC_RK312X, 30 ROCKCHIP_SOC_RK3368, 31 ROCKCHIP_SOC_RK3399, 32 ROCKCHIP_SOC_RK3228H, 33 ROCKCHIP_SOC_RK3328, 34 ROCKCHIP_SOC_RK3228, 35 ROCKCHIP_SOC_RK3229, 36 ROCKCHIP_SOC_RV1108, 37 ROCKCHIP_SOC_RV1109, 38 ROCKCHIP_SOC_RV1126, 39 ROCKCHIP_SOC_RK3326, 40 ROCKCHIP_SOC_RK3128H, 41 ROCKCHIP_SOC_PX30, 42 ROCKCHIP_SOC_RK1808, 43 ROCKCHIP_SOC_RK3566, 44 ROCKCHIP_SOC_RK3568, 45 ROCKCHIP_SOC_RK3588, 46 ROCKCHIP_SOC_BUTT, 47 } RockchipSocType; 48 49 typedef struct MppDecHwCap_t { 50 RK_U32 cap_coding; 51 52 MppClientType type : 8; 53 54 RK_U32 cap_fbc : 4; 55 RK_U32 cap_4k : 1; 56 RK_U32 cap_8k : 1; 57 RK_U32 cap_colmv_buf : 1; 58 RK_U32 cap_hw_h265_rps : 1; 59 RK_U32 cap_hw_vp9_prob : 1; 60 RK_U32 cap_jpg_pp_out : 1; 61 RK_U32 cap_10bit : 1; 62 RK_U32 reserved : 13; 63 } MppDecHwCap; 64 65 typedef struct MppEncHwCap_t { 66 RK_U32 cap_coding; 67 68 MppClientType type : 8; 69 70 RK_U32 cap_fbc : 4; 71 RK_U32 cap_4k : 1; 72 RK_U32 cap_8k : 1; 73 RK_U32 cap_hw_osd : 1; 74 RK_U32 cap_hw_roi : 1; 75 RK_U32 reserved : 16; 76 } MppEncHwCap; 77 78 typedef struct { 79 const char *compatible; 80 const RockchipSocType soc_type; 81 const RK_U32 vcodec_type; 82 83 /* Max 4 decoder cap */ 84 const MppDecHwCap *dec_caps[6]; 85 /* Max 4 encoder cap */ 86 const MppEncHwCap *enc_caps[4]; 87 } MppSocInfo; 88 89 #ifdef __cplusplus 90 extern "C" { 91 #endif 92 93 const char *mpp_get_soc_name(void); 94 RockchipSocType mpp_get_soc_type(void); 95 96 const MppSocInfo *mpp_get_soc_info(void); 97 RK_U32 mpp_check_soc_cap(MppCtxType type, MppCodingType coding); 98 99 #ifdef __cplusplus 100 } 101 #endif 102 103 #endif /*__MPP_SOC_H__*/ 104