blob: 2b7e0febf2f685f70c1030b735fbd48e23068b9c [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 Ferris525ce912017-07-26 13:12:53 -070029#define DRM_VMW_HANDLE_CLOSE 2
Christopher Ferris38062f92014-07-09 15:33:25 -070030#define DRM_VMW_CURSOR_BYPASS 3
Ben Cheng655a7c02013-10-16 16:09:24 -070031#define DRM_VMW_CONTROL_STREAM 4
32#define DRM_VMW_CLAIM_STREAM 5
33#define DRM_VMW_UNREF_STREAM 6
Christopher Ferris38062f92014-07-09 15:33:25 -070034#define DRM_VMW_CREATE_CONTEXT 7
Ben Cheng655a7c02013-10-16 16:09:24 -070035#define DRM_VMW_UNREF_CONTEXT 8
36#define DRM_VMW_CREATE_SURFACE 9
37#define DRM_VMW_UNREF_SURFACE 10
Christopher Ferris38062f92014-07-09 15:33:25 -070038#define DRM_VMW_REF_SURFACE 11
Ben Cheng655a7c02013-10-16 16:09:24 -070039#define DRM_VMW_EXECBUF 12
40#define DRM_VMW_GET_3D_CAP 13
41#define DRM_VMW_FENCE_WAIT 14
Christopher Ferris38062f92014-07-09 15:33:25 -070042#define DRM_VMW_FENCE_SIGNALED 15
Ben Cheng655a7c02013-10-16 16:09:24 -070043#define DRM_VMW_FENCE_UNREF 16
44#define DRM_VMW_FENCE_EVENT 17
45#define DRM_VMW_PRESENT 18
Christopher Ferris38062f92014-07-09 15:33:25 -070046#define DRM_VMW_PRESENT_READBACK 19
Ben Cheng655a7c02013-10-16 16:09:24 -070047#define DRM_VMW_UPDATE_LAYOUT 20
Christopher Ferris38062f92014-07-09 15:33:25 -070048#define DRM_VMW_CREATE_SHADER 21
49#define DRM_VMW_UNREF_SHADER 22
Christopher Ferris38062f92014-07-09 15:33:25 -070050#define DRM_VMW_GB_SURFACE_CREATE 23
51#define DRM_VMW_GB_SURFACE_REF 24
52#define DRM_VMW_SYNCCPU 25
Christopher Ferris05d08e92016-02-04 13:16:38 -080053#define DRM_VMW_CREATE_EXTENDED_CONTEXT 26
Christopher Ferris05d08e92016-02-04 13:16:38 -080054#define DRM_VMW_PARAM_NUM_STREAMS 0
Ben Cheng655a7c02013-10-16 16:09:24 -070055#define DRM_VMW_PARAM_NUM_FREE_STREAMS 1
56#define DRM_VMW_PARAM_3D 2
Ben Cheng655a7c02013-10-16 16:09:24 -070057#define DRM_VMW_PARAM_HW_CAPS 3
Christopher Ferris05d08e92016-02-04 13:16:38 -080058#define DRM_VMW_PARAM_FIFO_CAPS 4
Ben Cheng655a7c02013-10-16 16:09:24 -070059#define DRM_VMW_PARAM_MAX_FB_SIZE 5
60#define DRM_VMW_PARAM_FIFO_HW_VERSION 6
Christopher Ferris38062f92014-07-09 15:33:25 -070061#define DRM_VMW_PARAM_MAX_SURF_MEMORY 7
Christopher Ferris05d08e92016-02-04 13:16:38 -080062#define DRM_VMW_PARAM_3D_CAPS_SIZE 8
Christopher Ferris38062f92014-07-09 15:33:25 -070063#define DRM_VMW_PARAM_MAX_MOB_MEMORY 9
64#define DRM_VMW_PARAM_MAX_MOB_SIZE 10
Christopher Ferris05d08e92016-02-04 13:16:38 -080065#define DRM_VMW_PARAM_SCREEN_TARGET 11
Christopher Ferris05d08e92016-02-04 13:16:38 -080066#define DRM_VMW_PARAM_DX 12
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070067enum drm_vmw_handle_type {
Tao Baod7db5942015-01-28 10:07:51 -080068 DRM_VMW_HANDLE_LEGACY = 0,
Tao Baod7db5942015-01-28 10:07:51 -080069 DRM_VMW_HANDLE_PRIME = 1
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070070};
Ben Cheng655a7c02013-10-16 16:09:24 -070071struct drm_vmw_getparam_arg {
Christopher Ferris106b3a82016-08-24 12:15:38 -070072 __u64 value;
73 __u32 param;
74 __u32 pad64;
Ben Cheng655a7c02013-10-16 16:09:24 -070075};
76struct drm_vmw_context_arg {
Christopher Ferris106b3a82016-08-24 12:15:38 -070077 __s32 cid;
78 __u32 pad64;
Ben Cheng655a7c02013-10-16 16:09:24 -070079};
80struct drm_vmw_surface_create_req {
Christopher Ferris106b3a82016-08-24 12:15:38 -070081 __u32 flags;
82 __u32 format;
83 __u32 mip_levels[DRM_VMW_MAX_SURFACE_FACES];
Christopher Ferris106b3a82016-08-24 12:15:38 -070084 __u64 size_addr;
85 __s32 shareable;
86 __s32 scanout;
Ben Cheng655a7c02013-10-16 16:09:24 -070087};
Christopher Ferris106b3a82016-08-24 12:15:38 -070088struct drm_vmw_surface_arg {
89 __s32 sid;
Tao Baod7db5942015-01-28 10:07:51 -080090 enum drm_vmw_handle_type handle_type;
Ben Cheng655a7c02013-10-16 16:09:24 -070091};
92struct drm_vmw_size {
Christopher Ferris106b3a82016-08-24 12:15:38 -070093 __u32 width;
94 __u32 height;
95 __u32 depth;
Christopher Ferris106b3a82016-08-24 12:15:38 -070096 __u32 pad64;
Ben Cheng655a7c02013-10-16 16:09:24 -070097};
98union drm_vmw_surface_create_arg {
Tao Baod7db5942015-01-28 10:07:51 -080099 struct drm_vmw_surface_arg rep;
100 struct drm_vmw_surface_create_req req;
Ben Cheng655a7c02013-10-16 16:09:24 -0700101};
102union drm_vmw_surface_reference_arg {
Tao Baod7db5942015-01-28 10:07:51 -0800103 struct drm_vmw_surface_create_req rep;
104 struct drm_vmw_surface_arg req;
Ben Cheng655a7c02013-10-16 16:09:24 -0700105};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800106#define DRM_VMW_EXECBUF_VERSION 2
Ben Cheng655a7c02013-10-16 16:09:24 -0700107struct drm_vmw_execbuf_arg {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700108 __u64 commands;
109 __u32 command_size;
110 __u32 throttle_us;
111 __u64 fence_rep;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700112 __u32 version;
113 __u32 flags;
114 __u32 context_handle;
115 __u32 pad64;
Ben Cheng655a7c02013-10-16 16:09:24 -0700116};
Ben Cheng655a7c02013-10-16 16:09:24 -0700117struct drm_vmw_fence_rep {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700118 __u32 handle;
119 __u32 mask;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700120 __u32 seqno;
121 __u32 passed_seqno;
122 __u32 pad64;
123 __s32 error;
Ben Cheng655a7c02013-10-16 16:09:24 -0700124};
Ben Cheng655a7c02013-10-16 16:09:24 -0700125struct drm_vmw_alloc_dmabuf_req {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700126 __u32 size;
127 __u32 pad64;
Ben Cheng655a7c02013-10-16 16:09:24 -0700128};
Ben Cheng655a7c02013-10-16 16:09:24 -0700129struct drm_vmw_dmabuf_rep {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700130 __u64 map_handle;
131 __u32 handle;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700132 __u32 cur_gmr_id;
133 __u32 cur_gmr_offset;
134 __u32 pad64;
Ben Cheng655a7c02013-10-16 16:09:24 -0700135};
136union drm_vmw_alloc_dmabuf_arg {
Tao Baod7db5942015-01-28 10:07:51 -0800137 struct drm_vmw_alloc_dmabuf_req req;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800138 struct drm_vmw_dmabuf_rep rep;
Ben Cheng655a7c02013-10-16 16:09:24 -0700139};
140struct drm_vmw_unref_dmabuf_arg {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700141 __u32 handle;
142 __u32 pad64;
Ben Cheng655a7c02013-10-16 16:09:24 -0700143};
144struct drm_vmw_rect {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700145 __s32 x;
146 __s32 y;
147 __u32 w;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700148 __u32 h;
Ben Cheng655a7c02013-10-16 16:09:24 -0700149};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800150struct drm_vmw_control_stream_arg {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700151 __u32 stream_id;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700152 __u32 enabled;
153 __u32 flags;
154 __u32 color_key;
155 __u32 handle;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700156 __u32 offset;
157 __s32 format;
158 __u32 size;
159 __u32 width;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700160 __u32 height;
161 __u32 pitch[3];
162 __u32 pad64;
Tao Baod7db5942015-01-28 10:07:51 -0800163 struct drm_vmw_rect src;
164 struct drm_vmw_rect dst;
Ben Cheng655a7c02013-10-16 16:09:24 -0700165};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800166#define DRM_VMW_CURSOR_BYPASS_ALL (1 << 0)
Ben Cheng655a7c02013-10-16 16:09:24 -0700167#define DRM_VMW_CURSOR_BYPASS_FLAGS (1)
168struct drm_vmw_cursor_bypass_arg {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700169 __u32 flags;
170 __u32 crtc_id;
171 __s32 xpos;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700172 __s32 ypos;
173 __s32 xhot;
174 __s32 yhot;
Ben Cheng655a7c02013-10-16 16:09:24 -0700175};
176struct drm_vmw_stream_arg {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700177 __u32 stream_id;
178 __u32 pad64;
Ben Cheng655a7c02013-10-16 16:09:24 -0700179};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700180struct drm_vmw_get_3d_cap_arg {
181 __u64 buffer;
182 __u32 max_size;
183 __u32 pad64;
Ben Cheng655a7c02013-10-16 16:09:24 -0700184};
Ben Cheng655a7c02013-10-16 16:09:24 -0700185#define DRM_VMW_FENCE_FLAG_EXEC (1 << 0)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800186#define DRM_VMW_FENCE_FLAG_QUERY (1 << 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700187#define DRM_VMW_WAIT_OPTION_UNREF (1 << 0)
188struct drm_vmw_fence_wait_arg {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700189 __u32 handle;
190 __s32 cookie_valid;
191 __u64 kernel_cookie;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700192 __u64 timeout_us;
193 __s32 lazy;
194 __s32 flags;
195 __s32 wait_options;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700196 __s32 pad64;
Ben Cheng655a7c02013-10-16 16:09:24 -0700197};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800198struct drm_vmw_fence_signaled_arg {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700199 __u32 handle;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700200 __u32 flags;
201 __s32 signaled;
202 __u32 passed_seqno;
203 __u32 signaled_flags;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700204 __u32 pad64;
Ben Cheng655a7c02013-10-16 16:09:24 -0700205};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800206struct drm_vmw_fence_arg {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700207 __u32 handle;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700208 __u32 pad64;
209};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800210#define DRM_VMW_EVENT_FENCE_SIGNALED 0x80000000
Ben Cheng655a7c02013-10-16 16:09:24 -0700211struct drm_vmw_event_fence {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700212 struct drm_event base;
213 __u64 user_data;
214 __u32 tv_sec;
215 __u32 tv_usec;
Ben Cheng655a7c02013-10-16 16:09:24 -0700216};
Ben Cheng655a7c02013-10-16 16:09:24 -0700217#define DRM_VMW_FE_FLAG_REQ_TIME (1 << 0)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800218struct drm_vmw_fence_event_arg {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700219 __u64 fence_rep;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700220 __u64 user_data;
221 __u32 handle;
222 __u32 flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700223};
224struct drm_vmw_present_arg {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700225 __u32 fb_id;
226 __u32 sid;
227 __s32 dest_x;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700228 __s32 dest_y;
229 __u64 clips_ptr;
230 __u32 num_clips;
231 __u32 pad64;
Ben Cheng655a7c02013-10-16 16:09:24 -0700232};
Ben Cheng655a7c02013-10-16 16:09:24 -0700233struct drm_vmw_present_readback_arg {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700234 __u32 fb_id;
235 __u32 num_clips;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700236 __u64 clips_ptr;
237 __u64 fence_rep;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800238};
Ben Cheng655a7c02013-10-16 16:09:24 -0700239struct drm_vmw_update_layout_arg {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700240 __u32 num_outputs;
241 __u32 pad64;
242 __u64 rects;
Christopher Ferris38062f92014-07-09 15:33:25 -0700243};
244enum drm_vmw_shader_type {
Tao Baod7db5942015-01-28 10:07:51 -0800245 drm_vmw_shader_type_vs = 0,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800246 drm_vmw_shader_type_ps,
Christopher Ferris38062f92014-07-09 15:33:25 -0700247};
248struct drm_vmw_shader_create_arg {
Tao Baod7db5942015-01-28 10:07:51 -0800249 enum drm_vmw_shader_type shader_type;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700250 __u32 size;
251 __u32 buffer_handle;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700252 __u32 shader_handle;
253 __u64 offset;
Christopher Ferris38062f92014-07-09 15:33:25 -0700254};
255struct drm_vmw_shader_arg {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700256 __u32 handle;
257 __u32 pad64;
Christopher Ferris38062f92014-07-09 15:33:25 -0700258};
259enum drm_vmw_surface_flags {
Tao Baod7db5942015-01-28 10:07:51 -0800260 drm_vmw_surface_flag_shareable = (1 << 0),
261 drm_vmw_surface_flag_scanout = (1 << 1),
Tao Baod7db5942015-01-28 10:07:51 -0800262 drm_vmw_surface_flag_create_buffer = (1 << 2)
Christopher Ferris38062f92014-07-09 15:33:25 -0700263};
264struct drm_vmw_gb_surface_create_req {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700265 __u32 svga3d_flags;
266 __u32 format;
267 __u32 mip_levels;
Tao Baod7db5942015-01-28 10:07:51 -0800268 enum drm_vmw_surface_flags drm_surface_flags;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700269 __u32 multisample_count;
270 __u32 autogen_filter;
271 __u32 buffer_handle;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700272 __u32 array_size;
Tao Baod7db5942015-01-28 10:07:51 -0800273 struct drm_vmw_size base_size;
Christopher Ferris38062f92014-07-09 15:33:25 -0700274};
275struct drm_vmw_gb_surface_create_rep {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700276 __u32 handle;
277 __u32 backup_size;
278 __u32 buffer_handle;
279 __u32 buffer_size;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700280 __u64 buffer_map_handle;
Christopher Ferris38062f92014-07-09 15:33:25 -0700281};
Christopher Ferris38062f92014-07-09 15:33:25 -0700282union drm_vmw_gb_surface_create_arg {
Tao Baod7db5942015-01-28 10:07:51 -0800283 struct drm_vmw_gb_surface_create_rep rep;
284 struct drm_vmw_gb_surface_create_req req;
Christopher Ferris38062f92014-07-09 15:33:25 -0700285};
Christopher Ferris38062f92014-07-09 15:33:25 -0700286struct drm_vmw_gb_surface_ref_rep {
Tao Baod7db5942015-01-28 10:07:51 -0800287 struct drm_vmw_gb_surface_create_req creq;
288 struct drm_vmw_gb_surface_create_rep crep;
Christopher Ferris38062f92014-07-09 15:33:25 -0700289};
Christopher Ferris38062f92014-07-09 15:33:25 -0700290union drm_vmw_gb_surface_reference_arg {
Tao Baod7db5942015-01-28 10:07:51 -0800291 struct drm_vmw_gb_surface_ref_rep rep;
292 struct drm_vmw_surface_arg req;
Christopher Ferris38062f92014-07-09 15:33:25 -0700293};
Christopher Ferris38062f92014-07-09 15:33:25 -0700294enum drm_vmw_synccpu_flags {
Tao Baod7db5942015-01-28 10:07:51 -0800295 drm_vmw_synccpu_read = (1 << 0),
296 drm_vmw_synccpu_write = (1 << 1),
297 drm_vmw_synccpu_dontblock = (1 << 2),
Tao Baod7db5942015-01-28 10:07:51 -0800298 drm_vmw_synccpu_allow_cs = (1 << 3)
Christopher Ferris38062f92014-07-09 15:33:25 -0700299};
300enum drm_vmw_synccpu_op {
Tao Baod7db5942015-01-28 10:07:51 -0800301 drm_vmw_synccpu_grab,
Tao Baod7db5942015-01-28 10:07:51 -0800302 drm_vmw_synccpu_release
Christopher Ferris38062f92014-07-09 15:33:25 -0700303};
304struct drm_vmw_synccpu_arg {
Tao Baod7db5942015-01-28 10:07:51 -0800305 enum drm_vmw_synccpu_op op;
Tao Baod7db5942015-01-28 10:07:51 -0800306 enum drm_vmw_synccpu_flags flags;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700307 __u32 handle;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700308 __u32 pad64;
309};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800310enum drm_vmw_extended_context {
311 drm_vmw_context_legacy,
312 drm_vmw_context_dx
313};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800314union drm_vmw_extended_context_arg {
315 enum drm_vmw_extended_context req;
316 struct drm_vmw_context_arg rep;
317};
Christopher Ferris525ce912017-07-26 13:12:53 -0700318struct drm_vmw_handle_close_arg {
319 __u32 handle;
320 __u32 pad64;
321};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700322#ifdef __cplusplus
323#endif
Christopher Ferris38062f92014-07-09 15:33:25 -0700324#endif