vki-linux-drm.h 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810
  1. /*
  2. * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
  3. * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
  4. * Copyright (c) 2003-2008 Tungsten Graphics, Inc., Cedar Park, TX., USA
  5. * Copyright (c) 2007 Dave Airlie <airlied@linux.ie>
  6. * Copyright (c) 2007 Jakob Bornecrantz <wallbraker@gmail.com>
  7. * Copyright (c) 2007-2008 Intel Corporation
  8. * Copyright (c) 2008 Red Hat Inc.
  9. * All rights reserved.
  10. *
  11. * Permission is hereby granted, free of charge, to any person obtaining a
  12. * copy of this software and associated documentation files (the "Software"),
  13. * to deal in the Software without restriction, including without limitation
  14. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  15. * and/or sell copies of the Software, and to permit persons to whom the
  16. * Software is furnished to do so, subject to the following conditions:
  17. *
  18. * The above copyright notice and this permission notice (including the next
  19. * paragraph) shall be included in all copies or substantial portions of the
  20. * Software.
  21. *
  22. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  23. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  24. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  25. * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
  26. * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  27. * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  28. * OTHER DEALINGS IN THE SOFTWARE.
  29. */
  30. #ifndef __VKI_LINUX_DRM_H
  31. #define __VKI_LINUX_DRM_H
  32. //----------------------------------------------------------------------
  33. // From include/drm/drm.h
  34. //----------------------------------------------------------------------
  35. typedef unsigned int vki_drm_context_t;
  36. typedef unsigned int vki_drm_drawable_t;
  37. typedef unsigned int vki_drm_magic_t;
  38. struct vki_drm_clip_rect {
  39. unsigned short x1;
  40. unsigned short y1;
  41. unsigned short x2;
  42. unsigned short y2;
  43. };
  44. struct vki_drm_version {
  45. int version_major; /**< Major version */
  46. int version_minor; /**< Minor version */
  47. int version_patchlevel; /**< Patch level */
  48. vki_size_t name_len; /**< Length of name buffer */
  49. char __user *name; /**< Name of driver */
  50. vki_size_t date_len; /**< Length of date buffer */
  51. char __user *date; /**< User-space buffer to hold date */
  52. vki_size_t desc_len; /**< Length of desc buffer */
  53. char __user *desc; /**< User-space buffer to hold desc */
  54. };
  55. struct vki_drm_unique {
  56. vki_size_t unique_len; /**< Length of unique */
  57. char __user *unique; /**< Unique name for driver instantiation */
  58. };
  59. struct vki_drm_block {
  60. int unused;
  61. };
  62. struct vki_drm_control {
  63. enum {
  64. VKI_DRM_ADD_COMMAND,
  65. VKI_DRM_RM_COMMAND,
  66. VKI_DRM_INST_HANDLER,
  67. VKI_DRM_UNINST_HANDLER
  68. } func;
  69. int irq;
  70. };
  71. enum vki_drm_map_type {
  72. _VKI_DRM_FRAME_BUFFER = 0, /**< WC (no caching), no core dump */
  73. _VKI_DRM_REGISTERS = 1, /**< no caching, no core dump */
  74. _VKI_DRM_SHM = 2, /**< shared, cached */
  75. _VKI_DRM_AGP = 3, /**< AGP/GART */
  76. _VKI_DRM_SCATTER_GATHER = 4, /**< Scatter/gather memory for PCI DMA */
  77. _VKI_DRM_CONSISTENT = 5, /**< Consistent memory for PCI DMA */
  78. _VKI_DRM_GEM = 6, /**< GEM object */
  79. };
  80. enum vki_drm_map_flags {
  81. _VKI_DRM_RESTRICTED = 0x01, /**< Cannot be mapped to user-virtual */
  82. _VKI_DRM_READ_ONLY = 0x02,
  83. _VKI_DRM_LOCKED = 0x04, /**< shared, cached, locked */
  84. _VKI_DRM_KERNEL = 0x08, /**< kernel requires access */
  85. _VKI_DRM_WRITE_COMBINING = 0x10, /**< use write-combining if available */
  86. _VKI_DRM_CONTAINS_LOCK = 0x20, /**< SHM page that contains lock */
  87. _VKI_DRM_REMOVABLE = 0x40, /**< Removable mapping */
  88. _VKI_DRM_DRIVER = 0x80 /**< Managed by driver */
  89. };
  90. struct vki_drm_ctx_priv_map {
  91. unsigned int ctx_id; /**< Context requesting private mapping */
  92. void *handle; /**< Handle of map */
  93. };
  94. struct vki_drm_map {
  95. unsigned long offset; /**< Requested physical address (0 for SAREA)*/
  96. unsigned long size; /**< Requested physical size (bytes) */
  97. enum vki_drm_map_type type; /**< Type of memory to map */
  98. enum vki_drm_map_flags flags; /**< Flags */
  99. void *handle; /**< User-space: "Handle" to pass to mmap() */
  100. /**< Kernel-space: kernel-virtual address */
  101. int mtrr; /**< MTRR slot used */
  102. /* Private data */
  103. };
  104. struct vki_drm_client {
  105. int idx; /**< Which client desired? */
  106. int auth; /**< Is client authenticated? */
  107. unsigned long pid; /**< Process ID */
  108. unsigned long uid; /**< User ID */
  109. unsigned long magic; /**< Magic */
  110. unsigned long iocs; /**< Ioctl count */
  111. };
  112. enum vki_drm_stat_type {
  113. _VKI_DRM_STAT_LOCK,
  114. _VKI_DRM_STAT_OPENS,
  115. _VKI_DRM_STAT_CLOSES,
  116. _VKI_DRM_STAT_IOCTLS,
  117. _VKI_DRM_STAT_LOCKS,
  118. _VKI_DRM_STAT_UNLOCKS,
  119. _VKI_DRM_STAT_VALUE, /**< Generic value */
  120. _VKI_DRM_STAT_BYTE, /**< Generic byte counter (1024bytes/K) */
  121. _VKI_DRM_STAT_COUNT, /**< Generic non-byte counter (1000/k) */
  122. _VKI_DRM_STAT_IRQ, /**< IRQ */
  123. _VKI_DRM_STAT_PRIMARY, /**< Primary DMA bytes */
  124. _VKI_DRM_STAT_SECONDARY, /**< Secondary DMA bytes */
  125. _VKI_DRM_STAT_DMA, /**< DMA */
  126. _VKI_DRM_STAT_SPECIAL, /**< Special DMA (e.g., priority or polled) */
  127. _VKI_DRM_STAT_MISSED /**< Missed DMA opportunity */
  128. /* Add to the *END* of the list */
  129. };
  130. struct vki_drm_stats {
  131. unsigned long count;
  132. struct {
  133. unsigned long value;
  134. enum vki_drm_stat_type type;
  135. } data[15];
  136. };
  137. enum vki_drm_lock_flags {
  138. _VKI_DRM_LOCK_READY = 0x01, /**< Wait until hardware is ready for DMA */
  139. _VKI_DRM_LOCK_QUIESCENT = 0x02, /**< Wait until hardware quiescent */
  140. _VKI_DRM_LOCK_FLUSH = 0x04, /**< Flush this context's DMA queue first */
  141. _VKI_DRM_LOCK_FLUSH_ALL = 0x08, /**< Flush all DMA queues first */
  142. /* These *HALT* flags aren't supported yet
  143. -- they will be used to support the
  144. full-screen DGA-like mode. */
  145. _VKI_DRM_HALT_ALL_QUEUES = 0x10, /**< Halt all current and future queues */
  146. _VKI_DRM_HALT_CUR_QUEUES = 0x20 /**< Halt all current queues */
  147. };
  148. struct vki_drm_lock {
  149. int context;
  150. enum vki_drm_lock_flags flags;
  151. };
  152. enum vki_drm_dma_flags {
  153. /* Flags for DMA buffer dispatch */
  154. _VKI_DRM_DMA_BLOCK = 0x01, /**<
  155. * Block until buffer dispatched.
  156. *
  157. * \note The buffer may not yet have
  158. * been processed by the hardware --
  159. * getting a hardware lock with the
  160. * hardware quiescent will ensure
  161. * that the buffer has been
  162. * processed.
  163. */
  164. _VKI_DRM_DMA_WHILE_LOCKED = 0x02, /**< Dispatch while lock held */
  165. _VKI_DRM_DMA_PRIORITY = 0x04, /**< High priority dispatch */
  166. /* Flags for DMA buffer request */
  167. _VKI_DRM_DMA_WAIT = 0x10, /**< Wait for free buffers */
  168. _VKI_DRM_DMA_SMALLER_OK = 0x20, /**< Smaller-than-requested buffers OK */
  169. _VKI_DRM_DMA_LARGER_OK = 0x40 /**< Larger-than-requested buffers OK */
  170. };
  171. struct vki_drm_buf_desc {
  172. int count; /**< Number of buffers of this size */
  173. int size; /**< Size in bytes */
  174. int low_mark; /**< Low water mark */
  175. int high_mark; /**< High water mark */
  176. enum {
  177. _VKI_DRM_PAGE_ALIGN = 0x01, /**< Align on page boundaries for DMA */
  178. _VKI_DRM_AGP_BUFFER = 0x02, /**< Buffer is in AGP space */
  179. _VKI_DRM_SG_BUFFER = 0x04, /**< Scatter/gather memory buffer */
  180. _VKI_DRM_FB_BUFFER = 0x08, /**< Buffer is in frame buffer */
  181. _VKI_DRM_PCI_BUFFER_RO = 0x10 /**< Map PCI DMA buffer read-only */
  182. } flags;
  183. unsigned long agp_start; /**<
  184. * Start address of where the AGP buffers are
  185. * in the AGP aperture
  186. */
  187. };
  188. struct vki_drm_buf_info {
  189. int count; /**< Entries in list */
  190. struct vki_drm_buf_desc __user *list;
  191. };
  192. struct vki_drm_buf_free {
  193. int count;
  194. int __user *list;
  195. };
  196. struct vki_drm_buf_pub {
  197. int idx; /**< Index into the master buffer list */
  198. int total; /**< Buffer size */
  199. int used; /**< Amount of buffer in use (for DMA) */
  200. void __user *address; /**< Address of buffer */
  201. };
  202. struct vki_drm_buf_map {
  203. int count; /**< Length of the buffer list */
  204. void __user *virtuaL; /**< Mmap'd area in user-virtual */
  205. struct vki_drm_buf_pub __user *list; /**< Buffer information */
  206. };
  207. struct vki_drm_dma {
  208. int context; /**< Context handle */
  209. int send_count; /**< Number of buffers to send */
  210. int __user *send_indices; /**< List of handles to buffers */
  211. int __user *send_sizes; /**< Lengths of data to send */
  212. enum vki_drm_dma_flags flags; /**< Flags */
  213. int request_count; /**< Number of buffers requested */
  214. int request_size; /**< Desired size for buffers */
  215. int __user *request_indices; /**< Buffer information */
  216. int __user *request_sizes;
  217. int granted_count; /**< Number of buffers granted */
  218. };
  219. enum vki_drm_ctx_flags {
  220. _VKI_DRM_CONTEXT_PRESERVED = 0x01,
  221. _VKI_DRM_CONTEXT_2DONLY = 0x02
  222. };
  223. struct vki_drm_ctx {
  224. vki_drm_context_t handle;
  225. enum vki_drm_ctx_flags flags;
  226. };
  227. struct vki_drm_ctx_res {
  228. int count;
  229. struct vki_drm_ctx __user *contexts;
  230. };
  231. struct vki_drm_draw {
  232. vki_drm_drawable_t handle;
  233. };
  234. typedef enum {
  235. VKI_DRM_DRAWABLE_CLIPRECTS,
  236. } vki_drm_drawable_info_type_t;
  237. struct vki_drm_update_draw {
  238. vki_drm_drawable_t handle;
  239. unsigned int type;
  240. unsigned int num;
  241. unsigned long long data;
  242. };
  243. struct vki_drm_auth {
  244. vki_drm_magic_t magic;
  245. };
  246. struct vki_drm_irq_busid {
  247. int irq; /**< IRQ number */
  248. int busnum; /**< bus number */
  249. int devnum; /**< device number */
  250. int funcnum; /**< function number */
  251. };
  252. enum vki_drm_vblank_seq_type {
  253. _VKI_DRM_VBLANK_ABSOLUTE = 0x0, /**< Wait for specific vblank sequence number */
  254. _VKI_DRM_VBLANK_RELATIVE = 0x1, /**< Wait for given number of vblanks */
  255. _VKI_DRM_VBLANK_HIGH_CRTC_MASK = 0x0000003e,
  256. _VKI_DRM_VBLANK_EVENT = 0x4000000, /**< Send event instead of blocking */
  257. _VKI_DRM_VBLANK_FLIP = 0x8000000, /**< Scheduled buffer swap should flip */
  258. _VKI_DRM_VBLANK_NEXTONMISS = 0x10000000, /**< If missed, wait for next vblank */
  259. _VKI_DRM_VBLANK_SECONDARY = 0x20000000, /**< Secondary display controller */
  260. _VKI_DRM_VBLANK_SIGNAL = 0x40000000 /**< Send signal instead of blocking, unsupported */
  261. };
  262. struct vki_drm_wait_vblank_request {
  263. enum vki_drm_vblank_seq_type type;
  264. unsigned int sequence;
  265. unsigned long signal;
  266. };
  267. struct vki_drm_wait_vblank_reply {
  268. enum vki_drm_vblank_seq_type type;
  269. unsigned int sequence;
  270. long tval_sec;
  271. long tval_usec;
  272. };
  273. union vki_drm_wait_vblank {
  274. struct vki_drm_wait_vblank_request request;
  275. struct vki_drm_wait_vblank_reply reply;
  276. };
  277. struct vki_drm_modeset_ctl {
  278. __vki_u32 crtc;
  279. __vki_u32 cmd;
  280. };
  281. struct vki_drm_agp_mode {
  282. unsigned long mode; /**< AGP mode */
  283. };
  284. struct vki_drm_agp_buffer {
  285. unsigned long size; /**< In bytes -- will round to page boundary */
  286. unsigned long handle; /**< Used for binding / unbinding */
  287. unsigned long type; /**< Type of memory to allocate */
  288. unsigned long physical; /**< Physical used by i810 */
  289. };
  290. struct vki_drm_agp_binding {
  291. unsigned long handle; /**< From drm_agp_buffer */
  292. unsigned long offset; /**< In bytes -- will round to page boundary */
  293. };
  294. struct vki_drm_agp_info {
  295. int agp_version_major;
  296. int agp_version_minor;
  297. unsigned long mode;
  298. unsigned long aperture_base; /* physical address */
  299. unsigned long aperture_size; /* bytes */
  300. unsigned long memory_allowed; /* bytes */
  301. unsigned long memory_used;
  302. unsigned short id_vendor;
  303. unsigned short id_device;
  304. };
  305. struct vki_drm_scatter_gather {
  306. unsigned long size; /**< In bytes -- will round to page boundary */
  307. unsigned long handle; /**< Used for mapping / unmapping */
  308. };
  309. struct vki_drm_set_version {
  310. int drm_di_major;
  311. int drm_di_minor;
  312. int drm_dd_major;
  313. int drm_dd_minor;
  314. };
  315. struct vki_drm_gem_close {
  316. __vki_u32 handle;
  317. __vki_u32 pad;
  318. };
  319. struct vki_drm_gem_flink {
  320. __vki_u32 handle;
  321. __vki_u32 name;
  322. };
  323. struct vki_drm_gem_open {
  324. __vki_u32 name;
  325. __vki_u32 handle;
  326. __vki_u64 size;
  327. };
  328. //----------------------------------------------------------------------
  329. // From include/drm/drm_mode.h
  330. //----------------------------------------------------------------------
  331. #define VKI_DRM_DISPLAY_MODE_LEN 32
  332. #define VKI_DRM_PROP_NAME_LEN 32
  333. struct vki_drm_mode_modeinfo {
  334. __vki_u32 clock;
  335. __vki_u16 hdisplay, hsync_start, hsync_end, htotal, hskew;
  336. __vki_u16 vdisplay, vsync_start, vsync_end, vtotal, vscan;
  337. __vki_u32 vrefresh; /* vertical refresh * 1000 */
  338. __vki_u32 flags;
  339. __vki_u32 type;
  340. char name[VKI_DRM_DISPLAY_MODE_LEN];
  341. };
  342. struct vki_drm_mode_card_res {
  343. __vki_u64 fb_id_ptr;
  344. __vki_u64 crtc_id_ptr;
  345. __vki_u64 connector_id_ptr;
  346. __vki_u64 encoder_id_ptr;
  347. __vki_u32 count_fbs;
  348. __vki_u32 count_crtcs;
  349. __vki_u32 count_connectors;
  350. __vki_u32 count_encoders;
  351. __vki_u32 min_width, max_width;
  352. __vki_u32 min_height, max_height;
  353. };
  354. struct vki_drm_mode_crtc {
  355. __vki_u64 set_connectors_ptr;
  356. __vki_u32 count_connectors;
  357. __vki_u32 crtc_id; /**< Id */
  358. __vki_u32 fb_id; /**< Id of framebuffer */
  359. __vki_u32 x, y; /**< Position on the frameuffer */
  360. __vki_u32 gamma_size;
  361. __vki_u32 mode_valid;
  362. struct vki_drm_mode_modeinfo mode;
  363. };
  364. struct vki_drm_mode_get_encoder {
  365. __vki_u32 encoder_id;
  366. __vki_u32 encoder_type;
  367. __vki_u32 crtc_id; /**< Id of crtc */
  368. __vki_u32 possible_crtcs;
  369. __vki_u32 possible_clones;
  370. };
  371. struct vki_drm_mode_get_property {
  372. __vki_u64 values_ptr; /* values and blob lengths */
  373. __vki_u64 enum_blob_ptr; /* enum and blob id ptrs */
  374. __vki_u32 prop_id;
  375. __vki_u32 flags;
  376. char name[VKI_DRM_PROP_NAME_LEN];
  377. __vki_u32 count_values;
  378. __vki_u32 count_enum_blobs;
  379. };
  380. struct vki_drm_mode_connector_set_property {
  381. __vki_u64 value;
  382. __vki_u32 prop_id;
  383. __vki_u32 connector_id;
  384. };
  385. struct vki_drm_mode_get_blob {
  386. __vki_u32 blob_id;
  387. __vki_u32 length;
  388. __vki_u64 data;
  389. };
  390. struct vki_drm_mode_fb_cmd {
  391. __vki_u32 fb_id;
  392. __vki_u32 width, height;
  393. __vki_u32 pitch;
  394. __vki_u32 bpp;
  395. __vki_u32 depth;
  396. /* driver specific handle */
  397. __vki_u32 handle;
  398. };
  399. struct vki_drm_mode_mode_cmd {
  400. __vki_u32 connector_id;
  401. struct vki_drm_mode_modeinfo mode;
  402. };
  403. struct vki_drm_mode_cursor {
  404. __vki_u32 flags;
  405. __vki_u32 crtc_id;
  406. __vki_s32 x;
  407. __vki_s32 y;
  408. __vki_u32 width;
  409. __vki_u32 height;
  410. /* driver specific handle */
  411. __vki_u32 handle;
  412. };
  413. struct vki_drm_mode_crtc_lut {
  414. __vki_u32 crtc_id;
  415. __vki_u32 gamma_size;
  416. /* pointers to arrays */
  417. __vki_u64 red;
  418. __vki_u64 green;
  419. __vki_u64 blue;
  420. };
  421. //----------------------------------------------------------------------
  422. // From include/drm/drm.h
  423. //----------------------------------------------------------------------
  424. #define VKI_DRM_IOCTL_BASE 'd'
  425. #define VKI_DRM_IO(nr) _VKI_IO(VKI_DRM_IOCTL_BASE,nr)
  426. #define VKI_DRM_IOR(nr,type) _VKI_IOR(VKI_DRM_IOCTL_BASE,nr,type)
  427. #define VKI_DRM_IOW(nr,type) _VKI_IOW(VKI_DRM_IOCTL_BASE,nr,type)
  428. #define VKI_DRM_IOWR(nr,type) _VKI_IOWR(VKI_DRM_IOCTL_BASE,nr,type)
  429. #define VKI_DRM_IOCTL_VERSION VKI_DRM_IOWR(0x00, struct vki_drm_version)
  430. #define VKI_DRM_IOCTL_GET_UNIQUE VKI_DRM_IOWR(0x01, struct vki_drm_unique)
  431. #define VKI_DRM_IOCTL_GET_MAGIC VKI_DRM_IOR( 0x02, struct vki_drm_auth)
  432. #define VKI_DRM_IOCTL_IRQ_BUSID VKI_DRM_IOWR(0x03, struct vki_drm_irq_busid)
  433. #define VKI_DRM_IOCTL_GET_MAP VKI_DRM_IOWR(0x04, struct vki_drm_map)
  434. #define VKI_DRM_IOCTL_GET_CLIENT VKI_DRM_IOWR(0x05, struct vki_drm_client)
  435. #define VKI_DRM_IOCTL_GET_STATS VKI_DRM_IOR( 0x06, struct vki_drm_stats)
  436. #define VKI_DRM_IOCTL_SET_VERSION VKI_DRM_IOWR(0x07, struct vki_drm_set_version)
  437. #define VKI_DRM_IOCTL_MODESET_CTL VKI_DRM_IOW(0x08, struct vki_drm_modeset_ctl)
  438. #define VKI_DRM_IOCTL_GEM_CLOSE VKI_DRM_IOW (0x09, struct vki_drm_gem_close)
  439. #define VKI_DRM_IOCTL_GEM_FLINK VKI_DRM_IOWR(0x0a, struct vki_drm_gem_flink)
  440. #define VKI_DRM_IOCTL_GEM_OPEN VKI_DRM_IOWR(0x0b, struct vki_drm_gem_open)
  441. #define VKI_DRM_IOCTL_SET_UNIQUE VKI_DRM_IOW( 0x10, struct vki_drm_unique)
  442. #define VKI_DRM_IOCTL_AUTH_MAGIC VKI_DRM_IOW( 0x11, struct vki_drm_auth)
  443. #define VKI_DRM_IOCTL_BLOCK VKI_DRM_IOWR(0x12, struct vki_drm_block)
  444. #define VKI_DRM_IOCTL_UNBLOCK VKI_DRM_IOWR(0x13, struct vki_drm_block)
  445. #define VKI_DRM_IOCTL_CONTROL VKI_DRM_IOW( 0x14, struct vki_drm_control)
  446. #define VKI_DRM_IOCTL_ADD_MAP VKI_DRM_IOWR(0x15, struct vki_drm_map)
  447. #define VKI_DRM_IOCTL_ADD_BUFS VKI_DRM_IOWR(0x16, struct vki_drm_buf_desc)
  448. #define VKI_DRM_IOCTL_MARK_BUFS VKI_DRM_IOW( 0x17, struct vki_drm_buf_desc)
  449. #define VKI_DRM_IOCTL_INFO_BUFS VKI_DRM_IOWR(0x18, struct vki_drm_buf_info)
  450. #define VKI_DRM_IOCTL_MAP_BUFS VKI_DRM_IOWR(0x19, struct vki_drm_buf_map)
  451. #define VKI_DRM_IOCTL_FREE_BUFS VKI_DRM_IOW( 0x1a, struct vki_drm_buf_free)
  452. #define VKI_DRM_IOCTL_RM_MAP VKI_DRM_IOW( 0x1b, struct vki_drm_map)
  453. #define VKI_DRM_IOCTL_SET_SAREA_CTX VKI_DRM_IOW( 0x1c, struct vki_drm_ctx_priv_map)
  454. #define VKI_DRM_IOCTL_GET_SAREA_CTX VKI_DRM_IOWR(0x1d, struct vki_drm_ctx_priv_map)
  455. #define VKI_DRM_IOCTL_SET_MASTER VKI_DRM_IO(0x1e)
  456. #define VKI_DRM_IOCTL_DROP_MASTER VKI_DRM_IO(0x1f)
  457. #define VKI_DRM_IOCTL_ADD_CTX VKI_DRM_IOWR(0x20, struct vki_drm_ctx)
  458. #define VKI_DRM_IOCTL_RM_CTX VKI_DRM_IOWR(0x21, struct vki_drm_ctx)
  459. #define VKI_DRM_IOCTL_MOD_CTX VKI_DRM_IOW( 0x22, struct vki_drm_ctx)
  460. #define VKI_DRM_IOCTL_GET_CTX VKI_DRM_IOWR(0x23, struct vki_drm_ctx)
  461. #define VKI_DRM_IOCTL_SWITCH_CTX VKI_DRM_IOW( 0x24, struct vki_drm_ctx)
  462. #define VKI_DRM_IOCTL_NEW_CTX VKI_DRM_IOW( 0x25, struct vki_drm_ctx)
  463. #define VKI_DRM_IOCTL_RES_CTX VKI_DRM_IOWR(0x26, struct vki_drm_ctx_res)
  464. #define VKI_DRM_IOCTL_ADD_DRAW VKI_DRM_IOWR(0x27, struct vki_drm_draw)
  465. #define VKI_DRM_IOCTL_RM_DRAW VKI_DRM_IOWR(0x28, struct vki_drm_draw)
  466. #define VKI_DRM_IOCTL_DMA VKI_DRM_IOWR(0x29, struct vki_drm_dma)
  467. #define VKI_DRM_IOCTL_LOCK VKI_DRM_IOW( 0x2a, struct vki_drm_lock)
  468. #define VKI_DRM_IOCTL_UNLOCK VKI_DRM_IOW( 0x2b, struct vki_drm_lock)
  469. #define VKI_DRM_IOCTL_FINISH VKI_DRM_IOW( 0x2c, struct vki_drm_lock)
  470. #define VKI_DRM_IOCTL_AGP_ACQUIRE VKI_DRM_IO( 0x30)
  471. #define VKI_DRM_IOCTL_AGP_RELEASE VKI_DRM_IO( 0x31)
  472. #define VKI_DRM_IOCTL_AGP_ENABLE VKI_DRM_IOW( 0x32, struct vki_drm_agp_mode)
  473. #define VKI_DRM_IOCTL_AGP_INFO VKI_DRM_IOR( 0x33, struct vki_drm_agp_info)
  474. #define VKI_DRM_IOCTL_AGP_ALLOC VKI_DRM_IOWR(0x34, struct vki_drm_agp_buffer)
  475. #define VKI_DRM_IOCTL_AGP_FREE VKI_DRM_IOW( 0x35, struct vki_drm_agp_buffer)
  476. #define VKI_DRM_IOCTL_AGP_BIND VKI_DRM_IOW( 0x36, struct vki_drm_agp_binding)
  477. #define VKI_DRM_IOCTL_AGP_UNBIND VKI_DRM_IOW( 0x37, struct vki_drm_agp_binding)
  478. #define VKI_DRM_IOCTL_SG_ALLOC VKI_DRM_IOWR(0x38, struct vki_drm_scatter_gather)
  479. #define VKI_DRM_IOCTL_SG_FREE VKI_DRM_IOW( 0x39, struct vki_drm_scatter_gather)
  480. #define VKI_DRM_IOCTL_WAIT_VBLANK VKI_DRM_IOWR(0x3a, union vki_drm_wait_vblank)
  481. #define VKI_DRM_IOCTL_UPDATE_DRAW VKI_DRM_IOW(0x3f, struct vki_drm_update_draw)
  482. #define VKI_DRM_IOCTL_MODE_GETRESOURCES VKI_DRM_IOWR(0xA0, struct vki_drm_mode_card_res)
  483. #define VKI_DRM_IOCTL_MODE_GETCRTC VKI_DRM_IOWR(0xA1, struct vki_drm_mode_crtc)
  484. #define VKI_DRM_IOCTL_MODE_SETCRTC VKI_DRM_IOWR(0xA2, struct vki_drm_mode_crtc)
  485. #define VKI_DRM_IOCTL_MODE_CURSOR VKI_DRM_IOWR(0xA3, struct vki_drm_mode_cursor)
  486. #define VKI_DRM_IOCTL_MODE_GETGAMMA VKI_DRM_IOWR(0xA4, struct vki_drm_mode_crtc_lut)
  487. #define VKI_DRM_IOCTL_MODE_SETGAMMA VKI_DRM_IOWR(0xA5, struct vki_drm_mode_crtc_lut)
  488. #define VKI_DRM_IOCTL_MODE_GETENCODER VKI_DRM_IOWR(0xA6, struct vki_drm_mode_get_encoder)
  489. #define VKI_DRM_IOCTL_MODE_GETCONNECTOR VKI_DRM_IOWR(0xA7, struct vki_drm_mode_get_connector)
  490. #define VKI_DRM_IOCTL_MODE_ATTACHMODE VKI_DRM_IOWR(0xA8, struct vki_drm_mode_mode_cmd)
  491. #define VKI_DRM_IOCTL_MODE_DETACHMODE VKI_DRM_IOWR(0xA9, struct vki_drm_mode_mode_cmd)
  492. #define VKI_DRM_IOCTL_MODE_GETPROPERTY VKI_DRM_IOWR(0xAA, struct vki_drm_mode_get_property)
  493. #define VKI_DRM_IOCTL_MODE_SETPROPERTY VKI_DRM_IOWR(0xAB, struct vki_drm_mode_connector_set_property)
  494. #define VKI_DRM_IOCTL_MODE_GETPROPBLOB VKI_DRM_IOWR(0xAC, struct vki_drm_mode_get_blob)
  495. #define VKI_DRM_IOCTL_MODE_GETFB VKI_DRM_IOWR(0xAD, struct vki_drm_mode_fb_cmd)
  496. #define VKI_DRM_IOCTL_MODE_ADDFB VKI_DRM_IOWR(0xAE, struct vki_drm_mode_fb_cmd)
  497. #define VKI_DRM_IOCTL_MODE_RMFB VKI_DRM_IOWR(0xAF, unsigned int)
  498. #define VKI_DRM_COMMAND_BASE 0x40
  499. #define VKI_DRM_COMMAND_END 0xA0
  500. //----------------------------------------------------------------------
  501. // From include/drm/i915_drm.h
  502. //----------------------------------------------------------------------
  503. typedef struct _vki_drm_i915_init {
  504. enum {
  505. VKI_I915_INIT_DMA = 0x01,
  506. VKI_I915_CLEANUP_DMA = 0x02,
  507. VKI_I915_RESUME_DMA = 0x03
  508. } func;
  509. unsigned int mmio_offset;
  510. int sarea_priv_offset;
  511. unsigned int ring_start;
  512. unsigned int ring_end;
  513. unsigned int ring_size;
  514. unsigned int front_offset;
  515. unsigned int back_offset;
  516. unsigned int depth_offset;
  517. unsigned int w;
  518. unsigned int h;
  519. unsigned int pitch;
  520. unsigned int pitch_bits;
  521. unsigned int back_pitch;
  522. unsigned int depth_pitch;
  523. unsigned int cpp;
  524. unsigned int chipset;
  525. } vki_drm_i915_init_t;
  526. #define VKI_DRM_I915_INIT 0x00
  527. #define VKI_DRM_I915_FLUSH 0x01
  528. #define VKI_DRM_I915_FLIP 0x02
  529. #define VKI_DRM_I915_BATCHBUFFER 0x03
  530. #define VKI_DRM_I915_IRQ_EMIT 0x04
  531. #define VKI_DRM_I915_IRQ_WAIT 0x05
  532. #define VKI_DRM_I915_GETPARAM 0x06
  533. #define VKI_DRM_I915_SETPARAM 0x07
  534. #define VKI_DRM_I915_ALLOC 0x08
  535. #define VKI_DRM_I915_FREE 0x09
  536. #define VKI_DRM_I915_INIT_HEAP 0x0a
  537. #define VKI_DRM_I915_CMDBUFFER 0x0b
  538. #define VKI_DRM_I915_DESTROY_HEAP 0x0c
  539. #define VKI_DRM_I915_SET_VBLANK_PIPE 0x0d
  540. #define VKI_DRM_I915_GET_VBLANK_PIPE 0x0e
  541. #define VKI_DRM_I915_VBLANK_SWAP 0x0f
  542. #define VKI_DRM_I915_HWS_ADDR 0x11
  543. #define VKI_DRM_I915_GEM_INIT 0x13
  544. #define VKI_DRM_I915_GEM_EXECBUFFER 0x14
  545. #define VKI_DRM_I915_GEM_PIN 0x15
  546. #define VKI_DRM_I915_GEM_UNPIN 0x16
  547. #define VKI_DRM_I915_GEM_BUSY 0x17
  548. #define VKI_DRM_I915_GEM_THROTTLE 0x18
  549. #define VKI_DRM_I915_GEM_ENTERVT 0x19
  550. #define VKI_DRM_I915_GEM_LEAVEVT 0x1a
  551. #define VKI_DRM_I915_GEM_CREATE 0x1b
  552. #define VKI_DRM_I915_GEM_PREAD 0x1c
  553. #define VKI_DRM_I915_GEM_PWRITE 0x1d
  554. #define VKI_DRM_I915_GEM_MMAP 0x1e
  555. #define VKI_DRM_I915_GEM_SET_DOMAIN 0x1f
  556. #define VKI_DRM_I915_GEM_SW_FINISH 0x20
  557. #define VKI_DRM_I915_GEM_SET_TILING 0x21
  558. #define VKI_DRM_I915_GEM_GET_TILING 0x22
  559. #define VKI_DRM_I915_GEM_GET_APERTURE 0x23
  560. #define VKI_DRM_I915_GEM_MMAP_GTT 0x24
  561. #define VKI_DRM_I915_GET_PIPE_FROM_CRTC_ID 0x25
  562. #define VKI_DRM_I915_GEM_MADVISE 0x26
  563. #define VKI_DRM_I915_OVERLAY_PUT_IMAGE 0x27
  564. #define VKI_DRM_I915_OVERLAY_ATTRS 0x28
  565. #define VKI_DRM_I915_GEM_EXECBUFFER2 0x29
  566. #define VKI_DRM_IOCTL_I915_INIT VKI_DRM_IOW( VKI_DRM_COMMAND_BASE + VKI_DRM_I915_INIT, vki_drm_i915_init_t)
  567. #define VKI_DRM_IOCTL_I915_FLUSH VKI_DRM_IO ( VKI_DRM_COMMAND_BASE + VKI_DRM_I915_FLUSH)
  568. #define VKI_DRM_IOCTL_I915_FLIP VKI_DRM_IO ( VKI_DRM_COMMAND_BASE + VKI_DRM_I915_FLIP)
  569. #define VKI_DRM_IOCTL_I915_BATCHBUFFER VKI_DRM_IOW( VKI_DRM_COMMAND_BASE + VKI_DRM_I915_BATCHBUFFER, vki_drm_i915_batchbuffer_t)
  570. #define VKI_DRM_IOCTL_I915_IRQ_EMIT VKI_DRM_IOWR(VKI_DRM_COMMAND_BASE + VKI_DRM_I915_IRQ_EMIT, vki_drm_i915_irq_emit_t)
  571. #define VKI_DRM_IOCTL_I915_IRQ_WAIT VKI_DRM_IOW( VKI_DRM_COMMAND_BASE + VKI_DRM_I915_IRQ_WAIT, vki_drm_i915_irq_wait_t)
  572. #define VKI_DRM_IOCTL_I915_GETPARAM VKI_DRM_IOWR(VKI_DRM_COMMAND_BASE + VKI_DRM_I915_GETPARAM, vki_drm_i915_getparam_t)
  573. #define VKI_DRM_IOCTL_I915_SETPARAM VKI_DRM_IOW( VKI_DRM_COMMAND_BASE + VKI_DRM_I915_SETPARAM, vki_drm_i915_setparam_t)
  574. #define VKI_DRM_IOCTL_I915_ALLOC VKI_DRM_IOWR(VKI_DRM_COMMAND_BASE + VKI_DRM_I915_ALLOC, vki_drm_i915_mem_alloc_t)
  575. #define VKI_DRM_IOCTL_I915_FREE VKI_DRM_IOW( VKI_DRM_COMMAND_BASE + VKI_DRM_I915_FREE, vki_drm_i915_mem_free_t)
  576. #define VKI_DRM_IOCTL_I915_INIT_HEAP VKI_DRM_IOW( VKI_DRM_COMMAND_BASE + VKI_DRM_I915_INIT_HEAP, vki_drm_i915_mem_init_heap_t)
  577. #define VKI_DRM_IOCTL_I915_CMDBUFFER VKI_DRM_IOW( VKI_DRM_COMMAND_BASE + VKI_DRM_I915_CMDBUFFER, vki_drm_i915_cmdbuffer_t)
  578. #define VKI_DRM_IOCTL_I915_DESTROY_HEAP VKI_DRM_IOW( VKI_DRM_COMMAND_BASE + VKI_DRM_I915_DESTROY_HEAP, vki_drm_i915_mem_destroy_heap_t)
  579. #define VKI_DRM_IOCTL_I915_SET_VBLANK_PIPE VKI_DRM_IOW( VKI_DRM_COMMAND_BASE + VKI_DRM_I915_SET_VBLANK_PIPE, vki_drm_i915_vblank_pipe_t)
  580. #define VKI_DRM_IOCTL_I915_GET_VBLANK_PIPE VKI_DRM_IOR( VKI_DRM_COMMAND_BASE + VKI_DRM_I915_GET_VBLANK_PIPE, vki_drm_i915_vblank_pipe_t)
  581. #define VKI_DRM_IOCTL_I915_VBLANK_SWAP VKI_DRM_IOWR(VKI_DRM_COMMAND_BASE + VKI_DRM_I915_VBLANK_SWAP, vki_drm_i915_vblank_swap_t)
  582. #define VKI_DRM_IOCTL_I915_GEM_INIT VKI_DRM_IOW(VKI_DRM_COMMAND_BASE + VKI_DRM_I915_GEM_INIT, struct vki_drm_i915_gem_init)
  583. #define VKI_DRM_IOCTL_I915_GEM_EXECBUFFER VKI_DRM_IOW(VKI_DRM_COMMAND_BASE + VKI_DRM_I915_GEM_EXECBUFFER, struct vki_drm_i915_gem_execbuffer)
  584. #define VKI_DRM_IOCTL_I915_GEM_PIN VKI_DRM_IOWR(VKI_DRM_COMMAND_BASE + VKI_DRM_I915_GEM_PIN, struct vki_drm_i915_gem_pin)
  585. #define VKI_DRM_IOCTL_I915_GEM_UNPIN VKI_DRM_IOW(VKI_DRM_COMMAND_BASE + VKI_DRM_I915_GEM_UNPIN, struct vki_drm_i915_gem_unpin)
  586. #define VKI_DRM_IOCTL_I915_GEM_BUSY VKI_DRM_IOWR(VKI_DRM_COMMAND_BASE + VKI_DRM_I915_GEM_BUSY, struct vki_drm_i915_gem_busy)
  587. #define VKI_DRM_IOCTL_I915_GEM_THROTTLE VKI_DRM_IO ( VKI_DRM_COMMAND_BASE + VKI_DRM_I915_GEM_THROTTLE)
  588. #define VKI_DRM_IOCTL_I915_GEM_ENTERVT VKI_DRM_IO(VKI_DRM_COMMAND_BASE + VKI_DRM_I915_GEM_ENTERVT)
  589. #define VKI_DRM_IOCTL_I915_GEM_LEAVEVT VKI_DRM_IO(VKI_DRM_COMMAND_BASE + VKI_DRM_I915_GEM_LEAVEVT)
  590. #define VKI_DRM_IOCTL_I915_GEM_CREATE VKI_DRM_IOWR(VKI_DRM_COMMAND_BASE + VKI_DRM_I915_GEM_CREATE, struct vki_drm_i915_gem_create)
  591. #define VKI_DRM_IOCTL_I915_GEM_PREAD VKI_DRM_IOW (VKI_DRM_COMMAND_BASE + VKI_DRM_I915_GEM_PREAD, struct vki_drm_i915_gem_pread)
  592. #define VKI_DRM_IOCTL_I915_GEM_PWRITE VKI_DRM_IOW (VKI_DRM_COMMAND_BASE + VKI_DRM_I915_GEM_PWRITE, struct vki_drm_i915_gem_pwrite)
  593. #define VKI_DRM_IOCTL_I915_GEM_MMAP VKI_DRM_IOWR(VKI_DRM_COMMAND_BASE + VKI_DRM_I915_GEM_MMAP, struct vki_drm_i915_gem_mmap)
  594. #define VKI_DRM_IOCTL_I915_GEM_MMAP_GTT VKI_DRM_IOWR(VKI_DRM_COMMAND_BASE + VKI_DRM_I915_GEM_MMAP_GTT, struct vki_drm_i915_gem_mmap_gtt)
  595. #define VKI_DRM_IOCTL_I915_GEM_SET_DOMAIN VKI_DRM_IOW (VKI_DRM_COMMAND_BASE + VKI_DRM_I915_GEM_SET_DOMAIN, struct vki_drm_i915_gem_set_domain)
  596. #define VKI_DRM_IOCTL_I915_GEM_SW_FINISH VKI_DRM_IOW (VKI_DRM_COMMAND_BASE + VKI_DRM_I915_GEM_SW_FINISH, struct vki_drm_i915_gem_sw_finish)
  597. #define VKI_DRM_IOCTL_I915_GEM_SET_TILING VKI_DRM_IOWR (VKI_DRM_COMMAND_BASE + VKI_DRM_I915_GEM_SET_TILING, struct vki_drm_i915_gem_set_tiling)
  598. #define VKI_DRM_IOCTL_I915_GEM_GET_TILING VKI_DRM_IOWR (VKI_DRM_COMMAND_BASE + VKI_DRM_I915_GEM_GET_TILING, struct vki_drm_i915_gem_get_tiling)
  599. #define VKI_DRM_IOCTL_I915_GEM_GET_APERTURE VKI_DRM_IOR (VKI_DRM_COMMAND_BASE + VKI_DRM_I915_GEM_GET_APERTURE, struct vki_drm_i915_gem_get_aperture)
  600. #define VKI_DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID VKI_DRM_IOWR(VKI_DRM_COMMAND_BASE + VKI_DRM_I915_GET_PIPE_FROM_CRTC_ID, struct vki_drm_intel_get_pipe_from_crtc_id)
  601. typedef struct vki_drm_i915_batchbuffer {
  602. int start; /* agp offset */
  603. int used; /* nr bytes in use */
  604. int DR1; /* hw flags for GFX_OP_DRAWRECT_INFO */
  605. int DR4; /* window origin for GFX_OP_DRAWRECT_INFO */
  606. int num_cliprects; /* mulitpass with multiple cliprects? */
  607. struct vki_drm_clip_rect __user *cliprects; /* pointer to userspace cliprects */
  608. } vki_drm_i915_batchbuffer_t;
  609. typedef struct _vki_drm_i915_cmdbuffer {
  610. char __user *buf; /* pointer to userspace command buffer */
  611. int sz; /* nr bytes in buf */
  612. int DR1; /* hw flags for GFX_OP_DRAWRECT_INFO */
  613. int DR4; /* window origin for GFX_OP_DRAWRECT_INFO */
  614. int num_cliprects; /* mulitpass with multiple cliprects? */
  615. struct vki_drm_clip_rect __user *cliprects; /* pointer to userspace cliprects */
  616. } vki_drm_i915_cmdbuffer_t;
  617. typedef struct vki_drm_i915_irq_emit {
  618. int __user *irq_seq;
  619. } vki_drm_i915_irq_emit_t;
  620. typedef struct vki_drm_i915_irq_wait {
  621. int irq_seq;
  622. } vki_drm_i915_irq_wait_t;
  623. typedef struct vki_drm_i915_getparam {
  624. int param;
  625. int __user *value;
  626. } vki_drm_i915_getparam_t;
  627. typedef struct vki_drm_i915_setparam {
  628. int param;
  629. int value;
  630. } vki_drm_i915_setparam_t;
  631. typedef struct vki_drm_i915_mem_alloc {
  632. int region;
  633. int alignment;
  634. int size;
  635. int __user *region_offset; /* offset from start of fb or agp */
  636. } vki_drm_i915_mem_alloc_t;
  637. typedef struct vki_drm_i915_mem_free {
  638. int region;
  639. int region_offset;
  640. } vki_drm_i915_mem_free_t;
  641. typedef struct vki_drm_i915_mem_init_heap {
  642. int region;
  643. int size;
  644. int start;
  645. } vki_drm_i915_mem_init_heap_t;
  646. typedef struct vki_drm_i915_mem_destroy_heap {
  647. int region;
  648. } vki_drm_i915_mem_destroy_heap_t;
  649. typedef struct vki_drm_i915_vblank_pipe {
  650. int pipe;
  651. } vki_drm_i915_vblank_pipe_t;
  652. typedef struct vki_drm_i915_vblank_swap {
  653. vki_drm_drawable_t drawable;
  654. enum vki_drm_vblank_seq_type seqtype;
  655. unsigned int sequence;
  656. } vki_drm_i915_vblank_swap_t;
  657. typedef struct vki_drm_i915_hws_addr {
  658. __vki_u64 addr;
  659. } vki_drm_i915_hws_addr_t;
  660. struct vki_drm_i915_gem_init {
  661. __vki_u64 gtt_start;
  662. __vki_u64 gtt_end;
  663. };
  664. struct vki_drm_i915_gem_create {
  665. __vki_u64 size;
  666. __vki_u32 handle;
  667. __vki_u32 pad;
  668. };
  669. struct vki_drm_i915_gem_pread {
  670. __vki_u32 handle;
  671. __vki_u32 pad;
  672. __vki_u64 offset;
  673. __vki_u64 size;
  674. __vki_u64 data_ptr;
  675. };
  676. struct vki_drm_i915_gem_pwrite {
  677. __vki_u32 handle;
  678. __vki_u32 pad;
  679. __vki_u64 offset;
  680. __vki_u64 size;
  681. __vki_u64 data_ptr;
  682. };
  683. struct vki_drm_i915_gem_mmap {
  684. __vki_u32 handle;
  685. __vki_u32 pad;
  686. __vki_u64 offset;
  687. __vki_u64 size;
  688. __vki_u64 addr_ptr;
  689. };
  690. struct vki_drm_i915_gem_mmap_gtt {
  691. __vki_u32 handle;
  692. __vki_u32 pad;
  693. __vki_u64 offset;
  694. };
  695. struct vki_drm_i915_gem_set_domain {
  696. __vki_u32 handle;
  697. __vki_u32 read_domains;
  698. __vki_u32 write_domain;
  699. };
  700. struct vki_drm_i915_gem_sw_finish {
  701. __vki_u32 handle;
  702. };
  703. struct vki_drm_i915_gem_relocation_entry {
  704. __vki_u32 target_handle;
  705. __vki_u32 delta;
  706. __vki_u64 offset;
  707. __vki_u64 presumed_offset;
  708. __vki_u32 read_domains;
  709. __vki_u32 write_domain;
  710. };
  711. struct vki_drm_i915_gem_exec_object {
  712. __vki_u32 handle;
  713. __vki_u32 relocation_count;
  714. __vki_u64 relocs_ptr;
  715. __vki_u64 alignment;
  716. __vki_u64 offset;
  717. };
  718. struct vki_drm_i915_gem_execbuffer {
  719. __vki_u64 buffers_ptr;
  720. __vki_u32 buffer_count;
  721. __vki_u32 batch_start_offset;
  722. __vki_u32 batch_len;
  723. __vki_u32 DR1;
  724. __vki_u32 DR4;
  725. __vki_u32 num_cliprects;
  726. __vki_u64 cliprects_ptr;
  727. };
  728. struct vki_drm_i915_gem_pin {
  729. __vki_u32 handle;
  730. __vki_u32 pad;
  731. __vki_u64 alignment;
  732. __vki_u64 offset;
  733. };
  734. struct vki_drm_i915_gem_unpin {
  735. __vki_u32 handle;
  736. __vki_u32 pad;
  737. };
  738. struct vki_drm_i915_gem_busy {
  739. __vki_u32 handle;
  740. __vki_u32 busy;
  741. };
  742. struct vki_drm_i915_gem_set_tiling {
  743. __vki_u32 handle;
  744. __vki_u32 tiling_mode;
  745. __vki_u32 stride;
  746. __vki_u32 swizzle_mode;
  747. };
  748. struct vki_drm_i915_gem_get_tiling {
  749. __vki_u32 handle;
  750. __vki_u32 tiling_mode;
  751. __vki_u32 swizzle_mode;
  752. };
  753. struct vki_drm_i915_gem_get_aperture {
  754. __vki_u64 aper_size;
  755. __vki_u64 aper_available_size;
  756. };
  757. struct vki_drm_i915_get_pipe_from_crtc_id {
  758. __vki_u32 crtc_id;
  759. __vki_u32 pipe;
  760. };
  761. #endif //__VKI_LINUX_DRM_H
  762. /*--------------------------------------------------------------------*/
  763. /*--- end ---*/
  764. /*--------------------------------------------------------------------*/