1 /****************************************************************************
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 _UAPI_I915_DRM_H_
20 #define _UAPI_I915_DRM_H_
21 #include "drm.h"
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 #define I915_L3_PARITY_UEVENT "L3_PARITY_ERROR"
26 #define I915_ERROR_UEVENT "ERROR"
27 #define I915_RESET_UEVENT "RESET"
28 struct i915_user_extension {
29   __u64 next_extension;
30   __u32 name;
31   __u32 flags;
32   __u32 rsvd[4];
33 };
34 enum i915_mocs_table_index {
35   I915_MOCS_UNCACHED,
36   I915_MOCS_PTE,
37   I915_MOCS_CACHED,
38 };
39 enum drm_i915_gem_engine_class {
40   I915_ENGINE_CLASS_RENDER = 0,
41   I915_ENGINE_CLASS_COPY = 1,
42   I915_ENGINE_CLASS_VIDEO = 2,
43   I915_ENGINE_CLASS_VIDEO_ENHANCE = 3,
44   I915_ENGINE_CLASS_INVALID = - 1
45 };
46 struct i915_engine_class_instance {
47   __u16 engine_class;
48   __u16 engine_instance;
49 #define I915_ENGINE_CLASS_INVALID_NONE - 1
50 #define I915_ENGINE_CLASS_INVALID_VIRTUAL - 2
51 };
52 enum drm_i915_pmu_engine_sample {
53   I915_SAMPLE_BUSY = 0,
54   I915_SAMPLE_WAIT = 1,
55   I915_SAMPLE_SEMA = 2
56 };
57 #define I915_PMU_SAMPLE_BITS (4)
58 #define I915_PMU_SAMPLE_MASK (0xf)
59 #define I915_PMU_SAMPLE_INSTANCE_BITS (8)
60 #define I915_PMU_CLASS_SHIFT (I915_PMU_SAMPLE_BITS + I915_PMU_SAMPLE_INSTANCE_BITS)
61 #define __I915_PMU_ENGINE(class,instance,sample) ((class) << I915_PMU_CLASS_SHIFT | (instance) << I915_PMU_SAMPLE_BITS | (sample))
62 #define I915_PMU_ENGINE_BUSY(class,instance) __I915_PMU_ENGINE(class, instance, I915_SAMPLE_BUSY)
63 #define I915_PMU_ENGINE_WAIT(class,instance) __I915_PMU_ENGINE(class, instance, I915_SAMPLE_WAIT)
64 #define I915_PMU_ENGINE_SEMA(class,instance) __I915_PMU_ENGINE(class, instance, I915_SAMPLE_SEMA)
65 #define __I915_PMU_OTHER(x) (__I915_PMU_ENGINE(0xff, 0xff, 0xf) + 1 + (x))
66 #define I915_PMU_ACTUAL_FREQUENCY __I915_PMU_OTHER(0)
67 #define I915_PMU_REQUESTED_FREQUENCY __I915_PMU_OTHER(1)
68 #define I915_PMU_INTERRUPTS __I915_PMU_OTHER(2)
69 #define I915_PMU_RC6_RESIDENCY __I915_PMU_OTHER(3)
70 #define I915_PMU_SOFTWARE_GT_AWAKE_TIME __I915_PMU_OTHER(4)
71 #define I915_PMU_LAST I915_PMU_RC6_RESIDENCY
72 #define I915_NR_TEX_REGIONS 255
73 #define I915_LOG_MIN_TEX_REGION_SIZE 14
74 typedef struct _drm_i915_init {
75   enum {
76     I915_INIT_DMA = 0x01,
77     I915_CLEANUP_DMA = 0x02,
78     I915_RESUME_DMA = 0x03
79   } func;
80   unsigned int mmio_offset;
81   int sarea_priv_offset;
82   unsigned int ring_start;
83   unsigned int ring_end;
84   unsigned int ring_size;
85   unsigned int front_offset;
86   unsigned int back_offset;
87   unsigned int depth_offset;
88   unsigned int w;
89   unsigned int h;
90   unsigned int pitch;
91   unsigned int pitch_bits;
92   unsigned int back_pitch;
93   unsigned int depth_pitch;
94   unsigned int cpp;
95   unsigned int chipset;
96 } drm_i915_init_t;
97 typedef struct _drm_i915_sarea {
98   struct drm_tex_region texList[I915_NR_TEX_REGIONS + 1];
99   int last_upload;
100   int last_enqueue;
101   int last_dispatch;
102   int ctxOwner;
103   int texAge;
104   int pf_enabled;
105   int pf_active;
106   int pf_current_page;
107   int perf_boxes;
108   int width, height;
109   drm_handle_t front_handle;
110   int front_offset;
111   int front_size;
112   drm_handle_t back_handle;
113   int back_offset;
114   int back_size;
115   drm_handle_t depth_handle;
116   int depth_offset;
117   int depth_size;
118   drm_handle_t tex_handle;
119   int tex_offset;
120   int tex_size;
121   int log_tex_granularity;
122   int pitch;
123   int rotation;
124   int rotated_offset;
125   int rotated_size;
126   int rotated_pitch;
127   int virtualX, virtualY;
128   unsigned int front_tiled;
129   unsigned int back_tiled;
130   unsigned int depth_tiled;
131   unsigned int rotated_tiled;
132   unsigned int rotated2_tiled;
133   int pipeA_x;
134   int pipeA_y;
135   int pipeA_w;
136   int pipeA_h;
137   int pipeB_x;
138   int pipeB_y;
139   int pipeB_w;
140   int pipeB_h;
141   drm_handle_t unused_handle;
142   __u32 unused1, unused2, unused3;
143   __u32 front_bo_handle;
144   __u32 back_bo_handle;
145   __u32 unused_bo_handle;
146   __u32 depth_bo_handle;
147 } drm_i915_sarea_t;
148 #define planeA_x pipeA_x
149 #define planeA_y pipeA_y
150 #define planeA_w pipeA_w
151 #define planeA_h pipeA_h
152 #define planeB_x pipeB_x
153 #define planeB_y pipeB_y
154 #define planeB_w pipeB_w
155 #define planeB_h pipeB_h
156 #define I915_BOX_RING_EMPTY 0x1
157 #define I915_BOX_FLIP 0x2
158 #define I915_BOX_WAIT 0x4
159 #define I915_BOX_TEXTURE_LOAD 0x8
160 #define I915_BOX_LOST_CONTEXT 0x10
161 #define DRM_I915_INIT 0x00
162 #define DRM_I915_FLUSH 0x01
163 #define DRM_I915_FLIP 0x02
164 #define DRM_I915_BATCHBUFFER 0x03
165 #define DRM_I915_IRQ_EMIT 0x04
166 #define DRM_I915_IRQ_WAIT 0x05
167 #define DRM_I915_GETPARAM 0x06
168 #define DRM_I915_SETPARAM 0x07
169 #define DRM_I915_ALLOC 0x08
170 #define DRM_I915_FREE 0x09
171 #define DRM_I915_INIT_HEAP 0x0a
172 #define DRM_I915_CMDBUFFER 0x0b
173 #define DRM_I915_DESTROY_HEAP 0x0c
174 #define DRM_I915_SET_VBLANK_PIPE 0x0d
175 #define DRM_I915_GET_VBLANK_PIPE 0x0e
176 #define DRM_I915_VBLANK_SWAP 0x0f
177 #define DRM_I915_HWS_ADDR 0x11
178 #define DRM_I915_GEM_INIT 0x13
179 #define DRM_I915_GEM_EXECBUFFER 0x14
180 #define DRM_I915_GEM_PIN 0x15
181 #define DRM_I915_GEM_UNPIN 0x16
182 #define DRM_I915_GEM_BUSY 0x17
183 #define DRM_I915_GEM_THROTTLE 0x18
184 #define DRM_I915_GEM_ENTERVT 0x19
185 #define DRM_I915_GEM_LEAVEVT 0x1a
186 #define DRM_I915_GEM_CREATE 0x1b
187 #define DRM_I915_GEM_PREAD 0x1c
188 #define DRM_I915_GEM_PWRITE 0x1d
189 #define DRM_I915_GEM_MMAP 0x1e
190 #define DRM_I915_GEM_SET_DOMAIN 0x1f
191 #define DRM_I915_GEM_SW_FINISH 0x20
192 #define DRM_I915_GEM_SET_TILING 0x21
193 #define DRM_I915_GEM_GET_TILING 0x22
194 #define DRM_I915_GEM_GET_APERTURE 0x23
195 #define DRM_I915_GEM_MMAP_GTT 0x24
196 #define DRM_I915_GET_PIPE_FROM_CRTC_ID 0x25
197 #define DRM_I915_GEM_MADVISE 0x26
198 #define DRM_I915_OVERLAY_PUT_IMAGE 0x27
199 #define DRM_I915_OVERLAY_ATTRS 0x28
200 #define DRM_I915_GEM_EXECBUFFER2 0x29
201 #define DRM_I915_GEM_EXECBUFFER2_WR DRM_I915_GEM_EXECBUFFER2
202 #define DRM_I915_GET_SPRITE_COLORKEY 0x2a
203 #define DRM_I915_SET_SPRITE_COLORKEY 0x2b
204 #define DRM_I915_GEM_WAIT 0x2c
205 #define DRM_I915_GEM_CONTEXT_CREATE 0x2d
206 #define DRM_I915_GEM_CONTEXT_DESTROY 0x2e
207 #define DRM_I915_GEM_SET_CACHING 0x2f
208 #define DRM_I915_GEM_GET_CACHING 0x30
209 #define DRM_I915_REG_READ 0x31
210 #define DRM_I915_GET_RESET_STATS 0x32
211 #define DRM_I915_GEM_USERPTR 0x33
212 #define DRM_I915_GEM_CONTEXT_GETPARAM 0x34
213 #define DRM_I915_GEM_CONTEXT_SETPARAM 0x35
214 #define DRM_I915_PERF_OPEN 0x36
215 #define DRM_I915_PERF_ADD_CONFIG 0x37
216 #define DRM_I915_PERF_REMOVE_CONFIG 0x38
217 #define DRM_I915_QUERY 0x39
218 #define DRM_I915_GEM_VM_CREATE 0x3a
219 #define DRM_I915_GEM_VM_DESTROY 0x3b
220 #define DRM_IOCTL_I915_INIT DRM_IOW(DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t)
221 #define DRM_IOCTL_I915_FLUSH DRM_IO(DRM_COMMAND_BASE + DRM_I915_FLUSH)
222 #define DRM_IOCTL_I915_FLIP DRM_IO(DRM_COMMAND_BASE + DRM_I915_FLIP)
223 #define DRM_IOCTL_I915_BATCHBUFFER DRM_IOW(DRM_COMMAND_BASE + DRM_I915_BATCHBUFFER, drm_i915_batchbuffer_t)
224 #define DRM_IOCTL_I915_IRQ_EMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_IRQ_EMIT, drm_i915_irq_emit_t)
225 #define DRM_IOCTL_I915_IRQ_WAIT DRM_IOW(DRM_COMMAND_BASE + DRM_I915_IRQ_WAIT, drm_i915_irq_wait_t)
226 #define DRM_IOCTL_I915_GETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GETPARAM, drm_i915_getparam_t)
227 #define DRM_IOCTL_I915_SETPARAM DRM_IOW(DRM_COMMAND_BASE + DRM_I915_SETPARAM, drm_i915_setparam_t)
228 #define DRM_IOCTL_I915_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_ALLOC, drm_i915_mem_alloc_t)
229 #define DRM_IOCTL_I915_FREE DRM_IOW(DRM_COMMAND_BASE + DRM_I915_FREE, drm_i915_mem_free_t)
230 #define DRM_IOCTL_I915_INIT_HEAP DRM_IOW(DRM_COMMAND_BASE + DRM_I915_INIT_HEAP, drm_i915_mem_init_heap_t)
231 #define DRM_IOCTL_I915_CMDBUFFER DRM_IOW(DRM_COMMAND_BASE + DRM_I915_CMDBUFFER, drm_i915_cmdbuffer_t)
232 #define DRM_IOCTL_I915_DESTROY_HEAP DRM_IOW(DRM_COMMAND_BASE + DRM_I915_DESTROY_HEAP, drm_i915_mem_destroy_heap_t)
233 #define DRM_IOCTL_I915_SET_VBLANK_PIPE DRM_IOW(DRM_COMMAND_BASE + DRM_I915_SET_VBLANK_PIPE, drm_i915_vblank_pipe_t)
234 #define DRM_IOCTL_I915_GET_VBLANK_PIPE DRM_IOR(DRM_COMMAND_BASE + DRM_I915_GET_VBLANK_PIPE, drm_i915_vblank_pipe_t)
235 #define DRM_IOCTL_I915_VBLANK_SWAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_VBLANK_SWAP, drm_i915_vblank_swap_t)
236 #define DRM_IOCTL_I915_HWS_ADDR DRM_IOW(DRM_COMMAND_BASE + DRM_I915_HWS_ADDR, struct drm_i915_gem_init)
237 #define DRM_IOCTL_I915_GEM_INIT DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_INIT, struct drm_i915_gem_init)
238 #define DRM_IOCTL_I915_GEM_EXECBUFFER DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER, struct drm_i915_gem_execbuffer)
239 #define DRM_IOCTL_I915_GEM_EXECBUFFER2 DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER2, struct drm_i915_gem_execbuffer2)
240 #define DRM_IOCTL_I915_GEM_EXECBUFFER2_WR DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER2_WR, struct drm_i915_gem_execbuffer2)
241 #define DRM_IOCTL_I915_GEM_PIN DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_PIN, struct drm_i915_gem_pin)
242 #define DRM_IOCTL_I915_GEM_UNPIN DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_UNPIN, struct drm_i915_gem_unpin)
243 #define DRM_IOCTL_I915_GEM_BUSY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_BUSY, struct drm_i915_gem_busy)
244 #define DRM_IOCTL_I915_GEM_SET_CACHING DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_SET_CACHING, struct drm_i915_gem_caching)
245 #define DRM_IOCTL_I915_GEM_GET_CACHING DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_GET_CACHING, struct drm_i915_gem_caching)
246 #define DRM_IOCTL_I915_GEM_THROTTLE DRM_IO(DRM_COMMAND_BASE + DRM_I915_GEM_THROTTLE)
247 #define DRM_IOCTL_I915_GEM_ENTERVT DRM_IO(DRM_COMMAND_BASE + DRM_I915_GEM_ENTERVT)
248 #define DRM_IOCTL_I915_GEM_LEAVEVT DRM_IO(DRM_COMMAND_BASE + DRM_I915_GEM_LEAVEVT)
249 #define DRM_IOCTL_I915_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_CREATE, struct drm_i915_gem_create)
250 #define DRM_IOCTL_I915_GEM_PREAD DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_PREAD, struct drm_i915_gem_pread)
251 #define DRM_IOCTL_I915_GEM_PWRITE DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_PWRITE, struct drm_i915_gem_pwrite)
252 #define DRM_IOCTL_I915_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MMAP, struct drm_i915_gem_mmap)
253 #define DRM_IOCTL_I915_GEM_MMAP_GTT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MMAP_GTT, struct drm_i915_gem_mmap_gtt)
254 #define DRM_IOCTL_I915_GEM_MMAP_OFFSET DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MMAP_GTT, struct drm_i915_gem_mmap_offset)
255 #define DRM_IOCTL_I915_GEM_SET_DOMAIN DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_SET_DOMAIN, struct drm_i915_gem_set_domain)
256 #define DRM_IOCTL_I915_GEM_SW_FINISH DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_SW_FINISH, struct drm_i915_gem_sw_finish)
257 #define DRM_IOCTL_I915_GEM_SET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_SET_TILING, struct drm_i915_gem_set_tiling)
258 #define DRM_IOCTL_I915_GEM_GET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_GET_TILING, struct drm_i915_gem_get_tiling)
259 #define DRM_IOCTL_I915_GEM_GET_APERTURE DRM_IOR(DRM_COMMAND_BASE + DRM_I915_GEM_GET_APERTURE, struct drm_i915_gem_get_aperture)
260 #define DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GET_PIPE_FROM_CRTC_ID, struct drm_i915_get_pipe_from_crtc_id)
261 #define DRM_IOCTL_I915_GEM_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MADVISE, struct drm_i915_gem_madvise)
262 #define DRM_IOCTL_I915_OVERLAY_PUT_IMAGE DRM_IOW(DRM_COMMAND_BASE + DRM_I915_OVERLAY_PUT_IMAGE, struct drm_intel_overlay_put_image)
263 #define DRM_IOCTL_I915_OVERLAY_ATTRS DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_OVERLAY_ATTRS, struct drm_intel_overlay_attrs)
264 #define DRM_IOCTL_I915_SET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_SET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey)
265 #define DRM_IOCTL_I915_GET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey)
266 #define DRM_IOCTL_I915_GEM_WAIT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_WAIT, struct drm_i915_gem_wait)
267 #define DRM_IOCTL_I915_GEM_CONTEXT_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_CREATE, struct drm_i915_gem_context_create)
268 #define DRM_IOCTL_I915_GEM_CONTEXT_CREATE_EXT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_CREATE, struct drm_i915_gem_context_create_ext)
269 #define DRM_IOCTL_I915_GEM_CONTEXT_DESTROY DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_DESTROY, struct drm_i915_gem_context_destroy)
270 #define DRM_IOCTL_I915_REG_READ DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_REG_READ, struct drm_i915_reg_read)
271 #define DRM_IOCTL_I915_GET_RESET_STATS DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GET_RESET_STATS, struct drm_i915_reset_stats)
272 #define DRM_IOCTL_I915_GEM_USERPTR DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_USERPTR, struct drm_i915_gem_userptr)
273 #define DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_GETPARAM, struct drm_i915_gem_context_param)
274 #define DRM_IOCTL_I915_GEM_CONTEXT_SETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_SETPARAM, struct drm_i915_gem_context_param)
275 #define DRM_IOCTL_I915_PERF_OPEN DRM_IOW(DRM_COMMAND_BASE + DRM_I915_PERF_OPEN, struct drm_i915_perf_open_param)
276 #define DRM_IOCTL_I915_PERF_ADD_CONFIG DRM_IOW(DRM_COMMAND_BASE + DRM_I915_PERF_ADD_CONFIG, struct drm_i915_perf_oa_config)
277 #define DRM_IOCTL_I915_PERF_REMOVE_CONFIG DRM_IOW(DRM_COMMAND_BASE + DRM_I915_PERF_REMOVE_CONFIG, __u64)
278 #define DRM_IOCTL_I915_QUERY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_QUERY, struct drm_i915_query)
279 #define DRM_IOCTL_I915_GEM_VM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_VM_CREATE, struct drm_i915_gem_vm_control)
280 #define DRM_IOCTL_I915_GEM_VM_DESTROY DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_VM_DESTROY, struct drm_i915_gem_vm_control)
281 typedef struct drm_i915_batchbuffer {
282   int start;
283   int used;
284   int DR1;
285   int DR4;
286   int num_cliprects;
287   struct drm_clip_rect __user * cliprects;
288 } drm_i915_batchbuffer_t;
289 typedef struct _drm_i915_cmdbuffer {
290   char __user * buf;
291   int sz;
292   int DR1;
293   int DR4;
294   int num_cliprects;
295   struct drm_clip_rect __user * cliprects;
296 } drm_i915_cmdbuffer_t;
297 typedef struct drm_i915_irq_emit {
298   int __user * irq_seq;
299 } drm_i915_irq_emit_t;
300 typedef struct drm_i915_irq_wait {
301   int irq_seq;
302 } drm_i915_irq_wait_t;
303 #define I915_GEM_PPGTT_NONE 0
304 #define I915_GEM_PPGTT_ALIASING 1
305 #define I915_GEM_PPGTT_FULL 2
306 #define I915_PARAM_IRQ_ACTIVE 1
307 #define I915_PARAM_ALLOW_BATCHBUFFER 2
308 #define I915_PARAM_LAST_DISPATCH 3
309 #define I915_PARAM_CHIPSET_ID 4
310 #define I915_PARAM_HAS_GEM 5
311 #define I915_PARAM_NUM_FENCES_AVAIL 6
312 #define I915_PARAM_HAS_OVERLAY 7
313 #define I915_PARAM_HAS_PAGEFLIPPING 8
314 #define I915_PARAM_HAS_EXECBUF2 9
315 #define I915_PARAM_HAS_BSD 10
316 #define I915_PARAM_HAS_BLT 11
317 #define I915_PARAM_HAS_RELAXED_FENCING 12
318 #define I915_PARAM_HAS_COHERENT_RINGS 13
319 #define I915_PARAM_HAS_EXEC_CONSTANTS 14
320 #define I915_PARAM_HAS_RELAXED_DELTA 15
321 #define I915_PARAM_HAS_GEN7_SOL_RESET 16
322 #define I915_PARAM_HAS_LLC 17
323 #define I915_PARAM_HAS_ALIASING_PPGTT 18
324 #define I915_PARAM_HAS_WAIT_TIMEOUT 19
325 #define I915_PARAM_HAS_SEMAPHORES 20
326 #define I915_PARAM_HAS_PRIME_VMAP_FLUSH 21
327 #define I915_PARAM_HAS_VEBOX 22
328 #define I915_PARAM_HAS_SECURE_BATCHES 23
329 #define I915_PARAM_HAS_PINNED_BATCHES 24
330 #define I915_PARAM_HAS_EXEC_NO_RELOC 25
331 #define I915_PARAM_HAS_EXEC_HANDLE_LUT 26
332 #define I915_PARAM_HAS_WT 27
333 #define I915_PARAM_CMD_PARSER_VERSION 28
334 #define I915_PARAM_HAS_COHERENT_PHYS_GTT 29
335 #define I915_PARAM_MMAP_VERSION 30
336 #define I915_PARAM_HAS_BSD2 31
337 #define I915_PARAM_REVISION 32
338 #define I915_PARAM_SUBSLICE_TOTAL 33
339 #define I915_PARAM_EU_TOTAL 34
340 #define I915_PARAM_HAS_GPU_RESET 35
341 #define I915_PARAM_HAS_RESOURCE_STREAMER 36
342 #define I915_PARAM_HAS_EXEC_SOFTPIN 37
343 #define I915_PARAM_HAS_POOLED_EU 38
344 #define I915_PARAM_MIN_EU_IN_POOL 39
345 #define I915_PARAM_MMAP_GTT_VERSION 40
346 #define I915_PARAM_HAS_SCHEDULER 41
347 #define I915_SCHEDULER_CAP_ENABLED (1ul << 0)
348 #define I915_SCHEDULER_CAP_PRIORITY (1ul << 1)
349 #define I915_SCHEDULER_CAP_PREEMPTION (1ul << 2)
350 #define I915_SCHEDULER_CAP_SEMAPHORES (1ul << 3)
351 #define I915_SCHEDULER_CAP_ENGINE_BUSY_STATS (1ul << 4)
352 #define I915_PARAM_HUC_STATUS 42
353 #define I915_PARAM_HAS_EXEC_ASYNC 43
354 #define I915_PARAM_HAS_EXEC_FENCE 44
355 #define I915_PARAM_HAS_EXEC_CAPTURE 45
356 #define I915_PARAM_SLICE_MASK 46
357 #define I915_PARAM_SUBSLICE_MASK 47
358 #define I915_PARAM_HAS_EXEC_BATCH_FIRST 48
359 #define I915_PARAM_HAS_EXEC_FENCE_ARRAY 49
360 #define I915_PARAM_HAS_CONTEXT_ISOLATION 50
361 #define I915_PARAM_CS_TIMESTAMP_FREQUENCY 51
362 #define I915_PARAM_MMAP_GTT_COHERENT 52
363 #define I915_PARAM_HAS_EXEC_SUBMIT_FENCE 53
364 #define I915_PARAM_PERF_REVISION 54
365 #define I915_PARAM_HAS_EXEC_TIMELINE_FENCES 55
366 typedef struct drm_i915_getparam {
367   __s32 param;
368   int __user * value;
369 } drm_i915_getparam_t;
370 #define I915_SETPARAM_USE_MI_BATCHBUFFER_START 1
371 #define I915_SETPARAM_TEX_LRU_LOG_GRANULARITY 2
372 #define I915_SETPARAM_ALLOW_BATCHBUFFER 3
373 #define I915_SETPARAM_NUM_USED_FENCES 4
374 typedef struct drm_i915_setparam {
375   int param;
376   int value;
377 } drm_i915_setparam_t;
378 #define I915_MEM_REGION_AGP 1
379 typedef struct drm_i915_mem_alloc {
380   int region;
381   int alignment;
382   int size;
383   int __user * region_offset;
384 } drm_i915_mem_alloc_t;
385 typedef struct drm_i915_mem_free {
386   int region;
387   int region_offset;
388 } drm_i915_mem_free_t;
389 typedef struct drm_i915_mem_init_heap {
390   int region;
391   int size;
392   int start;
393 } drm_i915_mem_init_heap_t;
394 typedef struct drm_i915_mem_destroy_heap {
395   int region;
396 } drm_i915_mem_destroy_heap_t;
397 #define DRM_I915_VBLANK_PIPE_A 1
398 #define DRM_I915_VBLANK_PIPE_B 2
399 typedef struct drm_i915_vblank_pipe {
400   int pipe;
401 } drm_i915_vblank_pipe_t;
402 typedef struct drm_i915_vblank_swap {
403   drm_drawable_t drawable;
404   enum drm_vblank_seq_type seqtype;
405   unsigned int sequence;
406 } drm_i915_vblank_swap_t;
407 typedef struct drm_i915_hws_addr {
408   __u64 addr;
409 } drm_i915_hws_addr_t;
410 struct drm_i915_gem_init {
411   __u64 gtt_start;
412   __u64 gtt_end;
413 };
414 struct drm_i915_gem_create {
415   __u64 size;
416   __u32 handle;
417   __u32 pad;
418 };
419 struct drm_i915_gem_pread {
420   __u32 handle;
421   __u32 pad;
422   __u64 offset;
423   __u64 size;
424   __u64 data_ptr;
425 };
426 struct drm_i915_gem_pwrite {
427   __u32 handle;
428   __u32 pad;
429   __u64 offset;
430   __u64 size;
431   __u64 data_ptr;
432 };
433 struct drm_i915_gem_mmap {
434   __u32 handle;
435   __u32 pad;
436   __u64 offset;
437   __u64 size;
438   __u64 addr_ptr;
439   __u64 flags;
440 #define I915_MMAP_WC 0x1
441 };
442 struct drm_i915_gem_mmap_gtt {
443   __u32 handle;
444   __u32 pad;
445   __u64 offset;
446 };
447 struct drm_i915_gem_mmap_offset {
448   __u32 handle;
449   __u32 pad;
450   __u64 offset;
451   __u64 flags;
452 #define I915_MMAP_OFFSET_GTT 0
453 #define I915_MMAP_OFFSET_WC 1
454 #define I915_MMAP_OFFSET_WB 2
455 #define I915_MMAP_OFFSET_UC 3
456   __u64 extensions;
457 };
458 struct drm_i915_gem_set_domain {
459   __u32 handle;
460   __u32 read_domains;
461   __u32 write_domain;
462 };
463 struct drm_i915_gem_sw_finish {
464   __u32 handle;
465 };
466 struct drm_i915_gem_relocation_entry {
467   __u32 target_handle;
468   __u32 delta;
469   __u64 offset;
470   __u64 presumed_offset;
471   __u32 read_domains;
472   __u32 write_domain;
473 };
474 #define I915_GEM_DOMAIN_CPU 0x00000001
475 #define I915_GEM_DOMAIN_RENDER 0x00000002
476 #define I915_GEM_DOMAIN_SAMPLER 0x00000004
477 #define I915_GEM_DOMAIN_COMMAND 0x00000008
478 #define I915_GEM_DOMAIN_INSTRUCTION 0x00000010
479 #define I915_GEM_DOMAIN_VERTEX 0x00000020
480 #define I915_GEM_DOMAIN_GTT 0x00000040
481 #define I915_GEM_DOMAIN_WC 0x00000080
482 struct drm_i915_gem_exec_object {
483   __u32 handle;
484   __u32 relocation_count;
485   __u64 relocs_ptr;
486   __u64 alignment;
487   __u64 offset;
488 };
489 struct drm_i915_gem_execbuffer {
490   __u64 buffers_ptr;
491   __u32 buffer_count;
492   __u32 batch_start_offset;
493   __u32 batch_len;
494   __u32 DR1;
495   __u32 DR4;
496   __u32 num_cliprects;
497   __u64 cliprects_ptr;
498 };
499 struct drm_i915_gem_exec_object2 {
500   __u32 handle;
501   __u32 relocation_count;
502   __u64 relocs_ptr;
503   __u64 alignment;
504   __u64 offset;
505 #define EXEC_OBJECT_NEEDS_FENCE (1 << 0)
506 #define EXEC_OBJECT_NEEDS_GTT (1 << 1)
507 #define EXEC_OBJECT_WRITE (1 << 2)
508 #define EXEC_OBJECT_SUPPORTS_48B_ADDRESS (1 << 3)
509 #define EXEC_OBJECT_PINNED (1 << 4)
510 #define EXEC_OBJECT_PAD_TO_SIZE (1 << 5)
511 #define EXEC_OBJECT_ASYNC (1 << 6)
512 #define EXEC_OBJECT_CAPTURE (1 << 7)
513 #define __EXEC_OBJECT_UNKNOWN_FLAGS - (EXEC_OBJECT_CAPTURE << 1)
514   __u64 flags;
515   union {
516     __u64 rsvd1;
517     __u64 pad_to_size;
518   };
519   __u64 rsvd2;
520 };
521 struct drm_i915_gem_exec_fence {
522   __u32 handle;
523 #define I915_EXEC_FENCE_WAIT (1 << 0)
524 #define I915_EXEC_FENCE_SIGNAL (1 << 1)
525 #define __I915_EXEC_FENCE_UNKNOWN_FLAGS (- (I915_EXEC_FENCE_SIGNAL << 1))
526   __u32 flags;
527 };
528 #define DRM_I915_GEM_EXECBUFFER_EXT_TIMELINE_FENCES 0
529 struct drm_i915_gem_execbuffer_ext_timeline_fences {
530   struct i915_user_extension base;
531   __u64 fence_count;
532   __u64 handles_ptr;
533   __u64 values_ptr;
534 };
535 struct drm_i915_gem_execbuffer2 {
536   __u64 buffers_ptr;
537   __u32 buffer_count;
538   __u32 batch_start_offset;
539   __u32 batch_len;
540   __u32 DR1;
541   __u32 DR4;
542   __u32 num_cliprects;
543   __u64 cliprects_ptr;
544 #define I915_EXEC_RING_MASK (0x3f)
545 #define I915_EXEC_DEFAULT (0 << 0)
546 #define I915_EXEC_RENDER (1 << 0)
547 #define I915_EXEC_BSD (2 << 0)
548 #define I915_EXEC_BLT (3 << 0)
549 #define I915_EXEC_VEBOX (4 << 0)
550 #define I915_EXEC_CONSTANTS_MASK (3 << 6)
551 #define I915_EXEC_CONSTANTS_REL_GENERAL (0 << 6)
552 #define I915_EXEC_CONSTANTS_ABSOLUTE (1 << 6)
553 #define I915_EXEC_CONSTANTS_REL_SURFACE (2 << 6)
554   __u64 flags;
555   __u64 rsvd1;
556   __u64 rsvd2;
557 };
558 #define I915_EXEC_GEN7_SOL_RESET (1 << 8)
559 #define I915_EXEC_SECURE (1 << 9)
560 #define I915_EXEC_IS_PINNED (1 << 10)
561 #define I915_EXEC_NO_RELOC (1 << 11)
562 #define I915_EXEC_HANDLE_LUT (1 << 12)
563 #define I915_EXEC_BSD_SHIFT (13)
564 #define I915_EXEC_BSD_MASK (3 << I915_EXEC_BSD_SHIFT)
565 #define I915_EXEC_BSD_DEFAULT (0 << I915_EXEC_BSD_SHIFT)
566 #define I915_EXEC_BSD_RING1 (1 << I915_EXEC_BSD_SHIFT)
567 #define I915_EXEC_BSD_RING2 (2 << I915_EXEC_BSD_SHIFT)
568 #define I915_EXEC_RESOURCE_STREAMER (1 << 15)
569 #define I915_EXEC_FENCE_IN (1 << 16)
570 #define I915_EXEC_FENCE_OUT (1 << 17)
571 #define I915_EXEC_BATCH_FIRST (1 << 18)
572 #define I915_EXEC_FENCE_ARRAY (1 << 19)
573 #define I915_EXEC_FENCE_SUBMIT (1 << 20)
574 #define I915_EXEC_USE_EXTENSIONS (1 << 21)
575 #define __I915_EXEC_UNKNOWN_FLAGS (- (I915_EXEC_USE_EXTENSIONS << 1))
576 #define I915_EXEC_CONTEXT_ID_MASK (0xffffffff)
577 #define i915_execbuffer2_set_context_id(eb2,context) (eb2).rsvd1 = context & I915_EXEC_CONTEXT_ID_MASK
578 #define i915_execbuffer2_get_context_id(eb2) ((eb2).rsvd1 & I915_EXEC_CONTEXT_ID_MASK)
579 struct drm_i915_gem_pin {
580   __u32 handle;
581   __u32 pad;
582   __u64 alignment;
583   __u64 offset;
584 };
585 struct drm_i915_gem_unpin {
586   __u32 handle;
587   __u32 pad;
588 };
589 struct drm_i915_gem_busy {
590   __u32 handle;
591   __u32 busy;
592 };
593 #define I915_CACHING_NONE 0
594 #define I915_CACHING_CACHED 1
595 #define I915_CACHING_DISPLAY 2
596 struct drm_i915_gem_caching {
597   __u32 handle;
598   __u32 caching;
599 };
600 #define I915_TILING_NONE 0
601 #define I915_TILING_X 1
602 #define I915_TILING_Y 2
603 #define I915_TILING_LAST I915_TILING_Y
604 #define I915_BIT_6_SWIZZLE_NONE 0
605 #define I915_BIT_6_SWIZZLE_9 1
606 #define I915_BIT_6_SWIZZLE_9_10 2
607 #define I915_BIT_6_SWIZZLE_9_11 3
608 #define I915_BIT_6_SWIZZLE_9_10_11 4
609 #define I915_BIT_6_SWIZZLE_UNKNOWN 5
610 #define I915_BIT_6_SWIZZLE_9_17 6
611 #define I915_BIT_6_SWIZZLE_9_10_17 7
612 struct drm_i915_gem_set_tiling {
613   __u32 handle;
614   __u32 tiling_mode;
615   __u32 stride;
616   __u32 swizzle_mode;
617 };
618 struct drm_i915_gem_get_tiling {
619   __u32 handle;
620   __u32 tiling_mode;
621   __u32 swizzle_mode;
622   __u32 phys_swizzle_mode;
623 };
624 struct drm_i915_gem_get_aperture {
625   __u64 aper_size;
626   __u64 aper_available_size;
627 };
628 struct drm_i915_get_pipe_from_crtc_id {
629   __u32 crtc_id;
630   __u32 pipe;
631 };
632 #define I915_MADV_WILLNEED 0
633 #define I915_MADV_DONTNEED 1
634 #define __I915_MADV_PURGED 2
635 struct drm_i915_gem_madvise {
636   __u32 handle;
637   __u32 madv;
638   __u32 retained;
639 };
640 #define I915_OVERLAY_TYPE_MASK 0xff
641 #define I915_OVERLAY_YUV_PLANAR 0x01
642 #define I915_OVERLAY_YUV_PACKED 0x02
643 #define I915_OVERLAY_RGB 0x03
644 #define I915_OVERLAY_DEPTH_MASK 0xff00
645 #define I915_OVERLAY_RGB24 0x1000
646 #define I915_OVERLAY_RGB16 0x2000
647 #define I915_OVERLAY_RGB15 0x3000
648 #define I915_OVERLAY_YUV422 0x0100
649 #define I915_OVERLAY_YUV411 0x0200
650 #define I915_OVERLAY_YUV420 0x0300
651 #define I915_OVERLAY_YUV410 0x0400
652 #define I915_OVERLAY_SWAP_MASK 0xff0000
653 #define I915_OVERLAY_NO_SWAP 0x000000
654 #define I915_OVERLAY_UV_SWAP 0x010000
655 #define I915_OVERLAY_Y_SWAP 0x020000
656 #define I915_OVERLAY_Y_AND_UV_SWAP 0x030000
657 #define I915_OVERLAY_FLAGS_MASK 0xff000000
658 #define I915_OVERLAY_ENABLE 0x01000000
659 struct drm_intel_overlay_put_image {
660   __u32 flags;
661   __u32 bo_handle;
662   __u16 stride_Y;
663   __u16 stride_UV;
664   __u32 offset_Y;
665   __u32 offset_U;
666   __u32 offset_V;
667   __u16 src_width;
668   __u16 src_height;
669   __u16 src_scan_width;
670   __u16 src_scan_height;
671   __u32 crtc_id;
672   __u16 dst_x;
673   __u16 dst_y;
674   __u16 dst_width;
675   __u16 dst_height;
676 };
677 #define I915_OVERLAY_UPDATE_ATTRS (1 << 0)
678 #define I915_OVERLAY_UPDATE_GAMMA (1 << 1)
679 #define I915_OVERLAY_DISABLE_DEST_COLORKEY (1 << 2)
680 struct drm_intel_overlay_attrs {
681   __u32 flags;
682   __u32 color_key;
683   __s32 brightness;
684   __u32 contrast;
685   __u32 saturation;
686   __u32 gamma0;
687   __u32 gamma1;
688   __u32 gamma2;
689   __u32 gamma3;
690   __u32 gamma4;
691   __u32 gamma5;
692 };
693 #define I915_SET_COLORKEY_NONE (1 << 0)
694 #define I915_SET_COLORKEY_DESTINATION (1 << 1)
695 #define I915_SET_COLORKEY_SOURCE (1 << 2)
696 struct drm_intel_sprite_colorkey {
697   __u32 plane_id;
698   __u32 min_value;
699   __u32 channel_mask;
700   __u32 max_value;
701   __u32 flags;
702 };
703 struct drm_i915_gem_wait {
704   __u32 bo_handle;
705   __u32 flags;
706   __s64 timeout_ns;
707 };
708 struct drm_i915_gem_context_create {
709   __u32 ctx_id;
710   __u32 pad;
711 };
712 struct drm_i915_gem_context_create_ext {
713   __u32 ctx_id;
714   __u32 flags;
715 #define I915_CONTEXT_CREATE_FLAGS_USE_EXTENSIONS (1u << 0)
716 #define I915_CONTEXT_CREATE_FLAGS_SINGLE_TIMELINE (1u << 1)
717 #define I915_CONTEXT_CREATE_FLAGS_UNKNOWN (- (I915_CONTEXT_CREATE_FLAGS_SINGLE_TIMELINE << 1))
718   __u64 extensions;
719 };
720 struct drm_i915_gem_context_param {
721   __u32 ctx_id;
722   __u32 size;
723   __u64 param;
724 #define I915_CONTEXT_PARAM_BAN_PERIOD 0x1
725 #define I915_CONTEXT_PARAM_NO_ZEROMAP 0x2
726 #define I915_CONTEXT_PARAM_GTT_SIZE 0x3
727 #define I915_CONTEXT_PARAM_NO_ERROR_CAPTURE 0x4
728 #define I915_CONTEXT_PARAM_BANNABLE 0x5
729 #define I915_CONTEXT_PARAM_PRIORITY 0x6
730 #define I915_CONTEXT_MAX_USER_PRIORITY 1023
731 #define I915_CONTEXT_DEFAULT_PRIORITY 0
732 #define I915_CONTEXT_MIN_USER_PRIORITY - 1023
733 #define I915_CONTEXT_PARAM_SSEU 0x7
734 #define I915_CONTEXT_PARAM_RECOVERABLE 0x8
735 #define I915_CONTEXT_PARAM_VM 0x9
736 #define I915_CONTEXT_PARAM_ENGINES 0xa
737 #define I915_CONTEXT_PARAM_PERSISTENCE 0xb
738 #define I915_CONTEXT_PARAM_RINGSIZE 0xc
739   __u64 value;
740 };
741 struct drm_i915_gem_context_param_sseu {
742   struct i915_engine_class_instance engine;
743   __u32 flags;
744 #define I915_CONTEXT_SSEU_FLAG_ENGINE_INDEX (1u << 0)
745   __u64 slice_mask;
746   __u64 subslice_mask;
747   __u16 min_eus_per_subslice;
748   __u16 max_eus_per_subslice;
749   __u32 rsvd;
750 };
751 struct i915_context_engines_load_balance {
752   struct i915_user_extension base;
753   __u16 engine_index;
754   __u16 num_siblings;
755   __u32 flags;
756   __u64 mbz64;
757   struct i915_engine_class_instance engines[0];
758 } __attribute__((packed));
759 #define I915_DEFINE_CONTEXT_ENGINES_LOAD_BALANCE(name__,N__) struct { struct i915_user_extension base; __u16 engine_index; __u16 num_siblings; __u32 flags; __u64 mbz64; struct i915_engine_class_instance engines[N__]; \
760 } __attribute__((packed)) name__
761 struct i915_context_engines_bond {
762   struct i915_user_extension base;
763   struct i915_engine_class_instance master;
764   __u16 virtual_index;
765   __u16 num_bonds;
766   __u64 flags;
767   __u64 mbz64[4];
768   struct i915_engine_class_instance engines[0];
769 } __attribute__((packed));
770 #define I915_DEFINE_CONTEXT_ENGINES_BOND(name__,N__) struct { struct i915_user_extension base; struct i915_engine_class_instance master; __u16 virtual_index; __u16 num_bonds; __u64 flags; __u64 mbz64[4]; struct i915_engine_class_instance engines[N__]; \
771 } __attribute__((packed)) name__
772 struct i915_context_param_engines {
773   __u64 extensions;
774 #define I915_CONTEXT_ENGINES_EXT_LOAD_BALANCE 0
775 #define I915_CONTEXT_ENGINES_EXT_BOND 1
776   struct i915_engine_class_instance engines[0];
777 } __attribute__((packed));
778 #define I915_DEFINE_CONTEXT_PARAM_ENGINES(name__,N__) struct { __u64 extensions; struct i915_engine_class_instance engines[N__]; \
779 } __attribute__((packed)) name__
780 struct drm_i915_gem_context_create_ext_setparam {
781 #define I915_CONTEXT_CREATE_EXT_SETPARAM 0
782   struct i915_user_extension base;
783   struct drm_i915_gem_context_param param;
784 };
785 struct drm_i915_gem_context_create_ext_clone {
786 #define I915_CONTEXT_CREATE_EXT_CLONE 1
787   struct i915_user_extension base;
788   __u32 clone_id;
789   __u32 flags;
790 #define I915_CONTEXT_CLONE_ENGINES (1u << 0)
791 #define I915_CONTEXT_CLONE_FLAGS (1u << 1)
792 #define I915_CONTEXT_CLONE_SCHEDATTR (1u << 2)
793 #define I915_CONTEXT_CLONE_SSEU (1u << 3)
794 #define I915_CONTEXT_CLONE_TIMELINE (1u << 4)
795 #define I915_CONTEXT_CLONE_VM (1u << 5)
796 #define I915_CONTEXT_CLONE_UNKNOWN - (I915_CONTEXT_CLONE_VM << 1)
797   __u64 rsvd;
798 };
799 struct drm_i915_gem_context_destroy {
800   __u32 ctx_id;
801   __u32 pad;
802 };
803 struct drm_i915_gem_vm_control {
804   __u64 extensions;
805   __u32 flags;
806   __u32 vm_id;
807 };
808 struct drm_i915_reg_read {
809   __u64 offset;
810 #define I915_REG_READ_8B_WA (1ul << 0)
811   __u64 val;
812 };
813 struct drm_i915_reset_stats {
814   __u32 ctx_id;
815   __u32 flags;
816   __u32 reset_count;
817   __u32 batch_active;
818   __u32 batch_pending;
819   __u32 pad;
820 };
821 struct drm_i915_gem_userptr {
822   __u64 user_ptr;
823   __u64 user_size;
824   __u32 flags;
825 #define I915_USERPTR_READ_ONLY 0x1
826 #define I915_USERPTR_UNSYNCHRONIZED 0x80000000
827   __u32 handle;
828 };
829 enum drm_i915_oa_format {
830   I915_OA_FORMAT_A13 = 1,
831   I915_OA_FORMAT_A29,
832   I915_OA_FORMAT_A13_B8_C8,
833   I915_OA_FORMAT_B4_C8,
834   I915_OA_FORMAT_A45_B8_C8,
835   I915_OA_FORMAT_B4_C8_A16,
836   I915_OA_FORMAT_C4_B8,
837   I915_OA_FORMAT_A12,
838   I915_OA_FORMAT_A12_B8_C8,
839   I915_OA_FORMAT_A32u40_A4u32_B8_C8,
840   I915_OA_FORMAT_MAX
841 };
842 enum drm_i915_perf_property_id {
843   DRM_I915_PERF_PROP_CTX_HANDLE = 1,
844   DRM_I915_PERF_PROP_SAMPLE_OA,
845   DRM_I915_PERF_PROP_OA_METRICS_SET,
846   DRM_I915_PERF_PROP_OA_FORMAT,
847   DRM_I915_PERF_PROP_OA_EXPONENT,
848   DRM_I915_PERF_PROP_HOLD_PREEMPTION,
849   DRM_I915_PERF_PROP_GLOBAL_SSEU,
850   DRM_I915_PERF_PROP_POLL_OA_PERIOD,
851   DRM_I915_PERF_PROP_MAX
852 };
853 struct drm_i915_perf_open_param {
854   __u32 flags;
855 #define I915_PERF_FLAG_FD_CLOEXEC (1 << 0)
856 #define I915_PERF_FLAG_FD_NONBLOCK (1 << 1)
857 #define I915_PERF_FLAG_DISABLED (1 << 2)
858   __u32 num_properties;
859   __u64 properties_ptr;
860 };
861 #define I915_PERF_IOCTL_ENABLE _IO('i', 0x0)
862 #define I915_PERF_IOCTL_DISABLE _IO('i', 0x1)
863 #define I915_PERF_IOCTL_CONFIG _IO('i', 0x2)
864 struct drm_i915_perf_record_header {
865   __u32 type;
866   __u16 pad;
867   __u16 size;
868 };
869 enum drm_i915_perf_record_type {
870   DRM_I915_PERF_RECORD_SAMPLE = 1,
871   DRM_I915_PERF_RECORD_OA_REPORT_LOST = 2,
872   DRM_I915_PERF_RECORD_OA_BUFFER_LOST = 3,
873   DRM_I915_PERF_RECORD_MAX
874 };
875 struct drm_i915_perf_oa_config {
876   char uuid[36];
877   __u32 n_mux_regs;
878   __u32 n_boolean_regs;
879   __u32 n_flex_regs;
880   __u64 mux_regs_ptr;
881   __u64 boolean_regs_ptr;
882   __u64 flex_regs_ptr;
883 };
884 struct drm_i915_query_item {
885   __u64 query_id;
886 #define DRM_I915_QUERY_TOPOLOGY_INFO 1
887 #define DRM_I915_QUERY_ENGINE_INFO 2
888 #define DRM_I915_QUERY_PERF_CONFIG 3
889   __s32 length;
890   __u32 flags;
891 #define DRM_I915_QUERY_PERF_CONFIG_LIST 1
892 #define DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_UUID 2
893 #define DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_ID 3
894   __u64 data_ptr;
895 };
896 struct drm_i915_query {
897   __u32 num_items;
898   __u32 flags;
899   __u64 items_ptr;
900 };
901 struct drm_i915_query_topology_info {
902   __u16 flags;
903   __u16 max_slices;
904   __u16 max_subslices;
905   __u16 max_eus_per_subslice;
906   __u16 subslice_offset;
907   __u16 subslice_stride;
908   __u16 eu_offset;
909   __u16 eu_stride;
910   __u8 data[];
911 };
912 struct drm_i915_engine_info {
913   struct i915_engine_class_instance engine;
914   __u32 rsvd0;
915   __u64 flags;
916   __u64 capabilities;
917 #define I915_VIDEO_CLASS_CAPABILITY_HEVC (1 << 0)
918 #define I915_VIDEO_AND_ENHANCE_CLASS_CAPABILITY_SFC (1 << 1)
919   __u64 rsvd1[4];
920 };
921 struct drm_i915_query_engine_info {
922   __u32 num_engines;
923   __u32 rsvd[3];
924   struct drm_i915_engine_info engines[];
925 };
926 struct drm_i915_query_perf_config {
927   union {
928     __u64 n_configs;
929     __u64 config;
930     char uuid[36];
931   };
932   __u32 flags;
933   __u8 data[];
934 };
935 #ifdef __cplusplus
936 }
937 #endif
938 #endif
939