blob: 001ebd5a32c44090a15f7e9e1f1626cd26c6c297 [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 _UAPI_I915_DRM_H_
20#define _UAPI_I915_DRM_H_
Christopher Ferris106b3a82016-08-24 12:15:38 -070021#include "drm.h"
22#ifdef __cplusplus
Christopher Ferris48fe0ae2019-01-10 15:59:33 -080023extern "C" {
Christopher Ferris106b3a82016-08-24 12:15:38 -070024#endif
25#define I915_L3_PARITY_UEVENT "L3_PARITY_ERROR"
Christopher Ferris38062f92014-07-09 15:33:25 -070026#define I915_ERROR_UEVENT "ERROR"
27#define I915_RESET_UEVENT "RESET"
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -070028struct i915_user_extension {
29 __u64 next_extension;
30 __u32 name;
31 __u32 flags;
32 __u32 rsvd[4];
33};
Christopher Ferris6a9755d2017-01-13 14:09:31 -080034enum i915_mocs_table_index {
35 I915_MOCS_UNCACHED,
36 I915_MOCS_PTE,
37 I915_MOCS_CACHED,
Christopher Ferris6a9755d2017-01-13 14:09:31 -080038};
Christopher Ferris76a1d452018-06-27 14:12:29 -070039enum 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};
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -070046struct i915_engine_class_instance {
47 __u16 engine_class;
48 __u16 engine_instance;
Christopher Ferrisb8a95e22019-10-02 18:29:20 -070049#define I915_ENGINE_CLASS_INVALID_NONE - 1
50#define I915_ENGINE_CLASS_INVALID_VIRTUAL - 2
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -070051};
Christopher Ferris76a1d452018-06-27 14:12:29 -070052enum 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_LAST I915_PMU_RC6_RESIDENCY
Christopher Ferris38062f92014-07-09 15:33:25 -070071#define I915_NR_TEX_REGIONS 255
Ben Cheng655a7c02013-10-16 16:09:24 -070072#define I915_LOG_MIN_TEX_REGION_SIZE 14
73typedef struct _drm_i915_init {
Christopher Ferris6a9755d2017-01-13 14:09:31 -080074 enum {
Tao Baod7db5942015-01-28 10:07:51 -080075 I915_INIT_DMA = 0x01,
76 I915_CLEANUP_DMA = 0x02,
Tao Baod7db5942015-01-28 10:07:51 -080077 I915_RESUME_DMA = 0x03
Christopher Ferris6a9755d2017-01-13 14:09:31 -080078 } func;
Tao Baod7db5942015-01-28 10:07:51 -080079 unsigned int mmio_offset;
80 int sarea_priv_offset;
Tao Baod7db5942015-01-28 10:07:51 -080081 unsigned int ring_start;
Christopher Ferris6a9755d2017-01-13 14:09:31 -080082 unsigned int ring_end;
Tao Baod7db5942015-01-28 10:07:51 -080083 unsigned int ring_size;
84 unsigned int front_offset;
Tao Baod7db5942015-01-28 10:07:51 -080085 unsigned int back_offset;
Christopher Ferris6a9755d2017-01-13 14:09:31 -080086 unsigned int depth_offset;
Tao Baod7db5942015-01-28 10:07:51 -080087 unsigned int w;
88 unsigned int h;
Tao Baod7db5942015-01-28 10:07:51 -080089 unsigned int pitch;
Christopher Ferris6a9755d2017-01-13 14:09:31 -080090 unsigned int pitch_bits;
Tao Baod7db5942015-01-28 10:07:51 -080091 unsigned int back_pitch;
92 unsigned int depth_pitch;
Tao Baod7db5942015-01-28 10:07:51 -080093 unsigned int cpp;
Christopher Ferris6a9755d2017-01-13 14:09:31 -080094 unsigned int chipset;
Ben Cheng655a7c02013-10-16 16:09:24 -070095} drm_i915_init_t;
Ben Cheng655a7c02013-10-16 16:09:24 -070096typedef struct _drm_i915_sarea {
Tao Baod7db5942015-01-28 10:07:51 -080097 struct drm_tex_region texList[I915_NR_TEX_REGIONS + 1];
Christopher Ferris6a9755d2017-01-13 14:09:31 -080098 int last_upload;
Tao Baod7db5942015-01-28 10:07:51 -080099 int last_enqueue;
100 int last_dispatch;
Tao Baod7db5942015-01-28 10:07:51 -0800101 int ctxOwner;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800102 int texAge;
Tao Baod7db5942015-01-28 10:07:51 -0800103 int pf_enabled;
104 int pf_active;
Tao Baod7db5942015-01-28 10:07:51 -0800105 int pf_current_page;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800106 int perf_boxes;
Tao Baod7db5942015-01-28 10:07:51 -0800107 int width, height;
108 drm_handle_t front_handle;
Tao Baod7db5942015-01-28 10:07:51 -0800109 int front_offset;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800110 int front_size;
Tao Baod7db5942015-01-28 10:07:51 -0800111 drm_handle_t back_handle;
112 int back_offset;
Tao Baod7db5942015-01-28 10:07:51 -0800113 int back_size;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800114 drm_handle_t depth_handle;
Tao Baod7db5942015-01-28 10:07:51 -0800115 int depth_offset;
116 int depth_size;
Tao Baod7db5942015-01-28 10:07:51 -0800117 drm_handle_t tex_handle;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800118 int tex_offset;
Tao Baod7db5942015-01-28 10:07:51 -0800119 int tex_size;
120 int log_tex_granularity;
Tao Baod7db5942015-01-28 10:07:51 -0800121 int pitch;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800122 int rotation;
Tao Baod7db5942015-01-28 10:07:51 -0800123 int rotated_offset;
124 int rotated_size;
Tao Baod7db5942015-01-28 10:07:51 -0800125 int rotated_pitch;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800126 int virtualX, virtualY;
Tao Baod7db5942015-01-28 10:07:51 -0800127 unsigned int front_tiled;
128 unsigned int back_tiled;
Tao Baod7db5942015-01-28 10:07:51 -0800129 unsigned int depth_tiled;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800130 unsigned int rotated_tiled;
Tao Baod7db5942015-01-28 10:07:51 -0800131 unsigned int rotated2_tiled;
132 int pipeA_x;
Tao Baod7db5942015-01-28 10:07:51 -0800133 int pipeA_y;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800134 int pipeA_w;
Tao Baod7db5942015-01-28 10:07:51 -0800135 int pipeA_h;
136 int pipeB_x;
Tao Baod7db5942015-01-28 10:07:51 -0800137 int pipeB_y;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800138 int pipeB_w;
Tao Baod7db5942015-01-28 10:07:51 -0800139 int pipeB_h;
140 drm_handle_t unused_handle;
Tao Baod7db5942015-01-28 10:07:51 -0800141 __u32 unused1, unused2, unused3;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800142 __u32 front_bo_handle;
Tao Baod7db5942015-01-28 10:07:51 -0800143 __u32 back_bo_handle;
144 __u32 unused_bo_handle;
Tao Baod7db5942015-01-28 10:07:51 -0800145 __u32 depth_bo_handle;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800146} drm_i915_sarea_t;
Ben Cheng655a7c02013-10-16 16:09:24 -0700147#define planeA_x pipeA_x
Ben Cheng655a7c02013-10-16 16:09:24 -0700148#define planeA_y pipeA_y
149#define planeA_w pipeA_w
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800150#define planeA_h pipeA_h
Ben Cheng655a7c02013-10-16 16:09:24 -0700151#define planeB_x pipeB_x
Ben Cheng655a7c02013-10-16 16:09:24 -0700152#define planeB_y pipeB_y
153#define planeB_w pipeB_w
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800154#define planeB_h pipeB_h
Ben Cheng655a7c02013-10-16 16:09:24 -0700155#define I915_BOX_RING_EMPTY 0x1
Ben Cheng655a7c02013-10-16 16:09:24 -0700156#define I915_BOX_FLIP 0x2
157#define I915_BOX_WAIT 0x4
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800158#define I915_BOX_TEXTURE_LOAD 0x8
Ben Cheng655a7c02013-10-16 16:09:24 -0700159#define I915_BOX_LOST_CONTEXT 0x10
Ben Cheng655a7c02013-10-16 16:09:24 -0700160#define DRM_I915_INIT 0x00
161#define DRM_I915_FLUSH 0x01
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800162#define DRM_I915_FLIP 0x02
Ben Cheng655a7c02013-10-16 16:09:24 -0700163#define DRM_I915_BATCHBUFFER 0x03
Ben Cheng655a7c02013-10-16 16:09:24 -0700164#define DRM_I915_IRQ_EMIT 0x04
165#define DRM_I915_IRQ_WAIT 0x05
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800166#define DRM_I915_GETPARAM 0x06
Ben Cheng655a7c02013-10-16 16:09:24 -0700167#define DRM_I915_SETPARAM 0x07
Ben Cheng655a7c02013-10-16 16:09:24 -0700168#define DRM_I915_ALLOC 0x08
169#define DRM_I915_FREE 0x09
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800170#define DRM_I915_INIT_HEAP 0x0a
Ben Cheng655a7c02013-10-16 16:09:24 -0700171#define DRM_I915_CMDBUFFER 0x0b
Ben Cheng655a7c02013-10-16 16:09:24 -0700172#define DRM_I915_DESTROY_HEAP 0x0c
173#define DRM_I915_SET_VBLANK_PIPE 0x0d
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800174#define DRM_I915_GET_VBLANK_PIPE 0x0e
Ben Cheng655a7c02013-10-16 16:09:24 -0700175#define DRM_I915_VBLANK_SWAP 0x0f
Ben Cheng655a7c02013-10-16 16:09:24 -0700176#define DRM_I915_HWS_ADDR 0x11
177#define DRM_I915_GEM_INIT 0x13
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800178#define DRM_I915_GEM_EXECBUFFER 0x14
Ben Cheng655a7c02013-10-16 16:09:24 -0700179#define DRM_I915_GEM_PIN 0x15
Ben Cheng655a7c02013-10-16 16:09:24 -0700180#define DRM_I915_GEM_UNPIN 0x16
181#define DRM_I915_GEM_BUSY 0x17
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800182#define DRM_I915_GEM_THROTTLE 0x18
Ben Cheng655a7c02013-10-16 16:09:24 -0700183#define DRM_I915_GEM_ENTERVT 0x19
Ben Cheng655a7c02013-10-16 16:09:24 -0700184#define DRM_I915_GEM_LEAVEVT 0x1a
185#define DRM_I915_GEM_CREATE 0x1b
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800186#define DRM_I915_GEM_PREAD 0x1c
Ben Cheng655a7c02013-10-16 16:09:24 -0700187#define DRM_I915_GEM_PWRITE 0x1d
Ben Cheng655a7c02013-10-16 16:09:24 -0700188#define DRM_I915_GEM_MMAP 0x1e
189#define DRM_I915_GEM_SET_DOMAIN 0x1f
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800190#define DRM_I915_GEM_SW_FINISH 0x20
Ben Cheng655a7c02013-10-16 16:09:24 -0700191#define DRM_I915_GEM_SET_TILING 0x21
Ben Cheng655a7c02013-10-16 16:09:24 -0700192#define DRM_I915_GEM_GET_TILING 0x22
193#define DRM_I915_GEM_GET_APERTURE 0x23
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800194#define DRM_I915_GEM_MMAP_GTT 0x24
Ben Cheng655a7c02013-10-16 16:09:24 -0700195#define DRM_I915_GET_PIPE_FROM_CRTC_ID 0x25
Ben Cheng655a7c02013-10-16 16:09:24 -0700196#define DRM_I915_GEM_MADVISE 0x26
197#define DRM_I915_OVERLAY_PUT_IMAGE 0x27
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800198#define DRM_I915_OVERLAY_ATTRS 0x28
Ben Cheng655a7c02013-10-16 16:09:24 -0700199#define DRM_I915_GEM_EXECBUFFER2 0x29
Christopher Ferris525ce912017-07-26 13:12:53 -0700200#define DRM_I915_GEM_EXECBUFFER2_WR DRM_I915_GEM_EXECBUFFER2
Ben Cheng655a7c02013-10-16 16:09:24 -0700201#define DRM_I915_GET_SPRITE_COLORKEY 0x2a
202#define DRM_I915_SET_SPRITE_COLORKEY 0x2b
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800203#define DRM_I915_GEM_WAIT 0x2c
Ben Cheng655a7c02013-10-16 16:09:24 -0700204#define DRM_I915_GEM_CONTEXT_CREATE 0x2d
Ben Cheng655a7c02013-10-16 16:09:24 -0700205#define DRM_I915_GEM_CONTEXT_DESTROY 0x2e
206#define DRM_I915_GEM_SET_CACHING 0x2f
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800207#define DRM_I915_GEM_GET_CACHING 0x30
Ben Cheng655a7c02013-10-16 16:09:24 -0700208#define DRM_I915_REG_READ 0x31
Christopher Ferris38062f92014-07-09 15:33:25 -0700209#define DRM_I915_GET_RESET_STATS 0x32
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700210#define DRM_I915_GEM_USERPTR 0x33
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800211#define DRM_I915_GEM_CONTEXT_GETPARAM 0x34
Christopher Ferris05d08e92016-02-04 13:16:38 -0800212#define DRM_I915_GEM_CONTEXT_SETPARAM 0x35
Christopher Ferris525ce912017-07-26 13:12:53 -0700213#define DRM_I915_PERF_OPEN 0x36
Christopher Ferris1308ad32017-11-14 17:32:13 -0800214#define DRM_I915_PERF_ADD_CONFIG 0x37
215#define DRM_I915_PERF_REMOVE_CONFIG 0x38
Christopher Ferris76a1d452018-06-27 14:12:29 -0700216#define DRM_I915_QUERY 0x39
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700217#define DRM_I915_GEM_VM_CREATE 0x3a
218#define DRM_I915_GEM_VM_DESTROY 0x3b
Tao Baod7db5942015-01-28 10:07:51 -0800219#define DRM_IOCTL_I915_INIT DRM_IOW(DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t)
220#define DRM_IOCTL_I915_FLUSH DRM_IO(DRM_COMMAND_BASE + DRM_I915_FLUSH)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800221#define DRM_IOCTL_I915_FLIP DRM_IO(DRM_COMMAND_BASE + DRM_I915_FLIP)
Tao Baod7db5942015-01-28 10:07:51 -0800222#define DRM_IOCTL_I915_BATCHBUFFER DRM_IOW(DRM_COMMAND_BASE + DRM_I915_BATCHBUFFER, drm_i915_batchbuffer_t)
Ben Cheng655a7c02013-10-16 16:09:24 -0700223#define DRM_IOCTL_I915_IRQ_EMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_IRQ_EMIT, drm_i915_irq_emit_t)
Tao Baod7db5942015-01-28 10:07:51 -0800224#define DRM_IOCTL_I915_IRQ_WAIT DRM_IOW(DRM_COMMAND_BASE + DRM_I915_IRQ_WAIT, drm_i915_irq_wait_t)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800225#define DRM_IOCTL_I915_GETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GETPARAM, drm_i915_getparam_t)
Tao Baod7db5942015-01-28 10:07:51 -0800226#define DRM_IOCTL_I915_SETPARAM DRM_IOW(DRM_COMMAND_BASE + DRM_I915_SETPARAM, drm_i915_setparam_t)
Ben Cheng655a7c02013-10-16 16:09:24 -0700227#define DRM_IOCTL_I915_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_ALLOC, drm_i915_mem_alloc_t)
Tao Baod7db5942015-01-28 10:07:51 -0800228#define DRM_IOCTL_I915_FREE DRM_IOW(DRM_COMMAND_BASE + DRM_I915_FREE, drm_i915_mem_free_t)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800229#define DRM_IOCTL_I915_INIT_HEAP DRM_IOW(DRM_COMMAND_BASE + DRM_I915_INIT_HEAP, drm_i915_mem_init_heap_t)
Tao Baod7db5942015-01-28 10:07:51 -0800230#define DRM_IOCTL_I915_CMDBUFFER DRM_IOW(DRM_COMMAND_BASE + DRM_I915_CMDBUFFER, drm_i915_cmdbuffer_t)
231#define DRM_IOCTL_I915_DESTROY_HEAP DRM_IOW(DRM_COMMAND_BASE + DRM_I915_DESTROY_HEAP, drm_i915_mem_destroy_heap_t)
232#define DRM_IOCTL_I915_SET_VBLANK_PIPE DRM_IOW(DRM_COMMAND_BASE + DRM_I915_SET_VBLANK_PIPE, drm_i915_vblank_pipe_t)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800233#define DRM_IOCTL_I915_GET_VBLANK_PIPE DRM_IOR(DRM_COMMAND_BASE + DRM_I915_GET_VBLANK_PIPE, drm_i915_vblank_pipe_t)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700234#define DRM_IOCTL_I915_VBLANK_SWAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_VBLANK_SWAP, drm_i915_vblank_swap_t)
Ben Cheng655a7c02013-10-16 16:09:24 -0700235#define DRM_IOCTL_I915_HWS_ADDR DRM_IOW(DRM_COMMAND_BASE + DRM_I915_HWS_ADDR, struct drm_i915_gem_init)
236#define DRM_IOCTL_I915_GEM_INIT DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_INIT, struct drm_i915_gem_init)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800237#define DRM_IOCTL_I915_GEM_EXECBUFFER DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER, struct drm_i915_gem_execbuffer)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700238#define DRM_IOCTL_I915_GEM_EXECBUFFER2 DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER2, struct drm_i915_gem_execbuffer2)
Christopher Ferris525ce912017-07-26 13:12:53 -0700239#define DRM_IOCTL_I915_GEM_EXECBUFFER2_WR DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER2_WR, struct drm_i915_gem_execbuffer2)
Ben Cheng655a7c02013-10-16 16:09:24 -0700240#define DRM_IOCTL_I915_GEM_PIN DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_PIN, struct drm_i915_gem_pin)
241#define DRM_IOCTL_I915_GEM_UNPIN DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_UNPIN, struct drm_i915_gem_unpin)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800242#define DRM_IOCTL_I915_GEM_BUSY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_BUSY, struct drm_i915_gem_busy)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700243#define DRM_IOCTL_I915_GEM_SET_CACHING DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_SET_CACHING, struct drm_i915_gem_caching)
Ben Cheng655a7c02013-10-16 16:09:24 -0700244#define DRM_IOCTL_I915_GEM_GET_CACHING DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_GET_CACHING, struct drm_i915_gem_caching)
Tao Baod7db5942015-01-28 10:07:51 -0800245#define DRM_IOCTL_I915_GEM_THROTTLE DRM_IO(DRM_COMMAND_BASE + DRM_I915_GEM_THROTTLE)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800246#define DRM_IOCTL_I915_GEM_ENTERVT DRM_IO(DRM_COMMAND_BASE + DRM_I915_GEM_ENTERVT)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700247#define DRM_IOCTL_I915_GEM_LEAVEVT DRM_IO(DRM_COMMAND_BASE + DRM_I915_GEM_LEAVEVT)
Ben Cheng655a7c02013-10-16 16:09:24 -0700248#define DRM_IOCTL_I915_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_CREATE, struct drm_i915_gem_create)
Tao Baod7db5942015-01-28 10:07:51 -0800249#define DRM_IOCTL_I915_GEM_PREAD DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_PREAD, struct drm_i915_gem_pread)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800250#define DRM_IOCTL_I915_GEM_PWRITE DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_PWRITE, struct drm_i915_gem_pwrite)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700251#define DRM_IOCTL_I915_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MMAP, struct drm_i915_gem_mmap)
Ben Cheng655a7c02013-10-16 16:09:24 -0700252#define DRM_IOCTL_I915_GEM_MMAP_GTT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MMAP_GTT, struct drm_i915_gem_mmap_gtt)
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700253#define DRM_IOCTL_I915_GEM_MMAP_OFFSET DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MMAP_GTT, struct drm_i915_gem_mmap_offset)
Tao Baod7db5942015-01-28 10:07:51 -0800254#define DRM_IOCTL_I915_GEM_SET_DOMAIN DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_SET_DOMAIN, struct drm_i915_gem_set_domain)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800255#define DRM_IOCTL_I915_GEM_SW_FINISH DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_SW_FINISH, struct drm_i915_gem_sw_finish)
Tao Baod7db5942015-01-28 10:07:51 -0800256#define DRM_IOCTL_I915_GEM_SET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_SET_TILING, struct drm_i915_gem_set_tiling)
257#define DRM_IOCTL_I915_GEM_GET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_GET_TILING, struct drm_i915_gem_get_tiling)
258#define DRM_IOCTL_I915_GEM_GET_APERTURE DRM_IOR(DRM_COMMAND_BASE + DRM_I915_GEM_GET_APERTURE, struct drm_i915_gem_get_aperture)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800259#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)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700260#define DRM_IOCTL_I915_GEM_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MADVISE, struct drm_i915_gem_madvise)
Ben Cheng655a7c02013-10-16 16:09:24 -0700261#define DRM_IOCTL_I915_OVERLAY_PUT_IMAGE DRM_IOW(DRM_COMMAND_BASE + DRM_I915_OVERLAY_PUT_IMAGE, struct drm_intel_overlay_put_image)
262#define DRM_IOCTL_I915_OVERLAY_ATTRS DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_OVERLAY_ATTRS, struct drm_intel_overlay_attrs)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800263#define DRM_IOCTL_I915_SET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_SET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800264#define DRM_IOCTL_I915_GET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey)
Ben Cheng655a7c02013-10-16 16:09:24 -0700265#define DRM_IOCTL_I915_GEM_WAIT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_WAIT, struct drm_i915_gem_wait)
Tao Baod7db5942015-01-28 10:07:51 -0800266#define DRM_IOCTL_I915_GEM_CONTEXT_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_CREATE, struct drm_i915_gem_context_create)
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700267#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)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800268#define DRM_IOCTL_I915_GEM_CONTEXT_DESTROY DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_DESTROY, struct drm_i915_gem_context_destroy)
Tao Baod7db5942015-01-28 10:07:51 -0800269#define DRM_IOCTL_I915_REG_READ DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_REG_READ, struct drm_i915_reg_read)
270#define DRM_IOCTL_I915_GET_RESET_STATS DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GET_RESET_STATS, struct drm_i915_reset_stats)
271#define DRM_IOCTL_I915_GEM_USERPTR DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_USERPTR, struct drm_i915_gem_userptr)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800272#define DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_GETPARAM, struct drm_i915_gem_context_param)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800273#define DRM_IOCTL_I915_GEM_CONTEXT_SETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_SETPARAM, struct drm_i915_gem_context_param)
Christopher Ferris525ce912017-07-26 13:12:53 -0700274#define DRM_IOCTL_I915_PERF_OPEN DRM_IOW(DRM_COMMAND_BASE + DRM_I915_PERF_OPEN, struct drm_i915_perf_open_param)
Christopher Ferris1308ad32017-11-14 17:32:13 -0800275#define DRM_IOCTL_I915_PERF_ADD_CONFIG DRM_IOW(DRM_COMMAND_BASE + DRM_I915_PERF_ADD_CONFIG, struct drm_i915_perf_oa_config)
276#define DRM_IOCTL_I915_PERF_REMOVE_CONFIG DRM_IOW(DRM_COMMAND_BASE + DRM_I915_PERF_REMOVE_CONFIG, __u64)
Christopher Ferris76a1d452018-06-27 14:12:29 -0700277#define DRM_IOCTL_I915_QUERY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_QUERY, struct drm_i915_query)
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700278#define DRM_IOCTL_I915_GEM_VM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_VM_CREATE, struct drm_i915_gem_vm_control)
279#define DRM_IOCTL_I915_GEM_VM_DESTROY DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_VM_DESTROY, struct drm_i915_gem_vm_control)
Ben Cheng655a7c02013-10-16 16:09:24 -0700280typedef struct drm_i915_batchbuffer {
Tao Baod7db5942015-01-28 10:07:51 -0800281 int start;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800282 int used;
Tao Baod7db5942015-01-28 10:07:51 -0800283 int DR1;
284 int DR4;
Tao Baod7db5942015-01-28 10:07:51 -0800285 int num_cliprects;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800286 struct drm_clip_rect __user * cliprects;
Christopher Ferris38062f92014-07-09 15:33:25 -0700287} drm_i915_batchbuffer_t;
Ben Cheng655a7c02013-10-16 16:09:24 -0700288typedef struct _drm_i915_cmdbuffer {
Tao Baod7db5942015-01-28 10:07:51 -0800289 char __user * buf;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800290 int sz;
Tao Baod7db5942015-01-28 10:07:51 -0800291 int DR1;
292 int DR4;
Tao Baod7db5942015-01-28 10:07:51 -0800293 int num_cliprects;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800294 struct drm_clip_rect __user * cliprects;
Christopher Ferris38062f92014-07-09 15:33:25 -0700295} drm_i915_cmdbuffer_t;
Ben Cheng655a7c02013-10-16 16:09:24 -0700296typedef struct drm_i915_irq_emit {
Tao Baod7db5942015-01-28 10:07:51 -0800297 int __user * irq_seq;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800298} drm_i915_irq_emit_t;
Christopher Ferris38062f92014-07-09 15:33:25 -0700299typedef struct drm_i915_irq_wait {
Tao Baod7db5942015-01-28 10:07:51 -0800300 int irq_seq;
Ben Cheng655a7c02013-10-16 16:09:24 -0700301} drm_i915_irq_wait_t;
Christopher Ferrisd842e432019-03-07 10:21:59 -0800302#define I915_GEM_PPGTT_NONE 0
303#define I915_GEM_PPGTT_ALIASING 1
304#define I915_GEM_PPGTT_FULL 2
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800305#define I915_PARAM_IRQ_ACTIVE 1
Christopher Ferris38062f92014-07-09 15:33:25 -0700306#define I915_PARAM_ALLOW_BATCHBUFFER 2
Ben Cheng655a7c02013-10-16 16:09:24 -0700307#define I915_PARAM_LAST_DISPATCH 3
308#define I915_PARAM_CHIPSET_ID 4
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800309#define I915_PARAM_HAS_GEM 5
Christopher Ferris38062f92014-07-09 15:33:25 -0700310#define I915_PARAM_NUM_FENCES_AVAIL 6
Ben Cheng655a7c02013-10-16 16:09:24 -0700311#define I915_PARAM_HAS_OVERLAY 7
312#define I915_PARAM_HAS_PAGEFLIPPING 8
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800313#define I915_PARAM_HAS_EXECBUF2 9
Christopher Ferris38062f92014-07-09 15:33:25 -0700314#define I915_PARAM_HAS_BSD 10
Ben Cheng655a7c02013-10-16 16:09:24 -0700315#define I915_PARAM_HAS_BLT 11
316#define I915_PARAM_HAS_RELAXED_FENCING 12
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800317#define I915_PARAM_HAS_COHERENT_RINGS 13
Christopher Ferris38062f92014-07-09 15:33:25 -0700318#define I915_PARAM_HAS_EXEC_CONSTANTS 14
Ben Cheng655a7c02013-10-16 16:09:24 -0700319#define I915_PARAM_HAS_RELAXED_DELTA 15
320#define I915_PARAM_HAS_GEN7_SOL_RESET 16
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800321#define I915_PARAM_HAS_LLC 17
Christopher Ferris38062f92014-07-09 15:33:25 -0700322#define I915_PARAM_HAS_ALIASING_PPGTT 18
Ben Cheng655a7c02013-10-16 16:09:24 -0700323#define I915_PARAM_HAS_WAIT_TIMEOUT 19
324#define I915_PARAM_HAS_SEMAPHORES 20
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800325#define I915_PARAM_HAS_PRIME_VMAP_FLUSH 21
Christopher Ferris38062f92014-07-09 15:33:25 -0700326#define I915_PARAM_HAS_VEBOX 22
Ben Cheng655a7c02013-10-16 16:09:24 -0700327#define I915_PARAM_HAS_SECURE_BATCHES 23
328#define I915_PARAM_HAS_PINNED_BATCHES 24
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800329#define I915_PARAM_HAS_EXEC_NO_RELOC 25
Christopher Ferris38062f92014-07-09 15:33:25 -0700330#define I915_PARAM_HAS_EXEC_HANDLE_LUT 26
331#define I915_PARAM_HAS_WT 27
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700332#define I915_PARAM_CMD_PARSER_VERSION 28
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800333#define I915_PARAM_HAS_COHERENT_PHYS_GTT 29
Christopher Ferris05d08e92016-02-04 13:16:38 -0800334#define I915_PARAM_MMAP_VERSION 30
335#define I915_PARAM_HAS_BSD2 31
Christopher Ferris05d08e92016-02-04 13:16:38 -0800336#define I915_PARAM_REVISION 32
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800337#define I915_PARAM_SUBSLICE_TOTAL 33
Christopher Ferris05d08e92016-02-04 13:16:38 -0800338#define I915_PARAM_EU_TOTAL 34
339#define I915_PARAM_HAS_GPU_RESET 35
Christopher Ferris05d08e92016-02-04 13:16:38 -0800340#define I915_PARAM_HAS_RESOURCE_STREAMER 36
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800341#define I915_PARAM_HAS_EXEC_SOFTPIN 37
Christopher Ferris49f525c2016-12-12 14:55:36 -0800342#define I915_PARAM_HAS_POOLED_EU 38
343#define I915_PARAM_MIN_EU_IN_POOL 39
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800344#define I915_PARAM_MMAP_GTT_VERSION 40
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800345#define I915_PARAM_HAS_SCHEDULER 41
Christopher Ferris934ec942018-01-31 15:29:16 -0800346#define I915_SCHEDULER_CAP_ENABLED (1ul << 0)
347#define I915_SCHEDULER_CAP_PRIORITY (1ul << 1)
348#define I915_SCHEDULER_CAP_PREEMPTION (1ul << 2)
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700349#define I915_SCHEDULER_CAP_SEMAPHORES (1ul << 3)
Christopher Ferris9584fa42019-12-09 15:36:13 -0800350#define I915_SCHEDULER_CAP_ENGINE_BUSY_STATS (1ul << 4)
Christopher Ferris525ce912017-07-26 13:12:53 -0700351#define I915_PARAM_HUC_STATUS 42
352#define I915_PARAM_HAS_EXEC_ASYNC 43
353#define I915_PARAM_HAS_EXEC_FENCE 44
Christopher Ferris1308ad32017-11-14 17:32:13 -0800354#define I915_PARAM_HAS_EXEC_CAPTURE 45
355#define I915_PARAM_SLICE_MASK 46
356#define I915_PARAM_SUBSLICE_MASK 47
357#define I915_PARAM_HAS_EXEC_BATCH_FIRST 48
358#define I915_PARAM_HAS_EXEC_FENCE_ARRAY 49
Christopher Ferris76a1d452018-06-27 14:12:29 -0700359#define I915_PARAM_HAS_CONTEXT_ISOLATION 50
360#define I915_PARAM_CS_TIMESTAMP_FREQUENCY 51
Christopher Ferris86a48372019-01-10 14:14:59 -0800361#define I915_PARAM_MMAP_GTT_COHERENT 52
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700362#define I915_PARAM_HAS_EXEC_SUBMIT_FENCE 53
Christopher Ferrisd32ca142020-02-04 16:16:51 -0800363#define I915_PARAM_PERF_REVISION 54
Ben Cheng655a7c02013-10-16 16:09:24 -0700364typedef struct drm_i915_getparam {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800365 __s32 param;
Tao Baod7db5942015-01-28 10:07:51 -0800366 int __user * value;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800367} drm_i915_getparam_t;
Ben Cheng655a7c02013-10-16 16:09:24 -0700368#define I915_SETPARAM_USE_MI_BATCHBUFFER_START 1
369#define I915_SETPARAM_TEX_LRU_LOG_GRANULARITY 2
370#define I915_SETPARAM_ALLOW_BATCHBUFFER 3
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800371#define I915_SETPARAM_NUM_USED_FENCES 4
Ben Cheng655a7c02013-10-16 16:09:24 -0700372typedef struct drm_i915_setparam {
Tao Baod7db5942015-01-28 10:07:51 -0800373 int param;
374 int value;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800375} drm_i915_setparam_t;
Ben Cheng655a7c02013-10-16 16:09:24 -0700376#define I915_MEM_REGION_AGP 1
377typedef struct drm_i915_mem_alloc {
Tao Baod7db5942015-01-28 10:07:51 -0800378 int region;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800379 int alignment;
Tao Baod7db5942015-01-28 10:07:51 -0800380 int size;
381 int __user * region_offset;
Ben Cheng655a7c02013-10-16 16:09:24 -0700382} drm_i915_mem_alloc_t;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800383typedef struct drm_i915_mem_free {
Tao Baod7db5942015-01-28 10:07:51 -0800384 int region;
385 int region_offset;
Ben Cheng655a7c02013-10-16 16:09:24 -0700386} drm_i915_mem_free_t;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800387typedef struct drm_i915_mem_init_heap {
Tao Baod7db5942015-01-28 10:07:51 -0800388 int region;
389 int size;
390 int start;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800391} drm_i915_mem_init_heap_t;
Ben Cheng655a7c02013-10-16 16:09:24 -0700392typedef struct drm_i915_mem_destroy_heap {
Tao Baod7db5942015-01-28 10:07:51 -0800393 int region;
Ben Cheng655a7c02013-10-16 16:09:24 -0700394} drm_i915_mem_destroy_heap_t;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800395#define DRM_I915_VBLANK_PIPE_A 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700396#define DRM_I915_VBLANK_PIPE_B 2
397typedef struct drm_i915_vblank_pipe {
Tao Baod7db5942015-01-28 10:07:51 -0800398 int pipe;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800399} drm_i915_vblank_pipe_t;
Ben Cheng655a7c02013-10-16 16:09:24 -0700400typedef struct drm_i915_vblank_swap {
Tao Baod7db5942015-01-28 10:07:51 -0800401 drm_drawable_t drawable;
402 enum drm_vblank_seq_type seqtype;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800403 unsigned int sequence;
Ben Cheng655a7c02013-10-16 16:09:24 -0700404} drm_i915_vblank_swap_t;
405typedef struct drm_i915_hws_addr {
Tao Baod7db5942015-01-28 10:07:51 -0800406 __u64 addr;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800407} drm_i915_hws_addr_t;
Ben Cheng655a7c02013-10-16 16:09:24 -0700408struct drm_i915_gem_init {
Tao Baod7db5942015-01-28 10:07:51 -0800409 __u64 gtt_start;
410 __u64 gtt_end;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800411};
Ben Cheng655a7c02013-10-16 16:09:24 -0700412struct drm_i915_gem_create {
Tao Baod7db5942015-01-28 10:07:51 -0800413 __u64 size;
414 __u32 handle;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800415 __u32 pad;
Ben Cheng655a7c02013-10-16 16:09:24 -0700416};
417struct drm_i915_gem_pread {
Tao Baod7db5942015-01-28 10:07:51 -0800418 __u32 handle;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800419 __u32 pad;
Tao Baod7db5942015-01-28 10:07:51 -0800420 __u64 offset;
421 __u64 size;
422 __u64 data_ptr;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800423};
Ben Cheng655a7c02013-10-16 16:09:24 -0700424struct drm_i915_gem_pwrite {
Tao Baod7db5942015-01-28 10:07:51 -0800425 __u32 handle;
426 __u32 pad;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800427 __u64 offset;
Tao Baod7db5942015-01-28 10:07:51 -0800428 __u64 size;
429 __u64 data_ptr;
Ben Cheng655a7c02013-10-16 16:09:24 -0700430};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800431struct drm_i915_gem_mmap {
Tao Baod7db5942015-01-28 10:07:51 -0800432 __u32 handle;
433 __u32 pad;
434 __u64 offset;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800435 __u64 size;
Tao Baod7db5942015-01-28 10:07:51 -0800436 __u64 addr_ptr;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800437 __u64 flags;
438#define I915_MMAP_WC 0x1
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800439};
Ben Cheng655a7c02013-10-16 16:09:24 -0700440struct drm_i915_gem_mmap_gtt {
Tao Baod7db5942015-01-28 10:07:51 -0800441 __u32 handle;
442 __u32 pad;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800443 __u64 offset;
Ben Cheng655a7c02013-10-16 16:09:24 -0700444};
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700445struct drm_i915_gem_mmap_offset {
446 __u32 handle;
447 __u32 pad;
448 __u64 offset;
449 __u64 flags;
450#define I915_MMAP_OFFSET_GTT 0
451#define I915_MMAP_OFFSET_WC 1
452#define I915_MMAP_OFFSET_WB 2
453#define I915_MMAP_OFFSET_UC 3
454 __u64 extensions;
455};
Ben Cheng655a7c02013-10-16 16:09:24 -0700456struct drm_i915_gem_set_domain {
Tao Baod7db5942015-01-28 10:07:51 -0800457 __u32 handle;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800458 __u32 read_domains;
Tao Baod7db5942015-01-28 10:07:51 -0800459 __u32 write_domain;
Ben Cheng655a7c02013-10-16 16:09:24 -0700460};
Ben Cheng655a7c02013-10-16 16:09:24 -0700461struct drm_i915_gem_sw_finish {
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800462 __u32 handle;
Ben Cheng655a7c02013-10-16 16:09:24 -0700463};
464struct drm_i915_gem_relocation_entry {
Tao Baod7db5942015-01-28 10:07:51 -0800465 __u32 target_handle;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800466 __u32 delta;
Tao Baod7db5942015-01-28 10:07:51 -0800467 __u64 offset;
Tao Baod7db5942015-01-28 10:07:51 -0800468 __u64 presumed_offset;
469 __u32 read_domains;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800470 __u32 write_domain;
Ben Cheng655a7c02013-10-16 16:09:24 -0700471};
472#define I915_GEM_DOMAIN_CPU 0x00000001
Ben Cheng655a7c02013-10-16 16:09:24 -0700473#define I915_GEM_DOMAIN_RENDER 0x00000002
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800474#define I915_GEM_DOMAIN_SAMPLER 0x00000004
Ben Cheng655a7c02013-10-16 16:09:24 -0700475#define I915_GEM_DOMAIN_COMMAND 0x00000008
476#define I915_GEM_DOMAIN_INSTRUCTION 0x00000010
Ben Cheng655a7c02013-10-16 16:09:24 -0700477#define I915_GEM_DOMAIN_VERTEX 0x00000020
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800478#define I915_GEM_DOMAIN_GTT 0x00000040
Christopher Ferris1308ad32017-11-14 17:32:13 -0800479#define I915_GEM_DOMAIN_WC 0x00000080
Ben Cheng655a7c02013-10-16 16:09:24 -0700480struct drm_i915_gem_exec_object {
Tao Baod7db5942015-01-28 10:07:51 -0800481 __u32 handle;
482 __u32 relocation_count;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800483 __u64 relocs_ptr;
Tao Baod7db5942015-01-28 10:07:51 -0800484 __u64 alignment;
Tao Baod7db5942015-01-28 10:07:51 -0800485 __u64 offset;
Ben Cheng655a7c02013-10-16 16:09:24 -0700486};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800487struct drm_i915_gem_execbuffer {
Tao Baod7db5942015-01-28 10:07:51 -0800488 __u64 buffers_ptr;
Tao Baod7db5942015-01-28 10:07:51 -0800489 __u32 buffer_count;
490 __u32 batch_start_offset;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800491 __u32 batch_len;
Tao Baod7db5942015-01-28 10:07:51 -0800492 __u32 DR1;
Tao Baod7db5942015-01-28 10:07:51 -0800493 __u32 DR4;
494 __u32 num_cliprects;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800495 __u64 cliprects_ptr;
Ben Cheng655a7c02013-10-16 16:09:24 -0700496};
497struct drm_i915_gem_exec_object2 {
Tao Baod7db5942015-01-28 10:07:51 -0800498 __u32 handle;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800499 __u32 relocation_count;
Tao Baod7db5942015-01-28 10:07:51 -0800500 __u64 relocs_ptr;
Tao Baod7db5942015-01-28 10:07:51 -0800501 __u64 alignment;
502 __u64 offset;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800503#define EXEC_OBJECT_NEEDS_FENCE (1 << 0)
Tao Baod7db5942015-01-28 10:07:51 -0800504#define EXEC_OBJECT_NEEDS_GTT (1 << 1)
Tao Baod7db5942015-01-28 10:07:51 -0800505#define EXEC_OBJECT_WRITE (1 << 2)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800506#define EXEC_OBJECT_SUPPORTS_48B_ADDRESS (1 << 3)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800507#define EXEC_OBJECT_PINNED (1 << 4)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800508#define EXEC_OBJECT_PAD_TO_SIZE (1 << 5)
Christopher Ferris525ce912017-07-26 13:12:53 -0700509#define EXEC_OBJECT_ASYNC (1 << 6)
Christopher Ferris1308ad32017-11-14 17:32:13 -0800510#define EXEC_OBJECT_CAPTURE (1 << 7)
511#define __EXEC_OBJECT_UNKNOWN_FLAGS - (EXEC_OBJECT_CAPTURE << 1)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800512 __u64 flags;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800513 union {
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800514 __u64 rsvd1;
515 __u64 pad_to_size;
516 };
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800517 __u64 rsvd2;
Ben Cheng655a7c02013-10-16 16:09:24 -0700518};
Christopher Ferris1308ad32017-11-14 17:32:13 -0800519struct drm_i915_gem_exec_fence {
520 __u32 handle;
521#define I915_EXEC_FENCE_WAIT (1 << 0)
522#define I915_EXEC_FENCE_SIGNAL (1 << 1)
523#define __I915_EXEC_FENCE_UNKNOWN_FLAGS (- (I915_EXEC_FENCE_SIGNAL << 1))
524 __u32 flags;
525};
Ben Cheng655a7c02013-10-16 16:09:24 -0700526struct drm_i915_gem_execbuffer2 {
Tao Baod7db5942015-01-28 10:07:51 -0800527 __u64 buffers_ptr;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800528 __u32 buffer_count;
Tao Baod7db5942015-01-28 10:07:51 -0800529 __u32 batch_start_offset;
530 __u32 batch_len;
531 __u32 DR1;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800532 __u32 DR4;
Tao Baod7db5942015-01-28 10:07:51 -0800533 __u32 num_cliprects;
534 __u64 cliprects_ptr;
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700535#define I915_EXEC_RING_MASK (0x3f)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800536#define I915_EXEC_DEFAULT (0 << 0)
Tao Baod7db5942015-01-28 10:07:51 -0800537#define I915_EXEC_RENDER (1 << 0)
538#define I915_EXEC_BSD (2 << 0)
539#define I915_EXEC_BLT (3 << 0)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800540#define I915_EXEC_VEBOX (4 << 0)
Tao Baod7db5942015-01-28 10:07:51 -0800541#define I915_EXEC_CONSTANTS_MASK (3 << 6)
542#define I915_EXEC_CONSTANTS_REL_GENERAL (0 << 6)
543#define I915_EXEC_CONSTANTS_ABSOLUTE (1 << 6)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800544#define I915_EXEC_CONSTANTS_REL_SURFACE (2 << 6)
Tao Baod7db5942015-01-28 10:07:51 -0800545 __u64 flags;
546 __u64 rsvd1;
547 __u64 rsvd2;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800548};
Tao Baod7db5942015-01-28 10:07:51 -0800549#define I915_EXEC_GEN7_SOL_RESET (1 << 8)
550#define I915_EXEC_SECURE (1 << 9)
551#define I915_EXEC_IS_PINNED (1 << 10)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800552#define I915_EXEC_NO_RELOC (1 << 11)
Tao Baod7db5942015-01-28 10:07:51 -0800553#define I915_EXEC_HANDLE_LUT (1 << 12)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700554#define I915_EXEC_BSD_SHIFT (13)
555#define I915_EXEC_BSD_MASK (3 << I915_EXEC_BSD_SHIFT)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800556#define I915_EXEC_BSD_DEFAULT (0 << I915_EXEC_BSD_SHIFT)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700557#define I915_EXEC_BSD_RING1 (1 << I915_EXEC_BSD_SHIFT)
558#define I915_EXEC_BSD_RING2 (2 << I915_EXEC_BSD_SHIFT)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800559#define I915_EXEC_RESOURCE_STREAMER (1 << 15)
Christopher Ferris525ce912017-07-26 13:12:53 -0700560#define I915_EXEC_FENCE_IN (1 << 16)
561#define I915_EXEC_FENCE_OUT (1 << 17)
Christopher Ferris1308ad32017-11-14 17:32:13 -0800562#define I915_EXEC_BATCH_FIRST (1 << 18)
563#define I915_EXEC_FENCE_ARRAY (1 << 19)
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700564#define I915_EXEC_FENCE_SUBMIT (1 << 20)
565#define __I915_EXEC_UNKNOWN_FLAGS (- (I915_EXEC_FENCE_SUBMIT << 1))
Christopher Ferris106b3a82016-08-24 12:15:38 -0700566#define I915_EXEC_CONTEXT_ID_MASK (0xffffffff)
Tao Baod7db5942015-01-28 10:07:51 -0800567#define i915_execbuffer2_set_context_id(eb2,context) (eb2).rsvd1 = context & I915_EXEC_CONTEXT_ID_MASK
568#define i915_execbuffer2_get_context_id(eb2) ((eb2).rsvd1 & I915_EXEC_CONTEXT_ID_MASK)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800569struct drm_i915_gem_pin {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700570 __u32 handle;
Tao Baod7db5942015-01-28 10:07:51 -0800571 __u32 pad;
572 __u64 alignment;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800573 __u64 offset;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700574};
Ben Cheng655a7c02013-10-16 16:09:24 -0700575struct drm_i915_gem_unpin {
Tao Baod7db5942015-01-28 10:07:51 -0800576 __u32 handle;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800577 __u32 pad;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700578};
Ben Cheng655a7c02013-10-16 16:09:24 -0700579struct drm_i915_gem_busy {
Tao Baod7db5942015-01-28 10:07:51 -0800580 __u32 handle;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800581 __u32 busy;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700582};
Ben Cheng655a7c02013-10-16 16:09:24 -0700583#define I915_CACHING_NONE 0
Ben Cheng655a7c02013-10-16 16:09:24 -0700584#define I915_CACHING_CACHED 1
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800585#define I915_CACHING_DISPLAY 2
Christopher Ferris106b3a82016-08-24 12:15:38 -0700586struct drm_i915_gem_caching {
Tao Baod7db5942015-01-28 10:07:51 -0800587 __u32 handle;
588 __u32 caching;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800589};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700590#define I915_TILING_NONE 0
Ben Cheng655a7c02013-10-16 16:09:24 -0700591#define I915_TILING_X 1
592#define I915_TILING_Y 2
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800593#define I915_TILING_LAST I915_TILING_Y
Ben Cheng655a7c02013-10-16 16:09:24 -0700594#define I915_BIT_6_SWIZZLE_NONE 0
Christopher Ferris106b3a82016-08-24 12:15:38 -0700595#define I915_BIT_6_SWIZZLE_9 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700596#define I915_BIT_6_SWIZZLE_9_10 2
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800597#define I915_BIT_6_SWIZZLE_9_11 3
Ben Cheng655a7c02013-10-16 16:09:24 -0700598#define I915_BIT_6_SWIZZLE_9_10_11 4
Christopher Ferris106b3a82016-08-24 12:15:38 -0700599#define I915_BIT_6_SWIZZLE_UNKNOWN 5
Ben Cheng655a7c02013-10-16 16:09:24 -0700600#define I915_BIT_6_SWIZZLE_9_17 6
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800601#define I915_BIT_6_SWIZZLE_9_10_17 7
Ben Cheng655a7c02013-10-16 16:09:24 -0700602struct drm_i915_gem_set_tiling {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700603 __u32 handle;
Tao Baod7db5942015-01-28 10:07:51 -0800604 __u32 tiling_mode;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800605 __u32 stride;
Tao Baod7db5942015-01-28 10:07:51 -0800606 __u32 swizzle_mode;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700607};
Ben Cheng655a7c02013-10-16 16:09:24 -0700608struct drm_i915_gem_get_tiling {
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800609 __u32 handle;
Tao Baod7db5942015-01-28 10:07:51 -0800610 __u32 tiling_mode;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700611 __u32 swizzle_mode;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800612 __u32 phys_swizzle_mode;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800613};
Ben Cheng655a7c02013-10-16 16:09:24 -0700614struct drm_i915_gem_get_aperture {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700615 __u64 aper_size;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800616 __u64 aper_available_size;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800617};
Ben Cheng655a7c02013-10-16 16:09:24 -0700618struct drm_i915_get_pipe_from_crtc_id {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700619 __u32 crtc_id;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800620 __u32 pipe;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800621};
Ben Cheng655a7c02013-10-16 16:09:24 -0700622#define I915_MADV_WILLNEED 0
Christopher Ferris106b3a82016-08-24 12:15:38 -0700623#define I915_MADV_DONTNEED 1
Christopher Ferris05d08e92016-02-04 13:16:38 -0800624#define __I915_MADV_PURGED 2
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800625struct drm_i915_gem_madvise {
Tao Baod7db5942015-01-28 10:07:51 -0800626 __u32 handle;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700627 __u32 madv;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800628 __u32 retained;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800629};
Ben Cheng655a7c02013-10-16 16:09:24 -0700630#define I915_OVERLAY_TYPE_MASK 0xff
Christopher Ferris106b3a82016-08-24 12:15:38 -0700631#define I915_OVERLAY_YUV_PLANAR 0x01
Christopher Ferris05d08e92016-02-04 13:16:38 -0800632#define I915_OVERLAY_YUV_PACKED 0x02
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800633#define I915_OVERLAY_RGB 0x03
Ben Cheng655a7c02013-10-16 16:09:24 -0700634#define I915_OVERLAY_DEPTH_MASK 0xff00
Christopher Ferris106b3a82016-08-24 12:15:38 -0700635#define I915_OVERLAY_RGB24 0x1000
Christopher Ferris05d08e92016-02-04 13:16:38 -0800636#define I915_OVERLAY_RGB16 0x2000
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800637#define I915_OVERLAY_RGB15 0x3000
Ben Cheng655a7c02013-10-16 16:09:24 -0700638#define I915_OVERLAY_YUV422 0x0100
Christopher Ferris106b3a82016-08-24 12:15:38 -0700639#define I915_OVERLAY_YUV411 0x0200
Christopher Ferris05d08e92016-02-04 13:16:38 -0800640#define I915_OVERLAY_YUV420 0x0300
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800641#define I915_OVERLAY_YUV410 0x0400
Ben Cheng655a7c02013-10-16 16:09:24 -0700642#define I915_OVERLAY_SWAP_MASK 0xff0000
Christopher Ferris106b3a82016-08-24 12:15:38 -0700643#define I915_OVERLAY_NO_SWAP 0x000000
Christopher Ferris05d08e92016-02-04 13:16:38 -0800644#define I915_OVERLAY_UV_SWAP 0x010000
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800645#define I915_OVERLAY_Y_SWAP 0x020000
Ben Cheng655a7c02013-10-16 16:09:24 -0700646#define I915_OVERLAY_Y_AND_UV_SWAP 0x030000
Christopher Ferris106b3a82016-08-24 12:15:38 -0700647#define I915_OVERLAY_FLAGS_MASK 0xff000000
Christopher Ferris05d08e92016-02-04 13:16:38 -0800648#define I915_OVERLAY_ENABLE 0x01000000
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800649struct drm_intel_overlay_put_image {
Tao Baod7db5942015-01-28 10:07:51 -0800650 __u32 flags;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700651 __u32 bo_handle;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800652 __u16 stride_Y;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800653 __u16 stride_UV;
Tao Baod7db5942015-01-28 10:07:51 -0800654 __u32 offset_Y;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700655 __u32 offset_U;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800656 __u32 offset_V;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800657 __u16 src_width;
Tao Baod7db5942015-01-28 10:07:51 -0800658 __u16 src_height;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700659 __u16 src_scan_width;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800660 __u16 src_scan_height;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800661 __u32 crtc_id;
Tao Baod7db5942015-01-28 10:07:51 -0800662 __u16 dst_x;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700663 __u16 dst_y;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800664 __u16 dst_width;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800665 __u16 dst_height;
Ben Cheng655a7c02013-10-16 16:09:24 -0700666};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700667#define I915_OVERLAY_UPDATE_ATTRS (1 << 0)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800668#define I915_OVERLAY_UPDATE_GAMMA (1 << 1)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800669#define I915_OVERLAY_DISABLE_DEST_COLORKEY (1 << 2)
Ben Cheng655a7c02013-10-16 16:09:24 -0700670struct drm_intel_overlay_attrs {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700671 __u32 flags;
Tao Baod7db5942015-01-28 10:07:51 -0800672 __u32 color_key;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800673 __s32 brightness;
Tao Baod7db5942015-01-28 10:07:51 -0800674 __u32 contrast;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700675 __u32 saturation;
Tao Baod7db5942015-01-28 10:07:51 -0800676 __u32 gamma0;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800677 __u32 gamma1;
Tao Baod7db5942015-01-28 10:07:51 -0800678 __u32 gamma2;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700679 __u32 gamma3;
Tao Baod7db5942015-01-28 10:07:51 -0800680 __u32 gamma4;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800681 __u32 gamma5;
Ben Cheng655a7c02013-10-16 16:09:24 -0700682};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700683#define I915_SET_COLORKEY_NONE (1 << 0)
Tao Baod7db5942015-01-28 10:07:51 -0800684#define I915_SET_COLORKEY_DESTINATION (1 << 1)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800685#define I915_SET_COLORKEY_SOURCE (1 << 2)
Ben Cheng655a7c02013-10-16 16:09:24 -0700686struct drm_intel_sprite_colorkey {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700687 __u32 plane_id;
Tao Baod7db5942015-01-28 10:07:51 -0800688 __u32 min_value;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800689 __u32 channel_mask;
Tao Baod7db5942015-01-28 10:07:51 -0800690 __u32 max_value;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700691 __u32 flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700692};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800693struct drm_i915_gem_wait {
Tao Baod7db5942015-01-28 10:07:51 -0800694 __u32 bo_handle;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700695 __u32 flags;
Tao Baod7db5942015-01-28 10:07:51 -0800696 __s64 timeout_ns;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800697};
Ben Cheng655a7c02013-10-16 16:09:24 -0700698struct drm_i915_gem_context_create {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700699 __u32 ctx_id;
Tao Baod7db5942015-01-28 10:07:51 -0800700 __u32 pad;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800701};
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700702struct drm_i915_gem_context_create_ext {
703 __u32 ctx_id;
704 __u32 flags;
705#define I915_CONTEXT_CREATE_FLAGS_USE_EXTENSIONS (1u << 0)
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700706#define I915_CONTEXT_CREATE_FLAGS_SINGLE_TIMELINE (1u << 1)
707#define I915_CONTEXT_CREATE_FLAGS_UNKNOWN (- (I915_CONTEXT_CREATE_FLAGS_SINGLE_TIMELINE << 1))
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700708 __u64 extensions;
709};
710struct drm_i915_gem_context_param {
711 __u32 ctx_id;
712 __u32 size;
713 __u64 param;
714#define I915_CONTEXT_PARAM_BAN_PERIOD 0x1
715#define I915_CONTEXT_PARAM_NO_ZEROMAP 0x2
716#define I915_CONTEXT_PARAM_GTT_SIZE 0x3
717#define I915_CONTEXT_PARAM_NO_ERROR_CAPTURE 0x4
718#define I915_CONTEXT_PARAM_BANNABLE 0x5
719#define I915_CONTEXT_PARAM_PRIORITY 0x6
720#define I915_CONTEXT_MAX_USER_PRIORITY 1023
721#define I915_CONTEXT_DEFAULT_PRIORITY 0
722#define I915_CONTEXT_MIN_USER_PRIORITY - 1023
723#define I915_CONTEXT_PARAM_SSEU 0x7
724#define I915_CONTEXT_PARAM_RECOVERABLE 0x8
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700725#define I915_CONTEXT_PARAM_VM 0x9
726#define I915_CONTEXT_PARAM_ENGINES 0xa
Christopher Ferrisd32ca142020-02-04 16:16:51 -0800727#define I915_CONTEXT_PARAM_PERSISTENCE 0xb
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700728#define I915_CONTEXT_PARAM_RINGSIZE 0xc
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700729 __u64 value;
730};
731struct drm_i915_gem_context_param_sseu {
732 struct i915_engine_class_instance engine;
733 __u32 flags;
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700734#define I915_CONTEXT_SSEU_FLAG_ENGINE_INDEX (1u << 0)
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700735 __u64 slice_mask;
736 __u64 subslice_mask;
737 __u16 min_eus_per_subslice;
738 __u16 max_eus_per_subslice;
739 __u32 rsvd;
740};
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700741struct i915_context_engines_load_balance {
742 struct i915_user_extension base;
743 __u16 engine_index;
744 __u16 num_siblings;
745 __u32 flags;
746 __u64 mbz64;
747 struct i915_engine_class_instance engines[0];
748} __attribute__((packed));
749#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__]; \
750} __attribute__((packed)) name__
751struct i915_context_engines_bond {
752 struct i915_user_extension base;
753 struct i915_engine_class_instance master;
754 __u16 virtual_index;
755 __u16 num_bonds;
756 __u64 flags;
757 __u64 mbz64[4];
758 struct i915_engine_class_instance engines[0];
759} __attribute__((packed));
760#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__]; \
761} __attribute__((packed)) name__
762struct i915_context_param_engines {
763 __u64 extensions;
764#define I915_CONTEXT_ENGINES_EXT_LOAD_BALANCE 0
765#define I915_CONTEXT_ENGINES_EXT_BOND 1
766 struct i915_engine_class_instance engines[0];
767} __attribute__((packed));
768#define I915_DEFINE_CONTEXT_PARAM_ENGINES(name__,N__) struct { __u64 extensions; struct i915_engine_class_instance engines[N__]; \
769} __attribute__((packed)) name__
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700770struct drm_i915_gem_context_create_ext_setparam {
771#define I915_CONTEXT_CREATE_EXT_SETPARAM 0
772 struct i915_user_extension base;
773 struct drm_i915_gem_context_param param;
774};
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700775struct drm_i915_gem_context_create_ext_clone {
776#define I915_CONTEXT_CREATE_EXT_CLONE 1
777 struct i915_user_extension base;
778 __u32 clone_id;
779 __u32 flags;
780#define I915_CONTEXT_CLONE_ENGINES (1u << 0)
781#define I915_CONTEXT_CLONE_FLAGS (1u << 1)
782#define I915_CONTEXT_CLONE_SCHEDATTR (1u << 2)
783#define I915_CONTEXT_CLONE_SSEU (1u << 3)
784#define I915_CONTEXT_CLONE_TIMELINE (1u << 4)
785#define I915_CONTEXT_CLONE_VM (1u << 5)
786#define I915_CONTEXT_CLONE_UNKNOWN - (I915_CONTEXT_CLONE_VM << 1)
787 __u64 rsvd;
788};
Ben Cheng655a7c02013-10-16 16:09:24 -0700789struct drm_i915_gem_context_destroy {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700790 __u32 ctx_id;
Tao Baod7db5942015-01-28 10:07:51 -0800791 __u32 pad;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800792};
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700793struct drm_i915_gem_vm_control {
794 __u64 extensions;
795 __u32 flags;
796 __u32 vm_id;
797};
Ben Cheng655a7c02013-10-16 16:09:24 -0700798struct drm_i915_reg_read {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700799 __u64 offset;
Christopher Ferris934ec942018-01-31 15:29:16 -0800800#define I915_REG_READ_8B_WA (1ul << 0)
Tao Baod7db5942015-01-28 10:07:51 -0800801 __u64 val;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800802};
Christopher Ferris38062f92014-07-09 15:33:25 -0700803struct drm_i915_reset_stats {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700804 __u32 ctx_id;
Tao Baod7db5942015-01-28 10:07:51 -0800805 __u32 flags;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800806 __u32 reset_count;
Tao Baod7db5942015-01-28 10:07:51 -0800807 __u32 batch_active;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700808 __u32 batch_pending;
Tao Baod7db5942015-01-28 10:07:51 -0800809 __u32 pad;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800810};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700811struct drm_i915_gem_userptr {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700812 __u64 user_ptr;
Tao Baod7db5942015-01-28 10:07:51 -0800813 __u64 user_size;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800814 __u32 flags;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700815#define I915_USERPTR_READ_ONLY 0x1
Christopher Ferris106b3a82016-08-24 12:15:38 -0700816#define I915_USERPTR_UNSYNCHRONIZED 0x80000000
Tao Baod7db5942015-01-28 10:07:51 -0800817 __u32 handle;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800818};
Christopher Ferris525ce912017-07-26 13:12:53 -0700819enum drm_i915_oa_format {
820 I915_OA_FORMAT_A13 = 1,
821 I915_OA_FORMAT_A29,
822 I915_OA_FORMAT_A13_B8_C8,
823 I915_OA_FORMAT_B4_C8,
824 I915_OA_FORMAT_A45_B8_C8,
825 I915_OA_FORMAT_B4_C8_A16,
826 I915_OA_FORMAT_C4_B8,
Christopher Ferris1308ad32017-11-14 17:32:13 -0800827 I915_OA_FORMAT_A12,
828 I915_OA_FORMAT_A12_B8_C8,
829 I915_OA_FORMAT_A32u40_A4u32_B8_C8,
Christopher Ferris525ce912017-07-26 13:12:53 -0700830 I915_OA_FORMAT_MAX
831};
832enum drm_i915_perf_property_id {
833 DRM_I915_PERF_PROP_CTX_HANDLE = 1,
834 DRM_I915_PERF_PROP_SAMPLE_OA,
835 DRM_I915_PERF_PROP_OA_METRICS_SET,
836 DRM_I915_PERF_PROP_OA_FORMAT,
837 DRM_I915_PERF_PROP_OA_EXPONENT,
Christopher Ferrisd32ca142020-02-04 16:16:51 -0800838 DRM_I915_PERF_PROP_HOLD_PREEMPTION,
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700839 DRM_I915_PERF_PROP_GLOBAL_SSEU,
840 DRM_I915_PERF_PROP_POLL_OA_PERIOD,
Christopher Ferris525ce912017-07-26 13:12:53 -0700841 DRM_I915_PERF_PROP_MAX
842};
843struct drm_i915_perf_open_param {
844 __u32 flags;
845#define I915_PERF_FLAG_FD_CLOEXEC (1 << 0)
846#define I915_PERF_FLAG_FD_NONBLOCK (1 << 1)
847#define I915_PERF_FLAG_DISABLED (1 << 2)
848 __u32 num_properties;
849 __u64 properties_ptr;
850};
851#define I915_PERF_IOCTL_ENABLE _IO('i', 0x0)
852#define I915_PERF_IOCTL_DISABLE _IO('i', 0x1)
Christopher Ferrisd32ca142020-02-04 16:16:51 -0800853#define I915_PERF_IOCTL_CONFIG _IO('i', 0x2)
Christopher Ferris525ce912017-07-26 13:12:53 -0700854struct drm_i915_perf_record_header {
855 __u32 type;
856 __u16 pad;
857 __u16 size;
858};
859enum drm_i915_perf_record_type {
860 DRM_I915_PERF_RECORD_SAMPLE = 1,
861 DRM_I915_PERF_RECORD_OA_REPORT_LOST = 2,
862 DRM_I915_PERF_RECORD_OA_BUFFER_LOST = 3,
863 DRM_I915_PERF_RECORD_MAX
864};
Christopher Ferris1308ad32017-11-14 17:32:13 -0800865struct drm_i915_perf_oa_config {
866 char uuid[36];
867 __u32 n_mux_regs;
868 __u32 n_boolean_regs;
869 __u32 n_flex_regs;
Christopher Ferris934ec942018-01-31 15:29:16 -0800870 __u64 mux_regs_ptr;
871 __u64 boolean_regs_ptr;
872 __u64 flex_regs_ptr;
Christopher Ferris1308ad32017-11-14 17:32:13 -0800873};
Christopher Ferris76a1d452018-06-27 14:12:29 -0700874struct drm_i915_query_item {
875 __u64 query_id;
876#define DRM_I915_QUERY_TOPOLOGY_INFO 1
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700877#define DRM_I915_QUERY_ENGINE_INFO 2
Christopher Ferrisd32ca142020-02-04 16:16:51 -0800878#define DRM_I915_QUERY_PERF_CONFIG 3
Christopher Ferris76a1d452018-06-27 14:12:29 -0700879 __s32 length;
880 __u32 flags;
Christopher Ferrisd32ca142020-02-04 16:16:51 -0800881#define DRM_I915_QUERY_PERF_CONFIG_LIST 1
882#define DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_UUID 2
883#define DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_ID 3
Christopher Ferris76a1d452018-06-27 14:12:29 -0700884 __u64 data_ptr;
885};
886struct drm_i915_query {
887 __u32 num_items;
888 __u32 flags;
889 __u64 items_ptr;
890};
891struct drm_i915_query_topology_info {
892 __u16 flags;
893 __u16 max_slices;
894 __u16 max_subslices;
895 __u16 max_eus_per_subslice;
896 __u16 subslice_offset;
897 __u16 subslice_stride;
898 __u16 eu_offset;
899 __u16 eu_stride;
900 __u8 data[];
901};
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700902struct drm_i915_engine_info {
903 struct i915_engine_class_instance engine;
904 __u32 rsvd0;
905 __u64 flags;
906 __u64 capabilities;
907#define I915_VIDEO_CLASS_CAPABILITY_HEVC (1 << 0)
908#define I915_VIDEO_AND_ENHANCE_CLASS_CAPABILITY_SFC (1 << 1)
909 __u64 rsvd1[4];
910};
911struct drm_i915_query_engine_info {
912 __u32 num_engines;
913 __u32 rsvd[3];
914 struct drm_i915_engine_info engines[];
915};
Christopher Ferrisd32ca142020-02-04 16:16:51 -0800916struct drm_i915_query_perf_config {
917 union {
918 __u64 n_configs;
919 __u64 config;
920 char uuid[36];
921 };
922 __u32 flags;
923 __u8 data[];
924};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700925#ifdef __cplusplus
Christopher Ferris48fe0ae2019-01-10 15:59:33 -0800926}
Ben Cheng655a7c02013-10-16 16:09:24 -0700927#endif
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800928#endif