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#ifndef _DRM_H_
36#define _DRM_H_
37
38#if defined(__KERNEL__)
39
40#include <linux/types.h>
41#include <asm/ioctl.h>
42typedef unsigned int drm_handle_t;
43
44#elif defined(__linux__)
45
46#include <linux/types.h>
47#include <asm/ioctl.h>
48typedef unsigned int drm_handle_t;
49
50#else
51
52#include <stdint.h>
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
629
630
631
632
633
634#define DRM_CAP_DUMB_BUFFER 0x1
635
636
637
638
639
640
641
642
643#define DRM_CAP_VBLANK_HIGH_CRTC 0x2
644
645
646
647
648
649
650
651
652
653
654
655
656
657#define DRM_CAP_DUMB_PREFERRED_DEPTH 0x3
658
659
660
661
662
663
664
665
666
667
668
669#define DRM_CAP_DUMB_PREFER_SHADOW 0x4
670
671
672
673
674
675
676
677
678
679#define DRM_CAP_PRIME 0x5
680
681
682
683
684
685
686#define DRM_PRIME_CAP_IMPORT 0x1
687
688
689
690
691
692
693#define DRM_PRIME_CAP_EXPORT 0x2
694
695
696
697
698
699
700
701
702
703
704
705#define DRM_CAP_TIMESTAMP_MONOTONIC 0x6
706
707
708
709
710
711#define DRM_CAP_ASYNC_PAGE_FLIP 0x7
712
713
714
715
716
717
718
719
720
721
722
723#define DRM_CAP_CURSOR_WIDTH 0x8
724
725
726
727
728
729#define DRM_CAP_CURSOR_HEIGHT 0x9
730
731
732
733
734
735
736#define DRM_CAP_ADDFB2_MODIFIERS 0x10
737
738
739
740
741
742
743
744
745#define DRM_CAP_PAGE_FLIP_TARGET 0x11
746
747
748
749
750
751
752
753
754
755#define DRM_CAP_CRTC_IN_VBLANK_EVENT 0x12
756
757
758
759
760
761
762#define DRM_CAP_SYNCOBJ 0x13
763
764
765
766
767
768
769#define DRM_CAP_SYNCOBJ_TIMELINE 0x14
770
771
772struct drm_get_cap {
773 __u64 capability;
774 __u64 value;
775};
776
777
778
779
780
781
782
783
784
785
786
787#define DRM_CLIENT_CAP_STEREO_3D 1
788
789
790
791
792
793
794
795
796
797
798#define DRM_CLIENT_CAP_UNIVERSAL_PLANES 2
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814#define DRM_CLIENT_CAP_ATOMIC 3
815
816
817
818
819
820
821
822
823
824
825#define DRM_CLIENT_CAP_ASPECT_RATIO 4
826
827
828
829
830
831
832
833
834
835
836
837#define DRM_CLIENT_CAP_WRITEBACK_CONNECTORS 5
838
839
840struct drm_set_client_cap {
841 __u64 capability;
842 __u64 value;
843};
844
845#define DRM_RDWR O_RDWR
846#define DRM_CLOEXEC O_CLOEXEC
847struct drm_prime_handle {
848 __u32 handle;
849
850
851 __u32 flags;
852
853
854 __s32 fd;
855};
856
857struct drm_syncobj_create {
858 __u32 handle;
859#define DRM_SYNCOBJ_CREATE_SIGNALED (1 << 0)
860 __u32 flags;
861};
862
863struct drm_syncobj_destroy {
864 __u32 handle;
865 __u32 pad;
866};
867
868#define DRM_SYNCOBJ_FD_TO_HANDLE_FLAGS_IMPORT_SYNC_FILE (1 << 0)
869#define DRM_SYNCOBJ_HANDLE_TO_FD_FLAGS_EXPORT_SYNC_FILE (1 << 0)
870struct drm_syncobj_handle {
871 __u32 handle;
872 __u32 flags;
873
874 __s32 fd;
875 __u32 pad;
876};
877
878struct drm_syncobj_transfer {
879 __u32 src_handle;
880 __u32 dst_handle;
881 __u64 src_point;
882 __u64 dst_point;
883 __u32 flags;
884 __u32 pad;
885};
886
887#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_ALL (1 << 0)
888#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT (1 << 1)
889#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE (1 << 2)
890struct drm_syncobj_wait {
891 __u64 handles;
892
893 __s64 timeout_nsec;
894 __u32 count_handles;
895 __u32 flags;
896 __u32 first_signaled;
897 __u32 pad;
898};
899
900struct drm_syncobj_timeline_wait {
901 __u64 handles;
902
903 __u64 points;
904
905 __s64 timeout_nsec;
906 __u32 count_handles;
907 __u32 flags;
908 __u32 first_signaled;
909 __u32 pad;
910};
911
912
913struct drm_syncobj_array {
914 __u64 handles;
915 __u32 count_handles;
916 __u32 pad;
917};
918
919#define DRM_SYNCOBJ_QUERY_FLAGS_LAST_SUBMITTED (1 << 0)
920struct drm_syncobj_timeline_array {
921 __u64 handles;
922 __u64 points;
923 __u32 count_handles;
924 __u32 flags;
925};
926
927
928
929struct drm_crtc_get_sequence {
930 __u32 crtc_id;
931 __u32 active;
932 __u64 sequence;
933 __s64 sequence_ns;
934};
935
936
937
938
939
940#define DRM_CRTC_SEQUENCE_RELATIVE 0x00000001
941#define DRM_CRTC_SEQUENCE_NEXT_ON_MISS 0x00000002
942
943struct drm_crtc_queue_sequence {
944 __u32 crtc_id;
945 __u32 flags;
946 __u64 sequence;
947 __u64 user_data;
948};
949
950#if defined(__cplusplus)
951}
952#endif
953
954#include "drm_mode.h"
955
956#if defined(__cplusplus)
957extern "C" {
958#endif
959
960#define DRM_IOCTL_BASE 'd'
961#define DRM_IO(nr) _IO(DRM_IOCTL_BASE,nr)
962#define DRM_IOR(nr,type) _IOR(DRM_IOCTL_BASE,nr,type)
963#define DRM_IOW(nr,type) _IOW(DRM_IOCTL_BASE,nr,type)
964#define DRM_IOWR(nr,type) _IOWR(DRM_IOCTL_BASE,nr,type)
965
966#define DRM_IOCTL_VERSION DRM_IOWR(0x00, struct drm_version)
967#define DRM_IOCTL_GET_UNIQUE DRM_IOWR(0x01, struct drm_unique)
968#define DRM_IOCTL_GET_MAGIC DRM_IOR( 0x02, struct drm_auth)
969#define DRM_IOCTL_IRQ_BUSID DRM_IOWR(0x03, struct drm_irq_busid)
970#define DRM_IOCTL_GET_MAP DRM_IOWR(0x04, struct drm_map)
971#define DRM_IOCTL_GET_CLIENT DRM_IOWR(0x05, struct drm_client)
972#define DRM_IOCTL_GET_STATS DRM_IOR( 0x06, struct drm_stats)
973#define DRM_IOCTL_SET_VERSION DRM_IOWR(0x07, struct drm_set_version)
974#define DRM_IOCTL_MODESET_CTL DRM_IOW(0x08, struct drm_modeset_ctl)
975#define DRM_IOCTL_GEM_CLOSE DRM_IOW (0x09, struct drm_gem_close)
976#define DRM_IOCTL_GEM_FLINK DRM_IOWR(0x0a, struct drm_gem_flink)
977#define DRM_IOCTL_GEM_OPEN DRM_IOWR(0x0b, struct drm_gem_open)
978#define DRM_IOCTL_GET_CAP DRM_IOWR(0x0c, struct drm_get_cap)
979#define DRM_IOCTL_SET_CLIENT_CAP DRM_IOW( 0x0d, struct drm_set_client_cap)
980
981#define DRM_IOCTL_SET_UNIQUE DRM_IOW( 0x10, struct drm_unique)
982#define DRM_IOCTL_AUTH_MAGIC DRM_IOW( 0x11, struct drm_auth)
983#define DRM_IOCTL_BLOCK DRM_IOWR(0x12, struct drm_block)
984#define DRM_IOCTL_UNBLOCK DRM_IOWR(0x13, struct drm_block)
985#define DRM_IOCTL_CONTROL DRM_IOW( 0x14, struct drm_control)
986#define DRM_IOCTL_ADD_MAP DRM_IOWR(0x15, struct drm_map)
987#define DRM_IOCTL_ADD_BUFS DRM_IOWR(0x16, struct drm_buf_desc)
988#define DRM_IOCTL_MARK_BUFS DRM_IOW( 0x17, struct drm_buf_desc)
989#define DRM_IOCTL_INFO_BUFS DRM_IOWR(0x18, struct drm_buf_info)
990#define DRM_IOCTL_MAP_BUFS DRM_IOWR(0x19, struct drm_buf_map)
991#define DRM_IOCTL_FREE_BUFS DRM_IOW( 0x1a, struct drm_buf_free)
992
993#define DRM_IOCTL_RM_MAP DRM_IOW( 0x1b, struct drm_map)
994
995#define DRM_IOCTL_SET_SAREA_CTX DRM_IOW( 0x1c, struct drm_ctx_priv_map)
996#define DRM_IOCTL_GET_SAREA_CTX DRM_IOWR(0x1d, struct drm_ctx_priv_map)
997
998#define DRM_IOCTL_SET_MASTER DRM_IO(0x1e)
999#define DRM_IOCTL_DROP_MASTER DRM_IO(0x1f)
1000
1001#define DRM_IOCTL_ADD_CTX DRM_IOWR(0x20, struct drm_ctx)
1002#define DRM_IOCTL_RM_CTX DRM_IOWR(0x21, struct drm_ctx)
1003#define DRM_IOCTL_MOD_CTX DRM_IOW( 0x22, struct drm_ctx)
1004#define DRM_IOCTL_GET_CTX DRM_IOWR(0x23, struct drm_ctx)
1005#define DRM_IOCTL_SWITCH_CTX DRM_IOW( 0x24, struct drm_ctx)
1006#define DRM_IOCTL_NEW_CTX DRM_IOW( 0x25, struct drm_ctx)
1007#define DRM_IOCTL_RES_CTX DRM_IOWR(0x26, struct drm_ctx_res)
1008#define DRM_IOCTL_ADD_DRAW DRM_IOWR(0x27, struct drm_draw)
1009#define DRM_IOCTL_RM_DRAW DRM_IOWR(0x28, struct drm_draw)
1010#define DRM_IOCTL_DMA DRM_IOWR(0x29, struct drm_dma)
1011#define DRM_IOCTL_LOCK DRM_IOW( 0x2a, struct drm_lock)
1012#define DRM_IOCTL_UNLOCK DRM_IOW( 0x2b, struct drm_lock)
1013#define DRM_IOCTL_FINISH DRM_IOW( 0x2c, struct drm_lock)
1014
1015#define DRM_IOCTL_PRIME_HANDLE_TO_FD DRM_IOWR(0x2d, struct drm_prime_handle)
1016#define DRM_IOCTL_PRIME_FD_TO_HANDLE DRM_IOWR(0x2e, struct drm_prime_handle)
1017
1018#define DRM_IOCTL_AGP_ACQUIRE DRM_IO( 0x30)
1019#define DRM_IOCTL_AGP_RELEASE DRM_IO( 0x31)
1020#define DRM_IOCTL_AGP_ENABLE DRM_IOW( 0x32, struct drm_agp_mode)
1021#define DRM_IOCTL_AGP_INFO DRM_IOR( 0x33, struct drm_agp_info)
1022#define DRM_IOCTL_AGP_ALLOC DRM_IOWR(0x34, struct drm_agp_buffer)
1023#define DRM_IOCTL_AGP_FREE DRM_IOW( 0x35, struct drm_agp_buffer)
1024#define DRM_IOCTL_AGP_BIND DRM_IOW( 0x36, struct drm_agp_binding)
1025#define DRM_IOCTL_AGP_UNBIND DRM_IOW( 0x37, struct drm_agp_binding)
1026
1027#define DRM_IOCTL_SG_ALLOC DRM_IOWR(0x38, struct drm_scatter_gather)
1028#define DRM_IOCTL_SG_FREE DRM_IOW( 0x39, struct drm_scatter_gather)
1029
1030#define DRM_IOCTL_WAIT_VBLANK DRM_IOWR(0x3a, union drm_wait_vblank)
1031
1032#define DRM_IOCTL_CRTC_GET_SEQUENCE DRM_IOWR(0x3b, struct drm_crtc_get_sequence)
1033#define DRM_IOCTL_CRTC_QUEUE_SEQUENCE DRM_IOWR(0x3c, struct drm_crtc_queue_sequence)
1034
1035#define DRM_IOCTL_UPDATE_DRAW DRM_IOW(0x3f, struct drm_update_draw)
1036
1037#define DRM_IOCTL_MODE_GETRESOURCES DRM_IOWR(0xA0, struct drm_mode_card_res)
1038#define DRM_IOCTL_MODE_GETCRTC DRM_IOWR(0xA1, struct drm_mode_crtc)
1039#define DRM_IOCTL_MODE_SETCRTC DRM_IOWR(0xA2, struct drm_mode_crtc)
1040#define DRM_IOCTL_MODE_CURSOR DRM_IOWR(0xA3, struct drm_mode_cursor)
1041#define DRM_IOCTL_MODE_GETGAMMA DRM_IOWR(0xA4, struct drm_mode_crtc_lut)
1042#define DRM_IOCTL_MODE_SETGAMMA DRM_IOWR(0xA5, struct drm_mode_crtc_lut)
1043#define DRM_IOCTL_MODE_GETENCODER DRM_IOWR(0xA6, struct drm_mode_get_encoder)
1044#define DRM_IOCTL_MODE_GETCONNECTOR DRM_IOWR(0xA7, struct drm_mode_get_connector)
1045#define DRM_IOCTL_MODE_ATTACHMODE DRM_IOWR(0xA8, struct drm_mode_mode_cmd)
1046#define DRM_IOCTL_MODE_DETACHMODE DRM_IOWR(0xA9, struct drm_mode_mode_cmd)
1047
1048#define DRM_IOCTL_MODE_GETPROPERTY DRM_IOWR(0xAA, struct drm_mode_get_property)
1049#define DRM_IOCTL_MODE_SETPROPERTY DRM_IOWR(0xAB, struct drm_mode_connector_set_property)
1050#define DRM_IOCTL_MODE_GETPROPBLOB DRM_IOWR(0xAC, struct drm_mode_get_blob)
1051#define DRM_IOCTL_MODE_GETFB DRM_IOWR(0xAD, struct drm_mode_fb_cmd)
1052#define DRM_IOCTL_MODE_ADDFB DRM_IOWR(0xAE, struct drm_mode_fb_cmd)
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063#define DRM_IOCTL_MODE_RMFB DRM_IOWR(0xAF, unsigned int)
1064#define DRM_IOCTL_MODE_PAGE_FLIP DRM_IOWR(0xB0, struct drm_mode_crtc_page_flip)
1065#define DRM_IOCTL_MODE_DIRTYFB DRM_IOWR(0xB1, struct drm_mode_fb_dirty_cmd)
1066
1067#define DRM_IOCTL_MODE_CREATE_DUMB DRM_IOWR(0xB2, struct drm_mode_create_dumb)
1068#define DRM_IOCTL_MODE_MAP_DUMB DRM_IOWR(0xB3, struct drm_mode_map_dumb)
1069#define DRM_IOCTL_MODE_DESTROY_DUMB DRM_IOWR(0xB4, struct drm_mode_destroy_dumb)
1070#define DRM_IOCTL_MODE_GETPLANERESOURCES DRM_IOWR(0xB5, struct drm_mode_get_plane_res)
1071#define DRM_IOCTL_MODE_GETPLANE DRM_IOWR(0xB6, struct drm_mode_get_plane)
1072#define DRM_IOCTL_MODE_SETPLANE DRM_IOWR(0xB7, struct drm_mode_set_plane)
1073#define DRM_IOCTL_MODE_ADDFB2 DRM_IOWR(0xB8, struct drm_mode_fb_cmd2)
1074#define DRM_IOCTL_MODE_OBJ_GETPROPERTIES DRM_IOWR(0xB9, struct drm_mode_obj_get_properties)
1075#define DRM_IOCTL_MODE_OBJ_SETPROPERTY DRM_IOWR(0xBA, struct drm_mode_obj_set_property)
1076#define DRM_IOCTL_MODE_CURSOR2 DRM_IOWR(0xBB, struct drm_mode_cursor2)
1077#define DRM_IOCTL_MODE_ATOMIC DRM_IOWR(0xBC, struct drm_mode_atomic)
1078#define DRM_IOCTL_MODE_CREATEPROPBLOB DRM_IOWR(0xBD, struct drm_mode_create_blob)
1079#define DRM_IOCTL_MODE_DESTROYPROPBLOB DRM_IOWR(0xBE, struct drm_mode_destroy_blob)
1080
1081#define DRM_IOCTL_SYNCOBJ_CREATE DRM_IOWR(0xBF, struct drm_syncobj_create)
1082#define DRM_IOCTL_SYNCOBJ_DESTROY DRM_IOWR(0xC0, struct drm_syncobj_destroy)
1083#define DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD DRM_IOWR(0xC1, struct drm_syncobj_handle)
1084#define DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE DRM_IOWR(0xC2, struct drm_syncobj_handle)
1085#define DRM_IOCTL_SYNCOBJ_WAIT DRM_IOWR(0xC3, struct drm_syncobj_wait)
1086#define DRM_IOCTL_SYNCOBJ_RESET DRM_IOWR(0xC4, struct drm_syncobj_array)
1087#define DRM_IOCTL_SYNCOBJ_SIGNAL DRM_IOWR(0xC5, struct drm_syncobj_array)
1088
1089#define DRM_IOCTL_MODE_CREATE_LEASE DRM_IOWR(0xC6, struct drm_mode_create_lease)
1090#define DRM_IOCTL_MODE_LIST_LESSEES DRM_IOWR(0xC7, struct drm_mode_list_lessees)
1091#define DRM_IOCTL_MODE_GET_LEASE DRM_IOWR(0xC8, struct drm_mode_get_lease)
1092#define DRM_IOCTL_MODE_REVOKE_LEASE DRM_IOWR(0xC9, struct drm_mode_revoke_lease)
1093
1094#define DRM_IOCTL_SYNCOBJ_TIMELINE_WAIT DRM_IOWR(0xCA, struct drm_syncobj_timeline_wait)
1095#define DRM_IOCTL_SYNCOBJ_QUERY DRM_IOWR(0xCB, struct drm_syncobj_timeline_array)
1096#define DRM_IOCTL_SYNCOBJ_TRANSFER DRM_IOWR(0xCC, struct drm_syncobj_transfer)
1097#define DRM_IOCTL_SYNCOBJ_TIMELINE_SIGNAL DRM_IOWR(0xCD, struct drm_syncobj_timeline_array)
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117#define DRM_IOCTL_MODE_GETFB2 DRM_IOWR(0xCE, struct drm_mode_fb_cmd2)
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127#define DRM_COMMAND_BASE 0x40
1128#define DRM_COMMAND_END 0xA0
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142struct drm_event {
1143 __u32 type;
1144 __u32 length;
1145};
1146
1147#define DRM_EVENT_VBLANK 0x01
1148#define DRM_EVENT_FLIP_COMPLETE 0x02
1149#define DRM_EVENT_CRTC_SEQUENCE 0x03
1150
1151struct drm_event_vblank {
1152 struct drm_event base;
1153 __u64 user_data;
1154 __u32 tv_sec;
1155 __u32 tv_usec;
1156 __u32 sequence;
1157 __u32 crtc_id;
1158};
1159
1160
1161
1162
1163struct drm_event_crtc_sequence {
1164 struct drm_event base;
1165 __u64 user_data;
1166 __s64 time_ns;
1167 __u64 sequence;
1168};
1169
1170
1171#ifndef __KERNEL__
1172typedef struct drm_clip_rect drm_clip_rect_t;
1173typedef struct drm_drawable_info drm_drawable_info_t;
1174typedef struct drm_tex_region drm_tex_region_t;
1175typedef struct drm_hw_lock drm_hw_lock_t;
1176typedef struct drm_version drm_version_t;
1177typedef struct drm_unique drm_unique_t;
1178typedef struct drm_list drm_list_t;
1179typedef struct drm_block drm_block_t;
1180typedef struct drm_control drm_control_t;
1181typedef enum drm_map_type drm_map_type_t;
1182typedef enum drm_map_flags drm_map_flags_t;
1183typedef struct drm_ctx_priv_map drm_ctx_priv_map_t;
1184typedef struct drm_map drm_map_t;
1185typedef struct drm_client drm_client_t;
1186typedef enum drm_stat_type drm_stat_type_t;
1187typedef struct drm_stats drm_stats_t;
1188typedef enum drm_lock_flags drm_lock_flags_t;
1189typedef struct drm_lock drm_lock_t;
1190typedef enum drm_dma_flags drm_dma_flags_t;
1191typedef struct drm_buf_desc drm_buf_desc_t;
1192typedef struct drm_buf_info drm_buf_info_t;
1193typedef struct drm_buf_free drm_buf_free_t;
1194typedef struct drm_buf_pub drm_buf_pub_t;
1195typedef struct drm_buf_map drm_buf_map_t;
1196typedef struct drm_dma drm_dma_t;
1197typedef union drm_wait_vblank drm_wait_vblank_t;
1198typedef struct drm_agp_mode drm_agp_mode_t;
1199typedef enum drm_ctx_flags drm_ctx_flags_t;
1200typedef struct drm_ctx drm_ctx_t;
1201typedef struct drm_ctx_res drm_ctx_res_t;
1202typedef struct drm_draw drm_draw_t;
1203typedef struct drm_update_draw drm_update_draw_t;
1204typedef struct drm_auth drm_auth_t;
1205typedef struct drm_irq_busid drm_irq_busid_t;
1206typedef enum drm_vblank_seq_type drm_vblank_seq_type_t;
1207
1208typedef struct drm_agp_buffer drm_agp_buffer_t;
1209typedef struct drm_agp_binding drm_agp_binding_t;
1210typedef struct drm_agp_info drm_agp_info_t;
1211typedef struct drm_scatter_gather drm_scatter_gather_t;
1212typedef struct drm_set_version drm_set_version_t;
1213#endif
1214
1215#if defined(__cplusplus)
1216}
1217#endif
1218
1219#endif
1220