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_VENC_H_
20 #define _MSM_VENC_H_
21 #include <linux/types.h>
22 #define VENC_MAX_RECON_BUFFERS 2
23 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24 #define VENC_FLAG_EOS 0x00000001
25 #define VENC_FLAG_END_OF_FRAME 0x00000010
26 #define VENC_FLAG_SYNC_FRAME 0x00000020
27 #define VENC_FLAG_EXTRA_DATA 0x00000040
28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29 #define VENC_FLAG_CODEC_CONFIG 0x00000080
30 enum venc_flush_type {
31  VENC_FLUSH_INPUT,
32  VENC_FLUSH_OUTPUT,
33 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34  VENC_FLUSH_ALL
35 };
36 enum venc_state_type {
37  VENC_STATE_PAUSE = 0x1,
38 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39  VENC_STATE_START = 0x2,
40  VENC_STATE_STOP = 0x4
41 };
42 enum venc_event_type_enum {
43 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44  VENC_EVENT_START_STATUS,
45  VENC_EVENT_STOP_STATUS,
46  VENC_EVENT_SUSPEND_STATUS,
47  VENC_EVENT_RESUME_STATUS,
48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49  VENC_EVENT_FLUSH_STATUS,
50  VENC_EVENT_RELEASE_INPUT,
51  VENC_EVENT_DELIVER_OUTPUT,
52  VENC_EVENT_UNKNOWN_STATUS
53 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54 };
55 enum venc_status_code {
56  VENC_STATUS_SUCCESS,
57  VENC_STATUS_ERROR,
58 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59  VENC_STATUS_INVALID_STATE,
60  VENC_STATUS_FLUSHING,
61  VENC_STATUS_INVALID_PARAM,
62  VENC_STATUS_CMD_QUEUE_FULL,
63 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
64  VENC_STATUS_CRITICAL,
65  VENC_STATUS_INSUFFICIENT_RESOURCES,
66  VENC_STATUS_TIMEOUT
67 };
68 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69 enum venc_msg_code {
70  VENC_MSG_INDICATION,
71  VENC_MSG_INPUT_BUFFER_DONE,
72  VENC_MSG_OUTPUT_BUFFER_DONE,
73 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
74  VENC_MSG_NEED_OUTPUT_BUFFER,
75  VENC_MSG_FLUSH,
76  VENC_MSG_START,
77  VENC_MSG_STOP,
78 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
79  VENC_MSG_PAUSE,
80  VENC_MSG_RESUME,
81  VENC_MSG_STOP_READING_MSG
82 };
83 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
84 enum venc_error_code {
85  VENC_S_SUCCESS,
86  VENC_S_EFAIL,
87  VENC_S_EFATAL,
88 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
89  VENC_S_EBADPARAM,
90  VENC_S_EINVALSTATE,
91  VENC_S_ENOSWRES,
92  VENC_S_ENOHWRES,
93 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
94  VENC_S_EBUFFREQ,
95  VENC_S_EINVALCMD,
96  VENC_S_ETIMEOUT,
97  VENC_S_ENOREATMPT,
98 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
99  VENC_S_ENOPREREQ,
100  VENC_S_ECMDQFULL,
101  VENC_S_ENOTSUPP,
102  VENC_S_ENOTIMPL,
103 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
104  VENC_S_ENOTPMEM,
105  VENC_S_EFLUSHED,
106  VENC_S_EINSUFBUF,
107  VENC_S_ESAMESTATE,
108 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
109  VENC_S_EINVALTRANS
110 };
111 enum venc_mem_region_enum {
112  VENC_PMEM_EBI1,
113 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
114  VENC_PMEM_SMI
115 };
116 struct venc_buf_type {
117  u32 region;
118 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
119  u32 phys;
120  u32 size;
121  int offset;
122 };
123 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
124 struct venc_qp_range {
125  u32 min_qp;
126  u32 max_qp;
127 };
128 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
129 struct venc_frame_rate {
130  u32 frame_rate_num;
131  u32 frame_rate_den;
132 };
133 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
134 struct venc_slice_info {
135  u32 slice_mode;
136  u32 units_per_slice;
137 };
138 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
139 struct venc_extra_data {
140  u32 slice_extra_data_flag;
141  u32 slice_client_data1;
142  u32 slice_client_data2;
143 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
144  u32 slice_client_data3;
145  u32 none_extra_data_flag;
146  u32 none_client_data1;
147  u32 none_client_data2;
148 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
149  u32 none_client_data3;
150 };
151 struct venc_common_config {
152  u32 standard;
153 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
154  u32 input_frame_height;
155  u32 input_frame_width;
156  u32 output_frame_height;
157  u32 output_frame_width;
158 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
159  u32 rotation_angle;
160  u32 intra_period;
161  u32 rate_control;
162  struct venc_frame_rate frame_rate;
163 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
164  u32 bitrate;
165  struct venc_qp_range qp_range;
166  u32 iframe_qp;
167  u32 pframe_qp;
168 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
169  struct venc_slice_info slice_config;
170  struct venc_extra_data extra_data;
171 };
172 struct venc_nonio_buf_config {
173 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
174  struct venc_buf_type recon_buf1;
175  struct venc_buf_type recon_buf2;
176  struct venc_buf_type wb_buf;
177  struct venc_buf_type cmd_buf;
178 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
179  struct venc_buf_type vlc_buf;
180 };
181 struct venc_mpeg4_config {
182  u32 profile;
183 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
184  u32 level;
185  u32 time_resolution;
186  u32 ac_prediction;
187  u32 hec_interval;
188 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
189  u32 data_partition;
190  u32 short_header;
191  u32 rvlc_enable;
192 };
193 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
194 struct venc_h263_config {
195  u32 profile;
196  u32 level;
197 };
198 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
199 struct venc_h264_config {
200  u32 profile;
201  u32 level;
202  u32 max_nal;
203 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
204  u32 idr_period;
205 };
206 struct venc_pmem {
207  int src;
208 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
209  int fd;
210  u32 offset;
211  void *virt;
212  void *phys;
213 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
214  u32 size;
215 };
216 struct venc_buffer {
217  unsigned char *ptr_buffer;
218 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
219  u32 size;
220  u32 len;
221  u32 offset;
222  long long time_stamp;
223 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
224  u32 flags;
225  u32 client_data;
226 };
227 struct venc_buffers {
228 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
229  struct venc_pmem recon_buf[VENC_MAX_RECON_BUFFERS];
230  struct venc_pmem wb_buf;
231  struct venc_pmem cmd_buf;
232  struct venc_pmem vlc_buf;
233 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
234 };
235 struct venc_buffer_flush {
236  u32 flush_mode;
237 };
238 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
239 union venc_msg_data {
240  struct venc_buffer buf;
241  struct venc_buffer_flush flush_ret;
242 };
243 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
244 struct venc_msg {
245  u32 status_code;
246  u32 msg_code;
247  u32 msg_data_size;
248 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
249  union venc_msg_data msg_data;
250 };
251 union venc_codec_config {
252  struct venc_mpeg4_config mpeg4_params;
253 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
254  struct venc_h263_config h263_params;
255  struct venc_h264_config h264_params;
256 };
257 struct venc_q6_config {
258 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
259  struct venc_common_config config_params;
260  union venc_codec_config codec_params;
261  struct venc_nonio_buf_config buf_params;
262  void *callback_event;
263 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
264 };
265 struct venc_hdr_config {
266  struct venc_common_config config_params;
267  union venc_codec_config codec_params;
268 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
269 };
270 struct venc_init_config {
271  struct venc_q6_config q6_config;
272  struct venc_buffers q6_bufs;
273 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
274 };
275 struct venc_seq_config {
276  int size;
277  struct venc_pmem buf;
278 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
279  struct venc_q6_config q6_config;
280 };
281 struct venc_version {
282  u32 major;
283 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
284  u32 minor;
285 };
286 #define VENC_IOCTL_MAGIC 'V'
287 #define VENC_IOCTL_CMD_READ_NEXT_MSG   _IOWR(VENC_IOCTL_MAGIC, 1, struct venc_msg)
288 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
289 #define VENC_IOCTL_CMD_STOP_READ_MSG _IO(VENC_IOCTL_MAGIC, 2)
290 #define VENC_IOCTL_SET_INPUT_BUFFER   _IOW(VENC_IOCTL_MAGIC, 3, struct venc_pmem)
291 #define VENC_IOCTL_SET_OUTPUT_BUFFER   _IOW(VENC_IOCTL_MAGIC, 4, struct venc_pmem)
292 #define VENC_IOCTL_CMD_START _IOW(VENC_IOCTL_MAGIC, 5, struct venc_init_config)
293 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
294 #define VENC_IOCTL_CMD_ENCODE_FRAME   _IOW(VENC_IOCTL_MAGIC, 6, struct venc_buffer)
295 #define VENC_IOCTL_CMD_FILL_OUTPUT_BUFFER   _IOW(VENC_IOCTL_MAGIC, 7, struct venc_buffer)
296 #define VENC_IOCTL_CMD_FLUSH   _IOW(VENC_IOCTL_MAGIC, 8, struct venc_buffer_flush)
297 #define VENC_IOCTL_CMD_PAUSE _IO(VENC_IOCTL_MAGIC, 9)
298 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
299 #define VENC_IOCTL_CMD_RESUME _IO(VENC_IOCTL_MAGIC, 10)
300 #define VENC_IOCTL_CMD_STOP _IO(VENC_IOCTL_MAGIC, 11)
301 #define VENC_IOCTL_SET_INTRA_PERIOD   _IOW(VENC_IOCTL_MAGIC, 12, int)
302 #define VENC_IOCTL_CMD_REQUEST_IFRAME _IO(VENC_IOCTL_MAGIC, 13)
303 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
304 #define VENC_IOCTL_GET_SEQUENCE_HDR   _IOWR(VENC_IOCTL_MAGIC, 14, struct venc_seq_config)
305 #define VENC_IOCTL_SET_INTRA_REFRESH   _IOW(VENC_IOCTL_MAGIC, 15, int)
306 #define VENC_IOCTL_SET_FRAME_RATE   _IOW(VENC_IOCTL_MAGIC, 16, struct venc_frame_rate)
307 #define VENC_IOCTL_SET_TARGET_BITRATE   _IOW(VENC_IOCTL_MAGIC, 17, int)
308 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
309 #define VENC_IOCTL_SET_QP_RANGE   _IOW(VENC_IOCTL_MAGIC, 18, struct venc_qp_range)
310 #define VENC_IOCTL_GET_VERSION   _IOR(VENC_IOCTL_MAGIC, 19, struct venc_version)
311 #endif
312 
313