1 /*
2  * Copyright (C) 2020 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 _DECON_COMMON_HELPER_H
18 #define _DECON_COMMON_HELPER_H
19 #include <vector>
20 typedef unsigned int u32;
21 
22 struct decon_win_rect {
23     int x;
24     int y;
25     uint32_t w;
26     uint32_t h;
27 };
28 
29 struct decon_frame {
30     int x;
31     int y;
32     uint32_t w;
33     uint32_t h;
34     uint32_t f_w;
35     uint32_t f_h;
36 };
37 
38 enum decon_pixel_format {
39   DECON_PIXEL_FORMAT_ARGB_8888 = 0,
40   DECON_PIXEL_FORMAT_ABGR_8888,
41   DECON_PIXEL_FORMAT_RGBA_8888,
42   DECON_PIXEL_FORMAT_BGRA_8888,
43   DECON_PIXEL_FORMAT_XRGB_8888,
44   DECON_PIXEL_FORMAT_XBGR_8888,
45   DECON_PIXEL_FORMAT_RGBX_8888,
46   DECON_PIXEL_FORMAT_BGRX_8888,
47   DECON_PIXEL_FORMAT_RGBA_5551,
48   DECON_PIXEL_FORMAT_BGRA_5551,
49   DECON_PIXEL_FORMAT_ABGR_4444,
50   DECON_PIXEL_FORMAT_RGBA_4444,
51   DECON_PIXEL_FORMAT_BGRA_4444,
52   DECON_PIXEL_FORMAT_RGB_565,
53   DECON_PIXEL_FORMAT_BGR_565,
54   DECON_PIXEL_FORMAT_ARGB_2101010,
55   DECON_PIXEL_FORMAT_ABGR_2101010,
56   DECON_PIXEL_FORMAT_RGBA_1010102,
57   DECON_PIXEL_FORMAT_BGRA_1010102,
58   DECON_PIXEL_FORMAT_NV16,
59   DECON_PIXEL_FORMAT_NV61,
60   DECON_PIXEL_FORMAT_YVU422_3P,
61   DECON_PIXEL_FORMAT_NV12,
62   DECON_PIXEL_FORMAT_NV21,
63   DECON_PIXEL_FORMAT_NV12M,
64   DECON_PIXEL_FORMAT_NV21M,
65   DECON_PIXEL_FORMAT_YUV420,
66   DECON_PIXEL_FORMAT_YVU420,
67   DECON_PIXEL_FORMAT_YUV420M,
68   DECON_PIXEL_FORMAT_YVU420M,
69   DECON_PIXEL_FORMAT_NV12N,
70   DECON_PIXEL_FORMAT_NV12N_10B,
71   DECON_PIXEL_FORMAT_NV12M_P010,
72   DECON_PIXEL_FORMAT_NV21M_P010,
73   DECON_PIXEL_FORMAT_NV12M_S10B,
74   DECON_PIXEL_FORMAT_NV21M_S10B,
75   DECON_PIXEL_FORMAT_NV16M_P210,
76   DECON_PIXEL_FORMAT_NV61M_P210,
77   DECON_PIXEL_FORMAT_NV16M_S10B,
78   DECON_PIXEL_FORMAT_NV61M_S10B,
79   DECON_PIXEL_FORMAT_NV12_P010,
80   /* formats for lossless SBWC case */
81   DECON_PIXEL_FORMAT_NV12M_SBWC_8B,
82   DECON_PIXEL_FORMAT_NV12M_SBWC_10B,
83   DECON_PIXEL_FORMAT_NV21M_SBWC_8B,
84   DECON_PIXEL_FORMAT_NV21M_SBWC_10B,
85   DECON_PIXEL_FORMAT_NV12N_SBWC_8B,
86   DECON_PIXEL_FORMAT_NV12N_SBWC_10B,
87   /* formats for lossy SBWC case  */
88   DECON_PIXEL_FORMAT_NV12M_SBWC_8B_L50,
89   DECON_PIXEL_FORMAT_NV12M_SBWC_8B_L75,
90   DECON_PIXEL_FORMAT_NV12N_SBWC_8B_L50,
91   DECON_PIXEL_FORMAT_NV12N_SBWC_8B_L75,
92   DECON_PIXEL_FORMAT_NV12M_SBWC_10B_L40,
93   DECON_PIXEL_FORMAT_NV12M_SBWC_10B_L60,
94   DECON_PIXEL_FORMAT_NV12M_SBWC_10B_L80,
95   DECON_PIXEL_FORMAT_NV12N_SBWC_10B_L40,
96   DECON_PIXEL_FORMAT_NV12N_SBWC_10B_L60,
97   DECON_PIXEL_FORMAT_NV12N_SBWC_10B_L80,
98   DECON_PIXEL_FORMAT_MAX,
99 };
100 enum dpp_comp_src {
101   DPP_COMP_SRC_NONE = 0,
102   DPP_COMP_SRC_G2D,
103   DPP_COMP_SRC_GPU
104 };
105 
106 enum dpp_attr {
107     DPP_ATTR_AFBC           = 0,
108     DPP_ATTR_BLOCK          = 1,
109     DPP_ATTR_FLIP           = 2,
110     DPP_ATTR_ROT            = 3,
111     DPP_ATTR_CSC            = 4,
112     DPP_ATTR_SCALE          = 5,
113     DPP_ATTR_HDR            = 6,
114     DPP_ATTR_C_HDR          = 7,
115     DPP_ATTR_C_HDR10_PLUS   = 8,
116     DPP_ATTR_WCG            = 9,
117     DPP_ATTR_SBWC           = 10,
118     DPP_ATTR_HDR10_PLUS     = 11,
119     DPP_ATTR_IDMA           = 16,
120     DPP_ATTR_ODMA           = 17,
121     DPP_ATTR_DPP            = 18,
122 };
123 #endif
124