blob: a9e6952affd525c681be287c75fcc5bcafec9795 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef __VMWGFX_DRM_H__
20#define __VMWGFX_DRM_H__
Christopher Ferris106b3a82016-08-24 12:15:38 -070021#include "drm.h"
22#ifdef __cplusplus
Christopher Ferris106b3a82016-08-24 12:15:38 -070023#endif
24#define DRM_VMW_MAX_SURFACE_FACES 6
Christopher Ferris38062f92014-07-09 15:33:25 -070025#define DRM_VMW_MAX_MIP_LEVELS 24
Ben Cheng655a7c02013-10-16 16:09:24 -070026#define DRM_VMW_GET_PARAM 0
27#define DRM_VMW_ALLOC_DMABUF 1
28#define DRM_VMW_UNREF_DMABUF 2
Christopher Ferris38062f92014-07-09 15:33:25 -070029#define DRM_VMW_CURSOR_BYPASS 3
Ben Cheng655a7c02013-10-16 16:09:24 -070030#define DRM_VMW_CONTROL_STREAM 4
31#define DRM_VMW_CLAIM_STREAM 5
32#define DRM_VMW_UNREF_STREAM 6
Christopher Ferris38062f92014-07-09 15:33:25 -070033#define DRM_VMW_CREATE_CONTEXT 7
Ben Cheng655a7c02013-10-16 16:09:24 -070034#define DRM_VMW_UNREF_CONTEXT 8
35#define DRM_VMW_CREATE_SURFACE 9
36#define DRM_VMW_UNREF_SURFACE 10
Christopher Ferris38062f92014-07-09 15:33:25 -070037#define DRM_VMW_REF_SURFACE 11
Ben Cheng655a7c02013-10-16 16:09:24 -070038#define DRM_VMW_EXECBUF 12
39#define DRM_VMW_GET_3D_CAP 13
40#define DRM_VMW_FENCE_WAIT 14
Christopher Ferris38062f92014-07-09 15:33:25 -070041#define DRM_VMW_FENCE_SIGNALED 15
Ben Cheng655a7c02013-10-16 16:09:24 -070042#define DRM_VMW_FENCE_UNREF 16
43#define DRM_VMW_FENCE_EVENT 17
44#define DRM_VMW_PRESENT 18
Christopher Ferris38062f92014-07-09 15:33:25 -070045#define DRM_VMW_PRESENT_READBACK 19
Ben Cheng655a7c02013-10-16 16:09:24 -070046#define DRM_VMW_UPDATE_LAYOUT 20
Christopher Ferris38062f92014-07-09 15:33:25 -070047#define DRM_VMW_CREATE_SHADER 21
48#define DRM_VMW_UNREF_SHADER 22
Christopher Ferris38062f92014-07-09 15:33:25 -070049#define DRM_VMW_GB_SURFACE_CREATE 23
50#define DRM_VMW_GB_SURFACE_REF 24
51#define DRM_VMW_SYNCCPU 25
Christopher Ferris05d08e92016-02-04 13:16:38 -080052#define DRM_VMW_CREATE_EXTENDED_CONTEXT 26
Christopher Ferris05d08e92016-02-04 13:16:38 -080053#define DRM_VMW_PARAM_NUM_STREAMS 0
Ben Cheng655a7c02013-10-16 16:09:24 -070054#define DRM_VMW_PARAM_NUM_FREE_STREAMS 1
55#define DRM_VMW_PARAM_3D 2
Ben Cheng655a7c02013-10-16 16:09:24 -070056#define DRM_VMW_PARAM_HW_CAPS 3
Christopher Ferris05d08e92016-02-04 13:16:38 -080057#define DRM_VMW_PARAM_FIFO_CAPS 4
Ben Cheng655a7c02013-10-16 16:09:24 -070058#define DRM_VMW_PARAM_MAX_FB_SIZE 5
59#define DRM_VMW_PARAM_FIFO_HW_VERSION 6
Christopher Ferris38062f92014-07-09 15:33:25 -070060#define DRM_VMW_PARAM_MAX_SURF_MEMORY 7
Christopher Ferris05d08e92016-02-04 13:16:38 -080061#define DRM_VMW_PARAM_3D_CAPS_SIZE 8
Christopher Ferris38062f92014-07-09 15:33:25 -070062#define DRM_VMW_PARAM_MAX_MOB_MEMORY 9
63#define DRM_VMW_PARAM_MAX_MOB_SIZE 10
Christopher Ferris05d08e92016-02-04 13:16:38 -080064#define DRM_VMW_PARAM_SCREEN_TARGET 11
Christopher Ferris05d08e92016-02-04 13:16:38 -080065#define DRM_VMW_PARAM_DX 12
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070066enum drm_vmw_handle_type {
Tao Baod7db5942015-01-28 10:07:51 -080067 DRM_VMW_HANDLE_LEGACY = 0,
Tao Baod7db5942015-01-28 10:07:51 -080068 DRM_VMW_HANDLE_PRIME = 1
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070069};
Ben Cheng655a7c02013-10-16 16:09:24 -070070struct drm_vmw_getparam_arg {
Christopher Ferris106b3a82016-08-24 12:15:38 -070071 __u64 value;
72 __u32 param;
73 __u32 pad64;
Ben Cheng655a7c02013-10-16 16:09:24 -070074};
75struct drm_vmw_context_arg {
Christopher Ferris106b3a82016-08-24 12:15:38 -070076 __s32 cid;
77 __u32 pad64;
Ben Cheng655a7c02013-10-16 16:09:24 -070078};
79struct drm_vmw_surface_create_req {
Christopher Ferris106b3a82016-08-24 12:15:38 -070080 __u32 flags;
81 __u32 format;
82 __u32 mip_levels[DRM_VMW_MAX_SURFACE_FACES];
Christopher Ferris106b3a82016-08-24 12:15:38 -070083 __u64 size_addr;
84 __s32 shareable;
85 __s32 scanout;
Ben Cheng655a7c02013-10-16 16:09:24 -070086};
Christopher Ferris106b3a82016-08-24 12:15:38 -070087struct drm_vmw_surface_arg {
88 __s32 sid;
Tao Baod7db5942015-01-28 10:07:51 -080089 enum drm_vmw_handle_type handle_type;
Ben Cheng655a7c02013-10-16 16:09:24 -070090};
91struct drm_vmw_size {
Christopher Ferris106b3a82016-08-24 12:15:38 -070092 __u32 width;
93 __u32 height;
94 __u32 depth;
Christopher Ferris106b3a82016-08-24 12:15:38 -070095 __u32 pad64;
Ben Cheng655a7c02013-10-16 16:09:24 -070096};
97union drm_vmw_surface_create_arg {
Tao Baod7db5942015-01-28 10:07:51 -080098 struct drm_vmw_surface_arg rep;
99 struct drm_vmw_surface_create_req req;
Ben Cheng655a7c02013-10-16 16:09:24 -0700100};
101union drm_vmw_surface_reference_arg {
Tao Baod7db5942015-01-28 10:07:51 -0800102 struct drm_vmw_surface_create_req rep;
103 struct drm_vmw_surface_arg req;
Ben Cheng655a7c02013-10-16 16:09:24 -0700104};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800105#define DRM_VMW_EXECBUF_VERSION 2
Ben Cheng655a7c02013-10-16 16:09:24 -0700106struct drm_vmw_execbuf_arg {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700107 __u64 commands;
108 __u32 command_size;
109 __u32 throttle_us;
110 __u64 fence_rep;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700111 __u32 version;
112 __u32 flags;
113 __u32 context_handle;
114 __u32 pad64;
Ben Cheng655a7c02013-10-16 16:09:24 -0700115};
Ben Cheng655a7c02013-10-16 16:09:24 -0700116struct drm_vmw_fence_rep {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700117 __u32 handle;
118 __u32 mask;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700119 __u32 seqno;
120 __u32 passed_seqno;
121 __u32 pad64;
122 __s32 error;
Ben Cheng655a7c02013-10-16 16:09:24 -0700123};
Ben Cheng655a7c02013-10-16 16:09:24 -0700124struct drm_vmw_alloc_dmabuf_req {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700125 __u32 size;
126 __u32 pad64;
Ben Cheng655a7c02013-10-16 16:09:24 -0700127};
Ben Cheng655a7c02013-10-16 16:09:24 -0700128struct drm_vmw_dmabuf_rep {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700129 __u64 map_handle;
130 __u32 handle;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700131 __u32 cur_gmr_id;
132 __u32 cur_gmr_offset;
133 __u32 pad64;
Ben Cheng655a7c02013-10-16 16:09:24 -0700134};
135union drm_vmw_alloc_dmabuf_arg {
Tao Baod7db5942015-01-28 10:07:51 -0800136 struct drm_vmw_alloc_dmabuf_req req;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800137 struct drm_vmw_dmabuf_rep rep;
Ben Cheng655a7c02013-10-16 16:09:24 -0700138};
139struct drm_vmw_unref_dmabuf_arg {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700140 __u32 handle;
141 __u32 pad64;
Ben Cheng655a7c02013-10-16 16:09:24 -0700142};
143struct drm_vmw_rect {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700144 __s32 x;
145 __s32 y;
146 __u32 w;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700147 __u32 h;
Ben Cheng655a7c02013-10-16 16:09:24 -0700148};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800149struct drm_vmw_control_stream_arg {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700150 __u32 stream_id;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700151 __u32 enabled;
152 __u32 flags;
153 __u32 color_key;
154 __u32 handle;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700155 __u32 offset;
156 __s32 format;
157 __u32 size;
158 __u32 width;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700159 __u32 height;
160 __u32 pitch[3];
161 __u32 pad64;
Tao Baod7db5942015-01-28 10:07:51 -0800162 struct drm_vmw_rect src;
163 struct drm_vmw_rect dst;
Ben Cheng655a7c02013-10-16 16:09:24 -0700164};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800165#define DRM_VMW_CURSOR_BYPASS_ALL (1 << 0)
Ben Cheng655a7c02013-10-16 16:09:24 -0700166#define DRM_VMW_CURSOR_BYPASS_FLAGS (1)
167struct drm_vmw_cursor_bypass_arg {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700168 __u32 flags;
169 __u32 crtc_id;
170 __s32 xpos;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700171 __s32 ypos;
172 __s32 xhot;
173 __s32 yhot;
Ben Cheng655a7c02013-10-16 16:09:24 -0700174};
175struct drm_vmw_stream_arg {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700176 __u32 stream_id;
177 __u32 pad64;
Ben Cheng655a7c02013-10-16 16:09:24 -0700178};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700179struct drm_vmw_get_3d_cap_arg {
180 __u64 buffer;
181 __u32 max_size;
182 __u32 pad64;
Ben Cheng655a7c02013-10-16 16:09:24 -0700183};
Ben Cheng655a7c02013-10-16 16:09:24 -0700184#define DRM_VMW_FENCE_FLAG_EXEC (1 << 0)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800185#define DRM_VMW_FENCE_FLAG_QUERY (1 << 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700186#define DRM_VMW_WAIT_OPTION_UNREF (1 << 0)
187struct drm_vmw_fence_wait_arg {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700188 __u32 handle;
189 __s32 cookie_valid;
190 __u64 kernel_cookie;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700191 __u64 timeout_us;
192 __s32 lazy;
193 __s32 flags;
194 __s32 wait_options;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700195 __s32 pad64;
Ben Cheng655a7c02013-10-16 16:09:24 -0700196};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800197struct drm_vmw_fence_signaled_arg {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700198 __u32 handle;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700199 __u32 flags;
200 __s32 signaled;
201 __u32 passed_seqno;
202 __u32 signaled_flags;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700203 __u32 pad64;
Ben Cheng655a7c02013-10-16 16:09:24 -0700204};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800205struct drm_vmw_fence_arg {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700206 __u32 handle;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700207 __u32 pad64;
208};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800209#define DRM_VMW_EVENT_FENCE_SIGNALED 0x80000000
Ben Cheng655a7c02013-10-16 16:09:24 -0700210struct drm_vmw_event_fence {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700211 struct drm_event base;
212 __u64 user_data;
213 __u32 tv_sec;
214 __u32 tv_usec;
Ben Cheng655a7c02013-10-16 16:09:24 -0700215};
Ben Cheng655a7c02013-10-16 16:09:24 -0700216#define DRM_VMW_FE_FLAG_REQ_TIME (1 << 0)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800217struct drm_vmw_fence_event_arg {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700218 __u64 fence_rep;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700219 __u64 user_data;
220 __u32 handle;
221 __u32 flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700222};
223struct drm_vmw_present_arg {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700224 __u32 fb_id;
225 __u32 sid;
226 __s32 dest_x;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700227 __s32 dest_y;
228 __u64 clips_ptr;
229 __u32 num_clips;
230 __u32 pad64;
Ben Cheng655a7c02013-10-16 16:09:24 -0700231};
Ben Cheng655a7c02013-10-16 16:09:24 -0700232struct drm_vmw_present_readback_arg {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700233 __u32 fb_id;
234 __u32 num_clips;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700235 __u64 clips_ptr;
236 __u64 fence_rep;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800237};
Ben Cheng655a7c02013-10-16 16:09:24 -0700238struct drm_vmw_update_layout_arg {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700239 __u32 num_outputs;
240 __u32 pad64;
241 __u64 rects;
Christopher Ferris38062f92014-07-09 15:33:25 -0700242};
243enum drm_vmw_shader_type {
Tao Baod7db5942015-01-28 10:07:51 -0800244 drm_vmw_shader_type_vs = 0,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800245 drm_vmw_shader_type_ps,
Christopher Ferris38062f92014-07-09 15:33:25 -0700246};
247struct drm_vmw_shader_create_arg {
Tao Baod7db5942015-01-28 10:07:51 -0800248 enum drm_vmw_shader_type shader_type;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700249 __u32 size;
250 __u32 buffer_handle;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700251 __u32 shader_handle;
252 __u64 offset;
Christopher Ferris38062f92014-07-09 15:33:25 -0700253};
254struct drm_vmw_shader_arg {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700255 __u32 handle;
256 __u32 pad64;
Christopher Ferris38062f92014-07-09 15:33:25 -0700257};
258enum drm_vmw_surface_flags {
Tao Baod7db5942015-01-28 10:07:51 -0800259 drm_vmw_surface_flag_shareable = (1 << 0),
260 drm_vmw_surface_flag_scanout = (1 << 1),
Tao Baod7db5942015-01-28 10:07:51 -0800261 drm_vmw_surface_flag_create_buffer = (1 << 2)
Christopher Ferris38062f92014-07-09 15:33:25 -0700262};
263struct drm_vmw_gb_surface_create_req {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700264 __u32 svga3d_flags;
265 __u32 format;
266 __u32 mip_levels;
Tao Baod7db5942015-01-28 10:07:51 -0800267 enum drm_vmw_surface_flags drm_surface_flags;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700268 __u32 multisample_count;
269 __u32 autogen_filter;
270 __u32 buffer_handle;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700271 __u32 array_size;
Tao Baod7db5942015-01-28 10:07:51 -0800272 struct drm_vmw_size base_size;
Christopher Ferris38062f92014-07-09 15:33:25 -0700273};
274struct drm_vmw_gb_surface_create_rep {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700275 __u32 handle;
276 __u32 backup_size;
277 __u32 buffer_handle;
278 __u32 buffer_size;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700279 __u64 buffer_map_handle;
Christopher Ferris38062f92014-07-09 15:33:25 -0700280};
Christopher Ferris38062f92014-07-09 15:33:25 -0700281union drm_vmw_gb_surface_create_arg {
Tao Baod7db5942015-01-28 10:07:51 -0800282 struct drm_vmw_gb_surface_create_rep rep;
283 struct drm_vmw_gb_surface_create_req req;
Christopher Ferris38062f92014-07-09 15:33:25 -0700284};
Christopher Ferris38062f92014-07-09 15:33:25 -0700285struct drm_vmw_gb_surface_ref_rep {
Tao Baod7db5942015-01-28 10:07:51 -0800286 struct drm_vmw_gb_surface_create_req creq;
287 struct drm_vmw_gb_surface_create_rep crep;
Christopher Ferris38062f92014-07-09 15:33:25 -0700288};
Christopher Ferris38062f92014-07-09 15:33:25 -0700289union drm_vmw_gb_surface_reference_arg {
Tao Baod7db5942015-01-28 10:07:51 -0800290 struct drm_vmw_gb_surface_ref_rep rep;
291 struct drm_vmw_surface_arg req;
Christopher Ferris38062f92014-07-09 15:33:25 -0700292};
Christopher Ferris38062f92014-07-09 15:33:25 -0700293enum drm_vmw_synccpu_flags {
Tao Baod7db5942015-01-28 10:07:51 -0800294 drm_vmw_synccpu_read = (1 << 0),
295 drm_vmw_synccpu_write = (1 << 1),
296 drm_vmw_synccpu_dontblock = (1 << 2),
Tao Baod7db5942015-01-28 10:07:51 -0800297 drm_vmw_synccpu_allow_cs = (1 << 3)
Christopher Ferris38062f92014-07-09 15:33:25 -0700298};
299enum drm_vmw_synccpu_op {
Tao Baod7db5942015-01-28 10:07:51 -0800300 drm_vmw_synccpu_grab,
Tao Baod7db5942015-01-28 10:07:51 -0800301 drm_vmw_synccpu_release
Christopher Ferris38062f92014-07-09 15:33:25 -0700302};
303struct drm_vmw_synccpu_arg {
Tao Baod7db5942015-01-28 10:07:51 -0800304 enum drm_vmw_synccpu_op op;
Tao Baod7db5942015-01-28 10:07:51 -0800305 enum drm_vmw_synccpu_flags flags;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700306 __u32 handle;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700307 __u32 pad64;
308};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800309enum drm_vmw_extended_context {
310 drm_vmw_context_legacy,
311 drm_vmw_context_dx
312};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800313union drm_vmw_extended_context_arg {
314 enum drm_vmw_extended_context req;
315 struct drm_vmw_context_arg rep;
316};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700317#ifdef __cplusplus
318#endif
Christopher Ferris38062f92014-07-09 15:33:25 -0700319#endif