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