• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ***   To edit the content of this header, modify the corresponding
11  ***   source file (e.g. under external/kernel-headers/original/) then
12  ***   run bionic/libc/kernel/tools/update_all.py
13  ***
14  ***   Any manual change here will be lost the next time this script will
15  ***   be run. You've been warned!
16  ***
17  ****************************************************************************
18  ****************************************************************************/
19 #ifndef _MSM_MDP_EXT_H_
20 #define _MSM_MDP_EXT_H_
21 #include <linux/msm_mdp.h>
22 #define MDP_IOCTL_MAGIC 'S'
23 #define MSMFB_ATOMIC_COMMIT _IOWR(MDP_IOCTL_MAGIC, 128, void *)
24 #define MSMFB_ASYNC_POSITION_UPDATE _IOWR(MDP_IOCTL_MAGIC, 129, struct mdp_position_update)
25 #define MSMFB_MDP_SET_CFG _IOW(MDP_IOCTL_MAGIC, 130, struct mdp_set_cfg)
26 #define MSMFB_MDP_SET_PANEL_PPM _IOW(MDP_IOCTL_MAGIC, 131, int)
27 #ifdef __LP64
28 #define MDP_LAYER_COMMIT_V1_PAD 2
29 #else
30 #define MDP_LAYER_COMMIT_V1_PAD 3
31 #endif
32 #define MDP_LAYER_FLIP_LR 0x1
33 #define MDP_LAYER_FLIP_UD 0x2
34 #define MDP_LAYER_ENABLE_PIXEL_EXT 0x4
35 #define MDP_LAYER_FORGROUND 0x8
36 #define MDP_LAYER_SECURE_SESSION 0x10
37 #define MDP_LAYER_SOLID_FILL 0x20
38 #define MDP_LAYER_DEINTERLACE 0x40
39 #define MDP_LAYER_BWC 0x80
40 #define MDP_LAYER_ASYNC 0x100
41 #define MDP_LAYER_PP 0x200
42 #define MDP_LAYER_SECURE_DISPLAY_SESSION 0x400
43 #define MDP_LAYER_ENABLE_QSEED3_SCALE 0x800
44 #define MDP_LAYER_MULTIRECT_ENABLE 0x1000
45 #define MDP_LAYER_MULTIRECT_PARALLEL_MODE 0x2000
46 #define MDP_LAYER_SECURE_CAMERA_SESSION 0x4000
47 #define MDP_DESTSCALER_ENABLE 0x1
48 #define MDP_DESTSCALER_SCALE_UPDATE 0x2
49 #define MDP_DESTSCALER_ENHANCER_UPDATE 0x4
50 #define MDP_DESTSCALER_ROI_ENABLE 0x8
51 #define MDP_VALIDATE_LAYER 0x01
52 #define MDP_COMMIT_WAIT_FOR_FINISH 0x02
53 #define MDP_COMMIT_SYNC_FENCE_WAIT 0x04
54 #define MDP_COMMIT_AVR_EN 0x08
55 #define MDP_COMMIT_AVR_ONE_SHOT_MODE 0x10
56 #define MDP_COMMIT_PARTIAL_UPDATE_DUAL_ROI 0x20
57 #define MDP_COMMIT_UPDATE_BRIGHTNESS 0x40
58 #define MDP_COMMIT_CWB_EN 0x800
59 #define MDP_COMMIT_CWB_DSPP 0x1000
60 #define MDP_COMMIT_RECT_NUM 0x2000
61 #define MDP_COMMIT_VERSION_1_0 0x00010000
62 #define OUT_LAYER_COLOR_SPACE
63 #define MDP_HDR_EOTF_SMTPE_ST2084 0x2
64 #define MDP_HDR_EOTF_HLG 0x3
65 #define MDP_PIXEL_ENCODING_RGB 0x0
66 #define MDP_PIXEL_ENCODING_YCBCR_444 0x1
67 #define MDP_PIXEL_ENCODING_YCBCR_422 0x2
68 #define MDP_PIXEL_ENCODING_YCBCR_420 0x3
69 #define MDP_PIXEL_ENCODING_Y_ONLY 0x4
70 #define MDP_PIXEL_ENCODING_RAW 0x5
71 #define MDP_COLORIMETRY_RGB_SRGB 0x0
72 #define MDP_COLORIMETRY_RGB_WIDE_FIXED_POINT 0x1
73 #define MDP_COLORIMETRY_RGB_WIDE_FLOAT_POINT 0x2
74 #define MDP_COLORIMETRY_RGB_ADOBE 0x3
75 #define MDP_COLORIMETRY_RGB_DPI_P3 0x4
76 #define MDP_COLORIMETRY_RGB_CUSTOM 0x5
77 #define MDP_COLORIMETRY_RGB_ITU_R_BT_2020 0x6
78 #define MDP_COLORIMETRY_YCBCR_ITU_R_BT_601 0x0
79 #define MDP_COLORIMETRY_YCBCR_ITU_R_BT_709 0x1
80 #define MDP_COLORIMETRY_YCBCR_XV_YCC_601 0x2
81 #define MDP_COLORIMETRY_YCBCR_XV_YCC_709 0x3
82 #define MDP_COLORIMETRY_YCBCR_S_YCC_601 0x4
83 #define MDP_COLORIMETRY_YCBCR_ADOBE_YCC_601 0x5
84 #define MDP_COLORIMETRY_YCBCR_ITU_R_BT_2020_YCBCR_CONST 0x6
85 #define MDP_COLORIMETRY_YCBCR_ITU_R_BT_2020_YCBCR 0x7
86 #define MDP_DYNAMIC_RANGE_VESA 0x0
87 #define MDP_DYNAMIC_RANGE_CEA 0x1
88 #define MDP_RGB_6_BPC 0x0
89 #define MDP_RGB_8_BPC 0x1
90 #define MDP_RGB_10_BPC 0x2
91 #define MDP_RGB_12_BPC 0x3
92 #define MDP_RGB_16_BPC 0x4
93 #define MDP_YUV_8_BPC 0x1
94 #define MDP_YUV_10_BPC 0x2
95 #define MDP_YUV_12_BPC 0x3
96 #define MDP_YUV_16_BPC 0x4
97 #define MDP_RAW_6_BPC 0x1
98 #define MDP_RAW_7_BPC 0x2
99 #define MDP_RAW_8_BPC 0x3
100 #define MDP_RAW_10_BPC 0x4
101 #define MDP_RAW_12_BPC 0x5
102 #define MDP_RAW_14_BPC 0x6
103 #define MDP_RAW16_BPC 0x7
104 #define MDP_CONTENT_TYPE_NOT_DEFINED 0x0
105 #define MDP_CONTENT_TYPE_GRAPHICS 0x1
106 #define MDP_CONTENT_TYPE_PHOTO 0x2
107 #define MDP_CONTENT_TYPE_VIDEO 0x3
108 #define MDP_CONTENT_TYPE_GAME 0x4
109 struct mdp_layer_plane {
110   int fd;
111   uint32_t offset;
112   uint32_t stride;
113 };
114 struct mdp_layer_buffer {
115   uint32_t width;
116   uint32_t height;
117   uint32_t format;
118   struct mdp_layer_plane planes[MAX_PLANES];
119   uint32_t plane_count;
120   struct mult_factor comp_ratio;
121   int fence;
122   uint32_t reserved;
123 };
124 struct mdp_input_layer {
125   uint32_t flags;
126   uint32_t pipe_ndx;
127   uint8_t horz_deci;
128   uint8_t vert_deci;
129   uint8_t alpha;
130   uint16_t z_order;
131   uint32_t transp_mask;
132   uint32_t bg_color;
133   enum mdss_mdp_blend_op blend_op;
134   enum mdp_color_space color_space;
135   struct mdp_rect src_rect;
136   struct mdp_rect dst_rect;
137   void * scale;
138   struct mdp_layer_buffer buffer;
139   void * pp_info;
140   int error_code;
141   uint32_t rect_num;
142   uint32_t reserved[5];
143 };
144 struct mdp_output_layer {
145   uint32_t flags;
146   uint32_t writeback_ndx;
147   struct mdp_layer_buffer buffer;
148   enum mdp_color_space color_space;
149   uint32_t reserved[5];
150 };
151 struct mdp_destination_scaler_data {
152   uint32_t flags;
153   uint32_t dest_scaler_ndx;
154   uint32_t lm_width;
155   uint32_t lm_height;
156   uint64_t scale;
157   struct mdp_rect panel_roi;
158 };
159 struct mdp_layer_commit_v1 {
160   uint32_t flags;
161   int release_fence;
162   struct mdp_rect left_roi;
163   struct mdp_rect right_roi;
164   struct mdp_input_layer * input_layers;
165   uint32_t input_layer_cnt;
166   struct mdp_output_layer * output_layer;
167   int retire_fence;
168   void * dest_scaler;
169   uint32_t dest_scaler_cnt;
170   uint32_t bl_level;
171   uint32_t reserved[MDP_LAYER_COMMIT_V1_PAD];
172 };
173 struct mdp_layer_commit {
174   uint32_t version;
175   union {
176     struct mdp_layer_commit_v1 commit_v1;
177   };
178 };
179 struct mdp_point {
180   uint32_t x;
181   uint32_t y;
182 };
183 struct mdp_async_layer {
184   uint32_t flags;
185   uint32_t pipe_ndx;
186   struct mdp_point src;
187   struct mdp_point dst;
188   int error_code;
189   uint32_t reserved[3];
190 };
191 struct mdp_position_update {
192   struct mdp_async_layer * input_layers;
193   uint32_t input_layer_cnt;
194 };
195 #define MAX_DET_CURVES 3
196 struct mdp_det_enhance_data {
197   uint32_t enable;
198   int16_t sharpen_level1;
199   int16_t sharpen_level2;
200   uint16_t clip;
201   uint16_t limit;
202   uint16_t thr_quiet;
203   uint16_t thr_dieout;
204   uint16_t thr_low;
205   uint16_t thr_high;
206   uint16_t prec_shift;
207   int16_t adjust_a[MAX_DET_CURVES];
208   int16_t adjust_b[MAX_DET_CURVES];
209   int16_t adjust_c[MAX_DET_CURVES];
210 };
211 #define ENABLE_SCALE 0x1
212 #define ENABLE_DETAIL_ENHANCE 0x2
213 #define ENABLE_DIRECTION_DETECTION 0x4
214 #define SCALER_LUT_SWAP 0x1
215 #define SCALER_LUT_DIR_WR 0x2
216 #define SCALER_LUT_Y_CIR_WR 0x4
217 #define SCALER_LUT_UV_CIR_WR 0x8
218 #define SCALER_LUT_Y_SEP_WR 0x10
219 #define SCALER_LUT_UV_SEP_WR 0x20
220 #define FILTER_EDGE_DIRECTED_2D 0x0
221 #define FILTER_CIRCULAR_2D 0x1
222 #define FILTER_SEPARABLE_1D 0x2
223 #define FILTER_BILINEAR 0x3
224 #define FILTER_ALPHA_DROP_REPEAT 0x0
225 #define FILTER_ALPHA_BILINEAR 0x1
226 struct mdp_scale_data_v2 {
227   uint32_t enable;
228   int32_t init_phase_x[MAX_PLANES];
229   int32_t phase_step_x[MAX_PLANES];
230   int32_t init_phase_y[MAX_PLANES];
231   int32_t phase_step_y[MAX_PLANES];
232   uint32_t num_ext_pxls_left[MAX_PLANES];
233   uint32_t num_ext_pxls_right[MAX_PLANES];
234   uint32_t num_ext_pxls_top[MAX_PLANES];
235   uint32_t num_ext_pxls_btm[MAX_PLANES];
236   int32_t left_ftch[MAX_PLANES];
237   int32_t left_rpt[MAX_PLANES];
238   int32_t right_ftch[MAX_PLANES];
239   int32_t right_rpt[MAX_PLANES];
240   uint32_t top_rpt[MAX_PLANES];
241   uint32_t btm_rpt[MAX_PLANES];
242   uint32_t top_ftch[MAX_PLANES];
243   uint32_t btm_ftch[MAX_PLANES];
244   uint32_t roi_w[MAX_PLANES];
245   uint32_t preload_x[MAX_PLANES];
246   uint32_t preload_y[MAX_PLANES];
247   uint32_t src_width[MAX_PLANES];
248   uint32_t src_height[MAX_PLANES];
249   uint32_t dst_width;
250   uint32_t dst_height;
251   uint32_t y_rgb_filter_cfg;
252   uint32_t uv_filter_cfg;
253   uint32_t alpha_filter_cfg;
254   uint32_t blend_cfg;
255   uint32_t lut_flag;
256   uint32_t dir_lut_idx;
257   uint32_t y_rgb_cir_lut_idx;
258   uint32_t uv_cir_lut_idx;
259   uint32_t y_rgb_sep_lut_idx;
260   uint32_t uv_sep_lut_idx;
261   struct mdp_det_enhance_data detail_enhance;
262   uint64_t reserved[8];
263 };
264 struct mdp_scale_luts_info {
265   uint64_t dir_lut;
266   uint64_t cir_lut;
267   uint64_t sep_lut;
268   uint32_t dir_lut_size;
269   uint32_t cir_lut_size;
270   uint32_t sep_lut_size;
271 };
272 #define MDP_QSEED3_LUT_CFG 0x1
273 struct mdp_set_cfg {
274   uint64_t flags;
275   uint32_t len;
276   uint64_t payload;
277 };
278 #define HDR_PRIMARIES_COUNT 3
279 #define MDP_HDR_STREAM
280 struct mdp_hdr_stream {
281   uint32_t eotf;
282   uint32_t display_primaries_x[HDR_PRIMARIES_COUNT];
283   uint32_t display_primaries_y[HDR_PRIMARIES_COUNT];
284   uint32_t white_point_x;
285   uint32_t white_point_y;
286   uint32_t max_luminance;
287   uint32_t min_luminance;
288   uint32_t max_content_light_level;
289   uint32_t max_average_light_level;
290   uint32_t pixel_encoding;
291   uint32_t colorimetry;
292   uint32_t range;
293   uint32_t bits_per_component;
294   uint32_t content_type;
295   uint32_t reserved[5];
296 };
297 #define HDR_ENABLE (1 << 0)
298 #define HDR_DISABLE (1 << 1)
299 #define HDR_RESET (1 << 2)
300 struct mdp_hdr_stream_ctrl {
301   __u8 hdr_state;
302   struct mdp_hdr_stream hdr_stream;
303 };
304 #endif
305