1 /*
2  * Copyright (C) 2019 The Android Open Source Project
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 EXYNOS_RESOURCE_RESTRICTION_H_
18 #define EXYNOS_RESOURCE_RESTRICTION_H_
19 
20 #include "ExynosHWCModule.h"
21 
22 /*******************************************************************
23  * Structures for restrictions
24  * ****************************************************************/
25 #define RESTRICTION_NONE 0
26 
27 #define USE_MODULE_ATTR
28 
29 /* Basic supported features */
30 static feature_support_t feature_table[] =
31 {
32     {MPP_DPP_GF,
33         MPP_ATTR_AFBC | MPP_ATTR_BLOCK_MODE | MPP_ATTR_WINDOW_UPDATE |
34         MPP_ATTR_FLIP_H | MPP_ATTR_FLIP_V |
35         MPP_ATTR_DIM |
36         MPP_ATTR_WCG | MPP_ATTR_HDR10 |
37         MPP_ATTR_LAYER_TRANSFORM
38     },
39 
40     {MPP_DPP_VGRFS,
41         MPP_ATTR_AFBC | MPP_ATTR_BLOCK_MODE | MPP_ATTR_WINDOW_UPDATE | MPP_ATTR_SCALE |
42         MPP_ATTR_FLIP_H | MPP_ATTR_FLIP_V | MPP_ATTR_ROT_90 |
43         MPP_ATTR_DIM |
44         MPP_ATTR_WCG | MPP_ATTR_HDR10 | MPP_ATTR_HDR10PLUS |
45         MPP_ATTR_LAYER_TRANSFORM
46     },
47 
48     {MPP_G2D,
49         MPP_ATTR_AFBC | MPP_ATTR_SCALE |
50         MPP_ATTR_FLIP_H | MPP_ATTR_FLIP_V | MPP_ATTR_ROT_90 |
51         MPP_ATTR_WCG | MPP_ATTR_HDR10 | MPP_ATTR_HDR10PLUS | MPP_ATTR_USE_CAPA |
52         MPP_ATTR_LAYER_TRANSFORM
53     }
54 };
55 
56 /**************************************************************************************
57  * HAL_PIXEL_FORMATs
58 enum {
59     HAL_PIXEL_FORMAT_RGBA_8888          = 1,
60     HAL_PIXEL_FORMAT_RGBX_8888          = 2,
61     HAL_PIXEL_FORMAT_RGB_888            = 3,
62     HAL_PIXEL_FORMAT_RGB_565            = 4,
63     HAL_PIXEL_FORMAT_BGRA_8888          = 5,
64     HAL_PIXEL_FORMAT_YV12   = 0x32315659, // YCrCb 4:2:0 Planar
65     HAL_PIXEL_FORMAT_YCbCr_422_SP       = 0x10, // NV16
66     HAL_PIXEL_FORMAT_YCrCb_420_SP       = 0x11, // NV21
67     HAL_PIXEL_FORMAT_YCbCr_422_I        = 0x14, // YUY2
68     HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_P_M       = 0x101,
69     HAL_PIXEL_FORMAT_EXYNOS_CbYCrY_422_I        = 0x103,
70     HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SP_M      = 0x105,
71     HAL_PIXEL_FORMAT_EXYNOS_YCrCb_422_SP        = 0x106,
72     HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SP_M_TILED= 0x107,
73     HAL_PIXEL_FORMAT_EXYNOS_ARGB_8888           = 0x108,
74     HAL_PIXEL_FORMAT_EXYNOS_YCrCb_422_I         = 0x116,
75     HAL_PIXEL_FORMAT_EXYNOS_CrYCbY_422_I        = 0x118,
76     HAL_PIXEL_FORMAT_EXYNOS_YV12_M              = 0x11C,
77     HAL_PIXEL_FORMAT_EXYNOS_YCrCb_420_SP_M      = 0x11D,
78     HAL_PIXEL_FORMAT_EXYNOS_YCrCb_420_SP_M_FULL = 0x11E,
79     HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_P         = 0x11F,
80     HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SP        = 0x120,
81     HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SP_M_PRIV = 0x121,
82     // contiguous(single fd) custom formats
83     HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_PN        = 0x122,
84     HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SPN       = 0x123,
85     HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SPN_TILED = 0x124,
86     // 10-bit format (8bit + separated 2bit)
87     HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SP_M_S10B = 0x125,
88     // 10-bit contiguous(single fd, 8bit + separated 2bit) custom formats
89     HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SPN_S10B  = 0x126,
90 };
91 *************************************************************************************/
92 
93 const restriction_key_t restriction_format_table[] =
94 {
95     {MPP_DPP_GF, NODE_NONE, HAL_PIXEL_FORMAT_RGB_565, 0},
96     {MPP_DPP_GF, NODE_NONE, HAL_PIXEL_FORMAT_RGBA_8888, 0},
97     {MPP_DPP_GF, NODE_NONE, HAL_PIXEL_FORMAT_RGBX_8888, 0},
98     {MPP_DPP_GF, NODE_NONE, HAL_PIXEL_FORMAT_BGRA_8888, 0},
99     {MPP_DPP_GF, NODE_NONE, HAL_PIXEL_FORMAT_RGBA_1010102, 0},
100     {MPP_DPP_VG, NODE_NONE, HAL_PIXEL_FORMAT_RGB_565, 0},
101     {MPP_DPP_VG, NODE_NONE, HAL_PIXEL_FORMAT_RGBA_8888, 0},
102     {MPP_DPP_VG, NODE_NONE, HAL_PIXEL_FORMAT_RGBX_8888, 0},
103     {MPP_DPP_VG, NODE_NONE, HAL_PIXEL_FORMAT_BGRA_8888, 0},
104     {MPP_DPP_VG, NODE_NONE, HAL_PIXEL_FORMAT_RGBA_1010102, 0},
105     {MPP_DPP_VG, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SP_M, 0},
106     {MPP_DPP_VG, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SP_M_PRIV, 0},
107     {MPP_DPP_VG, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCrCb_420_SP_M, 0},
108     {MPP_DPP_VG, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCrCb_420_SP_M_FULL, 0},
109     {MPP_DPP_VG, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SPN, 0},
110     {MPP_DPP_VG, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SP_M_S10B, 0},
111     {MPP_DPP_VG, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SPN_S10B, 0},
112     {MPP_DPP_VG, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCbCr_P010_M, 0},
113     {MPP_DPP_VG, NODE_NONE, HAL_PIXEL_FORMAT_YCBCR_P010, 0},
114     {MPP_DPP_VG, NODE_NONE, HAL_PIXEL_FORMAT_GOOGLE_NV12_SP, 0},
115     {MPP_DPP_VG, NODE_NONE, HAL_PIXEL_FORMAT_GOOGLE_NV12_SP_10B, 0},
116     {MPP_DPP_VGS, NODE_NONE, HAL_PIXEL_FORMAT_RGB_565, 0},
117     {MPP_DPP_VGS, NODE_NONE, HAL_PIXEL_FORMAT_RGBA_8888, 0},
118     {MPP_DPP_VGS, NODE_NONE, HAL_PIXEL_FORMAT_RGBX_8888, 0},
119     {MPP_DPP_VGS, NODE_NONE, HAL_PIXEL_FORMAT_BGRA_8888, 0},
120     {MPP_DPP_VGS, NODE_NONE, HAL_PIXEL_FORMAT_RGBA_1010102, 0},
121     {MPP_DPP_VGS, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SP_M, 0},
122     {MPP_DPP_VGS, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SP_M_PRIV, 0},
123     {MPP_DPP_VGS, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCrCb_420_SP_M, 0},
124     {MPP_DPP_VGS, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCrCb_420_SP_M_FULL, 0},
125     {MPP_DPP_VGS, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SPN, 0},
126     {MPP_DPP_VGS, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SP_M_S10B, 0},
127     {MPP_DPP_VGS, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SPN_S10B, 0},
128     {MPP_DPP_VGS, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCbCr_P010_M, 0},
129     {MPP_DPP_VGS, NODE_NONE, HAL_PIXEL_FORMAT_YCBCR_P010, 0},
130     {MPP_DPP_VGS, NODE_NONE, HAL_PIXEL_FORMAT_GOOGLE_NV12_SP, 0},
131     {MPP_DPP_VGS, NODE_NONE, HAL_PIXEL_FORMAT_GOOGLE_NV12_SP_10B, 0},
132     {MPP_DPP_VGF, NODE_NONE, HAL_PIXEL_FORMAT_RGB_565, 0},
133     {MPP_DPP_VGF, NODE_NONE, HAL_PIXEL_FORMAT_RGBA_8888, 0},
134     {MPP_DPP_VGF, NODE_NONE, HAL_PIXEL_FORMAT_RGBX_8888, 0},
135     {MPP_DPP_VGF, NODE_NONE, HAL_PIXEL_FORMAT_BGRA_8888, 0},
136     {MPP_DPP_VGF, NODE_NONE, HAL_PIXEL_FORMAT_RGBA_1010102, 0},
137     {MPP_DPP_VGF, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SP_M, 0},
138     {MPP_DPP_VGF, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SP_M_PRIV, 0},
139     {MPP_DPP_VGF, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCrCb_420_SP_M, 0},
140     {MPP_DPP_VGF, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCrCb_420_SP_M_FULL, 0},
141     {MPP_DPP_VGF, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SPN, 0},
142     {MPP_DPP_VGF, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SP_M_S10B, 0},
143     {MPP_DPP_VGF, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SPN_S10B, 0},
144     {MPP_DPP_VGF, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCbCr_P010_M, 0},
145     {MPP_DPP_VGF, NODE_NONE, HAL_PIXEL_FORMAT_YCBCR_P010, 0},
146     {MPP_DPP_VGF, NODE_NONE, HAL_PIXEL_FORMAT_GOOGLE_NV12_SP, 0},
147     {MPP_DPP_VGF, NODE_NONE, HAL_PIXEL_FORMAT_GOOGLE_NV12_SP_10B, 0},
148     {MPP_DPP_VGRFS, NODE_NONE, HAL_PIXEL_FORMAT_RGB_565, 0},
149     {MPP_DPP_VGRFS, NODE_NONE, HAL_PIXEL_FORMAT_RGBA_8888, 0},
150     {MPP_DPP_VGRFS, NODE_NONE, HAL_PIXEL_FORMAT_RGBX_8888, 0},
151     {MPP_DPP_VGRFS, NODE_NONE, HAL_PIXEL_FORMAT_BGRA_8888, 0},
152     {MPP_DPP_VGRFS, NODE_NONE, HAL_PIXEL_FORMAT_RGBA_1010102, 0},
153     {MPP_DPP_VGRFS, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SP_M, 0},
154     {MPP_DPP_VGRFS, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SP_M_PRIV, 0},
155     {MPP_DPP_VGRFS, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCrCb_420_SP_M, 0},
156     {MPP_DPP_VGRFS, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCrCb_420_SP_M_FULL, 0},
157     {MPP_DPP_VGRFS, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SPN, 0},
158     {MPP_DPP_VGRFS, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SP_M_S10B, 0},
159     {MPP_DPP_VGRFS, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SPN_S10B, 0},
160     {MPP_DPP_VGRFS, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCbCr_P010_M, 0},
161     {MPP_DPP_VGRFS, NODE_NONE, HAL_PIXEL_FORMAT_YCBCR_P010, 0},
162     {MPP_DPP_VGRFS, NODE_NONE, HAL_PIXEL_FORMAT_GOOGLE_NV12_SP, 0},
163     {MPP_DPP_VGRFS, NODE_NONE, HAL_PIXEL_FORMAT_GOOGLE_NV12_SP_10B, 0},
164     {MPP_G2D, NODE_NONE, HAL_PIXEL_FORMAT_RGB_565, 0},
165     {MPP_G2D, NODE_NONE, HAL_PIXEL_FORMAT_RGB_888, 0},
166     {MPP_G2D, NODE_NONE, HAL_PIXEL_FORMAT_RGBA_8888, 0},
167     {MPP_G2D, NODE_NONE, HAL_PIXEL_FORMAT_RGBX_8888, 0},
168     {MPP_G2D, NODE_NONE, HAL_PIXEL_FORMAT_BGRA_8888, 0},
169     {MPP_G2D, NODE_NONE, HAL_PIXEL_FORMAT_RGBA_1010102, 0},
170     {MPP_G2D, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SP_M, 0},
171     {MPP_G2D, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SP_M_PRIV, 0},
172     {MPP_G2D, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SP_M_TILED, 0},
173     {MPP_G2D, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCrCb_420_SP_M, 0},
174     {MPP_G2D, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCrCb_420_SP_M_FULL, 0},
175     {MPP_G2D, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SPN, 0},
176     {MPP_G2D, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SP_M_S10B, 0},
177     {MPP_G2D, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SPN_S10B, 0},
178     {MPP_G2D, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCbCr_P010_M, 0},
179     {MPP_G2D, NODE_NONE, HAL_PIXEL_FORMAT_YCrCb_420_SP, 0},
180     {MPP_G2D, NODE_NONE, HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SPN_TILED, 0},
181     {MPP_G2D, NODE_NONE, HAL_PIXEL_FORMAT_GOOGLE_NV12_SP, 0},
182     {MPP_G2D, NODE_NONE, HAL_PIXEL_FORMAT_GOOGLE_NV12_SP_10B, 0},
183 };
184 
185 const restriction_size_element restriction_size_table_rgb[] =
186         {{{MPP_DPP_GF, NODE_SRC, HAL_PIXEL_FORMAT_NONE, 0},
187           {{1, 1, 65535, 8191, 16, 16, 1, 1, 4096, 4096, 16, 16, 1, 1, 1, 1}}},
188          {{MPP_DPP_VG, NODE_SRC, HAL_PIXEL_FORMAT_NONE, 0},
189           {{1, 1, 65535, 8191, 16, 16, 1, 1, 4096, 4096, 16, 16, 1, 1, 1, 1}}},
190          {{MPP_DPP_VGS, NODE_SRC, HAL_PIXEL_FORMAT_NONE, 0},
191           {{2, 8, 65535, 8191, 16, 16, 1, 1, 4096, 4096, 16, 16, 1, 1, 1, 1}}},
192          {{MPP_DPP_VGF, NODE_SRC, HAL_PIXEL_FORMAT_NONE, 0},
193           {{1, 1, 65535, 8191, 16, 16, 1, 1, 4096, 4096, 16, 16, 1, 1, 1, 1}}},
194          {{MPP_DPP_VGRFS, NODE_SRC, HAL_PIXEL_FORMAT_NONE, 0},
195           {{2, 8, 65535, 8191, 16, 16, 1, 1, 4096, 4096, 16, 16, 1, 1, 1, 1}}},
196          {{MPP_DPP_GF, NODE_DST, HAL_PIXEL_FORMAT_NONE, 0},
197           {{1, 1, 65535, 8191, 16, 16, 1, 1, 4096, 4096, 16, 16, 1, 1, 1, 1}}},
198          {{MPP_DPP_VG, NODE_DST, HAL_PIXEL_FORMAT_NONE, 0},
199           {{1, 1, 65535, 8191, 16, 16, 1, 1, 4096, 4096, 16, 16, 1, 1, 1, 1}}},
200          {{MPP_DPP_VGS, NODE_DST, HAL_PIXEL_FORMAT_NONE, 0},
201           {{2, 8, 65535, 8191, 16, 16, 1, 1, 4096, 4096, 16, 16, 1, 1, 1, 1}}},
202          {{MPP_DPP_VGF, NODE_DST, HAL_PIXEL_FORMAT_NONE, 0},
203           {{1, 1, 65535, 8191, 16, 16, 1, 1, 4096, 4096, 16, 16, 1, 1, 1, 1}}},
204          {{MPP_DPP_VGRFS, NODE_DST, HAL_PIXEL_FORMAT_NONE, 0},
205           {{2, 8, 65535, 8191, 16, 16, 1, 1, 4096, 4096, 16, 16, 1, 1, 1, 1}}},
206          /* MPP_G2D maxUpScale = max crop size / min crop size */
207          {{MPP_G2D, NODE_NONE, HAL_PIXEL_FORMAT_NONE, 0},
208           {{8192, 8192, 8192, 8192, 1, 1, 1, 1, 8192, 8192, 1, 1, 1, 1, 1, 1}}}};
209 
210 const restriction_size_element restriction_size_table_yuv[] =
211         {{{MPP_DPP_GF, NODE_SRC, HAL_PIXEL_FORMAT_NONE, 0},
212           {{1, 1, 65534, 8190, 32, 32, 2, 2, 4096, 4096, 32, 32, 2, 2, 2, 2}}},
213          {{MPP_DPP_VG, NODE_SRC, HAL_PIXEL_FORMAT_NONE, 0},
214           {{1, 1, 65534, 8190, 32, 32, 2, 2, 4096, 4096, 32, 32, 2, 2, 2, 2}}},
215          {{MPP_DPP_VGS, NODE_SRC, HAL_PIXEL_FORMAT_NONE, 0},
216           {{2, 8, 65534, 8190, 32, 32, 2, 2, 4096, 4096, 32, 32, 2, 2, 2, 2}}},
217          {{MPP_DPP_VGF, NODE_SRC, HAL_PIXEL_FORMAT_NONE, 0},
218           {{1, 1, 65534, 8190, 32, 32, 2, 2, 4096, 4096, 32, 32, 2, 2, 2, 2}}},
219          {{MPP_DPP_VGRFS, NODE_SRC, HAL_PIXEL_FORMAT_NONE, 0},
220           {{2, 8, 65534, 8190, 32, 32, 2, 2, 4096, 4096, 32, 32, 2, 2, 2, 2}}},
221          /* MPP_G2D maxUpScale = max crop size / min crop size */
222          {{MPP_G2D, NODE_SRC, HAL_PIXEL_FORMAT_NONE, 0},
223           {{4, 8192, 8192, 8192, 2, 2, 2, 2, 8192, 8192, 1, 1, 1, 1, 1, 1}}},
224          {{MPP_DPP_GF, NODE_DST, HAL_PIXEL_FORMAT_NONE, 0},
225           {{1, 1, 65535, 8191, 16, 16, 1, 1, 4096, 4096, 16, 16, 1, 1, 1, 1}}},
226          {{MPP_DPP_VG, NODE_DST, HAL_PIXEL_FORMAT_NONE, 0},
227           {{1, 1, 65535, 8191, 16, 16, 1, 1, 4096, 4096, 16, 16, 1, 1, 1, 1}}},
228          {{MPP_DPP_VGS, NODE_DST, HAL_PIXEL_FORMAT_NONE, 0},
229           {{2, 8, 65535, 8191, 16, 16, 1, 1, 4096, 4096, 16, 16, 1, 1, 1, 1}}},
230          {{MPP_DPP_VGF, NODE_DST, HAL_PIXEL_FORMAT_NONE, 0},
231           {{1, 1, 65535, 8191, 16, 16, 1, 1, 4096, 4096, 16, 16, 1, 1, 1, 1}}},
232          {{MPP_DPP_VGRFS, NODE_DST, HAL_PIXEL_FORMAT_NONE, 0},
233           {{2, 8, 65535, 8191, 16, 16, 1, 1, 4096, 4096, 16, 16, 1, 1, 1, 1}}},
234          /* MPP_G2D maxUpScale = max crop size / min crop size */
235          {{MPP_G2D, NODE_DST, HAL_PIXEL_FORMAT_NONE, 0},
236           {{8192, 8192, 8192, 8192, 2, 2, 2, 2, 8192, 8192, 2, 2, 2, 2, 2, 2}}}};
237 
238 const restriction_table_element restriction_tables[RESTRICTION_MAX] =
239 {
240     {RESTRICTION_RGB, restriction_size_table_rgb, sizeof(restriction_size_table_rgb)/sizeof(restriction_size_element)},
241     {RESTRICTION_YUV, restriction_size_table_yuv, sizeof(restriction_size_table_yuv)/sizeof(restriction_size_element)}
242 };
243 
244 #define USE_MODULE_DPU_ATTR_MAP
245 const dpu_attr_map_t dpu_attr_map_table [] =
246 {
247     {DPP_ATTR_AFBC, MPP_ATTR_AFBC},
248     {DPP_ATTR_BLOCK, MPP_ATTR_BLOCK_MODE},
249     {DPP_ATTR_FLIP, MPP_ATTR_FLIP_H | MPP_ATTR_FLIP_V},
250     {DPP_ATTR_ROT, MPP_ATTR_ROT_90},
251     {DPP_ATTR_SCALE, MPP_ATTR_SCALE},
252     {DPP_ATTR_HDR, MPP_ATTR_HDR10 | MPP_ATTR_WCG | MPP_ATTR_LAYER_TRANSFORM},
253     {DPP_ATTR_HDR10_PLUS, MPP_ATTR_HDR10PLUS | MPP_ATTR_HDR10 | MPP_ATTR_WCG | MPP_ATTR_LAYER_TRANSFORM},
254     {DPP_ATTR_C_HDR, MPP_ATTR_HDR10},
255     {DPP_ATTR_C_HDR10_PLUS, MPP_ATTR_HDR10PLUS},
256     {DPP_ATTR_WCG, MPP_ATTR_WCG},
257 };
258 
259 static ppc_table ppc_table_map = {
260     /* G2D support only 2 plane YUV, so all YUV format should use YUV2P PPC table */
261     /* In case of Scale-Up, G2D should use same PPC table */
262     {PPC_IDX(MPP_G2D,PPC_FORMAT_YUV420,PPC_ROT_NO),   {3.5, 3.6, 4.3, 4.3, 3.5, 3.7, 3.7}},
263     {PPC_IDX(MPP_G2D,PPC_FORMAT_YUV420,PPC_ROT),      {2.8, 3.2, 3.9, 4.3, 3.6, 2.6, 2.6}},
264 
265     {PPC_IDX(MPP_G2D,PPC_FORMAT_YUV422,PPC_ROT_NO),   {3.5, 3.6, 4.3, 4.3, 3.5, 3.7, 3.7}},
266     {PPC_IDX(MPP_G2D,PPC_FORMAT_YUV422,PPC_ROT),      {2.8, 3.2, 3.9, 4.3, 3.6, 2.6, 2.6}},
267 
268     {PPC_IDX(MPP_G2D,PPC_FORMAT_P010,PPC_ROT_NO),     {3.5, 3.6, 4.3, 4.3, 3.5, 3.7, 3.7}},
269     {PPC_IDX(MPP_G2D,PPC_FORMAT_P010,PPC_ROT),        {2.8, 3.2, 3.9, 4.3, 3.6, 2.6, 2.6}},
270 
271     {PPC_IDX(MPP_G2D,PPC_FORMAT_RGB32,PPC_ROT_NO),    {3.2, 2.1, 2.6, 3.3, 3.6, 3.8, 3.8}},
272     {PPC_IDX(MPP_G2D,PPC_FORMAT_RGB32,PPC_ROT),       {3.6, 2.1, 2.7, 3.3, 3.8, 3.5, 3.5}},
273 
274     {PPC_IDX(MPP_G2D,PPC_FORMAT_SBWC,PPC_ROT_NO),     {2.6, 1.4, 0.9, 1.0, 1.0, 3.6, 3.6}},
275     {PPC_IDX(MPP_G2D,PPC_FORMAT_SBWC,PPC_ROT),        {2.6, 1.4, 0.9, 1.0, 1.0, 2.6, 2.6}},
276 
277     {PPC_IDX(MPP_G2D,PPC_FORMAT_AFBC_RGB,PPC_ROT_NO), {3.4, 0.3, 0.5, 0.8, 0.7, 1.6, 1.6}},
278     {PPC_IDX(MPP_G2D,PPC_FORMAT_AFBC_RGB,PPC_ROT),    {3.6, 0.3, 0.8, 0.9, 0.9, 1.4, 1.4}},
279 
280     {PPC_IDX(MPP_G2D,PPC_FORMAT_AFBC_YUV,PPC_ROT_NO), {2.0, 0.8, 0.3, 0.3, 0.4, 2.9, 2.9}},
281     {PPC_IDX(MPP_G2D,PPC_FORMAT_AFBC_YUV,PPC_ROT),    {2.0, 0.8, 0.3, 0.3, 0.4, 2.6, 2.6}},
282 };
283 
284 #endif
285