1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 #ifndef _UAPI_EXYNOS_DRM_H_
17 #define _UAPI_EXYNOS_DRM_H_
18
19 #include "drm.h"
20
21 #if defined(__cplusplus)
22 extern "C" {
23 #endif
24
25
26
27
28
29
30
31
32
33
34 struct drm_exynos_gem_create {
35 __u64 size;
36 __u32 flags;
37 __u32 handle;
38 };
39
40
41
42
43
44
45
46
47 struct drm_exynos_gem_map {
48 __u32 handle;
49 __u32 reserved;
50 __u64 offset;
51 };
52
53
54
55
56
57
58
59
60
61
62 struct drm_exynos_gem_info {
63 __u32 handle;
64 __u32 flags;
65 __u64 size;
66 };
67
68
69
70
71
72
73
74
75
76 struct drm_exynos_vidi_connection {
77 __u32 connection;
78 __u32 extensions;
79 __u64 edid;
80 };
81
82
83 enum e_drm_exynos_gem_mem_type {
84
85 EXYNOS_BO_CONTIG = 0 << 0,
86
87 EXYNOS_BO_NONCONTIG = 1 << 0,
88
89 EXYNOS_BO_NONCACHABLE = 0 << 1,
90
91 EXYNOS_BO_CACHABLE = 1 << 1,
92
93 EXYNOS_BO_WC = 1 << 2,
94 EXYNOS_BO_MASK = EXYNOS_BO_NONCONTIG | EXYNOS_BO_CACHABLE |
95 EXYNOS_BO_WC
96 };
97
98 struct drm_exynos_g2d_get_ver {
99 __u32 major;
100 __u32 minor;
101 };
102
103 struct drm_exynos_g2d_cmd {
104 __u32 offset;
105 __u32 data;
106 };
107
108 enum drm_exynos_g2d_buf_type {
109 G2D_BUF_USERPTR = 1 << 31,
110 };
111
112 enum drm_exynos_g2d_event_type {
113 G2D_EVENT_NOT,
114 G2D_EVENT_NONSTOP,
115 G2D_EVENT_STOP,
116 };
117
118 struct drm_exynos_g2d_userptr {
119 unsigned long userptr;
120 unsigned long size;
121 };
122
123 struct drm_exynos_g2d_set_cmdlist {
124 __u64 cmd;
125 __u64 cmd_buf;
126 __u32 cmd_nr;
127 __u32 cmd_buf_nr;
128
129
130 __u64 event_type;
131 __u64 user_data;
132 };
133
134 struct drm_exynos_g2d_exec {
135 __u64 async;
136 };
137
138
139
140
141
142
143
144
145
146
147 struct drm_exynos_ioctl_ipp_get_res {
148 __u32 count_ipps;
149 __u32 reserved;
150 __u64 ipp_id_ptr;
151 };
152
153 enum drm_exynos_ipp_format_type {
154 DRM_EXYNOS_IPP_FORMAT_SOURCE = 0x01,
155 DRM_EXYNOS_IPP_FORMAT_DESTINATION = 0x02,
156 };
157
158 struct drm_exynos_ipp_format {
159 __u32 fourcc;
160 __u32 type;
161 __u64 modifier;
162 };
163
164 enum drm_exynos_ipp_capability {
165 DRM_EXYNOS_IPP_CAP_CROP = 0x01,
166 DRM_EXYNOS_IPP_CAP_ROTATE = 0x02,
167 DRM_EXYNOS_IPP_CAP_SCALE = 0x04,
168 DRM_EXYNOS_IPP_CAP_CONVERT = 0x08,
169 };
170
171
172
173
174
175
176
177
178
179
180
181 struct drm_exynos_ioctl_ipp_get_caps {
182 __u32 ipp_id;
183 __u32 capabilities;
184 __u32 reserved;
185 __u32 formats_count;
186 __u64 formats_ptr;
187 };
188
189 enum drm_exynos_ipp_limit_type {
190
191 DRM_EXYNOS_IPP_LIMIT_TYPE_SIZE = 0x0001,
192
193 DRM_EXYNOS_IPP_LIMIT_TYPE_SCALE = 0x0002,
194
195
196 DRM_EXYNOS_IPP_LIMIT_SIZE_BUFFER = 0x0001 << 16,
197
198 DRM_EXYNOS_IPP_LIMIT_SIZE_AREA = 0x0002 << 16,
199
200 DRM_EXYNOS_IPP_LIMIT_SIZE_ROTATED = 0x0003 << 16,
201
202 DRM_EXYNOS_IPP_LIMIT_TYPE_MASK = 0x000f,
203 DRM_EXYNOS_IPP_LIMIT_SIZE_MASK = 0x000f << 16,
204 };
205
206 struct drm_exynos_ipp_limit_val {
207 __u32 min;
208 __u32 max;
209 __u32 align;
210 __u32 reserved;
211 };
212
213
214
215
216
217
218
219
220
221 struct drm_exynos_ipp_limit {
222 __u32 type;
223 __u32 reserved;
224 struct drm_exynos_ipp_limit_val h;
225 struct drm_exynos_ipp_limit_val v;
226 };
227
228
229
230
231
232
233
234
235
236
237
238
239 struct drm_exynos_ioctl_ipp_get_limits {
240 __u32 ipp_id;
241 __u32 fourcc;
242 __u64 modifier;
243 __u32 type;
244 __u32 limits_count;
245 __u64 limits_ptr;
246 };
247
248 enum drm_exynos_ipp_task_id {
249
250 DRM_EXYNOS_IPP_TASK_BUFFER = 0x0001,
251
252 DRM_EXYNOS_IPP_TASK_RECTANGLE = 0x0002,
253
254 DRM_EXYNOS_IPP_TASK_TRANSFORM = 0x0003,
255
256 DRM_EXYNOS_IPP_TASK_ALPHA = 0x0004,
257
258
259 DRM_EXYNOS_IPP_TASK_TYPE_SOURCE = 0x0001 << 16,
260
261 DRM_EXYNOS_IPP_TASK_TYPE_DESTINATION = 0x0002 << 16,
262 };
263
264
265
266
267
268
269
270 struct drm_exynos_ipp_task_buffer {
271 __u32 id;
272 __u32 fourcc;
273 __u32 width, height;
274 __u32 gem_id[4];
275 __u32 offset[4];
276 __u32 pitch[4];
277 __u64 modifier;
278 };
279
280
281
282
283
284
285
286
287
288 struct drm_exynos_ipp_task_rect {
289 __u32 id;
290 __u32 reserved;
291 __u32 x;
292 __u32 y;
293 __u32 w;
294 __u32 h;
295 };
296
297
298
299
300
301
302
303 struct drm_exynos_ipp_task_transform {
304 __u32 id;
305 __u32 rotation;
306 };
307
308
309
310
311
312
313
314 struct drm_exynos_ipp_task_alpha {
315 __u32 id;
316 __u32 value;
317 };
318
319 enum drm_exynos_ipp_flag {
320
321 DRM_EXYNOS_IPP_FLAG_EVENT = 0x01,
322
323 DRM_EXYNOS_IPP_FLAG_TEST_ONLY = 0x02,
324
325 DRM_EXYNOS_IPP_FLAG_NONBLOCK = 0x04,
326 };
327
328 #define DRM_EXYNOS_IPP_FLAGS (DRM_EXYNOS_IPP_FLAG_EVENT |\
329 DRM_EXYNOS_IPP_FLAG_TEST_ONLY | DRM_EXYNOS_IPP_FLAG_NONBLOCK)
330
331
332
333
334
335
336
337
338
339
340
341
342 struct drm_exynos_ioctl_ipp_commit {
343 __u32 ipp_id;
344 __u32 flags;
345 __u32 reserved;
346 __u32 params_size;
347 __u64 params_ptr;
348 __u64 user_data;
349 };
350
351 #define DRM_EXYNOS_GEM_CREATE 0x00
352 #define DRM_EXYNOS_GEM_MAP 0x01
353
354 #define DRM_EXYNOS_GEM_GET 0x04
355 #define DRM_EXYNOS_VIDI_CONNECTION 0x07
356
357
358 #define DRM_EXYNOS_G2D_GET_VER 0x20
359 #define DRM_EXYNOS_G2D_SET_CMDLIST 0x21
360 #define DRM_EXYNOS_G2D_EXEC 0x22
361
362
363
364 #define DRM_EXYNOS_IPP_GET_RESOURCES 0x40
365 #define DRM_EXYNOS_IPP_GET_CAPS 0x41
366 #define DRM_EXYNOS_IPP_GET_LIMITS 0x42
367 #define DRM_EXYNOS_IPP_COMMIT 0x43
368
369 #define DRM_IOCTL_EXYNOS_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + \
370 DRM_EXYNOS_GEM_CREATE, struct drm_exynos_gem_create)
371 #define DRM_IOCTL_EXYNOS_GEM_MAP DRM_IOWR(DRM_COMMAND_BASE + \
372 DRM_EXYNOS_GEM_MAP, struct drm_exynos_gem_map)
373 #define DRM_IOCTL_EXYNOS_GEM_GET DRM_IOWR(DRM_COMMAND_BASE + \
374 DRM_EXYNOS_GEM_GET, struct drm_exynos_gem_info)
375
376 #define DRM_IOCTL_EXYNOS_VIDI_CONNECTION DRM_IOWR(DRM_COMMAND_BASE + \
377 DRM_EXYNOS_VIDI_CONNECTION, struct drm_exynos_vidi_connection)
378
379 #define DRM_IOCTL_EXYNOS_G2D_GET_VER DRM_IOWR(DRM_COMMAND_BASE + \
380 DRM_EXYNOS_G2D_GET_VER, struct drm_exynos_g2d_get_ver)
381 #define DRM_IOCTL_EXYNOS_G2D_SET_CMDLIST DRM_IOWR(DRM_COMMAND_BASE + \
382 DRM_EXYNOS_G2D_SET_CMDLIST, struct drm_exynos_g2d_set_cmdlist)
383 #define DRM_IOCTL_EXYNOS_G2D_EXEC DRM_IOWR(DRM_COMMAND_BASE + \
384 DRM_EXYNOS_G2D_EXEC, struct drm_exynos_g2d_exec)
385
386 #define DRM_IOCTL_EXYNOS_IPP_GET_RESOURCES DRM_IOWR(DRM_COMMAND_BASE + \
387 DRM_EXYNOS_IPP_GET_RESOURCES, \
388 struct drm_exynos_ioctl_ipp_get_res)
389 #define DRM_IOCTL_EXYNOS_IPP_GET_CAPS DRM_IOWR(DRM_COMMAND_BASE + \
390 DRM_EXYNOS_IPP_GET_CAPS, struct drm_exynos_ioctl_ipp_get_caps)
391 #define DRM_IOCTL_EXYNOS_IPP_GET_LIMITS DRM_IOWR(DRM_COMMAND_BASE + \
392 DRM_EXYNOS_IPP_GET_LIMITS, \
393 struct drm_exynos_ioctl_ipp_get_limits)
394 #define DRM_IOCTL_EXYNOS_IPP_COMMIT DRM_IOWR(DRM_COMMAND_BASE + \
395 DRM_EXYNOS_IPP_COMMIT, struct drm_exynos_ioctl_ipp_commit)
396
397
398 #define DRM_EXYNOS_G2D_EVENT 0x80000000
399 #define DRM_EXYNOS_IPP_EVENT 0x80000002
400
401 struct drm_exynos_g2d_event {
402 struct drm_event base;
403 __u64 user_data;
404 __u32 tv_sec;
405 __u32 tv_usec;
406 __u32 cmdlist_no;
407 __u32 reserved;
408 };
409
410 struct drm_exynos_ipp_event {
411 struct drm_event base;
412 __u64 user_data;
413 __u32 tv_sec;
414 __u32 tv_usec;
415 __u32 ipp_id;
416 __u32 sequence;
417 __u64 reserved;
418 };
419
420 #if defined(__cplusplus)
421 }
422 #endif
423
424 #endif