1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36#ifndef _DRM_H_
37#define _DRM_H_
38
39#if defined(__KERNEL__)
40
41#include <linux/types.h>
42#include <asm/ioctl.h>
43typedef unsigned int drm_handle_t;
44
45#elif defined(__linux__)
46
47#include <linux/types.h>
48#include <asm/ioctl.h>
49typedef unsigned int drm_handle_t;
50
51#else
52
53#include <sys/ioccom.h>
54#include <sys/types.h>
55typedef int8_t __s8;
56typedef uint8_t __u8;
57typedef int16_t __s16;
58typedef uint16_t __u16;
59typedef int32_t __s32;
60typedef uint32_t __u32;
61typedef int64_t __s64;
62typedef uint64_t __u64;
63typedef size_t __kernel_size_t;
64typedef unsigned long drm_handle_t;
65
66#endif
67
68#if defined(__cplusplus)
69extern "C" {
70#endif
71
72#define DRM_NAME "drm"
73#define DRM_MIN_ORDER 5
74#define DRM_MAX_ORDER 22
75#define DRM_RAM_PERCENT 10
76
77#define _DRM_LOCK_HELD 0x80000000U
78#define _DRM_LOCK_CONT 0x40000000U
79#define _DRM_LOCK_IS_HELD(lock) ((lock) & _DRM_LOCK_HELD)
80#define _DRM_LOCK_IS_CONT(lock) ((lock) & _DRM_LOCK_CONT)
81#define _DRM_LOCKING_CONTEXT(lock) ((lock) & ~(_DRM_LOCK_HELD|_DRM_LOCK_CONT))
82
83typedef unsigned int drm_context_t;
84typedef unsigned int drm_drawable_t;
85typedef unsigned int drm_magic_t;
86
87
88
89
90
91
92
93
94
95
96struct drm_clip_rect {
97 unsigned short x1;
98 unsigned short y1;
99 unsigned short x2;
100 unsigned short y2;
101};
102
103
104
105
106struct drm_drawable_info {
107 unsigned int num_rects;
108 struct drm_clip_rect *rects;
109};
110
111
112
113
114struct drm_tex_region {
115 unsigned char next;
116 unsigned char prev;
117 unsigned char in_use;
118 unsigned char padding;
119 unsigned int age;
120};
121
122
123
124
125
126
127
128
129struct drm_hw_lock {
130 __volatile__ unsigned int lock;
131 char padding[60];
132};
133
134
135
136
137
138
139struct drm_version {
140 int version_major;
141 int version_minor;
142 int version_patchlevel;
143 __kernel_size_t name_len;
144 char __user *name;
145 __kernel_size_t date_len;
146 char __user *date;
147 __kernel_size_t desc_len;
148 char __user *desc;
149};
150
151
152
153
154
155
156struct drm_unique {
157 __kernel_size_t unique_len;
158 char __user *unique;
159};
160
161struct drm_list {
162 int count;
163 struct drm_version __user *version;
164};
165
166struct drm_block {
167 int unused;
168};
169
170
171
172
173
174
175struct drm_control {
176 enum {
177 DRM_ADD_COMMAND,
178 DRM_RM_COMMAND,
179 DRM_INST_HANDLER,
180 DRM_UNINST_HANDLER
181 } func;
182 int irq;
183};
184
185
186
187
188enum drm_map_type {
189 _DRM_FRAME_BUFFER = 0,
190 _DRM_REGISTERS = 1,
191 _DRM_SHM = 2,
192 _DRM_AGP = 3,
193 _DRM_SCATTER_GATHER = 4,
194 _DRM_CONSISTENT = 5
195};
196
197
198
199
200enum drm_map_flags {
201 _DRM_RESTRICTED = 0x01,
202 _DRM_READ_ONLY = 0x02,
203 _DRM_LOCKED = 0x04,
204 _DRM_KERNEL = 0x08,
205 _DRM_WRITE_COMBINING = 0x10,
206 _DRM_CONTAINS_LOCK = 0x20,
207 _DRM_REMOVABLE = 0x40,
208 _DRM_DRIVER = 0x80
209};
210
211struct drm_ctx_priv_map {
212 unsigned int ctx_id;
213 void *handle;
214};
215
216
217
218
219
220
221
222struct drm_map {
223 unsigned long offset;
224 unsigned long size;
225 enum drm_map_type type;
226 enum drm_map_flags flags;
227 void *handle;
228
229 int mtrr;
230
231};
232
233
234
235
236struct drm_client {
237 int idx;
238 int auth;
239 unsigned long pid;
240 unsigned long uid;
241 unsigned long magic;
242 unsigned long iocs;
243};
244
245enum drm_stat_type {
246 _DRM_STAT_LOCK,
247 _DRM_STAT_OPENS,
248 _DRM_STAT_CLOSES,
249 _DRM_STAT_IOCTLS,
250 _DRM_STAT_LOCKS,
251 _DRM_STAT_UNLOCKS,
252 _DRM_STAT_VALUE,
253 _DRM_STAT_BYTE,
254 _DRM_STAT_COUNT,
255
256 _DRM_STAT_IRQ,
257 _DRM_STAT_PRIMARY,
258 _DRM_STAT_SECONDARY,
259 _DRM_STAT_DMA,
260 _DRM_STAT_SPECIAL,
261 _DRM_STAT_MISSED
262
263};
264
265
266
267
268struct drm_stats {
269 unsigned long count;
270 struct {
271 unsigned long value;
272 enum drm_stat_type type;
273 } data[15];
274};
275
276
277
278
279enum drm_lock_flags {
280 _DRM_LOCK_READY = 0x01,
281 _DRM_LOCK_QUIESCENT = 0x02,
282 _DRM_LOCK_FLUSH = 0x04,
283 _DRM_LOCK_FLUSH_ALL = 0x08,
284
285
286
287 _DRM_HALT_ALL_QUEUES = 0x10,
288 _DRM_HALT_CUR_QUEUES = 0x20
289};
290
291
292
293
294
295
296struct drm_lock {
297 int context;
298 enum drm_lock_flags flags;
299};
300
301
302
303
304
305
306
307
308
309enum drm_dma_flags {
310
311 _DRM_DMA_BLOCK = 0x01,
312
313
314
315
316
317
318
319
320
321 _DRM_DMA_WHILE_LOCKED = 0x02,
322 _DRM_DMA_PRIORITY = 0x04,
323
324
325 _DRM_DMA_WAIT = 0x10,
326 _DRM_DMA_SMALLER_OK = 0x20,
327 _DRM_DMA_LARGER_OK = 0x40
328};
329
330
331
332
333
334
335struct drm_buf_desc {
336 int count;
337 int size;
338 int low_mark;
339 int high_mark;
340 enum {
341 _DRM_PAGE_ALIGN = 0x01,
342 _DRM_AGP_BUFFER = 0x02,
343 _DRM_SG_BUFFER = 0x04,
344 _DRM_FB_BUFFER = 0x08,
345 _DRM_PCI_BUFFER_RO = 0x10
346 } flags;
347 unsigned long agp_start;
348
349
350
351};
352
353
354
355
356struct drm_buf_info {
357 int count;
358 struct drm_buf_desc __user *list;
359};
360
361
362
363
364struct drm_buf_free {
365 int count;
366 int __user *list;
367};
368
369
370
371
372
373
374struct drm_buf_pub {
375 int idx;
376 int total;
377 int used;
378 void __user *address;
379};
380
381
382
383
384struct drm_buf_map {
385 int count;
386#ifdef __cplusplus
387 void __user *virt;
388#else
389 void __user *virtual;
390#endif
391 struct drm_buf_pub __user *list;
392};
393
394
395
396
397
398
399
400
401struct drm_dma {
402 int context;
403 int send_count;
404 int __user *send_indices;
405 int __user *send_sizes;
406 enum drm_dma_flags flags;
407 int request_count;
408 int request_size;
409 int __user *request_indices;
410 int __user *request_sizes;
411 int granted_count;
412};
413
414enum drm_ctx_flags {
415 _DRM_CONTEXT_PRESERVED = 0x01,
416 _DRM_CONTEXT_2DONLY = 0x02
417};
418
419
420
421
422
423
424struct drm_ctx {
425 drm_context_t handle;
426 enum drm_ctx_flags flags;
427};
428
429
430
431
432struct drm_ctx_res {
433 int count;
434 struct drm_ctx __user *contexts;
435};
436
437
438
439
440struct drm_draw {
441 drm_drawable_t handle;
442};
443
444
445
446
447typedef enum {
448 DRM_DRAWABLE_CLIPRECTS
449} drm_drawable_info_type_t;
450
451struct drm_update_draw {
452 drm_drawable_t handle;
453 unsigned int type;
454 unsigned int num;
455 unsigned long long data;
456};
457
458
459
460
461struct drm_auth {
462 drm_magic_t magic;
463};
464
465
466
467
468
469
470struct drm_irq_busid {
471 int irq;
472 int busnum;
473 int devnum;
474 int funcnum;
475};
476
477enum drm_vblank_seq_type {
478 _DRM_VBLANK_ABSOLUTE = 0x0,
479 _DRM_VBLANK_RELATIVE = 0x1,
480
481 _DRM_VBLANK_HIGH_CRTC_MASK = 0x0000003e,
482 _DRM_VBLANK_EVENT = 0x4000000,
483 _DRM_VBLANK_FLIP = 0x8000000,
484 _DRM_VBLANK_NEXTONMISS = 0x10000000,
485 _DRM_VBLANK_SECONDARY = 0x20000000,
486 _DRM_VBLANK_SIGNAL = 0x40000000
487};
488#define _DRM_VBLANK_HIGH_CRTC_SHIFT 1
489
490#define _DRM_VBLANK_TYPES_MASK (_DRM_VBLANK_ABSOLUTE | _DRM_VBLANK_RELATIVE)
491#define _DRM_VBLANK_FLAGS_MASK (_DRM_VBLANK_EVENT | _DRM_VBLANK_SIGNAL | \
492 _DRM_VBLANK_SECONDARY | _DRM_VBLANK_NEXTONMISS)
493
494struct drm_wait_vblank_request {
495 enum drm_vblank_seq_type type;
496 unsigned int sequence;
497 unsigned long signal;
498};
499
500struct drm_wait_vblank_reply {
501 enum drm_vblank_seq_type type;
502 unsigned int sequence;
503 long tval_sec;
504 long tval_usec;
505};
506
507
508
509
510
511
512union drm_wait_vblank {
513 struct drm_wait_vblank_request request;
514 struct drm_wait_vblank_reply reply;
515};
516
517#define _DRM_PRE_MODESET 1
518#define _DRM_POST_MODESET 2
519
520
521
522
523
524
525struct drm_modeset_ctl {
526 __u32 crtc;
527 __u32 cmd;
528};
529
530
531
532
533
534
535struct drm_agp_mode {
536 unsigned long mode;
537};
538
539
540
541
542
543
544struct drm_agp_buffer {
545 unsigned long size;
546 unsigned long handle;
547 unsigned long type;
548 unsigned long physical;
549};
550
551
552
553
554
555
556struct drm_agp_binding {
557 unsigned long handle;
558 unsigned long offset;
559};
560
561
562
563
564
565
566
567
568struct drm_agp_info {
569 int agp_version_major;
570 int agp_version_minor;
571 unsigned long mode;
572 unsigned long aperture_base;
573 unsigned long aperture_size;
574 unsigned long memory_allowed;
575 unsigned long memory_used;
576
577
578 unsigned short id_vendor;
579 unsigned short id_device;
580};
581
582
583
584
585struct drm_scatter_gather {
586 unsigned long size;
587 unsigned long handle;
588};
589
590
591
592
593struct drm_set_version {
594 int drm_di_major;
595 int drm_di_minor;
596 int drm_dd_major;
597 int drm_dd_minor;
598};
599
600
601struct drm_gem_close {
602
603 __u32 handle;
604 __u32 pad;
605};
606
607
608struct drm_gem_flink {
609
610 __u32 handle;
611
612
613 __u32 name;
614};
615
616
617struct drm_gem_open {
618
619 __u32 name;
620
621
622 __u32 handle;
623
624
625 __u64 size;
626};
627
628#define DRM_CAP_DUMB_BUFFER 0x1
629#define DRM_CAP_VBLANK_HIGH_CRTC 0x2
630#define DRM_CAP_DUMB_PREFERRED_DEPTH 0x3
631#define DRM_CAP_DUMB_PREFER_SHADOW 0x4
632#define DRM_CAP_PRIME 0x5
633#define DRM_PRIME_CAP_IMPORT 0x1
634#define DRM_PRIME_CAP_EXPORT 0x2
635#define DRM_CAP_TIMESTAMP_MONOTONIC 0x6
636#define DRM_CAP_ASYNC_PAGE_FLIP 0x7
637
638
639
640
641
642
643
644
645
646#define DRM_CAP_CURSOR_WIDTH 0x8
647#define DRM_CAP_CURSOR_HEIGHT 0x9
648#define DRM_CAP_ADDFB2_MODIFIERS 0x10
649#define DRM_CAP_PAGE_FLIP_TARGET 0x11
650#define DRM_CAP_CRTC_IN_VBLANK_EVENT 0x12
651#define DRM_CAP_SYNCOBJ 0x13
652
653
654struct drm_get_cap {
655 __u64 capability;
656 __u64 value;
657};
658
659
660
661
662
663
664
665
666#define DRM_CLIENT_CAP_STEREO_3D 1
667
668
669
670
671
672
673
674#define DRM_CLIENT_CAP_UNIVERSAL_PLANES 2
675
676
677
678
679
680
681#define DRM_CLIENT_CAP_ATOMIC 3
682
683
684struct drm_set_client_cap {
685 __u64 capability;
686 __u64 value;
687};
688
689#define DRM_RDWR O_RDWR
690#define DRM_CLOEXEC O_CLOEXEC
691struct drm_prime_handle {
692 __u32 handle;
693
694
695 __u32 flags;
696
697
698 __s32 fd;
699};
700
701struct drm_syncobj_create {
702 __u32 handle;
703#define DRM_SYNCOBJ_CREATE_SIGNALED (1 << 0)
704 __u32 flags;
705};
706
707struct drm_syncobj_destroy {
708 __u32 handle;
709 __u32 pad;
710};
711
712#define DRM_SYNCOBJ_FD_TO_HANDLE_FLAGS_IMPORT_SYNC_FILE (1 << 0)
713#define DRM_SYNCOBJ_HANDLE_TO_FD_FLAGS_EXPORT_SYNC_FILE (1 << 0)
714struct drm_syncobj_handle {
715 __u32 handle;
716 __u32 flags;
717
718 __s32 fd;
719 __u32 pad;
720};
721
722#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_ALL (1 << 0)
723#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT (1 << 1)
724struct drm_syncobj_wait {
725 __u64 handles;
726
727 __s64 timeout_nsec;
728 __u32 count_handles;
729 __u32 flags;
730 __u32 first_signaled;
731 __u32 pad;
732};
733
734struct drm_syncobj_array {
735 __u64 handles;
736 __u32 count_handles;
737 __u32 pad;
738};
739
740
741struct drm_crtc_get_sequence {
742 __u32 crtc_id;
743 __u32 active;
744 __u64 sequence;
745 __s64 sequence_ns;
746};
747
748
749
750
751
752#define DRM_CRTC_SEQUENCE_RELATIVE 0x00000001
753#define DRM_CRTC_SEQUENCE_NEXT_ON_MISS 0x00000002
754
755struct drm_crtc_queue_sequence {
756 __u32 crtc_id;
757 __u32 flags;
758 __u64 sequence;
759 __u64 user_data;
760};
761
762#if defined(__cplusplus)
763}
764#endif
765
766#include "drm_mode.h"
767
768#if defined(__cplusplus)
769extern "C" {
770#endif
771
772#define DRM_IOCTL_BASE 'd'
773#define DRM_IO(nr) _IO(DRM_IOCTL_BASE,nr)
774#define DRM_IOR(nr,type) _IOR(DRM_IOCTL_BASE,nr,type)
775#define DRM_IOW(nr,type) _IOW(DRM_IOCTL_BASE,nr,type)
776#define DRM_IOWR(nr,type) _IOWR(DRM_IOCTL_BASE,nr,type)
777
778#define DRM_IOCTL_VERSION DRM_IOWR(0x00, struct drm_version)
779#define DRM_IOCTL_GET_UNIQUE DRM_IOWR(0x01, struct drm_unique)
780#define DRM_IOCTL_GET_MAGIC DRM_IOR( 0x02, struct drm_auth)
781#define DRM_IOCTL_IRQ_BUSID DRM_IOWR(0x03, struct drm_irq_busid)
782#define DRM_IOCTL_GET_MAP DRM_IOWR(0x04, struct drm_map)
783#define DRM_IOCTL_GET_CLIENT DRM_IOWR(0x05, struct drm_client)
784#define DRM_IOCTL_GET_STATS DRM_IOR( 0x06, struct drm_stats)
785#define DRM_IOCTL_SET_VERSION DRM_IOWR(0x07, struct drm_set_version)
786#define DRM_IOCTL_MODESET_CTL DRM_IOW(0x08, struct drm_modeset_ctl)
787#define DRM_IOCTL_GEM_CLOSE DRM_IOW (0x09, struct drm_gem_close)
788#define DRM_IOCTL_GEM_FLINK DRM_IOWR(0x0a, struct drm_gem_flink)
789#define DRM_IOCTL_GEM_OPEN DRM_IOWR(0x0b, struct drm_gem_open)
790#define DRM_IOCTL_GET_CAP DRM_IOWR(0x0c, struct drm_get_cap)
791#define DRM_IOCTL_SET_CLIENT_CAP DRM_IOW( 0x0d, struct drm_set_client_cap)
792
793#define DRM_IOCTL_SET_UNIQUE DRM_IOW( 0x10, struct drm_unique)
794#define DRM_IOCTL_AUTH_MAGIC DRM_IOW( 0x11, struct drm_auth)
795#define DRM_IOCTL_BLOCK DRM_IOWR(0x12, struct drm_block)
796#define DRM_IOCTL_UNBLOCK DRM_IOWR(0x13, struct drm_block)
797#define DRM_IOCTL_CONTROL DRM_IOW( 0x14, struct drm_control)
798#define DRM_IOCTL_ADD_MAP DRM_IOWR(0x15, struct drm_map)
799#define DRM_IOCTL_ADD_BUFS DRM_IOWR(0x16, struct drm_buf_desc)
800#define DRM_IOCTL_MARK_BUFS DRM_IOW( 0x17, struct drm_buf_desc)
801#define DRM_IOCTL_INFO_BUFS DRM_IOWR(0x18, struct drm_buf_info)
802#define DRM_IOCTL_MAP_BUFS DRM_IOWR(0x19, struct drm_buf_map)
803#define DRM_IOCTL_FREE_BUFS DRM_IOW( 0x1a, struct drm_buf_free)
804
805#define DRM_IOCTL_RM_MAP DRM_IOW( 0x1b, struct drm_map)
806
807#define DRM_IOCTL_SET_SAREA_CTX DRM_IOW( 0x1c, struct drm_ctx_priv_map)
808#define DRM_IOCTL_GET_SAREA_CTX DRM_IOWR(0x1d, struct drm_ctx_priv_map)
809
810#define DRM_IOCTL_SET_MASTER DRM_IO(0x1e)
811#define DRM_IOCTL_DROP_MASTER DRM_IO(0x1f)
812
813#define DRM_IOCTL_ADD_CTX DRM_IOWR(0x20, struct drm_ctx)
814#define DRM_IOCTL_RM_CTX DRM_IOWR(0x21, struct drm_ctx)
815#define DRM_IOCTL_MOD_CTX DRM_IOW( 0x22, struct drm_ctx)
816#define DRM_IOCTL_GET_CTX DRM_IOWR(0x23, struct drm_ctx)
817#define DRM_IOCTL_SWITCH_CTX DRM_IOW( 0x24, struct drm_ctx)
818#define DRM_IOCTL_NEW_CTX DRM_IOW( 0x25, struct drm_ctx)
819#define DRM_IOCTL_RES_CTX DRM_IOWR(0x26, struct drm_ctx_res)
820#define DRM_IOCTL_ADD_DRAW DRM_IOWR(0x27, struct drm_draw)
821#define DRM_IOCTL_RM_DRAW DRM_IOWR(0x28, struct drm_draw)
822#define DRM_IOCTL_DMA DRM_IOWR(0x29, struct drm_dma)
823#define DRM_IOCTL_LOCK DRM_IOW( 0x2a, struct drm_lock)
824#define DRM_IOCTL_UNLOCK DRM_IOW( 0x2b, struct drm_lock)
825#define DRM_IOCTL_FINISH DRM_IOW( 0x2c, struct drm_lock)
826
827#define DRM_IOCTL_PRIME_HANDLE_TO_FD DRM_IOWR(0x2d, struct drm_prime_handle)
828#define DRM_IOCTL_PRIME_FD_TO_HANDLE DRM_IOWR(0x2e, struct drm_prime_handle)
829
830#define DRM_IOCTL_AGP_ACQUIRE DRM_IO( 0x30)
831#define DRM_IOCTL_AGP_RELEASE DRM_IO( 0x31)
832#define DRM_IOCTL_AGP_ENABLE DRM_IOW( 0x32, struct drm_agp_mode)
833#define DRM_IOCTL_AGP_INFO DRM_IOR( 0x33, struct drm_agp_info)
834#define DRM_IOCTL_AGP_ALLOC DRM_IOWR(0x34, struct drm_agp_buffer)
835#define DRM_IOCTL_AGP_FREE DRM_IOW( 0x35, struct drm_agp_buffer)
836#define DRM_IOCTL_AGP_BIND DRM_IOW( 0x36, struct drm_agp_binding)
837#define DRM_IOCTL_AGP_UNBIND DRM_IOW( 0x37, struct drm_agp_binding)
838
839#define DRM_IOCTL_SG_ALLOC DRM_IOWR(0x38, struct drm_scatter_gather)
840#define DRM_IOCTL_SG_FREE DRM_IOW( 0x39, struct drm_scatter_gather)
841
842#define DRM_IOCTL_WAIT_VBLANK DRM_IOWR(0x3a, union drm_wait_vblank)
843
844#define DRM_IOCTL_CRTC_GET_SEQUENCE DRM_IOWR(0x3b, struct drm_crtc_get_sequence)
845#define DRM_IOCTL_CRTC_QUEUE_SEQUENCE DRM_IOWR(0x3c, struct drm_crtc_queue_sequence)
846
847#define DRM_IOCTL_UPDATE_DRAW DRM_IOW(0x3f, struct drm_update_draw)
848
849#define DRM_IOCTL_MODE_GETRESOURCES DRM_IOWR(0xA0, struct drm_mode_card_res)
850#define DRM_IOCTL_MODE_GETCRTC DRM_IOWR(0xA1, struct drm_mode_crtc)
851#define DRM_IOCTL_MODE_SETCRTC DRM_IOWR(0xA2, struct drm_mode_crtc)
852#define DRM_IOCTL_MODE_CURSOR DRM_IOWR(0xA3, struct drm_mode_cursor)
853#define DRM_IOCTL_MODE_GETGAMMA DRM_IOWR(0xA4, struct drm_mode_crtc_lut)
854#define DRM_IOCTL_MODE_SETGAMMA DRM_IOWR(0xA5, struct drm_mode_crtc_lut)
855#define DRM_IOCTL_MODE_GETENCODER DRM_IOWR(0xA6, struct drm_mode_get_encoder)
856#define DRM_IOCTL_MODE_GETCONNECTOR DRM_IOWR(0xA7, struct drm_mode_get_connector)
857#define DRM_IOCTL_MODE_ATTACHMODE DRM_IOWR(0xA8, struct drm_mode_mode_cmd)
858#define DRM_IOCTL_MODE_DETACHMODE DRM_IOWR(0xA9, struct drm_mode_mode_cmd)
859
860#define DRM_IOCTL_MODE_GETPROPERTY DRM_IOWR(0xAA, struct drm_mode_get_property)
861#define DRM_IOCTL_MODE_SETPROPERTY DRM_IOWR(0xAB, struct drm_mode_connector_set_property)
862#define DRM_IOCTL_MODE_GETPROPBLOB DRM_IOWR(0xAC, struct drm_mode_get_blob)
863#define DRM_IOCTL_MODE_GETFB DRM_IOWR(0xAD, struct drm_mode_fb_cmd)
864#define DRM_IOCTL_MODE_ADDFB DRM_IOWR(0xAE, struct drm_mode_fb_cmd)
865#define DRM_IOCTL_MODE_RMFB DRM_IOWR(0xAF, unsigned int)
866#define DRM_IOCTL_MODE_PAGE_FLIP DRM_IOWR(0xB0, struct drm_mode_crtc_page_flip)
867#define DRM_IOCTL_MODE_DIRTYFB DRM_IOWR(0xB1, struct drm_mode_fb_dirty_cmd)
868
869#define DRM_IOCTL_MODE_CREATE_DUMB DRM_IOWR(0xB2, struct drm_mode_create_dumb)
870#define DRM_IOCTL_MODE_MAP_DUMB DRM_IOWR(0xB3, struct drm_mode_map_dumb)
871#define DRM_IOCTL_MODE_DESTROY_DUMB DRM_IOWR(0xB4, struct drm_mode_destroy_dumb)
872#define DRM_IOCTL_MODE_GETPLANERESOURCES DRM_IOWR(0xB5, struct drm_mode_get_plane_res)
873#define DRM_IOCTL_MODE_GETPLANE DRM_IOWR(0xB6, struct drm_mode_get_plane)
874#define DRM_IOCTL_MODE_SETPLANE DRM_IOWR(0xB7, struct drm_mode_set_plane)
875#define DRM_IOCTL_MODE_ADDFB2 DRM_IOWR(0xB8, struct drm_mode_fb_cmd2)
876#define DRM_IOCTL_MODE_OBJ_GETPROPERTIES DRM_IOWR(0xB9, struct drm_mode_obj_get_properties)
877#define DRM_IOCTL_MODE_OBJ_SETPROPERTY DRM_IOWR(0xBA, struct drm_mode_obj_set_property)
878#define DRM_IOCTL_MODE_CURSOR2 DRM_IOWR(0xBB, struct drm_mode_cursor2)
879#define DRM_IOCTL_MODE_ATOMIC DRM_IOWR(0xBC, struct drm_mode_atomic)
880#define DRM_IOCTL_MODE_CREATEPROPBLOB DRM_IOWR(0xBD, struct drm_mode_create_blob)
881#define DRM_IOCTL_MODE_DESTROYPROPBLOB DRM_IOWR(0xBE, struct drm_mode_destroy_blob)
882
883#define DRM_IOCTL_SYNCOBJ_CREATE DRM_IOWR(0xBF, struct drm_syncobj_create)
884#define DRM_IOCTL_SYNCOBJ_DESTROY DRM_IOWR(0xC0, struct drm_syncobj_destroy)
885#define DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD DRM_IOWR(0xC1, struct drm_syncobj_handle)
886#define DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE DRM_IOWR(0xC2, struct drm_syncobj_handle)
887#define DRM_IOCTL_SYNCOBJ_WAIT DRM_IOWR(0xC3, struct drm_syncobj_wait)
888#define DRM_IOCTL_SYNCOBJ_RESET DRM_IOWR(0xC4, struct drm_syncobj_array)
889#define DRM_IOCTL_SYNCOBJ_SIGNAL DRM_IOWR(0xC5, struct drm_syncobj_array)
890
891#define DRM_IOCTL_MODE_CREATE_LEASE DRM_IOWR(0xC6, struct drm_mode_create_lease)
892#define DRM_IOCTL_MODE_LIST_LESSEES DRM_IOWR(0xC7, struct drm_mode_list_lessees)
893#define DRM_IOCTL_MODE_GET_LEASE DRM_IOWR(0xC8, struct drm_mode_get_lease)
894#define DRM_IOCTL_MODE_REVOKE_LEASE DRM_IOWR(0xC9, struct drm_mode_revoke_lease)
895
896
897
898
899
900
901
902
903
904#define DRM_COMMAND_BASE 0x40
905#define DRM_COMMAND_END 0xA0
906
907
908
909
910
911
912
913
914
915
916
917
918
919struct drm_event {
920 __u32 type;
921 __u32 length;
922};
923
924#define DRM_EVENT_VBLANK 0x01
925#define DRM_EVENT_FLIP_COMPLETE 0x02
926#define DRM_EVENT_CRTC_SEQUENCE 0x03
927
928struct drm_event_vblank {
929 struct drm_event base;
930 __u64 user_data;
931 __u32 tv_sec;
932 __u32 tv_usec;
933 __u32 sequence;
934 __u32 crtc_id;
935};
936
937
938
939
940struct drm_event_crtc_sequence {
941 struct drm_event base;
942 __u64 user_data;
943 __s64 time_ns;
944 __u64 sequence;
945};
946
947
948#ifndef __KERNEL__
949typedef struct drm_clip_rect drm_clip_rect_t;
950typedef struct drm_drawable_info drm_drawable_info_t;
951typedef struct drm_tex_region drm_tex_region_t;
952typedef struct drm_hw_lock drm_hw_lock_t;
953typedef struct drm_version drm_version_t;
954typedef struct drm_unique drm_unique_t;
955typedef struct drm_list drm_list_t;
956typedef struct drm_block drm_block_t;
957typedef struct drm_control drm_control_t;
958typedef enum drm_map_type drm_map_type_t;
959typedef enum drm_map_flags drm_map_flags_t;
960typedef struct drm_ctx_priv_map drm_ctx_priv_map_t;
961typedef struct drm_map drm_map_t;
962typedef struct drm_client drm_client_t;
963typedef enum drm_stat_type drm_stat_type_t;
964typedef struct drm_stats drm_stats_t;
965typedef enum drm_lock_flags drm_lock_flags_t;
966typedef struct drm_lock drm_lock_t;
967typedef enum drm_dma_flags drm_dma_flags_t;
968typedef struct drm_buf_desc drm_buf_desc_t;
969typedef struct drm_buf_info drm_buf_info_t;
970typedef struct drm_buf_free drm_buf_free_t;
971typedef struct drm_buf_pub drm_buf_pub_t;
972typedef struct drm_buf_map drm_buf_map_t;
973typedef struct drm_dma drm_dma_t;
974typedef union drm_wait_vblank drm_wait_vblank_t;
975typedef struct drm_agp_mode drm_agp_mode_t;
976typedef enum drm_ctx_flags drm_ctx_flags_t;
977typedef struct drm_ctx drm_ctx_t;
978typedef struct drm_ctx_res drm_ctx_res_t;
979typedef struct drm_draw drm_draw_t;
980typedef struct drm_update_draw drm_update_draw_t;
981typedef struct drm_auth drm_auth_t;
982typedef struct drm_irq_busid drm_irq_busid_t;
983typedef enum drm_vblank_seq_type drm_vblank_seq_type_t;
984
985typedef struct drm_agp_buffer drm_agp_buffer_t;
986typedef struct drm_agp_binding drm_agp_binding_t;
987typedef struct drm_agp_info drm_agp_info_t;
988typedef struct drm_scatter_gather drm_scatter_gather_t;
989typedef struct drm_set_version drm_set_version_t;
990#endif
991
992#if defined(__cplusplus)
993}
994#endif
995
996#endif
997