1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27 #ifndef _UAPI_I915_DRM_H_
28 #define _UAPI_I915_DRM_H_
29
30 #include "drm.h"
31
32 #if defined(__cplusplus)
33 extern "C" {
34 #endif
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61 #define I915_L3_PARITY_UEVENT "L3_PARITY_ERROR"
62 #define I915_ERROR_UEVENT "ERROR"
63 #define I915_RESET_UEVENT "RESET"
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80 struct i915_user_extension {
81 __u64 next_extension;
82 __u32 name;
83 __u32 flags;
84 __u32 rsvd[4];
85 };
86
87
88
89
90
91 enum i915_mocs_table_index {
92
93
94
95
96 I915_MOCS_UNCACHED,
97
98
99
100
101
102 I915_MOCS_PTE,
103
104
105
106
107
108 I915_MOCS_CACHED,
109 };
110
111
112
113
114
115
116
117
118 enum drm_i915_gem_engine_class {
119 I915_ENGINE_CLASS_RENDER = 0,
120 I915_ENGINE_CLASS_COPY = 1,
121 I915_ENGINE_CLASS_VIDEO = 2,
122 I915_ENGINE_CLASS_VIDEO_ENHANCE = 3,
123
124
125
126 I915_ENGINE_CLASS_INVALID = -1
127 };
128
129
130
131
132
133
134
135
136 struct i915_engine_class_instance {
137 __u16 engine_class;
138 __u16 engine_instance;
139 #define I915_ENGINE_CLASS_INVALID_NONE -1
140 #define I915_ENGINE_CLASS_INVALID_VIRTUAL -2
141 };
142
143
144
145
146
147
148 enum drm_i915_pmu_engine_sample {
149 I915_SAMPLE_BUSY = 0,
150 I915_SAMPLE_WAIT = 1,
151 I915_SAMPLE_SEMA = 2
152 };
153
154 #define I915_PMU_SAMPLE_BITS (4)
155 #define I915_PMU_SAMPLE_MASK (0xf)
156 #define I915_PMU_SAMPLE_INSTANCE_BITS (8)
157 #define I915_PMU_CLASS_SHIFT \
158 (I915_PMU_SAMPLE_BITS + I915_PMU_SAMPLE_INSTANCE_BITS)
159
160 #define __I915_PMU_ENGINE(class, instance, sample) \
161 ((class) << I915_PMU_CLASS_SHIFT | \
162 (instance) << I915_PMU_SAMPLE_BITS | \
163 (sample))
164
165 #define I915_PMU_ENGINE_BUSY(class, instance) \
166 __I915_PMU_ENGINE(class, instance, I915_SAMPLE_BUSY)
167
168 #define I915_PMU_ENGINE_WAIT(class, instance) \
169 __I915_PMU_ENGINE(class, instance, I915_SAMPLE_WAIT)
170
171 #define I915_PMU_ENGINE_SEMA(class, instance) \
172 __I915_PMU_ENGINE(class, instance, I915_SAMPLE_SEMA)
173
174 #define __I915_PMU_OTHER(x) (__I915_PMU_ENGINE(0xff, 0xff, 0xf) + 1 + (x))
175
176 #define I915_PMU_ACTUAL_FREQUENCY __I915_PMU_OTHER(0)
177 #define I915_PMU_REQUESTED_FREQUENCY __I915_PMU_OTHER(1)
178 #define I915_PMU_INTERRUPTS __I915_PMU_OTHER(2)
179 #define I915_PMU_RC6_RESIDENCY __I915_PMU_OTHER(3)
180
181 #define I915_PMU_LAST I915_PMU_RC6_RESIDENCY
182
183
184
185 #define I915_NR_TEX_REGIONS 255
186
187 #define I915_LOG_MIN_TEX_REGION_SIZE 14
188
189 typedef struct _drm_i915_init {
190 enum {
191 I915_INIT_DMA = 0x01,
192 I915_CLEANUP_DMA = 0x02,
193 I915_RESUME_DMA = 0x03
194 } func;
195 unsigned int mmio_offset;
196 int sarea_priv_offset;
197 unsigned int ring_start;
198 unsigned int ring_end;
199 unsigned int ring_size;
200 unsigned int front_offset;
201 unsigned int back_offset;
202 unsigned int depth_offset;
203 unsigned int w;
204 unsigned int h;
205 unsigned int pitch;
206 unsigned int pitch_bits;
207 unsigned int back_pitch;
208 unsigned int depth_pitch;
209 unsigned int cpp;
210 unsigned int chipset;
211 } drm_i915_init_t;
212
213 typedef struct _drm_i915_sarea {
214 struct drm_tex_region texList[I915_NR_TEX_REGIONS + 1];
215 int last_upload;
216 int last_enqueue;
217 int last_dispatch;
218 int ctxOwner;
219 int texAge;
220 int pf_enabled;
221 int pf_active;
222 int pf_current_page;
223 int perf_boxes;
224 int width, height;
225
226 drm_handle_t front_handle;
227 int front_offset;
228 int front_size;
229
230 drm_handle_t back_handle;
231 int back_offset;
232 int back_size;
233
234 drm_handle_t depth_handle;
235 int depth_offset;
236 int depth_size;
237
238 drm_handle_t tex_handle;
239 int tex_offset;
240 int tex_size;
241 int log_tex_granularity;
242 int pitch;
243 int rotation;
244 int rotated_offset;
245 int rotated_size;
246 int rotated_pitch;
247 int virtualX, virtualY;
248
249 unsigned int front_tiled;
250 unsigned int back_tiled;
251 unsigned int depth_tiled;
252 unsigned int rotated_tiled;
253 unsigned int rotated2_tiled;
254
255 int pipeA_x;
256 int pipeA_y;
257 int pipeA_w;
258 int pipeA_h;
259 int pipeB_x;
260 int pipeB_y;
261 int pipeB_w;
262 int pipeB_h;
263
264
265 drm_handle_t unused_handle;
266 __u32 unused1, unused2, unused3;
267
268
269
270
271 __u32 front_bo_handle;
272 __u32 back_bo_handle;
273 __u32 unused_bo_handle;
274 __u32 depth_bo_handle;
275
276 } drm_i915_sarea_t;
277
278
279 #define planeA_x pipeA_x
280 #define planeA_y pipeA_y
281 #define planeA_w pipeA_w
282 #define planeA_h pipeA_h
283 #define planeB_x pipeB_x
284 #define planeB_y pipeB_y
285 #define planeB_w pipeB_w
286 #define planeB_h pipeB_h
287
288
289
290 #define I915_BOX_RING_EMPTY 0x1
291 #define I915_BOX_FLIP 0x2
292 #define I915_BOX_WAIT 0x4
293 #define I915_BOX_TEXTURE_LOAD 0x8
294 #define I915_BOX_LOST_CONTEXT 0x10
295
296
297
298
299
300
301
302
303 #define DRM_I915_INIT 0x00
304 #define DRM_I915_FLUSH 0x01
305 #define DRM_I915_FLIP 0x02
306 #define DRM_I915_BATCHBUFFER 0x03
307 #define DRM_I915_IRQ_EMIT 0x04
308 #define DRM_I915_IRQ_WAIT 0x05
309 #define DRM_I915_GETPARAM 0x06
310 #define DRM_I915_SETPARAM 0x07
311 #define DRM_I915_ALLOC 0x08
312 #define DRM_I915_FREE 0x09
313 #define DRM_I915_INIT_HEAP 0x0a
314 #define DRM_I915_CMDBUFFER 0x0b
315 #define DRM_I915_DESTROY_HEAP 0x0c
316 #define DRM_I915_SET_VBLANK_PIPE 0x0d
317 #define DRM_I915_GET_VBLANK_PIPE 0x0e
318 #define DRM_I915_VBLANK_SWAP 0x0f
319 #define DRM_I915_HWS_ADDR 0x11
320 #define DRM_I915_GEM_INIT 0x13
321 #define DRM_I915_GEM_EXECBUFFER 0x14
322 #define DRM_I915_GEM_PIN 0x15
323 #define DRM_I915_GEM_UNPIN 0x16
324 #define DRM_I915_GEM_BUSY 0x17
325 #define DRM_I915_GEM_THROTTLE 0x18
326 #define DRM_I915_GEM_ENTERVT 0x19
327 #define DRM_I915_GEM_LEAVEVT 0x1a
328 #define DRM_I915_GEM_CREATE 0x1b
329 #define DRM_I915_GEM_PREAD 0x1c
330 #define DRM_I915_GEM_PWRITE 0x1d
331 #define DRM_I915_GEM_MMAP 0x1e
332 #define DRM_I915_GEM_SET_DOMAIN 0x1f
333 #define DRM_I915_GEM_SW_FINISH 0x20
334 #define DRM_I915_GEM_SET_TILING 0x21
335 #define DRM_I915_GEM_GET_TILING 0x22
336 #define DRM_I915_GEM_GET_APERTURE 0x23
337 #define DRM_I915_GEM_MMAP_GTT 0x24
338 #define DRM_I915_GET_PIPE_FROM_CRTC_ID 0x25
339 #define DRM_I915_GEM_MADVISE 0x26
340 #define DRM_I915_OVERLAY_PUT_IMAGE 0x27
341 #define DRM_I915_OVERLAY_ATTRS 0x28
342 #define DRM_I915_GEM_EXECBUFFER2 0x29
343 #define DRM_I915_GEM_EXECBUFFER2_WR DRM_I915_GEM_EXECBUFFER2
344 #define DRM_I915_GET_SPRITE_COLORKEY 0x2a
345 #define DRM_I915_SET_SPRITE_COLORKEY 0x2b
346 #define DRM_I915_GEM_WAIT 0x2c
347 #define DRM_I915_GEM_CONTEXT_CREATE 0x2d
348 #define DRM_I915_GEM_CONTEXT_DESTROY 0x2e
349 #define DRM_I915_GEM_SET_CACHING 0x2f
350 #define DRM_I915_GEM_GET_CACHING 0x30
351 #define DRM_I915_REG_READ 0x31
352 #define DRM_I915_GET_RESET_STATS 0x32
353 #define DRM_I915_GEM_USERPTR 0x33
354 #define DRM_I915_GEM_CONTEXT_GETPARAM 0x34
355 #define DRM_I915_GEM_CONTEXT_SETPARAM 0x35
356 #define DRM_I915_PERF_OPEN 0x36
357 #define DRM_I915_PERF_ADD_CONFIG 0x37
358 #define DRM_I915_PERF_REMOVE_CONFIG 0x38
359 #define DRM_I915_QUERY 0x39
360 #define DRM_I915_GEM_VM_CREATE 0x3a
361 #define DRM_I915_GEM_VM_DESTROY 0x3b
362
363
364 #define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t)
365 #define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH)
366 #define DRM_IOCTL_I915_FLIP DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLIP)
367 #define DRM_IOCTL_I915_BATCHBUFFER DRM_IOW( DRM_COMMAND_BASE + DRM_I915_BATCHBUFFER, drm_i915_batchbuffer_t)
368 #define DRM_IOCTL_I915_IRQ_EMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_IRQ_EMIT, drm_i915_irq_emit_t)
369 #define DRM_IOCTL_I915_IRQ_WAIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_IRQ_WAIT, drm_i915_irq_wait_t)
370 #define DRM_IOCTL_I915_GETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GETPARAM, drm_i915_getparam_t)
371 #define DRM_IOCTL_I915_SETPARAM DRM_IOW( DRM_COMMAND_BASE + DRM_I915_SETPARAM, drm_i915_setparam_t)
372 #define DRM_IOCTL_I915_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_ALLOC, drm_i915_mem_alloc_t)
373 #define DRM_IOCTL_I915_FREE DRM_IOW( DRM_COMMAND_BASE + DRM_I915_FREE, drm_i915_mem_free_t)
374 #define DRM_IOCTL_I915_INIT_HEAP DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT_HEAP, drm_i915_mem_init_heap_t)
375 #define DRM_IOCTL_I915_CMDBUFFER DRM_IOW( DRM_COMMAND_BASE + DRM_I915_CMDBUFFER, drm_i915_cmdbuffer_t)
376 #define DRM_IOCTL_I915_DESTROY_HEAP DRM_IOW( DRM_COMMAND_BASE + DRM_I915_DESTROY_HEAP, drm_i915_mem_destroy_heap_t)
377 #define DRM_IOCTL_I915_SET_VBLANK_PIPE DRM_IOW( DRM_COMMAND_BASE + DRM_I915_SET_VBLANK_PIPE, drm_i915_vblank_pipe_t)
378 #define DRM_IOCTL_I915_GET_VBLANK_PIPE DRM_IOR( DRM_COMMAND_BASE + DRM_I915_GET_VBLANK_PIPE, drm_i915_vblank_pipe_t)
379 #define DRM_IOCTL_I915_VBLANK_SWAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_VBLANK_SWAP, drm_i915_vblank_swap_t)
380 #define DRM_IOCTL_I915_HWS_ADDR DRM_IOW(DRM_COMMAND_BASE + DRM_I915_HWS_ADDR, struct drm_i915_gem_init)
381 #define DRM_IOCTL_I915_GEM_INIT DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_INIT, struct drm_i915_gem_init)
382 #define DRM_IOCTL_I915_GEM_EXECBUFFER DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER, struct drm_i915_gem_execbuffer)
383 #define DRM_IOCTL_I915_GEM_EXECBUFFER2 DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER2, struct drm_i915_gem_execbuffer2)
384 #define DRM_IOCTL_I915_GEM_EXECBUFFER2_WR DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER2_WR, struct drm_i915_gem_execbuffer2)
385 #define DRM_IOCTL_I915_GEM_PIN DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_PIN, struct drm_i915_gem_pin)
386 #define DRM_IOCTL_I915_GEM_UNPIN DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_UNPIN, struct drm_i915_gem_unpin)
387 #define DRM_IOCTL_I915_GEM_BUSY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_BUSY, struct drm_i915_gem_busy)
388 #define DRM_IOCTL_I915_GEM_SET_CACHING DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_SET_CACHING, struct drm_i915_gem_caching)
389 #define DRM_IOCTL_I915_GEM_GET_CACHING DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_GET_CACHING, struct drm_i915_gem_caching)
390 #define DRM_IOCTL_I915_GEM_THROTTLE DRM_IO ( DRM_COMMAND_BASE + DRM_I915_GEM_THROTTLE)
391 #define DRM_IOCTL_I915_GEM_ENTERVT DRM_IO(DRM_COMMAND_BASE + DRM_I915_GEM_ENTERVT)
392 #define DRM_IOCTL_I915_GEM_LEAVEVT DRM_IO(DRM_COMMAND_BASE + DRM_I915_GEM_LEAVEVT)
393 #define DRM_IOCTL_I915_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_CREATE, struct drm_i915_gem_create)
394 #define DRM_IOCTL_I915_GEM_PREAD DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_PREAD, struct drm_i915_gem_pread)
395 #define DRM_IOCTL_I915_GEM_PWRITE DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_PWRITE, struct drm_i915_gem_pwrite)
396 #define DRM_IOCTL_I915_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MMAP, struct drm_i915_gem_mmap)
397 #define DRM_IOCTL_I915_GEM_MMAP_GTT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MMAP_GTT, struct drm_i915_gem_mmap_gtt)
398 #define DRM_IOCTL_I915_GEM_SET_DOMAIN DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_SET_DOMAIN, struct drm_i915_gem_set_domain)
399 #define DRM_IOCTL_I915_GEM_SW_FINISH DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_SW_FINISH, struct drm_i915_gem_sw_finish)
400 #define DRM_IOCTL_I915_GEM_SET_TILING DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_SET_TILING, struct drm_i915_gem_set_tiling)
401 #define DRM_IOCTL_I915_GEM_GET_TILING DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_TILING, struct drm_i915_gem_get_tiling)
402 #define DRM_IOCTL_I915_GEM_GET_APERTURE DRM_IOR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_APERTURE, struct drm_i915_gem_get_aperture)
403 #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)
404 #define DRM_IOCTL_I915_GEM_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MADVISE, struct drm_i915_gem_madvise)
405 #define DRM_IOCTL_I915_OVERLAY_PUT_IMAGE DRM_IOW(DRM_COMMAND_BASE + DRM_I915_OVERLAY_PUT_IMAGE, struct drm_intel_overlay_put_image)
406 #define DRM_IOCTL_I915_OVERLAY_ATTRS DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_OVERLAY_ATTRS, struct drm_intel_overlay_attrs)
407 #define DRM_IOCTL_I915_SET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_SET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey)
408 #define DRM_IOCTL_I915_GET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey)
409 #define DRM_IOCTL_I915_GEM_WAIT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_WAIT, struct drm_i915_gem_wait)
410 #define DRM_IOCTL_I915_GEM_CONTEXT_CREATE DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_CREATE, struct drm_i915_gem_context_create)
411 #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)
412 #define DRM_IOCTL_I915_GEM_CONTEXT_DESTROY DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_DESTROY, struct drm_i915_gem_context_destroy)
413 #define DRM_IOCTL_I915_REG_READ DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_REG_READ, struct drm_i915_reg_read)
414 #define DRM_IOCTL_I915_GET_RESET_STATS DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GET_RESET_STATS, struct drm_i915_reset_stats)
415 #define DRM_IOCTL_I915_GEM_USERPTR DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_USERPTR, struct drm_i915_gem_userptr)
416 #define DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_GETPARAM, struct drm_i915_gem_context_param)
417 #define DRM_IOCTL_I915_GEM_CONTEXT_SETPARAM DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_SETPARAM, struct drm_i915_gem_context_param)
418 #define DRM_IOCTL_I915_PERF_OPEN DRM_IOW(DRM_COMMAND_BASE + DRM_I915_PERF_OPEN, struct drm_i915_perf_open_param)
419 #define DRM_IOCTL_I915_PERF_ADD_CONFIG DRM_IOW(DRM_COMMAND_BASE + DRM_I915_PERF_ADD_CONFIG, struct drm_i915_perf_oa_config)
420 #define DRM_IOCTL_I915_PERF_REMOVE_CONFIG DRM_IOW(DRM_COMMAND_BASE + DRM_I915_PERF_REMOVE_CONFIG, __u64)
421 #define DRM_IOCTL_I915_QUERY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_QUERY, struct drm_i915_query)
422 #define DRM_IOCTL_I915_GEM_VM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_VM_CREATE, struct drm_i915_gem_vm_control)
423 #define DRM_IOCTL_I915_GEM_VM_DESTROY DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_VM_DESTROY, struct drm_i915_gem_vm_control)
424
425
426
427
428 typedef struct drm_i915_batchbuffer {
429 int start;
430 int used;
431 int DR1;
432 int DR4;
433 int num_cliprects;
434 struct drm_clip_rect __user *cliprects;
435 } drm_i915_batchbuffer_t;
436
437
438
439
440 typedef struct _drm_i915_cmdbuffer {
441 char __user *buf;
442 int sz;
443 int DR1;
444 int DR4;
445 int num_cliprects;
446 struct drm_clip_rect __user *cliprects;
447 } drm_i915_cmdbuffer_t;
448
449
450
451 typedef struct drm_i915_irq_emit {
452 int __user *irq_seq;
453 } drm_i915_irq_emit_t;
454
455 typedef struct drm_i915_irq_wait {
456 int irq_seq;
457 } drm_i915_irq_wait_t;
458
459
460
461
462
463 #define I915_GEM_PPGTT_NONE 0
464 #define I915_GEM_PPGTT_ALIASING 1
465 #define I915_GEM_PPGTT_FULL 2
466
467
468
469 #define I915_PARAM_IRQ_ACTIVE 1
470 #define I915_PARAM_ALLOW_BATCHBUFFER 2
471 #define I915_PARAM_LAST_DISPATCH 3
472 #define I915_PARAM_CHIPSET_ID 4
473 #define I915_PARAM_HAS_GEM 5
474 #define I915_PARAM_NUM_FENCES_AVAIL 6
475 #define I915_PARAM_HAS_OVERLAY 7
476 #define I915_PARAM_HAS_PAGEFLIPPING 8
477 #define I915_PARAM_HAS_EXECBUF2 9
478 #define I915_PARAM_HAS_BSD 10
479 #define I915_PARAM_HAS_BLT 11
480 #define I915_PARAM_HAS_RELAXED_FENCING 12
481 #define I915_PARAM_HAS_COHERENT_RINGS 13
482 #define I915_PARAM_HAS_EXEC_CONSTANTS 14
483 #define I915_PARAM_HAS_RELAXED_DELTA 15
484 #define I915_PARAM_HAS_GEN7_SOL_RESET 16
485 #define I915_PARAM_HAS_LLC 17
486 #define I915_PARAM_HAS_ALIASING_PPGTT 18
487 #define I915_PARAM_HAS_WAIT_TIMEOUT 19
488 #define I915_PARAM_HAS_SEMAPHORES 20
489 #define I915_PARAM_HAS_PRIME_VMAP_FLUSH 21
490 #define I915_PARAM_HAS_VEBOX 22
491 #define I915_PARAM_HAS_SECURE_BATCHES 23
492 #define I915_PARAM_HAS_PINNED_BATCHES 24
493 #define I915_PARAM_HAS_EXEC_NO_RELOC 25
494 #define I915_PARAM_HAS_EXEC_HANDLE_LUT 26
495 #define I915_PARAM_HAS_WT 27
496 #define I915_PARAM_CMD_PARSER_VERSION 28
497 #define I915_PARAM_HAS_COHERENT_PHYS_GTT 29
498 #define I915_PARAM_MMAP_VERSION 30
499 #define I915_PARAM_HAS_BSD2 31
500 #define I915_PARAM_REVISION 32
501 #define I915_PARAM_SUBSLICE_TOTAL 33
502 #define I915_PARAM_EU_TOTAL 34
503 #define I915_PARAM_HAS_GPU_RESET 35
504 #define I915_PARAM_HAS_RESOURCE_STREAMER 36
505 #define I915_PARAM_HAS_EXEC_SOFTPIN 37
506 #define I915_PARAM_HAS_POOLED_EU 38
507 #define I915_PARAM_MIN_EU_IN_POOL 39
508 #define I915_PARAM_MMAP_GTT_VERSION 40
509
510
511
512
513
514
515
516
517
518
519 #define I915_PARAM_HAS_SCHEDULER 41
520 #define I915_SCHEDULER_CAP_ENABLED (1ul << 0)
521 #define I915_SCHEDULER_CAP_PRIORITY (1ul << 1)
522 #define I915_SCHEDULER_CAP_PREEMPTION (1ul << 2)
523 #define I915_SCHEDULER_CAP_SEMAPHORES (1ul << 3)
524 #define I915_SCHEDULER_CAP_ENGINE_BUSY_STATS (1ul << 4)
525
526 #define I915_PARAM_HUC_STATUS 42
527
528
529
530
531
532 #define I915_PARAM_HAS_EXEC_ASYNC 43
533
534
535
536
537
538
539 #define I915_PARAM_HAS_EXEC_FENCE 44
540
541
542
543
544
545 #define I915_PARAM_HAS_EXEC_CAPTURE 45
546
547 #define I915_PARAM_SLICE_MASK 46
548
549
550
551
552 #define I915_PARAM_SUBSLICE_MASK 47
553
554
555
556
557
558 #define I915_PARAM_HAS_EXEC_BATCH_FIRST 48
559
560
561
562
563 #define I915_PARAM_HAS_EXEC_FENCE_ARRAY 49
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578 #define I915_PARAM_HAS_CONTEXT_ISOLATION 50
579
580
581
582
583
584 #define I915_PARAM_CS_TIMESTAMP_FREQUENCY 51
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606 #define I915_PARAM_MMAP_GTT_COHERENT 52
607
608
609
610
611
612
613 #define I915_PARAM_HAS_EXEC_SUBMIT_FENCE 53
614
615
616 typedef struct drm_i915_getparam {
617 __s32 param;
618
619
620
621
622 int __user *value;
623 } drm_i915_getparam_t;
624
625
626
627 #define I915_SETPARAM_USE_MI_BATCHBUFFER_START 1
628 #define I915_SETPARAM_TEX_LRU_LOG_GRANULARITY 2
629 #define I915_SETPARAM_ALLOW_BATCHBUFFER 3
630 #define I915_SETPARAM_NUM_USED_FENCES 4
631
632
633 typedef struct drm_i915_setparam {
634 int param;
635 int value;
636 } drm_i915_setparam_t;
637
638
639
640 #define I915_MEM_REGION_AGP 1
641
642 typedef struct drm_i915_mem_alloc {
643 int region;
644 int alignment;
645 int size;
646 int __user *region_offset;
647 } drm_i915_mem_alloc_t;
648
649 typedef struct drm_i915_mem_free {
650 int region;
651 int region_offset;
652 } drm_i915_mem_free_t;
653
654 typedef struct drm_i915_mem_init_heap {
655 int region;
656 int size;
657 int start;
658 } drm_i915_mem_init_heap_t;
659
660
661
662
663 typedef struct drm_i915_mem_destroy_heap {
664 int region;
665 } drm_i915_mem_destroy_heap_t;
666
667
668
669 #define DRM_I915_VBLANK_PIPE_A 1
670 #define DRM_I915_VBLANK_PIPE_B 2
671
672 typedef struct drm_i915_vblank_pipe {
673 int pipe;
674 } drm_i915_vblank_pipe_t;
675
676
677
678 typedef struct drm_i915_vblank_swap {
679 drm_drawable_t drawable;
680 enum drm_vblank_seq_type seqtype;
681 unsigned int sequence;
682 } drm_i915_vblank_swap_t;
683
684 typedef struct drm_i915_hws_addr {
685 __u64 addr;
686 } drm_i915_hws_addr_t;
687
688 struct drm_i915_gem_init {
689
690
691
692
693 __u64 gtt_start;
694
695
696
697
698 __u64 gtt_end;
699 };
700
701 struct drm_i915_gem_create {
702
703
704
705
706
707 __u64 size;
708
709
710
711
712
713 __u32 handle;
714 __u32 pad;
715 };
716
717 struct drm_i915_gem_pread {
718
719 __u32 handle;
720 __u32 pad;
721
722 __u64 offset;
723
724 __u64 size;
725
726
727
728
729
730 __u64 data_ptr;
731 };
732
733 struct drm_i915_gem_pwrite {
734
735 __u32 handle;
736 __u32 pad;
737
738 __u64 offset;
739
740 __u64 size;
741
742
743
744
745
746 __u64 data_ptr;
747 };
748
749 struct drm_i915_gem_mmap {
750
751 __u32 handle;
752 __u32 pad;
753
754 __u64 offset;
755
756
757
758
759
760 __u64 size;
761
762
763
764
765
766 __u64 addr_ptr;
767
768
769
770
771
772
773 __u64 flags;
774 #define I915_MMAP_WC 0x1
775 };
776
777 struct drm_i915_gem_mmap_gtt {
778
779 __u32 handle;
780 __u32 pad;
781
782
783
784
785
786 __u64 offset;
787 };
788
789 struct drm_i915_gem_set_domain {
790
791 __u32 handle;
792
793
794 __u32 read_domains;
795
796
797 __u32 write_domain;
798 };
799
800 struct drm_i915_gem_sw_finish {
801
802 __u32 handle;
803 };
804
805 struct drm_i915_gem_relocation_entry {
806
807
808
809
810
811
812
813
814 __u32 target_handle;
815
816
817
818
819
820 __u32 delta;
821
822
823 __u64 offset;
824
825
826
827
828
829
830
831
832
833 __u64 presumed_offset;
834
835
836
837
838 __u32 read_domains;
839
840
841
842
843
844
845
846
847 __u32 write_domain;
848 };
849
850
851
852
853
854
855
856
857
858 #define I915_GEM_DOMAIN_CPU 0x00000001
859
860 #define I915_GEM_DOMAIN_RENDER 0x00000002
861
862 #define I915_GEM_DOMAIN_SAMPLER 0x00000004
863
864 #define I915_GEM_DOMAIN_COMMAND 0x00000008
865
866 #define I915_GEM_DOMAIN_INSTRUCTION 0x00000010
867
868 #define I915_GEM_DOMAIN_VERTEX 0x00000020
869
870 #define I915_GEM_DOMAIN_GTT 0x00000040
871
872 #define I915_GEM_DOMAIN_WC 0x00000080
873
874
875 struct drm_i915_gem_exec_object {
876
877
878
879
880 __u32 handle;
881
882
883 __u32 relocation_count;
884
885
886
887
888 __u64 relocs_ptr;
889
890
891 __u64 alignment;
892
893
894
895
896
897 __u64 offset;
898 };
899
900 struct drm_i915_gem_execbuffer {
901
902
903
904
905
906
907
908
909
910
911 __u64 buffers_ptr;
912 __u32 buffer_count;
913
914
915 __u32 batch_start_offset;
916
917 __u32 batch_len;
918 __u32 DR1;
919 __u32 DR4;
920 __u32 num_cliprects;
921
922 __u64 cliprects_ptr;
923 };
924
925 struct drm_i915_gem_exec_object2 {
926
927
928
929
930 __u32 handle;
931
932
933 __u32 relocation_count;
934
935
936
937
938 __u64 relocs_ptr;
939
940
941 __u64 alignment;
942
943
944
945
946
947
948
949
950
951 __u64 offset;
952
953 #define EXEC_OBJECT_NEEDS_FENCE (1<<0)
954 #define EXEC_OBJECT_NEEDS_GTT (1<<1)
955 #define EXEC_OBJECT_WRITE (1<<2)
956 #define EXEC_OBJECT_SUPPORTS_48B_ADDRESS (1<<3)
957 #define EXEC_OBJECT_PINNED (1<<4)
958 #define EXEC_OBJECT_PAD_TO_SIZE (1<<5)
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979 #define EXEC_OBJECT_ASYNC (1<<6)
980
981
982
983
984
985
986 #define EXEC_OBJECT_CAPTURE (1<<7)
987
988 #define __EXEC_OBJECT_UNKNOWN_FLAGS -(EXEC_OBJECT_CAPTURE<<1)
989 __u64 flags;
990
991 union {
992 __u64 rsvd1;
993 __u64 pad_to_size;
994 };
995 __u64 rsvd2;
996 };
997
998 struct drm_i915_gem_exec_fence {
999
1000
1001
1002 __u32 handle;
1003
1004 #define I915_EXEC_FENCE_WAIT (1<<0)
1005 #define I915_EXEC_FENCE_SIGNAL (1<<1)
1006 #define __I915_EXEC_FENCE_UNKNOWN_FLAGS (-(I915_EXEC_FENCE_SIGNAL << 1))
1007 __u32 flags;
1008 };
1009
1010 struct drm_i915_gem_execbuffer2 {
1011
1012
1013
1014 __u64 buffers_ptr;
1015 __u32 buffer_count;
1016
1017
1018 __u32 batch_start_offset;
1019
1020 __u32 batch_len;
1021 __u32 DR1;
1022 __u32 DR4;
1023 __u32 num_cliprects;
1024
1025
1026
1027
1028
1029 __u64 cliprects_ptr;
1030 #define I915_EXEC_RING_MASK (0x3f)
1031 #define I915_EXEC_DEFAULT (0<<0)
1032 #define I915_EXEC_RENDER (1<<0)
1033 #define I915_EXEC_BSD (2<<0)
1034 #define I915_EXEC_BLT (3<<0)
1035 #define I915_EXEC_VEBOX (4<<0)
1036
1037
1038
1039
1040
1041
1042
1043 #define I915_EXEC_CONSTANTS_MASK (3<<6)
1044 #define I915_EXEC_CONSTANTS_REL_GENERAL (0<<6)
1045 #define I915_EXEC_CONSTANTS_ABSOLUTE (1<<6)
1046 #define I915_EXEC_CONSTANTS_REL_SURFACE (2<<6)
1047 __u64 flags;
1048 __u64 rsvd1;
1049 __u64 rsvd2;
1050 };
1051
1052
1053 #define I915_EXEC_GEN7_SOL_RESET (1<<8)
1054
1055
1056
1057
1058 #define I915_EXEC_SECURE (1<<9)
1059
1060
1061
1062
1063
1064
1065
1066
1067 #define I915_EXEC_IS_PINNED (1<<10)
1068
1069
1070
1071
1072
1073
1074 #define I915_EXEC_NO_RELOC (1<<11)
1075
1076
1077
1078
1079 #define I915_EXEC_HANDLE_LUT (1<<12)
1080
1081
1082 #define I915_EXEC_BSD_SHIFT (13)
1083 #define I915_EXEC_BSD_MASK (3 << I915_EXEC_BSD_SHIFT)
1084
1085 #define I915_EXEC_BSD_DEFAULT (0 << I915_EXEC_BSD_SHIFT)
1086 #define I915_EXEC_BSD_RING1 (1 << I915_EXEC_BSD_SHIFT)
1087 #define I915_EXEC_BSD_RING2 (2 << I915_EXEC_BSD_SHIFT)
1088
1089
1090
1091
1092 #define I915_EXEC_RESOURCE_STREAMER (1<<15)
1093
1094
1095
1096
1097
1098
1099
1100 #define I915_EXEC_FENCE_IN (1<<16)
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117 #define I915_EXEC_FENCE_OUT (1<<17)
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128 #define I915_EXEC_BATCH_FIRST (1<<18)
1129
1130
1131
1132
1133
1134 #define I915_EXEC_FENCE_ARRAY (1<<19)
1135
1136
1137
1138
1139
1140
1141
1142
1143 #define I915_EXEC_FENCE_SUBMIT (1 << 20)
1144
1145 #define __I915_EXEC_UNKNOWN_FLAGS (-(I915_EXEC_FENCE_SUBMIT << 1))
1146
1147 #define I915_EXEC_CONTEXT_ID_MASK (0xffffffff)
1148 #define i915_execbuffer2_set_context_id(eb2, context) \
1149 (eb2).rsvd1 = context & I915_EXEC_CONTEXT_ID_MASK
1150 #define i915_execbuffer2_get_context_id(eb2) \
1151 ((eb2).rsvd1 & I915_EXEC_CONTEXT_ID_MASK)
1152
1153 struct drm_i915_gem_pin {
1154
1155 __u32 handle;
1156 __u32 pad;
1157
1158
1159 __u64 alignment;
1160
1161
1162 __u64 offset;
1163 };
1164
1165 struct drm_i915_gem_unpin {
1166
1167 __u32 handle;
1168 __u32 pad;
1169 };
1170
1171 struct drm_i915_gem_busy {
1172
1173 __u32 handle;
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221 __u32 busy;
1222 };
1223
1224
1225
1226
1227
1228
1229
1230 #define I915_CACHING_NONE 0
1231
1232
1233
1234
1235
1236
1237
1238 #define I915_CACHING_CACHED 1
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249 #define I915_CACHING_DISPLAY 2
1250
1251 struct drm_i915_gem_caching {
1252
1253
1254 __u32 handle;
1255
1256
1257
1258
1259
1260
1261
1262 __u32 caching;
1263 };
1264
1265 #define I915_TILING_NONE 0
1266 #define I915_TILING_X 1
1267 #define I915_TILING_Y 2
1268 #define I915_TILING_LAST I915_TILING_Y
1269
1270 #define I915_BIT_6_SWIZZLE_NONE 0
1271 #define I915_BIT_6_SWIZZLE_9 1
1272 #define I915_BIT_6_SWIZZLE_9_10 2
1273 #define I915_BIT_6_SWIZZLE_9_11 3
1274 #define I915_BIT_6_SWIZZLE_9_10_11 4
1275
1276 #define I915_BIT_6_SWIZZLE_UNKNOWN 5
1277
1278 #define I915_BIT_6_SWIZZLE_9_17 6
1279 #define I915_BIT_6_SWIZZLE_9_10_17 7
1280
1281 struct drm_i915_gem_set_tiling {
1282
1283 __u32 handle;
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297 __u32 tiling_mode;
1298
1299
1300
1301
1302
1303 __u32 stride;
1304
1305
1306
1307
1308
1309 __u32 swizzle_mode;
1310 };
1311
1312 struct drm_i915_gem_get_tiling {
1313
1314 __u32 handle;
1315
1316
1317
1318
1319
1320 __u32 tiling_mode;
1321
1322
1323
1324
1325
1326 __u32 swizzle_mode;
1327
1328
1329
1330
1331
1332 __u32 phys_swizzle_mode;
1333 };
1334
1335 struct drm_i915_gem_get_aperture {
1336
1337 __u64 aper_size;
1338
1339
1340
1341
1342
1343 __u64 aper_available_size;
1344 };
1345
1346 struct drm_i915_get_pipe_from_crtc_id {
1347
1348 __u32 crtc_id;
1349
1350
1351 __u32 pipe;
1352 };
1353
1354 #define I915_MADV_WILLNEED 0
1355 #define I915_MADV_DONTNEED 1
1356 #define __I915_MADV_PURGED 2
1357
1358 struct drm_i915_gem_madvise {
1359
1360 __u32 handle;
1361
1362
1363
1364
1365 __u32 madv;
1366
1367
1368 __u32 retained;
1369 };
1370
1371
1372 #define I915_OVERLAY_TYPE_MASK 0xff
1373 #define I915_OVERLAY_YUV_PLANAR 0x01
1374 #define I915_OVERLAY_YUV_PACKED 0x02
1375 #define I915_OVERLAY_RGB 0x03
1376
1377 #define I915_OVERLAY_DEPTH_MASK 0xff00
1378 #define I915_OVERLAY_RGB24 0x1000
1379 #define I915_OVERLAY_RGB16 0x2000
1380 #define I915_OVERLAY_RGB15 0x3000
1381 #define I915_OVERLAY_YUV422 0x0100
1382 #define I915_OVERLAY_YUV411 0x0200
1383 #define I915_OVERLAY_YUV420 0x0300
1384 #define I915_OVERLAY_YUV410 0x0400
1385
1386 #define I915_OVERLAY_SWAP_MASK 0xff0000
1387 #define I915_OVERLAY_NO_SWAP 0x000000
1388 #define I915_OVERLAY_UV_SWAP 0x010000
1389 #define I915_OVERLAY_Y_SWAP 0x020000
1390 #define I915_OVERLAY_Y_AND_UV_SWAP 0x030000
1391
1392 #define I915_OVERLAY_FLAGS_MASK 0xff000000
1393 #define I915_OVERLAY_ENABLE 0x01000000
1394
1395 struct drm_intel_overlay_put_image {
1396
1397 __u32 flags;
1398
1399 __u32 bo_handle;
1400
1401 __u16 stride_Y;
1402 __u16 stride_UV;
1403 __u32 offset_Y;
1404 __u32 offset_U;
1405 __u32 offset_V;
1406
1407 __u16 src_width;
1408 __u16 src_height;
1409
1410 __u16 src_scan_width;
1411 __u16 src_scan_height;
1412
1413 __u32 crtc_id;
1414 __u16 dst_x;
1415 __u16 dst_y;
1416 __u16 dst_width;
1417 __u16 dst_height;
1418 };
1419
1420
1421 #define I915_OVERLAY_UPDATE_ATTRS (1<<0)
1422 #define I915_OVERLAY_UPDATE_GAMMA (1<<1)
1423 #define I915_OVERLAY_DISABLE_DEST_COLORKEY (1<<2)
1424 struct drm_intel_overlay_attrs {
1425 __u32 flags;
1426 __u32 color_key;
1427 __s32 brightness;
1428 __u32 contrast;
1429 __u32 saturation;
1430 __u32 gamma0;
1431 __u32 gamma1;
1432 __u32 gamma2;
1433 __u32 gamma3;
1434 __u32 gamma4;
1435 __u32 gamma5;
1436 };
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459 #define I915_SET_COLORKEY_NONE (1<<0)
1460
1461
1462 #define I915_SET_COLORKEY_DESTINATION (1<<1)
1463 #define I915_SET_COLORKEY_SOURCE (1<<2)
1464 struct drm_intel_sprite_colorkey {
1465 __u32 plane_id;
1466 __u32 min_value;
1467 __u32 channel_mask;
1468 __u32 max_value;
1469 __u32 flags;
1470 };
1471
1472 struct drm_i915_gem_wait {
1473
1474 __u32 bo_handle;
1475 __u32 flags;
1476
1477 __s64 timeout_ns;
1478 };
1479
1480 struct drm_i915_gem_context_create {
1481 __u32 ctx_id;
1482 __u32 pad;
1483 };
1484
1485 struct drm_i915_gem_context_create_ext {
1486 __u32 ctx_id;
1487 __u32 flags;
1488 #define I915_CONTEXT_CREATE_FLAGS_USE_EXTENSIONS (1u << 0)
1489 #define I915_CONTEXT_CREATE_FLAGS_SINGLE_TIMELINE (1u << 1)
1490 #define I915_CONTEXT_CREATE_FLAGS_UNKNOWN \
1491 (-(I915_CONTEXT_CREATE_FLAGS_SINGLE_TIMELINE << 1))
1492 __u64 extensions;
1493 };
1494
1495 struct drm_i915_gem_context_param {
1496 __u32 ctx_id;
1497 __u32 size;
1498 __u64 param;
1499 #define I915_CONTEXT_PARAM_BAN_PERIOD 0x1
1500 #define I915_CONTEXT_PARAM_NO_ZEROMAP 0x2
1501 #define I915_CONTEXT_PARAM_GTT_SIZE 0x3
1502 #define I915_CONTEXT_PARAM_NO_ERROR_CAPTURE 0x4
1503 #define I915_CONTEXT_PARAM_BANNABLE 0x5
1504 #define I915_CONTEXT_PARAM_PRIORITY 0x6
1505 #define I915_CONTEXT_MAX_USER_PRIORITY 1023
1506 #define I915_CONTEXT_DEFAULT_PRIORITY 0
1507 #define I915_CONTEXT_MIN_USER_PRIORITY -1023
1508
1509
1510
1511
1512 #define I915_CONTEXT_PARAM_SSEU 0x7
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532 #define I915_CONTEXT_PARAM_RECOVERABLE 0x8
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543 #define I915_CONTEXT_PARAM_VM 0x9
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567 #define I915_CONTEXT_PARAM_ENGINES 0xa
1568
1569
1570 __u64 value;
1571 };
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594 struct drm_i915_gem_context_param_sseu {
1595
1596
1597
1598 struct i915_engine_class_instance engine;
1599
1600
1601
1602
1603 __u32 flags;
1604 #define I915_CONTEXT_SSEU_FLAG_ENGINE_INDEX (1u << 0)
1605
1606
1607
1608
1609
1610 __u64 slice_mask;
1611
1612
1613
1614
1615
1616 __u64 subslice_mask;
1617
1618
1619
1620
1621
1622
1623 __u16 min_eus_per_subslice;
1624 __u16 max_eus_per_subslice;
1625
1626
1627
1628
1629 __u32 rsvd;
1630 };
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648 struct i915_context_engines_load_balance {
1649 struct i915_user_extension base;
1650
1651 __u16 engine_index;
1652 __u16 num_siblings;
1653 __u32 flags;
1654
1655 __u64 mbz64;
1656
1657 struct i915_engine_class_instance engines[0];
1658 } __attribute__((packed));
1659
1660 #define I915_DEFINE_CONTEXT_ENGINES_LOAD_BALANCE(name__, N__) struct { \
1661 struct i915_user_extension base; \
1662 __u16 engine_index; \
1663 __u16 num_siblings; \
1664 __u32 flags; \
1665 __u64 mbz64; \
1666 struct i915_engine_class_instance engines[N__]; \
1667 } __attribute__((packed)) name__
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684 struct i915_context_engines_bond {
1685 struct i915_user_extension base;
1686
1687 struct i915_engine_class_instance master;
1688
1689 __u16 virtual_index;
1690 __u16 num_bonds;
1691
1692 __u64 flags;
1693 __u64 mbz64[4];
1694
1695 struct i915_engine_class_instance engines[0];
1696 } __attribute__((packed));
1697
1698 #define I915_DEFINE_CONTEXT_ENGINES_BOND(name__, N__) struct { \
1699 struct i915_user_extension base; \
1700 struct i915_engine_class_instance master; \
1701 __u16 virtual_index; \
1702 __u16 num_bonds; \
1703 __u64 flags; \
1704 __u64 mbz64[4]; \
1705 struct i915_engine_class_instance engines[N__]; \
1706 } __attribute__((packed)) name__
1707
1708 struct i915_context_param_engines {
1709 __u64 extensions;
1710 #define I915_CONTEXT_ENGINES_EXT_LOAD_BALANCE 0
1711 #define I915_CONTEXT_ENGINES_EXT_BOND 1
1712 struct i915_engine_class_instance engines[0];
1713 } __attribute__((packed));
1714
1715 #define I915_DEFINE_CONTEXT_PARAM_ENGINES(name__, N__) struct { \
1716 __u64 extensions; \
1717 struct i915_engine_class_instance engines[N__]; \
1718 } __attribute__((packed)) name__
1719
1720 struct drm_i915_gem_context_create_ext_setparam {
1721 #define I915_CONTEXT_CREATE_EXT_SETPARAM 0
1722 struct i915_user_extension base;
1723 struct drm_i915_gem_context_param param;
1724 };
1725
1726 struct drm_i915_gem_context_create_ext_clone {
1727 #define I915_CONTEXT_CREATE_EXT_CLONE 1
1728 struct i915_user_extension base;
1729 __u32 clone_id;
1730 __u32 flags;
1731 #define I915_CONTEXT_CLONE_ENGINES (1u << 0)
1732 #define I915_CONTEXT_CLONE_FLAGS (1u << 1)
1733 #define I915_CONTEXT_CLONE_SCHEDATTR (1u << 2)
1734 #define I915_CONTEXT_CLONE_SSEU (1u << 3)
1735 #define I915_CONTEXT_CLONE_TIMELINE (1u << 4)
1736 #define I915_CONTEXT_CLONE_VM (1u << 5)
1737 #define I915_CONTEXT_CLONE_UNKNOWN -(I915_CONTEXT_CLONE_VM << 1)
1738 __u64 rsvd;
1739 };
1740
1741 struct drm_i915_gem_context_destroy {
1742 __u32 ctx_id;
1743 __u32 pad;
1744 };
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767 struct drm_i915_gem_vm_control {
1768 __u64 extensions;
1769 __u32 flags;
1770 __u32 vm_id;
1771 };
1772
1773 struct drm_i915_reg_read {
1774
1775
1776
1777
1778
1779
1780 __u64 offset;
1781 #define I915_REG_READ_8B_WA (1ul << 0)
1782
1783 __u64 val;
1784 };
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795 struct drm_i915_reset_stats {
1796 __u32 ctx_id;
1797 __u32 flags;
1798
1799
1800 __u32 reset_count;
1801
1802
1803 __u32 batch_active;
1804
1805
1806 __u32 batch_pending;
1807
1808 __u32 pad;
1809 };
1810
1811 struct drm_i915_gem_userptr {
1812 __u64 user_ptr;
1813 __u64 user_size;
1814 __u32 flags;
1815 #define I915_USERPTR_READ_ONLY 0x1
1816 #define I915_USERPTR_UNSYNCHRONIZED 0x80000000
1817
1818
1819
1820
1821
1822 __u32 handle;
1823 };
1824
1825 enum drm_i915_oa_format {
1826 I915_OA_FORMAT_A13 = 1,
1827 I915_OA_FORMAT_A29,
1828 I915_OA_FORMAT_A13_B8_C8,
1829 I915_OA_FORMAT_B4_C8,
1830 I915_OA_FORMAT_A45_B8_C8,
1831 I915_OA_FORMAT_B4_C8_A16,
1832 I915_OA_FORMAT_C4_B8,
1833
1834
1835 I915_OA_FORMAT_A12,
1836 I915_OA_FORMAT_A12_B8_C8,
1837 I915_OA_FORMAT_A32u40_A4u32_B8_C8,
1838
1839 I915_OA_FORMAT_MAX
1840 };
1841
1842 enum drm_i915_perf_property_id {
1843
1844
1845
1846
1847
1848 DRM_I915_PERF_PROP_CTX_HANDLE = 1,
1849
1850
1851
1852
1853
1854 DRM_I915_PERF_PROP_SAMPLE_OA,
1855
1856
1857
1858
1859
1860 DRM_I915_PERF_PROP_OA_METRICS_SET,
1861
1862
1863
1864
1865 DRM_I915_PERF_PROP_OA_FORMAT,
1866
1867
1868
1869
1870
1871
1872
1873
1874 DRM_I915_PERF_PROP_OA_EXPONENT,
1875
1876 DRM_I915_PERF_PROP_MAX
1877 };
1878
1879 struct drm_i915_perf_open_param {
1880 __u32 flags;
1881 #define I915_PERF_FLAG_FD_CLOEXEC (1<<0)
1882 #define I915_PERF_FLAG_FD_NONBLOCK (1<<1)
1883 #define I915_PERF_FLAG_DISABLED (1<<2)
1884
1885
1886 __u32 num_properties;
1887
1888
1889
1890
1891
1892 __u64 properties_ptr;
1893 };
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905 #define I915_PERF_IOCTL_ENABLE _IO('i', 0x0)
1906
1907
1908
1909
1910
1911
1912 #define I915_PERF_IOCTL_DISABLE _IO('i', 0x1)
1913
1914
1915
1916
1917 struct drm_i915_perf_record_header {
1918 __u32 type;
1919 __u16 pad;
1920 __u16 size;
1921 };
1922
1923 enum drm_i915_perf_record_type {
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944 DRM_I915_PERF_RECORD_SAMPLE = 1,
1945
1946
1947
1948
1949
1950
1951
1952 DRM_I915_PERF_RECORD_OA_REPORT_LOST = 2,
1953
1954
1955
1956
1957 DRM_I915_PERF_RECORD_OA_BUFFER_LOST = 3,
1958
1959 DRM_I915_PERF_RECORD_MAX
1960 };
1961
1962
1963
1964
1965 struct drm_i915_perf_oa_config {
1966
1967 char uuid[36];
1968
1969 __u32 n_mux_regs;
1970 __u32 n_boolean_regs;
1971 __u32 n_flex_regs;
1972
1973
1974
1975
1976
1977
1978 __u64 mux_regs_ptr;
1979 __u64 boolean_regs_ptr;
1980 __u64 flex_regs_ptr;
1981 };
1982
1983 struct drm_i915_query_item {
1984 __u64 query_id;
1985 #define DRM_I915_QUERY_TOPOLOGY_INFO 1
1986 #define DRM_I915_QUERY_ENGINE_INFO 2
1987
1988
1989
1990
1991
1992
1993
1994
1995 __s32 length;
1996
1997
1998
1999
2000 __u32 flags;
2001
2002
2003
2004
2005
2006
2007 __u64 data_ptr;
2008 };
2009
2010 struct drm_i915_query {
2011 __u32 num_items;
2012
2013
2014
2015
2016 __u32 flags;
2017
2018
2019
2020
2021 __u64 items_ptr;
2022 };
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051 struct drm_i915_query_topology_info {
2052
2053
2054
2055 __u16 flags;
2056
2057 __u16 max_slices;
2058 __u16 max_subslices;
2059 __u16 max_eus_per_subslice;
2060
2061
2062
2063
2064 __u16 subslice_offset;
2065
2066
2067
2068
2069
2070 __u16 subslice_stride;
2071
2072
2073
2074
2075 __u16 eu_offset;
2076
2077
2078
2079
2080 __u16 eu_stride;
2081
2082 __u8 data[];
2083 };
2084
2085
2086
2087
2088
2089
2090 struct drm_i915_engine_info {
2091
2092 struct i915_engine_class_instance engine;
2093
2094
2095 __u32 rsvd0;
2096
2097
2098 __u64 flags;
2099
2100
2101 __u64 capabilities;
2102 #define I915_VIDEO_CLASS_CAPABILITY_HEVC (1 << 0)
2103 #define I915_VIDEO_AND_ENHANCE_CLASS_CAPABILITY_SFC (1 << 1)
2104
2105
2106 __u64 rsvd1[4];
2107 };
2108
2109
2110
2111
2112
2113
2114
2115 struct drm_i915_query_engine_info {
2116
2117 __u32 num_engines;
2118
2119
2120 __u32 rsvd[3];
2121
2122
2123 struct drm_i915_engine_info engines[];
2124 };
2125
2126 #if defined(__cplusplus)
2127 }
2128 #endif
2129
2130 #endif