XenevaOS
Loading...
Searching...
No Matches
drm.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: MIT */
2/*
3 * Header for the Direct Rendering Manager
4 *
5 * Author: Rickard E. (Rik) Faith <faith@valinux.com>
6 *
7 * Acknowledgments:
8 * Dec 1999, Richard Henderson <rth@twiddle.net>, move to generic cmpxchg.
9 */
10
11/*
12 * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
13 * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
14 * All rights reserved.
15 */
16
17#ifndef _DRM_H_
18#define _DRM_H_
19
20#if defined(__KERNEL__)
21
22#include <linux/types.h>
23#include <asm/ioctl.h>
24typedef unsigned int drm_handle_t;
25
26#elif defined(__linux__)
27
28#include <linux/types.h>
29#include <asm/ioctl.h>
30typedef unsigned int drm_handle_t;
31
32#else /* One of the BSDs */
33
34#include <stdint.h>
35#include <sys/ioccom.h>
36#include <sys/types.h>
37typedef int8_t __s8;
38typedef uint8_t __u8;
39typedef int16_t __s16;
41typedef int32_t __s32;
43typedef int64_t __s64;
45typedef size_t __kernel_size_t;
46typedef unsigned long drm_handle_t;
47
48#endif
49
50#if defined(__cplusplus)
51extern "C" {
52#endif
53
54#define DRM_NAME "drm"
55#define DRM_MIN_ORDER 5
56#define DRM_MAX_ORDER 22
57#define DRM_RAM_PERCENT 10
59#define _DRM_LOCK_HELD 0x80000000U
60#define _DRM_LOCK_CONT 0x40000000U
61#define _DRM_LOCK_IS_HELD(lock) ((lock) & _DRM_LOCK_HELD)
62#define _DRM_LOCK_IS_CONT(lock) ((lock) & _DRM_LOCK_CONT)
63#define _DRM_LOCKING_CONTEXT(lock) ((lock) & ~(_DRM_LOCK_HELD|_DRM_LOCK_CONT))
64
65typedef unsigned int drm_context_t;
66typedef unsigned int drm_drawable_t;
67typedef unsigned int drm_magic_t;
68
69/*
70 * Cliprect.
71 *
72 * \warning: If you change this structure, make sure you change
73 * XF86DRIClipRectRec in the server as well
74 *
75 * \note KW: Actually it's illegal to change either for
76 * backwards-compatibility reasons.
77 */
79 unsigned short x1;
80 unsigned short y1;
81 unsigned short x2;
82 unsigned short y2;
83};
84
85/*
86 * Drawable information.
87 */
89 unsigned int num_rects;
91};
92
93/*
94 * Texture region,
95 */
97 unsigned char next;
98 unsigned char prev;
99 unsigned char in_use;
100 unsigned char padding;
101 unsigned int age;
102};
103
104/*
105 * Hardware lock.
106 *
107 * The lock structure is a simple cache-line aligned integer. To avoid
108 * processor bus contention on a multiprocessor system, there should not be any
109 * other data stored in the same cache line.
110 */
112 __volatile__ unsigned int lock;
113 char padding[60];
114};
115
116/*
117 * DRM_IOCTL_VERSION ioctl argument type.
118 *
119 * \sa drmGetVersion().
120 */
132
133/*
134 * DRM_IOCTL_GET_UNIQUE ioctl argument type.
135 *
136 * \sa drmGetBusid() and drmSetBusId().
137 */
142
143struct drm_list {
144 int count;
146};
147
148struct drm_block {
150};
151
152/*
153 * DRM_IOCTL_CONTROL ioctl argument type.
154 *
155 * \sa drmCtlInstHandler() and drmCtlUninstHandler().
156 */
166
167/*
168 * Type of memory to map.
169 */
178
179/*
180 * Memory mapping flags.
181 */
192
194 unsigned int ctx_id;
195 void *handle;
196};
197
198/*
199 * DRM_IOCTL_GET_MAP, DRM_IOCTL_ADD_MAP and DRM_IOCTL_RM_MAP ioctls
200 * argument type.
201 *
202 * \sa drmAddMap().
203 */
204struct drm_map {
205 unsigned long offset;
206 unsigned long size;
209 void *handle;
211 int mtrr;
212 /* Private data */
213};
214
215/*
216 * DRM_IOCTL_GET_CLIENT ioctl argument type.
217 */
219 int idx;
220 int auth;
221 unsigned long pid;
222 unsigned long uid;
223 unsigned long magic;
224 unsigned long iocs;
225};
226
246
247/*
248 * DRM_IOCTL_GET_STATS ioctl argument type.
249 */
250struct drm_stats {
251 unsigned long count;
252 struct {
253 unsigned long value;
255 } data[15];
256};
257
258/*
259 * Hardware locking flags.
260 */
266 /* These *HALT* flags aren't supported yet
267 -- they will be used to support the
268 full-screen DGA-like mode. */
272
273/*
274 * DRM_IOCTL_LOCK, DRM_IOCTL_UNLOCK and DRM_IOCTL_FINISH ioctl argument type.
275 *
276 * \sa drmGetLock() and drmUnlock().
277 */
282
283/*
284 * DMA flags
285 *
286 * \warning
287 * These values \e must match xf86drm.h.
288 *
289 * \sa drm_dma.
290 */
292 /* Flags for DMA buffer dispatch */
293 _DRM_DMA_BLOCK = 0x01,
306 /* Flags for DMA buffer request */
309 _DRM_DMA_LARGER_OK = 0x40
311
312/*
313 * DRM_IOCTL_ADD_BUFS and DRM_IOCTL_MARK_BUFS ioctl argument type.
314 *
315 * \sa drmAddBufs().
316 */
318 int count;
319 int size;
322 enum {
327 _DRM_PCI_BUFFER_RO = 0x10
329 unsigned long agp_start;
333};
334
335/*
336 * DRM_IOCTL_INFO_BUFS ioctl argument type.
337 */
339 int count;
341};
342
343/*
344 * DRM_IOCTL_FREE_BUFS ioctl argument type.
345 */
347 int count;
349};
350
351/*
352 * Buffer information
353 *
354 * \sa drm_buf_map.
355 */
357 int idx;
358 int total;
359 int used;
361};
362
363/*
364 * DRM_IOCTL_MAP_BUFS ioctl argument type.
365 */
367 int count;
368#ifdef __cplusplus
369 void __user *virt;
370#else
371 void __user *virtual;
372#endif
374};
375
376/*
377 * DRM_IOCTL_DMA ioctl argument type.
378 *
379 * Indices here refer to the offset into the buffer list in drm_buf_get.
380 *
381 * \sa drmDMA().
382 */
395
400
401/*
402 * DRM_IOCTL_ADD_CTX ioctl argument type.
403 *
404 * \sa drmCreateContext() and drmDestroyContext().
405 */
410
411/*
412 * DRM_IOCTL_RES_CTX ioctl argument type.
413 */
415 int count;
417};
418
419/*
420 * DRM_IOCTL_ADD_DRAW and DRM_IOCTL_RM_DRAW ioctl argument type.
421 */
425
426/*
427 * DRM_IOCTL_UPDATE_DRAW ioctl argument type.
428 */
432
435 unsigned int type;
436 unsigned int num;
437 unsigned long long data;
438};
439
440/*
441 * DRM_IOCTL_GET_MAGIC and DRM_IOCTL_AUTH_MAGIC ioctl argument type.
442 */
446
447/*
448 * DRM_IOCTL_IRQ_BUSID ioctl argument type.
449 *
450 * \sa drmGetInterruptFromBusID().
451 */
453 int irq;
454 int busnum;
455 int devnum;
457};
458
462 /* bits 1-6 are reserved for high crtcs */
464 _DRM_VBLANK_EVENT = 0x4000000,
465 _DRM_VBLANK_FLIP = 0x8000000,
468 _DRM_VBLANK_SIGNAL = 0x40000000
470#define _DRM_VBLANK_HIGH_CRTC_SHIFT 1
471
472#define _DRM_VBLANK_TYPES_MASK (_DRM_VBLANK_ABSOLUTE | _DRM_VBLANK_RELATIVE)
473#define _DRM_VBLANK_FLAGS_MASK (_DRM_VBLANK_EVENT | _DRM_VBLANK_SIGNAL | \
474 _DRM_VBLANK_SECONDARY | _DRM_VBLANK_NEXTONMISS)
475
478 unsigned int sequence;
479 unsigned long signal;
480};
481
488
489/*
490 * DRM_IOCTL_WAIT_VBLANK ioctl argument type.
491 *
492 * \sa drmWaitVBlank().
493 */
498
499#define _DRM_PRE_MODESET 1
500#define _DRM_POST_MODESET 2
501
502/*
503 * DRM_IOCTL_MODESET_CTL ioctl argument type
504 *
505 * \sa drmModesetCtl().
506 */
511
512/*
513 * DRM_IOCTL_AGP_ENABLE ioctl argument type.
514 *
515 * \sa drmAgpEnable().
516 */
518 unsigned long mode;
519};
520
521/*
522 * DRM_IOCTL_AGP_ALLOC and DRM_IOCTL_AGP_FREE ioctls argument type.
523 *
524 * \sa drmAgpAlloc() and drmAgpFree().
525 */
527 unsigned long size;
528 unsigned long handle;
529 unsigned long type;
530 unsigned long physical;
531};
532
533/*
534 * DRM_IOCTL_AGP_BIND and DRM_IOCTL_AGP_UNBIND ioctls argument type.
535 *
536 * \sa drmAgpBind() and drmAgpUnbind().
537 */
539 unsigned long handle;
540 unsigned long offset;
541};
542
543/*
544 * DRM_IOCTL_AGP_INFO ioctl argument type.
545 *
546 * \sa drmAgpVersionMajor(), drmAgpVersionMinor(), drmAgpGetMode(),
547 * drmAgpBase(), drmAgpSize(), drmAgpMemoryUsed(), drmAgpMemoryAvail(),
548 * drmAgpVendorId() and drmAgpDeviceId().
549 */
553 unsigned long mode;
554 unsigned long aperture_base; /* physical address */
555 unsigned long aperture_size; /* bytes */
556 unsigned long memory_allowed; /* bytes */
557 unsigned long memory_used;
558
559 /* PCI information */
560 unsigned short id_vendor;
561 unsigned short id_device;
562};
563
564/*
565 * DRM_IOCTL_SG_ALLOC ioctl argument type.
566 */
568 unsigned long size;
569 unsigned long handle;
570};
571
572/*
573 * DRM_IOCTL_SET_VERSION ioctl argument type.
574 */
581
593
608
625
640
647#define DRM_CAP_DUMB_BUFFER 0x1
656#define DRM_CAP_VBLANK_HIGH_CRTC 0x2
670#define DRM_CAP_DUMB_PREFERRED_DEPTH 0x3
682#define DRM_CAP_DUMB_PREFER_SHADOW 0x4
695#define DRM_CAP_PRIME 0x5
704#define DRM_PRIME_CAP_IMPORT 0x1
713#define DRM_PRIME_CAP_EXPORT 0x2
725#define DRM_CAP_TIMESTAMP_MONOTONIC 0x6
732#define DRM_CAP_ASYNC_PAGE_FLIP 0x7
744#define DRM_CAP_CURSOR_WIDTH 0x8
750#define DRM_CAP_CURSOR_HEIGHT 0x9
757#define DRM_CAP_ADDFB2_MODIFIERS 0x10
766#define DRM_CAP_PAGE_FLIP_TARGET 0x11
776#define DRM_CAP_CRTC_IN_VBLANK_EVENT 0x12
782#define DRM_CAP_SYNCOBJ 0x13
789#define DRM_CAP_SYNCOBJ_TIMELINE 0x14
796#define DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP 0x15
797
798/* DRM_IOCTL_GET_CAP ioctl argument type */
803
814#define DRM_CLIENT_CAP_STEREO_3D 1
815
825#define DRM_CLIENT_CAP_UNIVERSAL_PLANES 2
826
841#define DRM_CLIENT_CAP_ATOMIC 3
842
852#define DRM_CLIENT_CAP_ASPECT_RATIO 4
853
864#define DRM_CLIENT_CAP_WRITEBACK_CONNECTORS 5
865
889#define DRM_CLIENT_CAP_CURSOR_PLANE_HOTSPOT 6
890
904#define DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE 7
905
906/* DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */
911
912#define DRM_RDWR O_RDWR
913#define DRM_CLOEXEC O_CLOEXEC
923
926#define DRM_SYNCOBJ_CREATE_SIGNALED (1 << 0)
928};
929
934
935#define DRM_SYNCOBJ_FD_TO_HANDLE_FLAGS_IMPORT_SYNC_FILE (1 << 0)
936#define DRM_SYNCOBJ_FD_TO_HANDLE_FLAGS_TIMELINE (1 << 1)
937#define DRM_SYNCOBJ_HANDLE_TO_FD_FLAGS_EXPORT_SYNC_FILE (1 << 0)
938#define DRM_SYNCOBJ_HANDLE_TO_FD_FLAGS_TIMELINE (1 << 1)
948
957
958#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_ALL (1 << 0)
959#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT (1 << 1)
960#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE (1 << 2) /* wait for time point to become available */
961#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_DEADLINE (1 << 3) /* set fence deadline to deadline_nsec */
964 /* absolute timeout */
968 __u32 first_signaled; /* only valid when not waiting all */
978};
979
982 /* wait on specific timeline point for every handles*/
984 /* absolute timeout */
988 __u32 first_signaled; /* only valid when not waiting all */
998};
999
1020
1021
1027
1028#define DRM_SYNCOBJ_QUERY_FLAGS_LAST_SUBMITTED (1 << 0) /* last available point on timeline syncobj */
1035
1036
1037/* Query current scanout sequence number */
1039 __u32 crtc_id; /* requested crtc_id */
1040 __u32 active; /* return: crtc output is active */
1041 __u64 sequence; /* return: most recent vblank sequence */
1042 __s64 sequence_ns; /* return: most recent time of first pixel out */
1043};
1044
1045/* Queue event to be delivered at specified sequence. Time stamp marks
1046 * when the first pixel of the refresh cycle leaves the display engine
1047 * for the display
1048 */
1049#define DRM_CRTC_SEQUENCE_RELATIVE 0x00000001 /* sequence is relative to current */
1050#define DRM_CRTC_SEQUENCE_NEXT_ON_MISS 0x00000002 /* Use next sequence if we've missed */
1051
1055 __u64 sequence; /* on input, target sequence. on output, actual sequence */
1056 __u64 user_data; /* user data passed to event */
1057};
1058
1059#define DRM_CLIENT_NAME_MAX_LEN 64
1064
1065
1066#if defined(__cplusplus)
1067}
1068#endif
1069
1070#include "drm_mode.h"
1071
1072#if defined(__cplusplus)
1073extern "C" {
1074#endif
1075
1076#define DRM_IOCTL_BASE 'd'
1077#define DRM_IO(nr) _IO(DRM_IOCTL_BASE,nr)
1078#define DRM_IOR(nr,type) _IOR(DRM_IOCTL_BASE,nr,type)
1079#define DRM_IOW(nr,type) _IOW(DRM_IOCTL_BASE,nr,type)
1080#define DRM_IOWR(nr,type) _IOWR(DRM_IOCTL_BASE,nr,type)
1081
1082#define DRM_IOCTL_VERSION DRM_IOWR(0x00, struct drm_version)
1083#define DRM_IOCTL_GET_UNIQUE DRM_IOWR(0x01, struct drm_unique)
1084#define DRM_IOCTL_GET_MAGIC DRM_IOR( 0x02, struct drm_auth)
1085#define DRM_IOCTL_IRQ_BUSID DRM_IOWR(0x03, struct drm_irq_busid)
1086#define DRM_IOCTL_GET_MAP DRM_IOWR(0x04, struct drm_map)
1087#define DRM_IOCTL_GET_CLIENT DRM_IOWR(0x05, struct drm_client)
1088#define DRM_IOCTL_GET_STATS DRM_IOR( 0x06, struct drm_stats)
1089#define DRM_IOCTL_SET_VERSION DRM_IOWR(0x07, struct drm_set_version)
1090#define DRM_IOCTL_MODESET_CTL DRM_IOW(0x08, struct drm_modeset_ctl)
1104#define DRM_IOCTL_GEM_CLOSE DRM_IOW (0x09, struct drm_gem_close)
1105#define DRM_IOCTL_GEM_FLINK DRM_IOWR(0x0a, struct drm_gem_flink)
1106#define DRM_IOCTL_GEM_OPEN DRM_IOWR(0x0b, struct drm_gem_open)
1107#define DRM_IOCTL_GET_CAP DRM_IOWR(0x0c, struct drm_get_cap)
1108#define DRM_IOCTL_SET_CLIENT_CAP DRM_IOW( 0x0d, struct drm_set_client_cap)
1109
1110#define DRM_IOCTL_SET_UNIQUE DRM_IOW( 0x10, struct drm_unique)
1111#define DRM_IOCTL_AUTH_MAGIC DRM_IOW( 0x11, struct drm_auth)
1112#define DRM_IOCTL_BLOCK DRM_IOWR(0x12, struct drm_block)
1113#define DRM_IOCTL_UNBLOCK DRM_IOWR(0x13, struct drm_block)
1114#define DRM_IOCTL_CONTROL DRM_IOW( 0x14, struct drm_control)
1115#define DRM_IOCTL_ADD_MAP DRM_IOWR(0x15, struct drm_map)
1116#define DRM_IOCTL_ADD_BUFS DRM_IOWR(0x16, struct drm_buf_desc)
1117#define DRM_IOCTL_MARK_BUFS DRM_IOW( 0x17, struct drm_buf_desc)
1118#define DRM_IOCTL_INFO_BUFS DRM_IOWR(0x18, struct drm_buf_info)
1119#define DRM_IOCTL_MAP_BUFS DRM_IOWR(0x19, struct drm_buf_map)
1120#define DRM_IOCTL_FREE_BUFS DRM_IOW( 0x1a, struct drm_buf_free)
1121
1122#define DRM_IOCTL_RM_MAP DRM_IOW( 0x1b, struct drm_map)
1123
1124#define DRM_IOCTL_SET_SAREA_CTX DRM_IOW( 0x1c, struct drm_ctx_priv_map)
1125#define DRM_IOCTL_GET_SAREA_CTX DRM_IOWR(0x1d, struct drm_ctx_priv_map)
1126
1127#define DRM_IOCTL_SET_MASTER DRM_IO(0x1e)
1128#define DRM_IOCTL_DROP_MASTER DRM_IO(0x1f)
1129
1130#define DRM_IOCTL_ADD_CTX DRM_IOWR(0x20, struct drm_ctx)
1131#define DRM_IOCTL_RM_CTX DRM_IOWR(0x21, struct drm_ctx)
1132#define DRM_IOCTL_MOD_CTX DRM_IOW( 0x22, struct drm_ctx)
1133#define DRM_IOCTL_GET_CTX DRM_IOWR(0x23, struct drm_ctx)
1134#define DRM_IOCTL_SWITCH_CTX DRM_IOW( 0x24, struct drm_ctx)
1135#define DRM_IOCTL_NEW_CTX DRM_IOW( 0x25, struct drm_ctx)
1136#define DRM_IOCTL_RES_CTX DRM_IOWR(0x26, struct drm_ctx_res)
1137#define DRM_IOCTL_ADD_DRAW DRM_IOWR(0x27, struct drm_draw)
1138#define DRM_IOCTL_RM_DRAW DRM_IOWR(0x28, struct drm_draw)
1139#define DRM_IOCTL_DMA DRM_IOWR(0x29, struct drm_dma)
1140#define DRM_IOCTL_LOCK DRM_IOW( 0x2a, struct drm_lock)
1141#define DRM_IOCTL_UNLOCK DRM_IOW( 0x2b, struct drm_lock)
1142#define DRM_IOCTL_FINISH DRM_IOW( 0x2c, struct drm_lock)
1143
1156#define DRM_IOCTL_PRIME_HANDLE_TO_FD DRM_IOWR(0x2d, struct drm_prime_handle)
1175#define DRM_IOCTL_PRIME_FD_TO_HANDLE DRM_IOWR(0x2e, struct drm_prime_handle)
1176
1177#define DRM_IOCTL_AGP_ACQUIRE DRM_IO( 0x30)
1178#define DRM_IOCTL_AGP_RELEASE DRM_IO( 0x31)
1179#define DRM_IOCTL_AGP_ENABLE DRM_IOW( 0x32, struct drm_agp_mode)
1180#define DRM_IOCTL_AGP_INFO DRM_IOR( 0x33, struct drm_agp_info)
1181#define DRM_IOCTL_AGP_ALLOC DRM_IOWR(0x34, struct drm_agp_buffer)
1182#define DRM_IOCTL_AGP_FREE DRM_IOW( 0x35, struct drm_agp_buffer)
1183#define DRM_IOCTL_AGP_BIND DRM_IOW( 0x36, struct drm_agp_binding)
1184#define DRM_IOCTL_AGP_UNBIND DRM_IOW( 0x37, struct drm_agp_binding)
1185
1186#define DRM_IOCTL_SG_ALLOC DRM_IOWR(0x38, struct drm_scatter_gather)
1187#define DRM_IOCTL_SG_FREE DRM_IOW( 0x39, struct drm_scatter_gather)
1188
1189#define DRM_IOCTL_WAIT_VBLANK DRM_IOWR(0x3a, union drm_wait_vblank)
1190
1191#define DRM_IOCTL_CRTC_GET_SEQUENCE DRM_IOWR(0x3b, struct drm_crtc_get_sequence)
1192#define DRM_IOCTL_CRTC_QUEUE_SEQUENCE DRM_IOWR(0x3c, struct drm_crtc_queue_sequence)
1193
1194#define DRM_IOCTL_UPDATE_DRAW DRM_IOW(0x3f, struct drm_update_draw)
1195
1196#define DRM_IOCTL_MODE_GETRESOURCES DRM_IOWR(0xA0, struct drm_mode_card_res)
1197#define DRM_IOCTL_MODE_GETCRTC DRM_IOWR(0xA1, struct drm_mode_crtc)
1198#define DRM_IOCTL_MODE_SETCRTC DRM_IOWR(0xA2, struct drm_mode_crtc)
1199#define DRM_IOCTL_MODE_CURSOR DRM_IOWR(0xA3, struct drm_mode_cursor)
1200#define DRM_IOCTL_MODE_GETGAMMA DRM_IOWR(0xA4, struct drm_mode_crtc_lut)
1201#define DRM_IOCTL_MODE_SETGAMMA DRM_IOWR(0xA5, struct drm_mode_crtc_lut)
1202#define DRM_IOCTL_MODE_GETENCODER DRM_IOWR(0xA6, struct drm_mode_get_encoder)
1203#define DRM_IOCTL_MODE_GETCONNECTOR DRM_IOWR(0xA7, struct drm_mode_get_connector)
1204#define DRM_IOCTL_MODE_ATTACHMODE DRM_IOWR(0xA8, struct drm_mode_mode_cmd) /* deprecated (never worked) */
1205#define DRM_IOCTL_MODE_DETACHMODE DRM_IOWR(0xA9, struct drm_mode_mode_cmd) /* deprecated (never worked) */
1206
1207#define DRM_IOCTL_MODE_GETPROPERTY DRM_IOWR(0xAA, struct drm_mode_get_property)
1208#define DRM_IOCTL_MODE_SETPROPERTY DRM_IOWR(0xAB, struct drm_mode_connector_set_property)
1209#define DRM_IOCTL_MODE_GETPROPBLOB DRM_IOWR(0xAC, struct drm_mode_get_blob)
1210#define DRM_IOCTL_MODE_GETFB DRM_IOWR(0xAD, struct drm_mode_fb_cmd)
1211#define DRM_IOCTL_MODE_ADDFB DRM_IOWR(0xAE, struct drm_mode_fb_cmd)
1222#define DRM_IOCTL_MODE_RMFB DRM_IOWR(0xAF, unsigned int)
1223#define DRM_IOCTL_MODE_PAGE_FLIP DRM_IOWR(0xB0, struct drm_mode_crtc_page_flip)
1224#define DRM_IOCTL_MODE_DIRTYFB DRM_IOWR(0xB1, struct drm_mode_fb_dirty_cmd)
1225
1246#define DRM_IOCTL_MODE_CREATE_DUMB DRM_IOWR(0xB2, struct drm_mode_create_dumb)
1247#define DRM_IOCTL_MODE_MAP_DUMB DRM_IOWR(0xB3, struct drm_mode_map_dumb)
1248#define DRM_IOCTL_MODE_DESTROY_DUMB DRM_IOWR(0xB4, struct drm_mode_destroy_dumb)
1249#define DRM_IOCTL_MODE_GETPLANERESOURCES DRM_IOWR(0xB5, struct drm_mode_get_plane_res)
1250#define DRM_IOCTL_MODE_GETPLANE DRM_IOWR(0xB6, struct drm_mode_get_plane)
1251#define DRM_IOCTL_MODE_SETPLANE DRM_IOWR(0xB7, struct drm_mode_set_plane)
1252#define DRM_IOCTL_MODE_ADDFB2 DRM_IOWR(0xB8, struct drm_mode_fb_cmd2)
1253#define DRM_IOCTL_MODE_OBJ_GETPROPERTIES DRM_IOWR(0xB9, struct drm_mode_obj_get_properties)
1254#define DRM_IOCTL_MODE_OBJ_SETPROPERTY DRM_IOWR(0xBA, struct drm_mode_obj_set_property)
1255#define DRM_IOCTL_MODE_CURSOR2 DRM_IOWR(0xBB, struct drm_mode_cursor2)
1256#define DRM_IOCTL_MODE_ATOMIC DRM_IOWR(0xBC, struct drm_mode_atomic)
1257#define DRM_IOCTL_MODE_CREATEPROPBLOB DRM_IOWR(0xBD, struct drm_mode_create_blob)
1258#define DRM_IOCTL_MODE_DESTROYPROPBLOB DRM_IOWR(0xBE, struct drm_mode_destroy_blob)
1259
1260#define DRM_IOCTL_SYNCOBJ_CREATE DRM_IOWR(0xBF, struct drm_syncobj_create)
1261#define DRM_IOCTL_SYNCOBJ_DESTROY DRM_IOWR(0xC0, struct drm_syncobj_destroy)
1262#define DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD DRM_IOWR(0xC1, struct drm_syncobj_handle)
1263#define DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE DRM_IOWR(0xC2, struct drm_syncobj_handle)
1264#define DRM_IOCTL_SYNCOBJ_WAIT DRM_IOWR(0xC3, struct drm_syncobj_wait)
1265#define DRM_IOCTL_SYNCOBJ_RESET DRM_IOWR(0xC4, struct drm_syncobj_array)
1266#define DRM_IOCTL_SYNCOBJ_SIGNAL DRM_IOWR(0xC5, struct drm_syncobj_array)
1267
1268#define DRM_IOCTL_MODE_CREATE_LEASE DRM_IOWR(0xC6, struct drm_mode_create_lease)
1269#define DRM_IOCTL_MODE_LIST_LESSEES DRM_IOWR(0xC7, struct drm_mode_list_lessees)
1270#define DRM_IOCTL_MODE_GET_LEASE DRM_IOWR(0xC8, struct drm_mode_get_lease)
1271#define DRM_IOCTL_MODE_REVOKE_LEASE DRM_IOWR(0xC9, struct drm_mode_revoke_lease)
1272
1273#define DRM_IOCTL_SYNCOBJ_TIMELINE_WAIT DRM_IOWR(0xCA, struct drm_syncobj_timeline_wait)
1274#define DRM_IOCTL_SYNCOBJ_QUERY DRM_IOWR(0xCB, struct drm_syncobj_timeline_array)
1275#define DRM_IOCTL_SYNCOBJ_TRANSFER DRM_IOWR(0xCC, struct drm_syncobj_transfer)
1276#define DRM_IOCTL_SYNCOBJ_TIMELINE_SIGNAL DRM_IOWR(0xCD, struct drm_syncobj_timeline_array)
1277
1306#define DRM_IOCTL_MODE_GETFB2 DRM_IOWR(0xCE, struct drm_mode_fb_cmd2)
1307
1315#define DRM_IOCTL_SYNCOBJ_EVENTFD DRM_IOWR(0xCF, struct drm_syncobj_eventfd)
1316
1335#define DRM_IOCTL_MODE_CLOSEFB DRM_IOWR(0xD0, struct drm_mode_closefb)
1336
1345#define DRM_IOCTL_SET_CLIENT_NAME DRM_IOWR(0xD1, struct drm_set_client_name)
1346
1353#define DRM_IOCTL_GEM_CHANGE_HANDLE DRM_IOWR(0xD2, struct drm_gem_change_handle)
1354
1355/*
1356 * Device specific ioctls should only be in their respective headers
1357 * The device specific ioctl range is from 0x40 to 0x9f.
1358 * Generic IOCTLS restart at 0xA0.
1359 *
1360 * \sa drmCommandNone(), drmCommandRead(), drmCommandWrite(), and
1361 * drmCommandReadWrite().
1362 */
1363#define DRM_COMMAND_BASE 0x40
1364#define DRM_COMMAND_END 0xA0
1365
1384
1393#define DRM_EVENT_VBLANK 0x01
1402#define DRM_EVENT_FLIP_COMPLETE 0x02
1410#define DRM_EVENT_CRTC_SEQUENCE 0x03
1411
1418 __u32 crtc_id; /* 0 on older kernels that do not support this */
1419};
1420
1421/* Event delivered at sequence. Time stamp marks when the first pixel
1422 * of the refresh cycle leaves the display engine for the display
1423 */
1430
1431/* typedef area */
1432#ifndef __KERNEL__
1439typedef struct drm_list drm_list_t;
1440typedef struct drm_block drm_block_t;
1445typedef struct drm_map drm_map_t;
1448typedef struct drm_stats drm_stats_t;
1450typedef struct drm_lock drm_lock_t;
1457typedef struct drm_dma drm_dma_t;
1461typedef struct drm_ctx drm_ctx_t;
1463typedef struct drm_draw drm_draw_t;
1465typedef struct drm_auth drm_auth_t;
1468
1474#endif
1475
1476#if defined(__cplusplus)
1477}
1478#endif
1479
1480#endif
int int32_t
Definition acefiex.h:160
unsigned int uint32_t
Definition acefiex.h:163
COMPILER_DEPENDENT_INT64 int64_t
Definition acefiex.h:164
short int int16_t
Definition acefiex.h:159
unsigned char uint8_t
Definition acefiex.h:161
COMPILER_DEPENDENT_UINT64 uint64_t
Definition acefiex.h:165
unsigned short int uint16_t
Definition acefiex.h:162
signed char int8_t
Definition acefiex.h:158
#define __user
Definition compiler.h:63
enum drm_lock_flags drm_lock_flags_t
Definition drm.h:1449
int8_t __s8
Definition drm.h:37
size_t __kernel_size_t
Definition drm.h:45
enum drm_map_flags drm_map_flags_t
Definition drm.h:1443
enum drm_map_type drm_map_type_t
Definition drm.h:1442
int32_t __s32
Definition drm.h:41
unsigned int drm_magic_t
Definition drm.h:67
uint32_t __u32
Definition drm.h:42
drm_stat_type
Definition drm.h:227
@ _DRM_STAT_COUNT
Definition drm.h:236
@ _DRM_STAT_CLOSES
Definition drm.h:230
@ _DRM_STAT_BYTE
Definition drm.h:235
@ _DRM_STAT_SPECIAL
Definition drm.h:242
@ _DRM_STAT_DMA
Definition drm.h:241
@ _DRM_STAT_MISSED
Definition drm.h:243
@ _DRM_STAT_OPENS
Definition drm.h:229
@ _DRM_STAT_SECONDARY
Definition drm.h:240
@ _DRM_STAT_IOCTLS
Definition drm.h:231
@ _DRM_STAT_LOCKS
Definition drm.h:232
@ _DRM_STAT_LOCK
Definition drm.h:228
@ _DRM_STAT_IRQ
Definition drm.h:238
@ _DRM_STAT_UNLOCKS
Definition drm.h:233
@ _DRM_STAT_PRIMARY
Definition drm.h:239
@ _DRM_STAT_VALUE
Definition drm.h:234
unsigned int drm_drawable_t
Definition drm.h:66
int64_t __s64
Definition drm.h:43
drm_drawable_info_type_t
Definition drm.h:429
@ DRM_DRAWABLE_CLIPRECTS
Definition drm.h:430
drm_dma_flags
Definition drm.h:291
@ _DRM_DMA_PRIORITY
Definition drm.h:304
@ _DRM_DMA_BLOCK
Definition drm.h:293
@ _DRM_DMA_SMALLER_OK
Definition drm.h:308
@ _DRM_DMA_LARGER_OK
Definition drm.h:309
@ _DRM_DMA_WAIT
Definition drm.h:307
@ _DRM_DMA_WHILE_LOCKED
Definition drm.h:303
unsigned int drm_context_t
Definition drm.h:65
drm_ctx_flags
Definition drm.h:396
@ _DRM_CONTEXT_PRESERVED
Definition drm.h:397
@ _DRM_CONTEXT_2DONLY
Definition drm.h:398
drm_lock_flags
Definition drm.h:261
@ _DRM_HALT_ALL_QUEUES
Definition drm.h:269
@ _DRM_LOCK_FLUSH
Definition drm.h:264
@ _DRM_LOCK_QUIESCENT
Definition drm.h:263
@ _DRM_HALT_CUR_QUEUES
Definition drm.h:270
@ _DRM_LOCK_READY
Definition drm.h:262
@ _DRM_LOCK_FLUSH_ALL
Definition drm.h:265
uint8_t __u8
Definition drm.h:38
enum drm_ctx_flags drm_ctx_flags_t
Definition drm.h:1460
int16_t __s16
Definition drm.h:39
enum drm_stat_type drm_stat_type_t
Definition drm.h:1447
drm_map_type
Definition drm.h:170
@ _DRM_SHM
Definition drm.h:173
@ _DRM_FRAME_BUFFER
Definition drm.h:171
@ _DRM_CONSISTENT
Definition drm.h:176
@ _DRM_REGISTERS
Definition drm.h:172
@ _DRM_AGP
Definition drm.h:174
@ _DRM_SCATTER_GATHER
Definition drm.h:175
drm_vblank_seq_type
Definition drm.h:459
@ _DRM_VBLANK_HIGH_CRTC_MASK
Definition drm.h:463
@ _DRM_VBLANK_NEXTONMISS
Definition drm.h:466
@ _DRM_VBLANK_EVENT
Definition drm.h:464
@ _DRM_VBLANK_ABSOLUTE
Definition drm.h:460
@ _DRM_VBLANK_SIGNAL
Definition drm.h:468
@ _DRM_VBLANK_RELATIVE
Definition drm.h:461
@ _DRM_VBLANK_FLIP
Definition drm.h:465
@ _DRM_VBLANK_SECONDARY
Definition drm.h:467
uint16_t __u16
Definition drm.h:40
uint64_t __u64
Definition drm.h:44
enum drm_vblank_seq_type drm_vblank_seq_type_t
Definition drm.h:1467
unsigned long drm_handle_t
Definition drm.h:46
drm_map_flags
Definition drm.h:182
@ _DRM_LOCKED
Definition drm.h:185
@ _DRM_READ_ONLY
Definition drm.h:184
@ _DRM_CONTAINS_LOCK
Definition drm.h:188
@ _DRM_REMOVABLE
Definition drm.h:189
@ _DRM_RESTRICTED
Definition drm.h:183
@ _DRM_WRITE_COMBINING
Definition drm.h:187
@ _DRM_DRIVER
Definition drm.h:190
@ _DRM_KERNEL
Definition drm.h:186
enum drm_dma_flags drm_dma_flags_t
Definition drm.h:1451
Definition drm.h:538
unsigned long offset
Definition drm.h:540
unsigned long handle
Definition drm.h:539
Definition drm.h:526
unsigned long physical
Definition drm.h:530
unsigned long size
Definition drm.h:527
unsigned long handle
Definition drm.h:528
unsigned long type
Definition drm.h:529
Definition drm.h:550
unsigned short id_vendor
Definition drm.h:560
unsigned long aperture_base
Definition drm.h:554
int agp_version_major
Definition drm.h:551
unsigned short id_device
Definition drm.h:561
int agp_version_minor
Definition drm.h:552
unsigned long aperture_size
Definition drm.h:555
unsigned long mode
Definition drm.h:553
unsigned long memory_allowed
Definition drm.h:556
unsigned long memory_used
Definition drm.h:557
Definition drm.h:517
unsigned long mode
Definition drm.h:518
Definition drm.h:443
drm_magic_t magic
Definition drm.h:444
Definition drm.h:148
int unused
Definition drm.h:149
Definition drm.h:317
int low_mark
Definition drm.h:320
int count
Definition drm.h:318
int size
Definition drm.h:319
int high_mark
Definition drm.h:321
@ _DRM_PCI_BUFFER_RO
Definition drm.h:327
@ _DRM_PAGE_ALIGN
Definition drm.h:323
@ _DRM_FB_BUFFER
Definition drm.h:326
@ _DRM_AGP_BUFFER
Definition drm.h:324
@ _DRM_SG_BUFFER
Definition drm.h:325
unsigned long agp_start
Definition drm.h:329
enum drm_buf_desc::@15 flags
Definition drm.h:346
int __user * list
Definition drm.h:348
int count
Definition drm.h:347
Definition drm.h:338
int count
Definition drm.h:339
struct drm_buf_desc __user * list
Definition drm.h:340
Definition drm.h:366
int count
Definition drm.h:367
struct drm_buf_pub __user * list
Definition drm.h:373
Definition drm.h:356
int used
Definition drm.h:359
int idx
Definition drm.h:357
int total
Definition drm.h:358
void __user * address
Definition drm.h:360
Definition drm.h:218
int idx
Definition drm.h:219
unsigned long magic
Definition drm.h:223
unsigned long iocs
Definition drm.h:224
unsigned long pid
Definition drm.h:221
unsigned long uid
Definition drm.h:222
int auth
Definition drm.h:220
Definition drm.h:78
unsigned short x1
Definition drm.h:79
unsigned short y2
Definition drm.h:82
unsigned short x2
Definition drm.h:81
unsigned short y1
Definition drm.h:80
Definition drm.h:157
int irq
Definition drm.h:164
enum drm_control::@13 func
@ DRM_ADD_COMMAND
Definition drm.h:159
@ DRM_INST_HANDLER
Definition drm.h:161
@ DRM_RM_COMMAND
Definition drm.h:160
@ DRM_UNINST_HANDLER
Definition drm.h:162
Definition drm.h:1038
__u32 crtc_id
Definition drm.h:1039
__u32 active
Definition drm.h:1040
__s64 sequence_ns
Definition drm.h:1042
__u64 sequence
Definition drm.h:1041
Definition drm.h:1052
__u64 sequence
Definition drm.h:1055
__u32 crtc_id
Definition drm.h:1053
__u32 flags
Definition drm.h:1054
__u64 user_data
Definition drm.h:1056
Definition drm.h:193
void * handle
Definition drm.h:195
unsigned int ctx_id
Definition drm.h:194
Definition drm.h:414
int count
Definition drm.h:415
struct drm_ctx __user * contexts
Definition drm.h:416
Definition drm.h:406
enum drm_ctx_flags flags
Definition drm.h:408
drm_context_t handle
Definition drm.h:407
Definition drm.h:383
int request_size
Definition drm.h:390
int __user * send_indices
Definition drm.h:386
int request_count
Definition drm.h:389
int granted_count
Definition drm.h:393
int __user * request_indices
Definition drm.h:391
int send_count
Definition drm.h:385
enum drm_dma_flags flags
Definition drm.h:388
int __user * request_sizes
Definition drm.h:392
int __user * send_sizes
Definition drm.h:387
int context
Definition drm.h:384
Definition drm.h:422
drm_drawable_t handle
Definition drm.h:423
Definition drm.h:88
struct drm_clip_rect * rects
Definition drm.h:90
unsigned int num_rects
Definition drm.h:89
Definition drm.h:1424
__u64 user_data
Definition drm.h:1426
struct drm_event base
Definition drm.h:1425
__s64 time_ns
Definition drm.h:1427
__u64 sequence
Definition drm.h:1428
Definition drm.h:1412
__u64 user_data
Definition drm.h:1414
__u32 sequence
Definition drm.h:1417
__u32 tv_usec
Definition drm.h:1416
struct drm_event base
Definition drm.h:1413
__u32 crtc_id
Definition drm.h:1418
__u32 tv_sec
Definition drm.h:1415
Definition drm.h:1380
__u32 type
Definition drm.h:1381
__u32 length
Definition drm.h:1382
Definition drm.h:636
__u32 new_handle
Definition drm.h:638
__u32 handle
Definition drm.h:637
Definition drm.h:589
__u32 handle
Definition drm.h:590
__u32 pad
Definition drm.h:591
Definition drm.h:620
__u32 name
Definition drm.h:621
__u32 handle
Definition drm.h:622
__u64 size
Definition drm.h:623
Definition drm.h:799
__u64 value
Definition drm.h:801
__u64 capability
Definition drm.h:800
Definition drm.h:111
char padding[60]
Definition drm.h:113
__volatile__ unsigned int lock
Definition drm.h:112
Definition drm.h:452
int funcnum
Definition drm.h:456
int busnum
Definition drm.h:454
int devnum
Definition drm.h:455
int irq
Definition drm.h:453
Definition drm.h:143
int count
Definition drm.h:144
struct drm_version __user * version
Definition drm.h:145
Definition drm.h:278
int context
Definition drm.h:279
enum drm_lock_flags flags
Definition drm.h:280
Definition drm.h:204
unsigned long size
Definition drm.h:206
enum drm_map_flags flags
Definition drm.h:208
unsigned long offset
Definition drm.h:205
enum drm_map_type type
Definition drm.h:207
void * handle
Definition drm.h:209
int mtrr
Definition drm.h:211
Definition drm.h:507
__u32 cmd
Definition drm.h:509
__u32 crtc
Definition drm.h:508
Definition drm.h:914
__u32 handle
Definition drm.h:915
__s32 fd
Definition drm.h:921
__u32 flags
Definition drm.h:918
Definition drm.h:567
unsigned long size
Definition drm.h:568
unsigned long handle
Definition drm.h:569
Definition drm.h:907
__u64 value
Definition drm.h:909
__u64 capability
Definition drm.h:908
Definition drm.h:1060
__u64 name_len
Definition drm.h:1061
__u64 name
Definition drm.h:1062
Definition drm.h:575
int drm_dd_major
Definition drm.h:578
int drm_di_minor
Definition drm.h:577
int drm_di_major
Definition drm.h:576
int drm_dd_minor
Definition drm.h:579
Definition drm.h:250
unsigned long value
Definition drm.h:253
struct drm_stats::@14 data[15]
unsigned long count
Definition drm.h:251
enum drm_stat_type type
Definition drm.h:254
Definition drm.h:1022
__u64 handles
Definition drm.h:1023
__u32 pad
Definition drm.h:1025
__u32 count_handles
Definition drm.h:1024
Definition drm.h:924
__u32 handle
Definition drm.h:925
__u32 flags
Definition drm.h:927
Definition drm.h:930
__u32 handle
Definition drm.h:931
__u32 pad
Definition drm.h:932
Definition drm.h:1013
__u64 point
Definition drm.h:1016
__u32 pad
Definition drm.h:1018
__u32 handle
Definition drm.h:1014
__u32 flags
Definition drm.h:1015
__s32 fd
Definition drm.h:1017
Definition drm.h:939
__u32 flags
Definition drm.h:941
__u32 handle
Definition drm.h:940
__u32 pad
Definition drm.h:944
__s32 fd
Definition drm.h:943
__u64 point
Definition drm.h:946
Definition drm.h:1029
__u32 flags
Definition drm.h:1033
__u64 handles
Definition drm.h:1030
__u64 points
Definition drm.h:1031
__u32 count_handles
Definition drm.h:1032
Definition drm.h:980
__u32 first_signaled
Definition drm.h:988
__u32 pad
Definition drm.h:989
__s64 timeout_nsec
Definition drm.h:985
__u32 count_handles
Definition drm.h:986
__u64 points
Definition drm.h:983
__u64 deadline_nsec
Definition drm.h:997
__u32 flags
Definition drm.h:987
__u64 handles
Definition drm.h:981
Definition drm.h:949
__u64 src_point
Definition drm.h:952
__u32 dst_handle
Definition drm.h:951
__u32 flags
Definition drm.h:954
__u64 dst_point
Definition drm.h:953
__u32 pad
Definition drm.h:955
__u32 src_handle
Definition drm.h:950
Definition drm.h:962
__u32 count_handles
Definition drm.h:966
__u64 handles
Definition drm.h:963
__u32 first_signaled
Definition drm.h:968
__u32 pad
Definition drm.h:969
__u64 deadline_nsec
Definition drm.h:977
__u32 flags
Definition drm.h:967
__s64 timeout_nsec
Definition drm.h:965
Definition drm.h:96
unsigned char in_use
Definition drm.h:99
unsigned int age
Definition drm.h:101
unsigned char padding
Definition drm.h:100
unsigned char next
Definition drm.h:97
unsigned char prev
Definition drm.h:98
Definition drm.h:138
char __user * unique
Definition drm.h:140
__kernel_size_t unique_len
Definition drm.h:139
Definition drm.h:433
unsigned long long data
Definition drm.h:437
unsigned int type
Definition drm.h:435
unsigned int num
Definition drm.h:436
drm_drawable_t handle
Definition drm.h:434
Definition drm.h:121
char __user * desc
Definition drm.h:130
__kernel_size_t name_len
Definition drm.h:125
__kernel_size_t desc_len
Definition drm.h:129
__kernel_size_t date_len
Definition drm.h:127
int version_patchlevel
Definition drm.h:124
char __user * date
Definition drm.h:128
int version_minor
Definition drm.h:123
int version_major
Definition drm.h:122
char __user * name
Definition drm.h:126
Definition drm.h:482
long tval_sec
Definition drm.h:485
unsigned int sequence
Definition drm.h:484
long tval_usec
Definition drm.h:486
enum drm_vblank_seq_type type
Definition drm.h:483
Definition drm.h:476
unsigned int sequence
Definition drm.h:478
enum drm_vblank_seq_type type
Definition drm.h:477
unsigned long signal
Definition drm.h:479
size_t __kernel_size_t
Definition drm.h:45
int32_t __s32
Definition drm.h:41
unsigned int drm_magic_t
Definition drm.h:67
uint32_t __u32
Definition drm.h:42
drm_stat_type
Definition drm.h:227
unsigned int drm_drawable_t
Definition drm.h:66
int64_t __s64
Definition drm.h:43
drm_dma_flags
Definition drm.h:291
unsigned int drm_context_t
Definition drm.h:65
drm_ctx_flags
Definition drm.h:396
drm_lock_flags
Definition drm.h:261
drm_map_type
Definition drm.h:170
drm_vblank_seq_type
Definition drm.h:459
uint64_t __u64
Definition drm.h:44
drm_map_flags
Definition drm.h:182
Definition drm.h:494
struct drm_wait_vblank_request request
Definition drm.h:495
struct drm_wait_vblank_reply reply
Definition drm.h:496