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