blob: 4c1d87fdfc7b3177cdebfdad7b2a759eacc25a16 [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 Ferris106b3a82016-08-24 12:15:38 -070023#endif
24#define I915_L3_PARITY_UEVENT "L3_PARITY_ERROR"
Christopher Ferris38062f92014-07-09 15:33:25 -070025#define I915_ERROR_UEVENT "ERROR"
26#define I915_RESET_UEVENT "RESET"
Christopher Ferris6a9755d2017-01-13 14:09:31 -080027enum i915_mocs_table_index {
28 I915_MOCS_UNCACHED,
29 I915_MOCS_PTE,
30 I915_MOCS_CACHED,
Christopher Ferris6a9755d2017-01-13 14:09:31 -080031};
Christopher Ferris76a1d452018-06-27 14:12:29 -070032enum drm_i915_gem_engine_class {
33 I915_ENGINE_CLASS_RENDER = 0,
34 I915_ENGINE_CLASS_COPY = 1,
35 I915_ENGINE_CLASS_VIDEO = 2,
36 I915_ENGINE_CLASS_VIDEO_ENHANCE = 3,
37 I915_ENGINE_CLASS_INVALID = - 1
38};
39enum drm_i915_pmu_engine_sample {
40 I915_SAMPLE_BUSY = 0,
41 I915_SAMPLE_WAIT = 1,
42 I915_SAMPLE_SEMA = 2
43};
44#define I915_PMU_SAMPLE_BITS (4)
45#define I915_PMU_SAMPLE_MASK (0xf)
46#define I915_PMU_SAMPLE_INSTANCE_BITS (8)
47#define I915_PMU_CLASS_SHIFT (I915_PMU_SAMPLE_BITS + I915_PMU_SAMPLE_INSTANCE_BITS)
48#define __I915_PMU_ENGINE(class,instance,sample) ((class) << I915_PMU_CLASS_SHIFT | (instance) << I915_PMU_SAMPLE_BITS | (sample))
49#define I915_PMU_ENGINE_BUSY(class,instance) __I915_PMU_ENGINE(class, instance, I915_SAMPLE_BUSY)
50#define I915_PMU_ENGINE_WAIT(class,instance) __I915_PMU_ENGINE(class, instance, I915_SAMPLE_WAIT)
51#define I915_PMU_ENGINE_SEMA(class,instance) __I915_PMU_ENGINE(class, instance, I915_SAMPLE_SEMA)
52#define __I915_PMU_OTHER(x) (__I915_PMU_ENGINE(0xff, 0xff, 0xf) + 1 + (x))
53#define I915_PMU_ACTUAL_FREQUENCY __I915_PMU_OTHER(0)
54#define I915_PMU_REQUESTED_FREQUENCY __I915_PMU_OTHER(1)
55#define I915_PMU_INTERRUPTS __I915_PMU_OTHER(2)
56#define I915_PMU_RC6_RESIDENCY __I915_PMU_OTHER(3)
57#define I915_PMU_LAST I915_PMU_RC6_RESIDENCY
Christopher Ferris38062f92014-07-09 15:33:25 -070058#define I915_NR_TEX_REGIONS 255
Ben Cheng655a7c02013-10-16 16:09:24 -070059#define I915_LOG_MIN_TEX_REGION_SIZE 14
60typedef struct _drm_i915_init {
Christopher Ferris6a9755d2017-01-13 14:09:31 -080061 enum {
Tao Baod7db5942015-01-28 10:07:51 -080062 I915_INIT_DMA = 0x01,
63 I915_CLEANUP_DMA = 0x02,
Tao Baod7db5942015-01-28 10:07:51 -080064 I915_RESUME_DMA = 0x03
Christopher Ferris6a9755d2017-01-13 14:09:31 -080065 } func;
Tao Baod7db5942015-01-28 10:07:51 -080066 unsigned int mmio_offset;
67 int sarea_priv_offset;
Tao Baod7db5942015-01-28 10:07:51 -080068 unsigned int ring_start;
Christopher Ferris6a9755d2017-01-13 14:09:31 -080069 unsigned int ring_end;
Tao Baod7db5942015-01-28 10:07:51 -080070 unsigned int ring_size;
71 unsigned int front_offset;
Tao Baod7db5942015-01-28 10:07:51 -080072 unsigned int back_offset;
Christopher Ferris6a9755d2017-01-13 14:09:31 -080073 unsigned int depth_offset;
Tao Baod7db5942015-01-28 10:07:51 -080074 unsigned int w;
75 unsigned int h;
Tao Baod7db5942015-01-28 10:07:51 -080076 unsigned int pitch;
Christopher Ferris6a9755d2017-01-13 14:09:31 -080077 unsigned int pitch_bits;
Tao Baod7db5942015-01-28 10:07:51 -080078 unsigned int back_pitch;
79 unsigned int depth_pitch;
Tao Baod7db5942015-01-28 10:07:51 -080080 unsigned int cpp;
Christopher Ferris6a9755d2017-01-13 14:09:31 -080081 unsigned int chipset;
Ben Cheng655a7c02013-10-16 16:09:24 -070082} drm_i915_init_t;
Ben Cheng655a7c02013-10-16 16:09:24 -070083typedef struct _drm_i915_sarea {
Tao Baod7db5942015-01-28 10:07:51 -080084 struct drm_tex_region texList[I915_NR_TEX_REGIONS + 1];
Christopher Ferris6a9755d2017-01-13 14:09:31 -080085 int last_upload;
Tao Baod7db5942015-01-28 10:07:51 -080086 int last_enqueue;
87 int last_dispatch;
Tao Baod7db5942015-01-28 10:07:51 -080088 int ctxOwner;
Christopher Ferris6a9755d2017-01-13 14:09:31 -080089 int texAge;
Tao Baod7db5942015-01-28 10:07:51 -080090 int pf_enabled;
91 int pf_active;
Tao Baod7db5942015-01-28 10:07:51 -080092 int pf_current_page;
Christopher Ferris6a9755d2017-01-13 14:09:31 -080093 int perf_boxes;
Tao Baod7db5942015-01-28 10:07:51 -080094 int width, height;
95 drm_handle_t front_handle;
Tao Baod7db5942015-01-28 10:07:51 -080096 int front_offset;
Christopher Ferris6a9755d2017-01-13 14:09:31 -080097 int front_size;
Tao Baod7db5942015-01-28 10:07:51 -080098 drm_handle_t back_handle;
99 int back_offset;
Tao Baod7db5942015-01-28 10:07:51 -0800100 int back_size;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800101 drm_handle_t depth_handle;
Tao Baod7db5942015-01-28 10:07:51 -0800102 int depth_offset;
103 int depth_size;
Tao Baod7db5942015-01-28 10:07:51 -0800104 drm_handle_t tex_handle;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800105 int tex_offset;
Tao Baod7db5942015-01-28 10:07:51 -0800106 int tex_size;
107 int log_tex_granularity;
Tao Baod7db5942015-01-28 10:07:51 -0800108 int pitch;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800109 int rotation;
Tao Baod7db5942015-01-28 10:07:51 -0800110 int rotated_offset;
111 int rotated_size;
Tao Baod7db5942015-01-28 10:07:51 -0800112 int rotated_pitch;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800113 int virtualX, virtualY;
Tao Baod7db5942015-01-28 10:07:51 -0800114 unsigned int front_tiled;
115 unsigned int back_tiled;
Tao Baod7db5942015-01-28 10:07:51 -0800116 unsigned int depth_tiled;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800117 unsigned int rotated_tiled;
Tao Baod7db5942015-01-28 10:07:51 -0800118 unsigned int rotated2_tiled;
119 int pipeA_x;
Tao Baod7db5942015-01-28 10:07:51 -0800120 int pipeA_y;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800121 int pipeA_w;
Tao Baod7db5942015-01-28 10:07:51 -0800122 int pipeA_h;
123 int pipeB_x;
Tao Baod7db5942015-01-28 10:07:51 -0800124 int pipeB_y;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800125 int pipeB_w;
Tao Baod7db5942015-01-28 10:07:51 -0800126 int pipeB_h;
127 drm_handle_t unused_handle;
Tao Baod7db5942015-01-28 10:07:51 -0800128 __u32 unused1, unused2, unused3;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800129 __u32 front_bo_handle;
Tao Baod7db5942015-01-28 10:07:51 -0800130 __u32 back_bo_handle;
131 __u32 unused_bo_handle;
Tao Baod7db5942015-01-28 10:07:51 -0800132 __u32 depth_bo_handle;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800133} drm_i915_sarea_t;
Ben Cheng655a7c02013-10-16 16:09:24 -0700134#define planeA_x pipeA_x
Ben Cheng655a7c02013-10-16 16:09:24 -0700135#define planeA_y pipeA_y
136#define planeA_w pipeA_w
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800137#define planeA_h pipeA_h
Ben Cheng655a7c02013-10-16 16:09:24 -0700138#define planeB_x pipeB_x
Ben Cheng655a7c02013-10-16 16:09:24 -0700139#define planeB_y pipeB_y
140#define planeB_w pipeB_w
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800141#define planeB_h pipeB_h
Ben Cheng655a7c02013-10-16 16:09:24 -0700142#define I915_BOX_RING_EMPTY 0x1
Ben Cheng655a7c02013-10-16 16:09:24 -0700143#define I915_BOX_FLIP 0x2
144#define I915_BOX_WAIT 0x4
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800145#define I915_BOX_TEXTURE_LOAD 0x8
Ben Cheng655a7c02013-10-16 16:09:24 -0700146#define I915_BOX_LOST_CONTEXT 0x10
Ben Cheng655a7c02013-10-16 16:09:24 -0700147#define DRM_I915_INIT 0x00
148#define DRM_I915_FLUSH 0x01
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800149#define DRM_I915_FLIP 0x02
Ben Cheng655a7c02013-10-16 16:09:24 -0700150#define DRM_I915_BATCHBUFFER 0x03
Ben Cheng655a7c02013-10-16 16:09:24 -0700151#define DRM_I915_IRQ_EMIT 0x04
152#define DRM_I915_IRQ_WAIT 0x05
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800153#define DRM_I915_GETPARAM 0x06
Ben Cheng655a7c02013-10-16 16:09:24 -0700154#define DRM_I915_SETPARAM 0x07
Ben Cheng655a7c02013-10-16 16:09:24 -0700155#define DRM_I915_ALLOC 0x08
156#define DRM_I915_FREE 0x09
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800157#define DRM_I915_INIT_HEAP 0x0a
Ben Cheng655a7c02013-10-16 16:09:24 -0700158#define DRM_I915_CMDBUFFER 0x0b
Ben Cheng655a7c02013-10-16 16:09:24 -0700159#define DRM_I915_DESTROY_HEAP 0x0c
160#define DRM_I915_SET_VBLANK_PIPE 0x0d
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800161#define DRM_I915_GET_VBLANK_PIPE 0x0e
Ben Cheng655a7c02013-10-16 16:09:24 -0700162#define DRM_I915_VBLANK_SWAP 0x0f
Ben Cheng655a7c02013-10-16 16:09:24 -0700163#define DRM_I915_HWS_ADDR 0x11
164#define DRM_I915_GEM_INIT 0x13
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800165#define DRM_I915_GEM_EXECBUFFER 0x14
Ben Cheng655a7c02013-10-16 16:09:24 -0700166#define DRM_I915_GEM_PIN 0x15
Ben Cheng655a7c02013-10-16 16:09:24 -0700167#define DRM_I915_GEM_UNPIN 0x16
168#define DRM_I915_GEM_BUSY 0x17
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800169#define DRM_I915_GEM_THROTTLE 0x18
Ben Cheng655a7c02013-10-16 16:09:24 -0700170#define DRM_I915_GEM_ENTERVT 0x19
Ben Cheng655a7c02013-10-16 16:09:24 -0700171#define DRM_I915_GEM_LEAVEVT 0x1a
172#define DRM_I915_GEM_CREATE 0x1b
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800173#define DRM_I915_GEM_PREAD 0x1c
Ben Cheng655a7c02013-10-16 16:09:24 -0700174#define DRM_I915_GEM_PWRITE 0x1d
Ben Cheng655a7c02013-10-16 16:09:24 -0700175#define DRM_I915_GEM_MMAP 0x1e
176#define DRM_I915_GEM_SET_DOMAIN 0x1f
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800177#define DRM_I915_GEM_SW_FINISH 0x20
Ben Cheng655a7c02013-10-16 16:09:24 -0700178#define DRM_I915_GEM_SET_TILING 0x21
Ben Cheng655a7c02013-10-16 16:09:24 -0700179#define DRM_I915_GEM_GET_TILING 0x22
180#define DRM_I915_GEM_GET_APERTURE 0x23
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800181#define DRM_I915_GEM_MMAP_GTT 0x24
Ben Cheng655a7c02013-10-16 16:09:24 -0700182#define DRM_I915_GET_PIPE_FROM_CRTC_ID 0x25
Ben Cheng655a7c02013-10-16 16:09:24 -0700183#define DRM_I915_GEM_MADVISE 0x26
184#define DRM_I915_OVERLAY_PUT_IMAGE 0x27
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800185#define DRM_I915_OVERLAY_ATTRS 0x28
Ben Cheng655a7c02013-10-16 16:09:24 -0700186#define DRM_I915_GEM_EXECBUFFER2 0x29
Christopher Ferris525ce912017-07-26 13:12:53 -0700187#define DRM_I915_GEM_EXECBUFFER2_WR DRM_I915_GEM_EXECBUFFER2
Ben Cheng655a7c02013-10-16 16:09:24 -0700188#define DRM_I915_GET_SPRITE_COLORKEY 0x2a
189#define DRM_I915_SET_SPRITE_COLORKEY 0x2b
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800190#define DRM_I915_GEM_WAIT 0x2c
Ben Cheng655a7c02013-10-16 16:09:24 -0700191#define DRM_I915_GEM_CONTEXT_CREATE 0x2d
Ben Cheng655a7c02013-10-16 16:09:24 -0700192#define DRM_I915_GEM_CONTEXT_DESTROY 0x2e
193#define DRM_I915_GEM_SET_CACHING 0x2f
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800194#define DRM_I915_GEM_GET_CACHING 0x30
Ben Cheng655a7c02013-10-16 16:09:24 -0700195#define DRM_I915_REG_READ 0x31
Christopher Ferris38062f92014-07-09 15:33:25 -0700196#define DRM_I915_GET_RESET_STATS 0x32
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700197#define DRM_I915_GEM_USERPTR 0x33
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800198#define DRM_I915_GEM_CONTEXT_GETPARAM 0x34
Christopher Ferris05d08e92016-02-04 13:16:38 -0800199#define DRM_I915_GEM_CONTEXT_SETPARAM 0x35
Christopher Ferris525ce912017-07-26 13:12:53 -0700200#define DRM_I915_PERF_OPEN 0x36
Christopher Ferris1308ad32017-11-14 17:32:13 -0800201#define DRM_I915_PERF_ADD_CONFIG 0x37
202#define DRM_I915_PERF_REMOVE_CONFIG 0x38
Christopher Ferris76a1d452018-06-27 14:12:29 -0700203#define DRM_I915_QUERY 0x39
Tao Baod7db5942015-01-28 10:07:51 -0800204#define DRM_IOCTL_I915_INIT DRM_IOW(DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t)
205#define DRM_IOCTL_I915_FLUSH DRM_IO(DRM_COMMAND_BASE + DRM_I915_FLUSH)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800206#define DRM_IOCTL_I915_FLIP DRM_IO(DRM_COMMAND_BASE + DRM_I915_FLIP)
Tao Baod7db5942015-01-28 10:07:51 -0800207#define DRM_IOCTL_I915_BATCHBUFFER DRM_IOW(DRM_COMMAND_BASE + DRM_I915_BATCHBUFFER, drm_i915_batchbuffer_t)
Ben Cheng655a7c02013-10-16 16:09:24 -0700208#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 -0800209#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 -0800210#define DRM_IOCTL_I915_GETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GETPARAM, drm_i915_getparam_t)
Tao Baod7db5942015-01-28 10:07:51 -0800211#define DRM_IOCTL_I915_SETPARAM DRM_IOW(DRM_COMMAND_BASE + DRM_I915_SETPARAM, drm_i915_setparam_t)
Ben Cheng655a7c02013-10-16 16:09:24 -0700212#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 -0800213#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 -0800214#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 -0800215#define DRM_IOCTL_I915_CMDBUFFER DRM_IOW(DRM_COMMAND_BASE + DRM_I915_CMDBUFFER, drm_i915_cmdbuffer_t)
216#define DRM_IOCTL_I915_DESTROY_HEAP DRM_IOW(DRM_COMMAND_BASE + DRM_I915_DESTROY_HEAP, drm_i915_mem_destroy_heap_t)
217#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 -0800218#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 -0700219#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 -0700220#define DRM_IOCTL_I915_HWS_ADDR DRM_IOW(DRM_COMMAND_BASE + DRM_I915_HWS_ADDR, struct drm_i915_gem_init)
221#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 -0800222#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 -0700223#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 -0700224#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 -0700225#define DRM_IOCTL_I915_GEM_PIN DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_PIN, struct drm_i915_gem_pin)
226#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 -0800227#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 -0700228#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 -0700229#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 -0800230#define DRM_IOCTL_I915_GEM_THROTTLE DRM_IO(DRM_COMMAND_BASE + DRM_I915_GEM_THROTTLE)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800231#define DRM_IOCTL_I915_GEM_ENTERVT DRM_IO(DRM_COMMAND_BASE + DRM_I915_GEM_ENTERVT)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700232#define DRM_IOCTL_I915_GEM_LEAVEVT DRM_IO(DRM_COMMAND_BASE + DRM_I915_GEM_LEAVEVT)
Ben Cheng655a7c02013-10-16 16:09:24 -0700233#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 -0800234#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 -0800235#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 -0700236#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 -0700237#define DRM_IOCTL_I915_GEM_MMAP_GTT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MMAP_GTT, struct drm_i915_gem_mmap_gtt)
Tao Baod7db5942015-01-28 10:07:51 -0800238#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 -0800239#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 -0800240#define DRM_IOCTL_I915_GEM_SET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_SET_TILING, struct drm_i915_gem_set_tiling)
241#define DRM_IOCTL_I915_GEM_GET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_GET_TILING, struct drm_i915_gem_get_tiling)
242#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 -0800243#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 -0700244#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 -0700245#define DRM_IOCTL_I915_OVERLAY_PUT_IMAGE DRM_IOW(DRM_COMMAND_BASE + DRM_I915_OVERLAY_PUT_IMAGE, struct drm_intel_overlay_put_image)
246#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 -0800247#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 -0800248#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 -0700249#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 -0800250#define DRM_IOCTL_I915_GEM_CONTEXT_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_CREATE, struct drm_i915_gem_context_create)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800251#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 -0800252#define DRM_IOCTL_I915_REG_READ DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_REG_READ, struct drm_i915_reg_read)
253#define DRM_IOCTL_I915_GET_RESET_STATS DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GET_RESET_STATS, struct drm_i915_reset_stats)
254#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 -0800255#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 -0800256#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 -0700257#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 -0800258#define DRM_IOCTL_I915_PERF_ADD_CONFIG DRM_IOW(DRM_COMMAND_BASE + DRM_I915_PERF_ADD_CONFIG, struct drm_i915_perf_oa_config)
259#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 -0700260#define DRM_IOCTL_I915_QUERY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_QUERY, struct drm_i915_query)
Ben Cheng655a7c02013-10-16 16:09:24 -0700261typedef struct drm_i915_batchbuffer {
Tao Baod7db5942015-01-28 10:07:51 -0800262 int start;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800263 int used;
Tao Baod7db5942015-01-28 10:07:51 -0800264 int DR1;
265 int DR4;
Tao Baod7db5942015-01-28 10:07:51 -0800266 int num_cliprects;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800267 struct drm_clip_rect __user * cliprects;
Christopher Ferris38062f92014-07-09 15:33:25 -0700268} drm_i915_batchbuffer_t;
Ben Cheng655a7c02013-10-16 16:09:24 -0700269typedef struct _drm_i915_cmdbuffer {
Tao Baod7db5942015-01-28 10:07:51 -0800270 char __user * buf;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800271 int sz;
Tao Baod7db5942015-01-28 10:07:51 -0800272 int DR1;
273 int DR4;
Tao Baod7db5942015-01-28 10:07:51 -0800274 int num_cliprects;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800275 struct drm_clip_rect __user * cliprects;
Christopher Ferris38062f92014-07-09 15:33:25 -0700276} drm_i915_cmdbuffer_t;
Ben Cheng655a7c02013-10-16 16:09:24 -0700277typedef struct drm_i915_irq_emit {
Tao Baod7db5942015-01-28 10:07:51 -0800278 int __user * irq_seq;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800279} drm_i915_irq_emit_t;
Christopher Ferris38062f92014-07-09 15:33:25 -0700280typedef struct drm_i915_irq_wait {
Tao Baod7db5942015-01-28 10:07:51 -0800281 int irq_seq;
Ben Cheng655a7c02013-10-16 16:09:24 -0700282} drm_i915_irq_wait_t;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800283#define I915_PARAM_IRQ_ACTIVE 1
Christopher Ferris38062f92014-07-09 15:33:25 -0700284#define I915_PARAM_ALLOW_BATCHBUFFER 2
Ben Cheng655a7c02013-10-16 16:09:24 -0700285#define I915_PARAM_LAST_DISPATCH 3
286#define I915_PARAM_CHIPSET_ID 4
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800287#define I915_PARAM_HAS_GEM 5
Christopher Ferris38062f92014-07-09 15:33:25 -0700288#define I915_PARAM_NUM_FENCES_AVAIL 6
Ben Cheng655a7c02013-10-16 16:09:24 -0700289#define I915_PARAM_HAS_OVERLAY 7
290#define I915_PARAM_HAS_PAGEFLIPPING 8
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800291#define I915_PARAM_HAS_EXECBUF2 9
Christopher Ferris38062f92014-07-09 15:33:25 -0700292#define I915_PARAM_HAS_BSD 10
Ben Cheng655a7c02013-10-16 16:09:24 -0700293#define I915_PARAM_HAS_BLT 11
294#define I915_PARAM_HAS_RELAXED_FENCING 12
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800295#define I915_PARAM_HAS_COHERENT_RINGS 13
Christopher Ferris38062f92014-07-09 15:33:25 -0700296#define I915_PARAM_HAS_EXEC_CONSTANTS 14
Ben Cheng655a7c02013-10-16 16:09:24 -0700297#define I915_PARAM_HAS_RELAXED_DELTA 15
298#define I915_PARAM_HAS_GEN7_SOL_RESET 16
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800299#define I915_PARAM_HAS_LLC 17
Christopher Ferris38062f92014-07-09 15:33:25 -0700300#define I915_PARAM_HAS_ALIASING_PPGTT 18
Ben Cheng655a7c02013-10-16 16:09:24 -0700301#define I915_PARAM_HAS_WAIT_TIMEOUT 19
302#define I915_PARAM_HAS_SEMAPHORES 20
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800303#define I915_PARAM_HAS_PRIME_VMAP_FLUSH 21
Christopher Ferris38062f92014-07-09 15:33:25 -0700304#define I915_PARAM_HAS_VEBOX 22
Ben Cheng655a7c02013-10-16 16:09:24 -0700305#define I915_PARAM_HAS_SECURE_BATCHES 23
306#define I915_PARAM_HAS_PINNED_BATCHES 24
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800307#define I915_PARAM_HAS_EXEC_NO_RELOC 25
Christopher Ferris38062f92014-07-09 15:33:25 -0700308#define I915_PARAM_HAS_EXEC_HANDLE_LUT 26
309#define I915_PARAM_HAS_WT 27
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700310#define I915_PARAM_CMD_PARSER_VERSION 28
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800311#define I915_PARAM_HAS_COHERENT_PHYS_GTT 29
Christopher Ferris05d08e92016-02-04 13:16:38 -0800312#define I915_PARAM_MMAP_VERSION 30
313#define I915_PARAM_HAS_BSD2 31
Christopher Ferris05d08e92016-02-04 13:16:38 -0800314#define I915_PARAM_REVISION 32
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800315#define I915_PARAM_SUBSLICE_TOTAL 33
Christopher Ferris05d08e92016-02-04 13:16:38 -0800316#define I915_PARAM_EU_TOTAL 34
317#define I915_PARAM_HAS_GPU_RESET 35
Christopher Ferris05d08e92016-02-04 13:16:38 -0800318#define I915_PARAM_HAS_RESOURCE_STREAMER 36
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800319#define I915_PARAM_HAS_EXEC_SOFTPIN 37
Christopher Ferris49f525c2016-12-12 14:55:36 -0800320#define I915_PARAM_HAS_POOLED_EU 38
321#define I915_PARAM_MIN_EU_IN_POOL 39
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800322#define I915_PARAM_MMAP_GTT_VERSION 40
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800323#define I915_PARAM_HAS_SCHEDULER 41
Christopher Ferris934ec942018-01-31 15:29:16 -0800324#define I915_SCHEDULER_CAP_ENABLED (1ul << 0)
325#define I915_SCHEDULER_CAP_PRIORITY (1ul << 1)
326#define I915_SCHEDULER_CAP_PREEMPTION (1ul << 2)
Christopher Ferris525ce912017-07-26 13:12:53 -0700327#define I915_PARAM_HUC_STATUS 42
328#define I915_PARAM_HAS_EXEC_ASYNC 43
329#define I915_PARAM_HAS_EXEC_FENCE 44
Christopher Ferris1308ad32017-11-14 17:32:13 -0800330#define I915_PARAM_HAS_EXEC_CAPTURE 45
331#define I915_PARAM_SLICE_MASK 46
332#define I915_PARAM_SUBSLICE_MASK 47
333#define I915_PARAM_HAS_EXEC_BATCH_FIRST 48
334#define I915_PARAM_HAS_EXEC_FENCE_ARRAY 49
Christopher Ferris76a1d452018-06-27 14:12:29 -0700335#define I915_PARAM_HAS_CONTEXT_ISOLATION 50
336#define I915_PARAM_CS_TIMESTAMP_FREQUENCY 51
Ben Cheng655a7c02013-10-16 16:09:24 -0700337typedef struct drm_i915_getparam {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800338 __s32 param;
Tao Baod7db5942015-01-28 10:07:51 -0800339 int __user * value;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800340} drm_i915_getparam_t;
Ben Cheng655a7c02013-10-16 16:09:24 -0700341#define I915_SETPARAM_USE_MI_BATCHBUFFER_START 1
342#define I915_SETPARAM_TEX_LRU_LOG_GRANULARITY 2
343#define I915_SETPARAM_ALLOW_BATCHBUFFER 3
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800344#define I915_SETPARAM_NUM_USED_FENCES 4
Ben Cheng655a7c02013-10-16 16:09:24 -0700345typedef struct drm_i915_setparam {
Tao Baod7db5942015-01-28 10:07:51 -0800346 int param;
347 int value;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800348} drm_i915_setparam_t;
Ben Cheng655a7c02013-10-16 16:09:24 -0700349#define I915_MEM_REGION_AGP 1
350typedef struct drm_i915_mem_alloc {
Tao Baod7db5942015-01-28 10:07:51 -0800351 int region;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800352 int alignment;
Tao Baod7db5942015-01-28 10:07:51 -0800353 int size;
354 int __user * region_offset;
Ben Cheng655a7c02013-10-16 16:09:24 -0700355} drm_i915_mem_alloc_t;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800356typedef struct drm_i915_mem_free {
Tao Baod7db5942015-01-28 10:07:51 -0800357 int region;
358 int region_offset;
Ben Cheng655a7c02013-10-16 16:09:24 -0700359} drm_i915_mem_free_t;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800360typedef struct drm_i915_mem_init_heap {
Tao Baod7db5942015-01-28 10:07:51 -0800361 int region;
362 int size;
363 int start;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800364} drm_i915_mem_init_heap_t;
Ben Cheng655a7c02013-10-16 16:09:24 -0700365typedef struct drm_i915_mem_destroy_heap {
Tao Baod7db5942015-01-28 10:07:51 -0800366 int region;
Ben Cheng655a7c02013-10-16 16:09:24 -0700367} drm_i915_mem_destroy_heap_t;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800368#define DRM_I915_VBLANK_PIPE_A 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700369#define DRM_I915_VBLANK_PIPE_B 2
370typedef struct drm_i915_vblank_pipe {
Tao Baod7db5942015-01-28 10:07:51 -0800371 int pipe;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800372} drm_i915_vblank_pipe_t;
Ben Cheng655a7c02013-10-16 16:09:24 -0700373typedef struct drm_i915_vblank_swap {
Tao Baod7db5942015-01-28 10:07:51 -0800374 drm_drawable_t drawable;
375 enum drm_vblank_seq_type seqtype;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800376 unsigned int sequence;
Ben Cheng655a7c02013-10-16 16:09:24 -0700377} drm_i915_vblank_swap_t;
378typedef struct drm_i915_hws_addr {
Tao Baod7db5942015-01-28 10:07:51 -0800379 __u64 addr;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800380} drm_i915_hws_addr_t;
Ben Cheng655a7c02013-10-16 16:09:24 -0700381struct drm_i915_gem_init {
Tao Baod7db5942015-01-28 10:07:51 -0800382 __u64 gtt_start;
383 __u64 gtt_end;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800384};
Ben Cheng655a7c02013-10-16 16:09:24 -0700385struct drm_i915_gem_create {
Tao Baod7db5942015-01-28 10:07:51 -0800386 __u64 size;
387 __u32 handle;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800388 __u32 pad;
Ben Cheng655a7c02013-10-16 16:09:24 -0700389};
390struct drm_i915_gem_pread {
Tao Baod7db5942015-01-28 10:07:51 -0800391 __u32 handle;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800392 __u32 pad;
Tao Baod7db5942015-01-28 10:07:51 -0800393 __u64 offset;
394 __u64 size;
395 __u64 data_ptr;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800396};
Ben Cheng655a7c02013-10-16 16:09:24 -0700397struct drm_i915_gem_pwrite {
Tao Baod7db5942015-01-28 10:07:51 -0800398 __u32 handle;
399 __u32 pad;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800400 __u64 offset;
Tao Baod7db5942015-01-28 10:07:51 -0800401 __u64 size;
402 __u64 data_ptr;
Ben Cheng655a7c02013-10-16 16:09:24 -0700403};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800404struct drm_i915_gem_mmap {
Tao Baod7db5942015-01-28 10:07:51 -0800405 __u32 handle;
406 __u32 pad;
407 __u64 offset;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800408 __u64 size;
Tao Baod7db5942015-01-28 10:07:51 -0800409 __u64 addr_ptr;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800410 __u64 flags;
411#define I915_MMAP_WC 0x1
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800412};
Ben Cheng655a7c02013-10-16 16:09:24 -0700413struct drm_i915_gem_mmap_gtt {
Tao Baod7db5942015-01-28 10:07:51 -0800414 __u32 handle;
415 __u32 pad;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800416 __u64 offset;
Ben Cheng655a7c02013-10-16 16:09:24 -0700417};
418struct drm_i915_gem_set_domain {
Tao Baod7db5942015-01-28 10:07:51 -0800419 __u32 handle;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800420 __u32 read_domains;
Tao Baod7db5942015-01-28 10:07:51 -0800421 __u32 write_domain;
Ben Cheng655a7c02013-10-16 16:09:24 -0700422};
Ben Cheng655a7c02013-10-16 16:09:24 -0700423struct drm_i915_gem_sw_finish {
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800424 __u32 handle;
Ben Cheng655a7c02013-10-16 16:09:24 -0700425};
426struct drm_i915_gem_relocation_entry {
Tao Baod7db5942015-01-28 10:07:51 -0800427 __u32 target_handle;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800428 __u32 delta;
Tao Baod7db5942015-01-28 10:07:51 -0800429 __u64 offset;
Tao Baod7db5942015-01-28 10:07:51 -0800430 __u64 presumed_offset;
431 __u32 read_domains;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800432 __u32 write_domain;
Ben Cheng655a7c02013-10-16 16:09:24 -0700433};
434#define I915_GEM_DOMAIN_CPU 0x00000001
Ben Cheng655a7c02013-10-16 16:09:24 -0700435#define I915_GEM_DOMAIN_RENDER 0x00000002
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800436#define I915_GEM_DOMAIN_SAMPLER 0x00000004
Ben Cheng655a7c02013-10-16 16:09:24 -0700437#define I915_GEM_DOMAIN_COMMAND 0x00000008
438#define I915_GEM_DOMAIN_INSTRUCTION 0x00000010
Ben Cheng655a7c02013-10-16 16:09:24 -0700439#define I915_GEM_DOMAIN_VERTEX 0x00000020
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800440#define I915_GEM_DOMAIN_GTT 0x00000040
Christopher Ferris1308ad32017-11-14 17:32:13 -0800441#define I915_GEM_DOMAIN_WC 0x00000080
Ben Cheng655a7c02013-10-16 16:09:24 -0700442struct drm_i915_gem_exec_object {
Tao Baod7db5942015-01-28 10:07:51 -0800443 __u32 handle;
444 __u32 relocation_count;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800445 __u64 relocs_ptr;
Tao Baod7db5942015-01-28 10:07:51 -0800446 __u64 alignment;
Tao Baod7db5942015-01-28 10:07:51 -0800447 __u64 offset;
Ben Cheng655a7c02013-10-16 16:09:24 -0700448};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800449struct drm_i915_gem_execbuffer {
Tao Baod7db5942015-01-28 10:07:51 -0800450 __u64 buffers_ptr;
Tao Baod7db5942015-01-28 10:07:51 -0800451 __u32 buffer_count;
452 __u32 batch_start_offset;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800453 __u32 batch_len;
Tao Baod7db5942015-01-28 10:07:51 -0800454 __u32 DR1;
Tao Baod7db5942015-01-28 10:07:51 -0800455 __u32 DR4;
456 __u32 num_cliprects;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800457 __u64 cliprects_ptr;
Ben Cheng655a7c02013-10-16 16:09:24 -0700458};
459struct drm_i915_gem_exec_object2 {
Tao Baod7db5942015-01-28 10:07:51 -0800460 __u32 handle;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800461 __u32 relocation_count;
Tao Baod7db5942015-01-28 10:07:51 -0800462 __u64 relocs_ptr;
Tao Baod7db5942015-01-28 10:07:51 -0800463 __u64 alignment;
464 __u64 offset;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800465#define EXEC_OBJECT_NEEDS_FENCE (1 << 0)
Tao Baod7db5942015-01-28 10:07:51 -0800466#define EXEC_OBJECT_NEEDS_GTT (1 << 1)
Tao Baod7db5942015-01-28 10:07:51 -0800467#define EXEC_OBJECT_WRITE (1 << 2)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800468#define EXEC_OBJECT_SUPPORTS_48B_ADDRESS (1 << 3)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800469#define EXEC_OBJECT_PINNED (1 << 4)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800470#define EXEC_OBJECT_PAD_TO_SIZE (1 << 5)
Christopher Ferris525ce912017-07-26 13:12:53 -0700471#define EXEC_OBJECT_ASYNC (1 << 6)
Christopher Ferris1308ad32017-11-14 17:32:13 -0800472#define EXEC_OBJECT_CAPTURE (1 << 7)
473#define __EXEC_OBJECT_UNKNOWN_FLAGS - (EXEC_OBJECT_CAPTURE << 1)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800474 __u64 flags;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800475 union {
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800476 __u64 rsvd1;
477 __u64 pad_to_size;
478 };
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800479 __u64 rsvd2;
Ben Cheng655a7c02013-10-16 16:09:24 -0700480};
Christopher Ferris1308ad32017-11-14 17:32:13 -0800481struct drm_i915_gem_exec_fence {
482 __u32 handle;
483#define I915_EXEC_FENCE_WAIT (1 << 0)
484#define I915_EXEC_FENCE_SIGNAL (1 << 1)
485#define __I915_EXEC_FENCE_UNKNOWN_FLAGS (- (I915_EXEC_FENCE_SIGNAL << 1))
486 __u32 flags;
487};
Ben Cheng655a7c02013-10-16 16:09:24 -0700488struct drm_i915_gem_execbuffer2 {
Tao Baod7db5942015-01-28 10:07:51 -0800489 __u64 buffers_ptr;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800490 __u32 buffer_count;
Tao Baod7db5942015-01-28 10:07:51 -0800491 __u32 batch_start_offset;
492 __u32 batch_len;
493 __u32 DR1;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800494 __u32 DR4;
Tao Baod7db5942015-01-28 10:07:51 -0800495 __u32 num_cliprects;
496 __u64 cliprects_ptr;
497#define I915_EXEC_RING_MASK (7 << 0)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800498#define I915_EXEC_DEFAULT (0 << 0)
Tao Baod7db5942015-01-28 10:07:51 -0800499#define I915_EXEC_RENDER (1 << 0)
500#define I915_EXEC_BSD (2 << 0)
501#define I915_EXEC_BLT (3 << 0)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800502#define I915_EXEC_VEBOX (4 << 0)
Tao Baod7db5942015-01-28 10:07:51 -0800503#define I915_EXEC_CONSTANTS_MASK (3 << 6)
504#define I915_EXEC_CONSTANTS_REL_GENERAL (0 << 6)
505#define I915_EXEC_CONSTANTS_ABSOLUTE (1 << 6)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800506#define I915_EXEC_CONSTANTS_REL_SURFACE (2 << 6)
Tao Baod7db5942015-01-28 10:07:51 -0800507 __u64 flags;
508 __u64 rsvd1;
509 __u64 rsvd2;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800510};
Tao Baod7db5942015-01-28 10:07:51 -0800511#define I915_EXEC_GEN7_SOL_RESET (1 << 8)
512#define I915_EXEC_SECURE (1 << 9)
513#define I915_EXEC_IS_PINNED (1 << 10)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800514#define I915_EXEC_NO_RELOC (1 << 11)
Tao Baod7db5942015-01-28 10:07:51 -0800515#define I915_EXEC_HANDLE_LUT (1 << 12)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700516#define I915_EXEC_BSD_SHIFT (13)
517#define I915_EXEC_BSD_MASK (3 << I915_EXEC_BSD_SHIFT)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800518#define I915_EXEC_BSD_DEFAULT (0 << I915_EXEC_BSD_SHIFT)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700519#define I915_EXEC_BSD_RING1 (1 << I915_EXEC_BSD_SHIFT)
520#define I915_EXEC_BSD_RING2 (2 << I915_EXEC_BSD_SHIFT)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800521#define I915_EXEC_RESOURCE_STREAMER (1 << 15)
Christopher Ferris525ce912017-07-26 13:12:53 -0700522#define I915_EXEC_FENCE_IN (1 << 16)
523#define I915_EXEC_FENCE_OUT (1 << 17)
Christopher Ferris1308ad32017-11-14 17:32:13 -0800524#define I915_EXEC_BATCH_FIRST (1 << 18)
525#define I915_EXEC_FENCE_ARRAY (1 << 19)
526#define __I915_EXEC_UNKNOWN_FLAGS (- (I915_EXEC_FENCE_ARRAY << 1))
Christopher Ferris106b3a82016-08-24 12:15:38 -0700527#define I915_EXEC_CONTEXT_ID_MASK (0xffffffff)
Tao Baod7db5942015-01-28 10:07:51 -0800528#define i915_execbuffer2_set_context_id(eb2,context) (eb2).rsvd1 = context & I915_EXEC_CONTEXT_ID_MASK
529#define i915_execbuffer2_get_context_id(eb2) ((eb2).rsvd1 & I915_EXEC_CONTEXT_ID_MASK)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800530struct drm_i915_gem_pin {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700531 __u32 handle;
Tao Baod7db5942015-01-28 10:07:51 -0800532 __u32 pad;
533 __u64 alignment;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800534 __u64 offset;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700535};
Ben Cheng655a7c02013-10-16 16:09:24 -0700536struct drm_i915_gem_unpin {
Tao Baod7db5942015-01-28 10:07:51 -0800537 __u32 handle;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800538 __u32 pad;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700539};
Ben Cheng655a7c02013-10-16 16:09:24 -0700540struct drm_i915_gem_busy {
Tao Baod7db5942015-01-28 10:07:51 -0800541 __u32 handle;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800542 __u32 busy;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700543};
Ben Cheng655a7c02013-10-16 16:09:24 -0700544#define I915_CACHING_NONE 0
Ben Cheng655a7c02013-10-16 16:09:24 -0700545#define I915_CACHING_CACHED 1
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800546#define I915_CACHING_DISPLAY 2
Christopher Ferris106b3a82016-08-24 12:15:38 -0700547struct drm_i915_gem_caching {
Tao Baod7db5942015-01-28 10:07:51 -0800548 __u32 handle;
549 __u32 caching;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800550};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700551#define I915_TILING_NONE 0
Ben Cheng655a7c02013-10-16 16:09:24 -0700552#define I915_TILING_X 1
553#define I915_TILING_Y 2
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800554#define I915_TILING_LAST I915_TILING_Y
Ben Cheng655a7c02013-10-16 16:09:24 -0700555#define I915_BIT_6_SWIZZLE_NONE 0
Christopher Ferris106b3a82016-08-24 12:15:38 -0700556#define I915_BIT_6_SWIZZLE_9 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700557#define I915_BIT_6_SWIZZLE_9_10 2
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800558#define I915_BIT_6_SWIZZLE_9_11 3
Ben Cheng655a7c02013-10-16 16:09:24 -0700559#define I915_BIT_6_SWIZZLE_9_10_11 4
Christopher Ferris106b3a82016-08-24 12:15:38 -0700560#define I915_BIT_6_SWIZZLE_UNKNOWN 5
Ben Cheng655a7c02013-10-16 16:09:24 -0700561#define I915_BIT_6_SWIZZLE_9_17 6
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800562#define I915_BIT_6_SWIZZLE_9_10_17 7
Ben Cheng655a7c02013-10-16 16:09:24 -0700563struct drm_i915_gem_set_tiling {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700564 __u32 handle;
Tao Baod7db5942015-01-28 10:07:51 -0800565 __u32 tiling_mode;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800566 __u32 stride;
Tao Baod7db5942015-01-28 10:07:51 -0800567 __u32 swizzle_mode;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700568};
Ben Cheng655a7c02013-10-16 16:09:24 -0700569struct drm_i915_gem_get_tiling {
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800570 __u32 handle;
Tao Baod7db5942015-01-28 10:07:51 -0800571 __u32 tiling_mode;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700572 __u32 swizzle_mode;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800573 __u32 phys_swizzle_mode;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800574};
Ben Cheng655a7c02013-10-16 16:09:24 -0700575struct drm_i915_gem_get_aperture {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700576 __u64 aper_size;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800577 __u64 aper_available_size;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800578};
Ben Cheng655a7c02013-10-16 16:09:24 -0700579struct drm_i915_get_pipe_from_crtc_id {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700580 __u32 crtc_id;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800581 __u32 pipe;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800582};
Ben Cheng655a7c02013-10-16 16:09:24 -0700583#define I915_MADV_WILLNEED 0
Christopher Ferris106b3a82016-08-24 12:15:38 -0700584#define I915_MADV_DONTNEED 1
Christopher Ferris05d08e92016-02-04 13:16:38 -0800585#define __I915_MADV_PURGED 2
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800586struct drm_i915_gem_madvise {
Tao Baod7db5942015-01-28 10:07:51 -0800587 __u32 handle;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700588 __u32 madv;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800589 __u32 retained;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800590};
Ben Cheng655a7c02013-10-16 16:09:24 -0700591#define I915_OVERLAY_TYPE_MASK 0xff
Christopher Ferris106b3a82016-08-24 12:15:38 -0700592#define I915_OVERLAY_YUV_PLANAR 0x01
Christopher Ferris05d08e92016-02-04 13:16:38 -0800593#define I915_OVERLAY_YUV_PACKED 0x02
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800594#define I915_OVERLAY_RGB 0x03
Ben Cheng655a7c02013-10-16 16:09:24 -0700595#define I915_OVERLAY_DEPTH_MASK 0xff00
Christopher Ferris106b3a82016-08-24 12:15:38 -0700596#define I915_OVERLAY_RGB24 0x1000
Christopher Ferris05d08e92016-02-04 13:16:38 -0800597#define I915_OVERLAY_RGB16 0x2000
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800598#define I915_OVERLAY_RGB15 0x3000
Ben Cheng655a7c02013-10-16 16:09:24 -0700599#define I915_OVERLAY_YUV422 0x0100
Christopher Ferris106b3a82016-08-24 12:15:38 -0700600#define I915_OVERLAY_YUV411 0x0200
Christopher Ferris05d08e92016-02-04 13:16:38 -0800601#define I915_OVERLAY_YUV420 0x0300
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800602#define I915_OVERLAY_YUV410 0x0400
Ben Cheng655a7c02013-10-16 16:09:24 -0700603#define I915_OVERLAY_SWAP_MASK 0xff0000
Christopher Ferris106b3a82016-08-24 12:15:38 -0700604#define I915_OVERLAY_NO_SWAP 0x000000
Christopher Ferris05d08e92016-02-04 13:16:38 -0800605#define I915_OVERLAY_UV_SWAP 0x010000
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800606#define I915_OVERLAY_Y_SWAP 0x020000
Ben Cheng655a7c02013-10-16 16:09:24 -0700607#define I915_OVERLAY_Y_AND_UV_SWAP 0x030000
Christopher Ferris106b3a82016-08-24 12:15:38 -0700608#define I915_OVERLAY_FLAGS_MASK 0xff000000
Christopher Ferris05d08e92016-02-04 13:16:38 -0800609#define I915_OVERLAY_ENABLE 0x01000000
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800610struct drm_intel_overlay_put_image {
Tao Baod7db5942015-01-28 10:07:51 -0800611 __u32 flags;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700612 __u32 bo_handle;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800613 __u16 stride_Y;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800614 __u16 stride_UV;
Tao Baod7db5942015-01-28 10:07:51 -0800615 __u32 offset_Y;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700616 __u32 offset_U;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800617 __u32 offset_V;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800618 __u16 src_width;
Tao Baod7db5942015-01-28 10:07:51 -0800619 __u16 src_height;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700620 __u16 src_scan_width;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800621 __u16 src_scan_height;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800622 __u32 crtc_id;
Tao Baod7db5942015-01-28 10:07:51 -0800623 __u16 dst_x;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700624 __u16 dst_y;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800625 __u16 dst_width;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800626 __u16 dst_height;
Ben Cheng655a7c02013-10-16 16:09:24 -0700627};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700628#define I915_OVERLAY_UPDATE_ATTRS (1 << 0)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800629#define I915_OVERLAY_UPDATE_GAMMA (1 << 1)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800630#define I915_OVERLAY_DISABLE_DEST_COLORKEY (1 << 2)
Ben Cheng655a7c02013-10-16 16:09:24 -0700631struct drm_intel_overlay_attrs {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700632 __u32 flags;
Tao Baod7db5942015-01-28 10:07:51 -0800633 __u32 color_key;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800634 __s32 brightness;
Tao Baod7db5942015-01-28 10:07:51 -0800635 __u32 contrast;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700636 __u32 saturation;
Tao Baod7db5942015-01-28 10:07:51 -0800637 __u32 gamma0;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800638 __u32 gamma1;
Tao Baod7db5942015-01-28 10:07:51 -0800639 __u32 gamma2;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700640 __u32 gamma3;
Tao Baod7db5942015-01-28 10:07:51 -0800641 __u32 gamma4;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800642 __u32 gamma5;
Ben Cheng655a7c02013-10-16 16:09:24 -0700643};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700644#define I915_SET_COLORKEY_NONE (1 << 0)
Tao Baod7db5942015-01-28 10:07:51 -0800645#define I915_SET_COLORKEY_DESTINATION (1 << 1)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800646#define I915_SET_COLORKEY_SOURCE (1 << 2)
Ben Cheng655a7c02013-10-16 16:09:24 -0700647struct drm_intel_sprite_colorkey {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700648 __u32 plane_id;
Tao Baod7db5942015-01-28 10:07:51 -0800649 __u32 min_value;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800650 __u32 channel_mask;
Tao Baod7db5942015-01-28 10:07:51 -0800651 __u32 max_value;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700652 __u32 flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700653};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800654struct drm_i915_gem_wait {
Tao Baod7db5942015-01-28 10:07:51 -0800655 __u32 bo_handle;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700656 __u32 flags;
Tao Baod7db5942015-01-28 10:07:51 -0800657 __s64 timeout_ns;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800658};
Ben Cheng655a7c02013-10-16 16:09:24 -0700659struct drm_i915_gem_context_create {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700660 __u32 ctx_id;
Tao Baod7db5942015-01-28 10:07:51 -0800661 __u32 pad;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800662};
Ben Cheng655a7c02013-10-16 16:09:24 -0700663struct drm_i915_gem_context_destroy {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700664 __u32 ctx_id;
Tao Baod7db5942015-01-28 10:07:51 -0800665 __u32 pad;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800666};
Ben Cheng655a7c02013-10-16 16:09:24 -0700667struct drm_i915_reg_read {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700668 __u64 offset;
Christopher Ferris934ec942018-01-31 15:29:16 -0800669#define I915_REG_READ_8B_WA (1ul << 0)
Tao Baod7db5942015-01-28 10:07:51 -0800670 __u64 val;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800671};
Christopher Ferris38062f92014-07-09 15:33:25 -0700672struct drm_i915_reset_stats {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700673 __u32 ctx_id;
Tao Baod7db5942015-01-28 10:07:51 -0800674 __u32 flags;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800675 __u32 reset_count;
Tao Baod7db5942015-01-28 10:07:51 -0800676 __u32 batch_active;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700677 __u32 batch_pending;
Tao Baod7db5942015-01-28 10:07:51 -0800678 __u32 pad;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800679};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700680struct drm_i915_gem_userptr {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700681 __u64 user_ptr;
Tao Baod7db5942015-01-28 10:07:51 -0800682 __u64 user_size;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800683 __u32 flags;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700684#define I915_USERPTR_READ_ONLY 0x1
Christopher Ferris106b3a82016-08-24 12:15:38 -0700685#define I915_USERPTR_UNSYNCHRONIZED 0x80000000
Tao Baod7db5942015-01-28 10:07:51 -0800686 __u32 handle;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800687};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800688struct drm_i915_gem_context_param {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700689 __u32 ctx_id;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800690 __u32 size;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800691 __u64 param;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800692#define I915_CONTEXT_PARAM_BAN_PERIOD 0x1
Christopher Ferris106b3a82016-08-24 12:15:38 -0700693#define I915_CONTEXT_PARAM_NO_ZEROMAP 0x2
694#define I915_CONTEXT_PARAM_GTT_SIZE 0x3
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800695#define I915_CONTEXT_PARAM_NO_ERROR_CAPTURE 0x4
Christopher Ferris525ce912017-07-26 13:12:53 -0700696#define I915_CONTEXT_PARAM_BANNABLE 0x5
Christopher Ferris934ec942018-01-31 15:29:16 -0800697#define I915_CONTEXT_PARAM_PRIORITY 0x6
698#define I915_CONTEXT_MAX_USER_PRIORITY 1023
699#define I915_CONTEXT_DEFAULT_PRIORITY 0
700#define I915_CONTEXT_MIN_USER_PRIORITY - 1023
Christopher Ferris05d08e92016-02-04 13:16:38 -0800701 __u64 value;
702};
Christopher Ferris525ce912017-07-26 13:12:53 -0700703enum drm_i915_oa_format {
704 I915_OA_FORMAT_A13 = 1,
705 I915_OA_FORMAT_A29,
706 I915_OA_FORMAT_A13_B8_C8,
707 I915_OA_FORMAT_B4_C8,
708 I915_OA_FORMAT_A45_B8_C8,
709 I915_OA_FORMAT_B4_C8_A16,
710 I915_OA_FORMAT_C4_B8,
Christopher Ferris1308ad32017-11-14 17:32:13 -0800711 I915_OA_FORMAT_A12,
712 I915_OA_FORMAT_A12_B8_C8,
713 I915_OA_FORMAT_A32u40_A4u32_B8_C8,
Christopher Ferris525ce912017-07-26 13:12:53 -0700714 I915_OA_FORMAT_MAX
715};
716enum drm_i915_perf_property_id {
717 DRM_I915_PERF_PROP_CTX_HANDLE = 1,
718 DRM_I915_PERF_PROP_SAMPLE_OA,
719 DRM_I915_PERF_PROP_OA_METRICS_SET,
720 DRM_I915_PERF_PROP_OA_FORMAT,
721 DRM_I915_PERF_PROP_OA_EXPONENT,
722 DRM_I915_PERF_PROP_MAX
723};
724struct drm_i915_perf_open_param {
725 __u32 flags;
726#define I915_PERF_FLAG_FD_CLOEXEC (1 << 0)
727#define I915_PERF_FLAG_FD_NONBLOCK (1 << 1)
728#define I915_PERF_FLAG_DISABLED (1 << 2)
729 __u32 num_properties;
730 __u64 properties_ptr;
731};
732#define I915_PERF_IOCTL_ENABLE _IO('i', 0x0)
733#define I915_PERF_IOCTL_DISABLE _IO('i', 0x1)
734struct drm_i915_perf_record_header {
735 __u32 type;
736 __u16 pad;
737 __u16 size;
738};
739enum drm_i915_perf_record_type {
740 DRM_I915_PERF_RECORD_SAMPLE = 1,
741 DRM_I915_PERF_RECORD_OA_REPORT_LOST = 2,
742 DRM_I915_PERF_RECORD_OA_BUFFER_LOST = 3,
743 DRM_I915_PERF_RECORD_MAX
744};
Christopher Ferris1308ad32017-11-14 17:32:13 -0800745struct drm_i915_perf_oa_config {
746 char uuid[36];
747 __u32 n_mux_regs;
748 __u32 n_boolean_regs;
749 __u32 n_flex_regs;
Christopher Ferris934ec942018-01-31 15:29:16 -0800750 __u64 mux_regs_ptr;
751 __u64 boolean_regs_ptr;
752 __u64 flex_regs_ptr;
Christopher Ferris1308ad32017-11-14 17:32:13 -0800753};
Christopher Ferris76a1d452018-06-27 14:12:29 -0700754struct drm_i915_query_item {
755 __u64 query_id;
756#define DRM_I915_QUERY_TOPOLOGY_INFO 1
757 __s32 length;
758 __u32 flags;
759 __u64 data_ptr;
760};
761struct drm_i915_query {
762 __u32 num_items;
763 __u32 flags;
764 __u64 items_ptr;
765};
766struct drm_i915_query_topology_info {
767 __u16 flags;
768 __u16 max_slices;
769 __u16 max_subslices;
770 __u16 max_eus_per_subslice;
771 __u16 subslice_offset;
772 __u16 subslice_stride;
773 __u16 eu_offset;
774 __u16 eu_stride;
775 __u8 data[];
776};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700777#ifdef __cplusplus
Ben Cheng655a7c02013-10-16 16:09:24 -0700778#endif
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800779#endif