xref: /OK3568_Linux_fs/external/mpp/osal/inc/mpp_soc.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
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_RK3528,
47     ROCKCHIP_SOC_RK3562,
48     ROCKCHIP_SOC_BUTT,
49 } RockchipSocType;
50 
51 typedef struct MppDecHwCap_t {
52     RK_U32          cap_coding;
53 
54     MppClientType   type                : 8;
55 
56     RK_U32          cap_fbc             : 4;
57     RK_U32          cap_4k              : 1;
58     RK_U32          cap_8k              : 1;
59     RK_U32          cap_colmv_compress  : 1;
60     RK_U32          cap_hw_h265_rps     : 1;
61     RK_U32          cap_hw_vp9_prob     : 1;
62     RK_U32          cap_jpg_pp_out      : 1;
63     RK_U32          cap_10bit           : 1;
64     RK_U32          cap_down_scale      : 1;
65     RK_U32          cap_lmt_linebuf     : 1;
66     RK_U32          cap_core_num        : 3;
67     RK_U32          cap_hw_jpg_fix      : 1;
68     RK_U32          reserved            : 8;
69 } MppDecHwCap;
70 
71 typedef struct MppEncHwCap_t {
72     RK_U32          cap_coding;
73 
74     MppClientType   type            : 8;
75 
76     RK_U32          cap_fbc         : 4;
77     RK_U32          cap_4k          : 1;
78     RK_U32          cap_8k          : 1;
79     RK_U32          cap_hw_osd      : 1;
80     RK_U32          cap_hw_roi      : 1;
81     RK_U32          reserved        : 16;
82 } MppEncHwCap;
83 
84 typedef struct {
85     const char              *compatible;
86     const RockchipSocType   soc_type;
87     const RK_U32            vcodec_type;
88 
89     /* Max 4 decoder cap */
90     const MppDecHwCap       *dec_caps[6];
91     /* Max 4 encoder cap */
92     const MppEncHwCap       *enc_caps[4];
93 } MppSocInfo;
94 
95 #ifdef __cplusplus
96 extern "C" {
97 #endif
98 
99 const char *mpp_get_soc_name(void);
100 RockchipSocType mpp_get_soc_type(void);
101 
102 const MppSocInfo *mpp_get_soc_info(void);
103 RK_U32 mpp_check_soc_cap(MppCtxType type, MppCodingType coding);
104 
105 #ifdef __cplusplus
106 }
107 #endif
108 
109 #endif /*__MPP_SOC_H__*/
110