blob: af6f064309f9656bb959b9b59d221a1bd51f8361 [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 Ferris38062f92014-07-09 15:33:25 -070032#define I915_NR_TEX_REGIONS 255
Ben Cheng655a7c02013-10-16 16:09:24 -070033#define I915_LOG_MIN_TEX_REGION_SIZE 14
34typedef struct _drm_i915_init {
Christopher Ferris6a9755d2017-01-13 14:09:31 -080035 enum {
Tao Baod7db5942015-01-28 10:07:51 -080036 I915_INIT_DMA = 0x01,
37 I915_CLEANUP_DMA = 0x02,
Tao Baod7db5942015-01-28 10:07:51 -080038 I915_RESUME_DMA = 0x03
Christopher Ferris6a9755d2017-01-13 14:09:31 -080039 } func;
Tao Baod7db5942015-01-28 10:07:51 -080040 unsigned int mmio_offset;
41 int sarea_priv_offset;
Tao Baod7db5942015-01-28 10:07:51 -080042 unsigned int ring_start;
Christopher Ferris6a9755d2017-01-13 14:09:31 -080043 unsigned int ring_end;
Tao Baod7db5942015-01-28 10:07:51 -080044 unsigned int ring_size;
45 unsigned int front_offset;
Tao Baod7db5942015-01-28 10:07:51 -080046 unsigned int back_offset;
Christopher Ferris6a9755d2017-01-13 14:09:31 -080047 unsigned int depth_offset;
Tao Baod7db5942015-01-28 10:07:51 -080048 unsigned int w;
49 unsigned int h;
Tao Baod7db5942015-01-28 10:07:51 -080050 unsigned int pitch;
Christopher Ferris6a9755d2017-01-13 14:09:31 -080051 unsigned int pitch_bits;
Tao Baod7db5942015-01-28 10:07:51 -080052 unsigned int back_pitch;
53 unsigned int depth_pitch;
Tao Baod7db5942015-01-28 10:07:51 -080054 unsigned int cpp;
Christopher Ferris6a9755d2017-01-13 14:09:31 -080055 unsigned int chipset;
Ben Cheng655a7c02013-10-16 16:09:24 -070056} drm_i915_init_t;
Ben Cheng655a7c02013-10-16 16:09:24 -070057typedef struct _drm_i915_sarea {
Tao Baod7db5942015-01-28 10:07:51 -080058 struct drm_tex_region texList[I915_NR_TEX_REGIONS + 1];
Christopher Ferris6a9755d2017-01-13 14:09:31 -080059 int last_upload;
Tao Baod7db5942015-01-28 10:07:51 -080060 int last_enqueue;
61 int last_dispatch;
Tao Baod7db5942015-01-28 10:07:51 -080062 int ctxOwner;
Christopher Ferris6a9755d2017-01-13 14:09:31 -080063 int texAge;
Tao Baod7db5942015-01-28 10:07:51 -080064 int pf_enabled;
65 int pf_active;
Tao Baod7db5942015-01-28 10:07:51 -080066 int pf_current_page;
Christopher Ferris6a9755d2017-01-13 14:09:31 -080067 int perf_boxes;
Tao Baod7db5942015-01-28 10:07:51 -080068 int width, height;
69 drm_handle_t front_handle;
Tao Baod7db5942015-01-28 10:07:51 -080070 int front_offset;
Christopher Ferris6a9755d2017-01-13 14:09:31 -080071 int front_size;
Tao Baod7db5942015-01-28 10:07:51 -080072 drm_handle_t back_handle;
73 int back_offset;
Tao Baod7db5942015-01-28 10:07:51 -080074 int back_size;
Christopher Ferris6a9755d2017-01-13 14:09:31 -080075 drm_handle_t depth_handle;
Tao Baod7db5942015-01-28 10:07:51 -080076 int depth_offset;
77 int depth_size;
Tao Baod7db5942015-01-28 10:07:51 -080078 drm_handle_t tex_handle;
Christopher Ferris6a9755d2017-01-13 14:09:31 -080079 int tex_offset;
Tao Baod7db5942015-01-28 10:07:51 -080080 int tex_size;
81 int log_tex_granularity;
Tao Baod7db5942015-01-28 10:07:51 -080082 int pitch;
Christopher Ferris6a9755d2017-01-13 14:09:31 -080083 int rotation;
Tao Baod7db5942015-01-28 10:07:51 -080084 int rotated_offset;
85 int rotated_size;
Tao Baod7db5942015-01-28 10:07:51 -080086 int rotated_pitch;
Christopher Ferris6a9755d2017-01-13 14:09:31 -080087 int virtualX, virtualY;
Tao Baod7db5942015-01-28 10:07:51 -080088 unsigned int front_tiled;
89 unsigned int back_tiled;
Tao Baod7db5942015-01-28 10:07:51 -080090 unsigned int depth_tiled;
Christopher Ferris6a9755d2017-01-13 14:09:31 -080091 unsigned int rotated_tiled;
Tao Baod7db5942015-01-28 10:07:51 -080092 unsigned int rotated2_tiled;
93 int pipeA_x;
Tao Baod7db5942015-01-28 10:07:51 -080094 int pipeA_y;
Christopher Ferris6a9755d2017-01-13 14:09:31 -080095 int pipeA_w;
Tao Baod7db5942015-01-28 10:07:51 -080096 int pipeA_h;
97 int pipeB_x;
Tao Baod7db5942015-01-28 10:07:51 -080098 int pipeB_y;
Christopher Ferris6a9755d2017-01-13 14:09:31 -080099 int pipeB_w;
Tao Baod7db5942015-01-28 10:07:51 -0800100 int pipeB_h;
101 drm_handle_t unused_handle;
Tao Baod7db5942015-01-28 10:07:51 -0800102 __u32 unused1, unused2, unused3;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800103 __u32 front_bo_handle;
Tao Baod7db5942015-01-28 10:07:51 -0800104 __u32 back_bo_handle;
105 __u32 unused_bo_handle;
Tao Baod7db5942015-01-28 10:07:51 -0800106 __u32 depth_bo_handle;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800107} drm_i915_sarea_t;
Ben Cheng655a7c02013-10-16 16:09:24 -0700108#define planeA_x pipeA_x
Ben Cheng655a7c02013-10-16 16:09:24 -0700109#define planeA_y pipeA_y
110#define planeA_w pipeA_w
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800111#define planeA_h pipeA_h
Ben Cheng655a7c02013-10-16 16:09:24 -0700112#define planeB_x pipeB_x
Ben Cheng655a7c02013-10-16 16:09:24 -0700113#define planeB_y pipeB_y
114#define planeB_w pipeB_w
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800115#define planeB_h pipeB_h
Ben Cheng655a7c02013-10-16 16:09:24 -0700116#define I915_BOX_RING_EMPTY 0x1
Ben Cheng655a7c02013-10-16 16:09:24 -0700117#define I915_BOX_FLIP 0x2
118#define I915_BOX_WAIT 0x4
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800119#define I915_BOX_TEXTURE_LOAD 0x8
Ben Cheng655a7c02013-10-16 16:09:24 -0700120#define I915_BOX_LOST_CONTEXT 0x10
Ben Cheng655a7c02013-10-16 16:09:24 -0700121#define DRM_I915_INIT 0x00
122#define DRM_I915_FLUSH 0x01
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800123#define DRM_I915_FLIP 0x02
Ben Cheng655a7c02013-10-16 16:09:24 -0700124#define DRM_I915_BATCHBUFFER 0x03
Ben Cheng655a7c02013-10-16 16:09:24 -0700125#define DRM_I915_IRQ_EMIT 0x04
126#define DRM_I915_IRQ_WAIT 0x05
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800127#define DRM_I915_GETPARAM 0x06
Ben Cheng655a7c02013-10-16 16:09:24 -0700128#define DRM_I915_SETPARAM 0x07
Ben Cheng655a7c02013-10-16 16:09:24 -0700129#define DRM_I915_ALLOC 0x08
130#define DRM_I915_FREE 0x09
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800131#define DRM_I915_INIT_HEAP 0x0a
Ben Cheng655a7c02013-10-16 16:09:24 -0700132#define DRM_I915_CMDBUFFER 0x0b
Ben Cheng655a7c02013-10-16 16:09:24 -0700133#define DRM_I915_DESTROY_HEAP 0x0c
134#define DRM_I915_SET_VBLANK_PIPE 0x0d
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800135#define DRM_I915_GET_VBLANK_PIPE 0x0e
Ben Cheng655a7c02013-10-16 16:09:24 -0700136#define DRM_I915_VBLANK_SWAP 0x0f
Ben Cheng655a7c02013-10-16 16:09:24 -0700137#define DRM_I915_HWS_ADDR 0x11
138#define DRM_I915_GEM_INIT 0x13
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800139#define DRM_I915_GEM_EXECBUFFER 0x14
Ben Cheng655a7c02013-10-16 16:09:24 -0700140#define DRM_I915_GEM_PIN 0x15
Ben Cheng655a7c02013-10-16 16:09:24 -0700141#define DRM_I915_GEM_UNPIN 0x16
142#define DRM_I915_GEM_BUSY 0x17
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800143#define DRM_I915_GEM_THROTTLE 0x18
Ben Cheng655a7c02013-10-16 16:09:24 -0700144#define DRM_I915_GEM_ENTERVT 0x19
Ben Cheng655a7c02013-10-16 16:09:24 -0700145#define DRM_I915_GEM_LEAVEVT 0x1a
146#define DRM_I915_GEM_CREATE 0x1b
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800147#define DRM_I915_GEM_PREAD 0x1c
Ben Cheng655a7c02013-10-16 16:09:24 -0700148#define DRM_I915_GEM_PWRITE 0x1d
Ben Cheng655a7c02013-10-16 16:09:24 -0700149#define DRM_I915_GEM_MMAP 0x1e
150#define DRM_I915_GEM_SET_DOMAIN 0x1f
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800151#define DRM_I915_GEM_SW_FINISH 0x20
Ben Cheng655a7c02013-10-16 16:09:24 -0700152#define DRM_I915_GEM_SET_TILING 0x21
Ben Cheng655a7c02013-10-16 16:09:24 -0700153#define DRM_I915_GEM_GET_TILING 0x22
154#define DRM_I915_GEM_GET_APERTURE 0x23
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800155#define DRM_I915_GEM_MMAP_GTT 0x24
Ben Cheng655a7c02013-10-16 16:09:24 -0700156#define DRM_I915_GET_PIPE_FROM_CRTC_ID 0x25
Ben Cheng655a7c02013-10-16 16:09:24 -0700157#define DRM_I915_GEM_MADVISE 0x26
158#define DRM_I915_OVERLAY_PUT_IMAGE 0x27
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800159#define DRM_I915_OVERLAY_ATTRS 0x28
Ben Cheng655a7c02013-10-16 16:09:24 -0700160#define DRM_I915_GEM_EXECBUFFER2 0x29
Christopher Ferris525ce912017-07-26 13:12:53 -0700161#define DRM_I915_GEM_EXECBUFFER2_WR DRM_I915_GEM_EXECBUFFER2
Ben Cheng655a7c02013-10-16 16:09:24 -0700162#define DRM_I915_GET_SPRITE_COLORKEY 0x2a
163#define DRM_I915_SET_SPRITE_COLORKEY 0x2b
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800164#define DRM_I915_GEM_WAIT 0x2c
Ben Cheng655a7c02013-10-16 16:09:24 -0700165#define DRM_I915_GEM_CONTEXT_CREATE 0x2d
Ben Cheng655a7c02013-10-16 16:09:24 -0700166#define DRM_I915_GEM_CONTEXT_DESTROY 0x2e
167#define DRM_I915_GEM_SET_CACHING 0x2f
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800168#define DRM_I915_GEM_GET_CACHING 0x30
Ben Cheng655a7c02013-10-16 16:09:24 -0700169#define DRM_I915_REG_READ 0x31
Christopher Ferris38062f92014-07-09 15:33:25 -0700170#define DRM_I915_GET_RESET_STATS 0x32
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700171#define DRM_I915_GEM_USERPTR 0x33
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800172#define DRM_I915_GEM_CONTEXT_GETPARAM 0x34
Christopher Ferris05d08e92016-02-04 13:16:38 -0800173#define DRM_I915_GEM_CONTEXT_SETPARAM 0x35
Christopher Ferris525ce912017-07-26 13:12:53 -0700174#define DRM_I915_PERF_OPEN 0x36
Tao Baod7db5942015-01-28 10:07:51 -0800175#define DRM_IOCTL_I915_INIT DRM_IOW(DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t)
176#define DRM_IOCTL_I915_FLUSH DRM_IO(DRM_COMMAND_BASE + DRM_I915_FLUSH)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800177#define DRM_IOCTL_I915_FLIP DRM_IO(DRM_COMMAND_BASE + DRM_I915_FLIP)
Tao Baod7db5942015-01-28 10:07:51 -0800178#define DRM_IOCTL_I915_BATCHBUFFER DRM_IOW(DRM_COMMAND_BASE + DRM_I915_BATCHBUFFER, drm_i915_batchbuffer_t)
Ben Cheng655a7c02013-10-16 16:09:24 -0700179#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 -0800180#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 -0800181#define DRM_IOCTL_I915_GETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GETPARAM, drm_i915_getparam_t)
Tao Baod7db5942015-01-28 10:07:51 -0800182#define DRM_IOCTL_I915_SETPARAM DRM_IOW(DRM_COMMAND_BASE + DRM_I915_SETPARAM, drm_i915_setparam_t)
Ben Cheng655a7c02013-10-16 16:09:24 -0700183#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 -0800184#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 -0800185#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 -0800186#define DRM_IOCTL_I915_CMDBUFFER DRM_IOW(DRM_COMMAND_BASE + DRM_I915_CMDBUFFER, drm_i915_cmdbuffer_t)
187#define DRM_IOCTL_I915_DESTROY_HEAP DRM_IOW(DRM_COMMAND_BASE + DRM_I915_DESTROY_HEAP, drm_i915_mem_destroy_heap_t)
188#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 -0800189#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 -0700190#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 -0700191#define DRM_IOCTL_I915_HWS_ADDR DRM_IOW(DRM_COMMAND_BASE + DRM_I915_HWS_ADDR, struct drm_i915_gem_init)
192#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 -0800193#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 -0700194#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 -0700195#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 -0700196#define DRM_IOCTL_I915_GEM_PIN DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_PIN, struct drm_i915_gem_pin)
197#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 -0800198#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 -0700199#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 -0700200#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 -0800201#define DRM_IOCTL_I915_GEM_THROTTLE DRM_IO(DRM_COMMAND_BASE + DRM_I915_GEM_THROTTLE)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800202#define DRM_IOCTL_I915_GEM_ENTERVT DRM_IO(DRM_COMMAND_BASE + DRM_I915_GEM_ENTERVT)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700203#define DRM_IOCTL_I915_GEM_LEAVEVT DRM_IO(DRM_COMMAND_BASE + DRM_I915_GEM_LEAVEVT)
Ben Cheng655a7c02013-10-16 16:09:24 -0700204#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 -0800205#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 -0800206#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 -0700207#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 -0700208#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 -0800209#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 -0800210#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 -0800211#define DRM_IOCTL_I915_GEM_SET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_SET_TILING, struct drm_i915_gem_set_tiling)
212#define DRM_IOCTL_I915_GEM_GET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_GET_TILING, struct drm_i915_gem_get_tiling)
213#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 -0800214#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 -0700215#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 -0700216#define DRM_IOCTL_I915_OVERLAY_PUT_IMAGE DRM_IOW(DRM_COMMAND_BASE + DRM_I915_OVERLAY_PUT_IMAGE, struct drm_intel_overlay_put_image)
217#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 -0800218#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 -0800219#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 -0700220#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 -0800221#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 -0800222#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 -0800223#define DRM_IOCTL_I915_REG_READ DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_REG_READ, struct drm_i915_reg_read)
224#define DRM_IOCTL_I915_GET_RESET_STATS DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GET_RESET_STATS, struct drm_i915_reset_stats)
225#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 -0800226#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 -0800227#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 -0700228#define DRM_IOCTL_I915_PERF_OPEN DRM_IOW(DRM_COMMAND_BASE + DRM_I915_PERF_OPEN, struct drm_i915_perf_open_param)
Ben Cheng655a7c02013-10-16 16:09:24 -0700229typedef struct drm_i915_batchbuffer {
Tao Baod7db5942015-01-28 10:07:51 -0800230 int start;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800231 int used;
Tao Baod7db5942015-01-28 10:07:51 -0800232 int DR1;
233 int DR4;
Tao Baod7db5942015-01-28 10:07:51 -0800234 int num_cliprects;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800235 struct drm_clip_rect __user * cliprects;
Christopher Ferris38062f92014-07-09 15:33:25 -0700236} drm_i915_batchbuffer_t;
Ben Cheng655a7c02013-10-16 16:09:24 -0700237typedef struct _drm_i915_cmdbuffer {
Tao Baod7db5942015-01-28 10:07:51 -0800238 char __user * buf;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800239 int sz;
Tao Baod7db5942015-01-28 10:07:51 -0800240 int DR1;
241 int DR4;
Tao Baod7db5942015-01-28 10:07:51 -0800242 int num_cliprects;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800243 struct drm_clip_rect __user * cliprects;
Christopher Ferris38062f92014-07-09 15:33:25 -0700244} drm_i915_cmdbuffer_t;
Ben Cheng655a7c02013-10-16 16:09:24 -0700245typedef struct drm_i915_irq_emit {
Tao Baod7db5942015-01-28 10:07:51 -0800246 int __user * irq_seq;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800247} drm_i915_irq_emit_t;
Christopher Ferris38062f92014-07-09 15:33:25 -0700248typedef struct drm_i915_irq_wait {
Tao Baod7db5942015-01-28 10:07:51 -0800249 int irq_seq;
Ben Cheng655a7c02013-10-16 16:09:24 -0700250} drm_i915_irq_wait_t;
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800251#define I915_PARAM_IRQ_ACTIVE 1
Christopher Ferris38062f92014-07-09 15:33:25 -0700252#define I915_PARAM_ALLOW_BATCHBUFFER 2
Ben Cheng655a7c02013-10-16 16:09:24 -0700253#define I915_PARAM_LAST_DISPATCH 3
254#define I915_PARAM_CHIPSET_ID 4
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800255#define I915_PARAM_HAS_GEM 5
Christopher Ferris38062f92014-07-09 15:33:25 -0700256#define I915_PARAM_NUM_FENCES_AVAIL 6
Ben Cheng655a7c02013-10-16 16:09:24 -0700257#define I915_PARAM_HAS_OVERLAY 7
258#define I915_PARAM_HAS_PAGEFLIPPING 8
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800259#define I915_PARAM_HAS_EXECBUF2 9
Christopher Ferris38062f92014-07-09 15:33:25 -0700260#define I915_PARAM_HAS_BSD 10
Ben Cheng655a7c02013-10-16 16:09:24 -0700261#define I915_PARAM_HAS_BLT 11
262#define I915_PARAM_HAS_RELAXED_FENCING 12
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800263#define I915_PARAM_HAS_COHERENT_RINGS 13
Christopher Ferris38062f92014-07-09 15:33:25 -0700264#define I915_PARAM_HAS_EXEC_CONSTANTS 14
Ben Cheng655a7c02013-10-16 16:09:24 -0700265#define I915_PARAM_HAS_RELAXED_DELTA 15
266#define I915_PARAM_HAS_GEN7_SOL_RESET 16
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800267#define I915_PARAM_HAS_LLC 17
Christopher Ferris38062f92014-07-09 15:33:25 -0700268#define I915_PARAM_HAS_ALIASING_PPGTT 18
Ben Cheng655a7c02013-10-16 16:09:24 -0700269#define I915_PARAM_HAS_WAIT_TIMEOUT 19
270#define I915_PARAM_HAS_SEMAPHORES 20
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800271#define I915_PARAM_HAS_PRIME_VMAP_FLUSH 21
Christopher Ferris38062f92014-07-09 15:33:25 -0700272#define I915_PARAM_HAS_VEBOX 22
Ben Cheng655a7c02013-10-16 16:09:24 -0700273#define I915_PARAM_HAS_SECURE_BATCHES 23
274#define I915_PARAM_HAS_PINNED_BATCHES 24
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800275#define I915_PARAM_HAS_EXEC_NO_RELOC 25
Christopher Ferris38062f92014-07-09 15:33:25 -0700276#define I915_PARAM_HAS_EXEC_HANDLE_LUT 26
277#define I915_PARAM_HAS_WT 27
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700278#define I915_PARAM_CMD_PARSER_VERSION 28
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800279#define I915_PARAM_HAS_COHERENT_PHYS_GTT 29
Christopher Ferris05d08e92016-02-04 13:16:38 -0800280#define I915_PARAM_MMAP_VERSION 30
281#define I915_PARAM_HAS_BSD2 31
Christopher Ferris05d08e92016-02-04 13:16:38 -0800282#define I915_PARAM_REVISION 32
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800283#define I915_PARAM_SUBSLICE_TOTAL 33
Christopher Ferris05d08e92016-02-04 13:16:38 -0800284#define I915_PARAM_EU_TOTAL 34
285#define I915_PARAM_HAS_GPU_RESET 35
Christopher Ferris05d08e92016-02-04 13:16:38 -0800286#define I915_PARAM_HAS_RESOURCE_STREAMER 36
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800287#define I915_PARAM_HAS_EXEC_SOFTPIN 37
Christopher Ferris49f525c2016-12-12 14:55:36 -0800288#define I915_PARAM_HAS_POOLED_EU 38
289#define I915_PARAM_MIN_EU_IN_POOL 39
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800290#define I915_PARAM_MMAP_GTT_VERSION 40
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800291#define I915_PARAM_HAS_SCHEDULER 41
Christopher Ferris525ce912017-07-26 13:12:53 -0700292#define I915_PARAM_HUC_STATUS 42
293#define I915_PARAM_HAS_EXEC_ASYNC 43
294#define I915_PARAM_HAS_EXEC_FENCE 44
Ben Cheng655a7c02013-10-16 16:09:24 -0700295typedef struct drm_i915_getparam {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800296 __s32 param;
Tao Baod7db5942015-01-28 10:07:51 -0800297 int __user * value;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800298} drm_i915_getparam_t;
Ben Cheng655a7c02013-10-16 16:09:24 -0700299#define I915_SETPARAM_USE_MI_BATCHBUFFER_START 1
300#define I915_SETPARAM_TEX_LRU_LOG_GRANULARITY 2
301#define I915_SETPARAM_ALLOW_BATCHBUFFER 3
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800302#define I915_SETPARAM_NUM_USED_FENCES 4
Ben Cheng655a7c02013-10-16 16:09:24 -0700303typedef struct drm_i915_setparam {
Tao Baod7db5942015-01-28 10:07:51 -0800304 int param;
305 int value;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800306} drm_i915_setparam_t;
Ben Cheng655a7c02013-10-16 16:09:24 -0700307#define I915_MEM_REGION_AGP 1
308typedef struct drm_i915_mem_alloc {
Tao Baod7db5942015-01-28 10:07:51 -0800309 int region;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800310 int alignment;
Tao Baod7db5942015-01-28 10:07:51 -0800311 int size;
312 int __user * region_offset;
Ben Cheng655a7c02013-10-16 16:09:24 -0700313} drm_i915_mem_alloc_t;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800314typedef struct drm_i915_mem_free {
Tao Baod7db5942015-01-28 10:07:51 -0800315 int region;
316 int region_offset;
Ben Cheng655a7c02013-10-16 16:09:24 -0700317} drm_i915_mem_free_t;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800318typedef struct drm_i915_mem_init_heap {
Tao Baod7db5942015-01-28 10:07:51 -0800319 int region;
320 int size;
321 int start;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800322} drm_i915_mem_init_heap_t;
Ben Cheng655a7c02013-10-16 16:09:24 -0700323typedef struct drm_i915_mem_destroy_heap {
Tao Baod7db5942015-01-28 10:07:51 -0800324 int region;
Ben Cheng655a7c02013-10-16 16:09:24 -0700325} drm_i915_mem_destroy_heap_t;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800326#define DRM_I915_VBLANK_PIPE_A 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700327#define DRM_I915_VBLANK_PIPE_B 2
328typedef struct drm_i915_vblank_pipe {
Tao Baod7db5942015-01-28 10:07:51 -0800329 int pipe;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800330} drm_i915_vblank_pipe_t;
Ben Cheng655a7c02013-10-16 16:09:24 -0700331typedef struct drm_i915_vblank_swap {
Tao Baod7db5942015-01-28 10:07:51 -0800332 drm_drawable_t drawable;
333 enum drm_vblank_seq_type seqtype;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800334 unsigned int sequence;
Ben Cheng655a7c02013-10-16 16:09:24 -0700335} drm_i915_vblank_swap_t;
336typedef struct drm_i915_hws_addr {
Tao Baod7db5942015-01-28 10:07:51 -0800337 __u64 addr;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800338} drm_i915_hws_addr_t;
Ben Cheng655a7c02013-10-16 16:09:24 -0700339struct drm_i915_gem_init {
Tao Baod7db5942015-01-28 10:07:51 -0800340 __u64 gtt_start;
341 __u64 gtt_end;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800342};
Ben Cheng655a7c02013-10-16 16:09:24 -0700343struct drm_i915_gem_create {
Tao Baod7db5942015-01-28 10:07:51 -0800344 __u64 size;
345 __u32 handle;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800346 __u32 pad;
Ben Cheng655a7c02013-10-16 16:09:24 -0700347};
348struct drm_i915_gem_pread {
Tao Baod7db5942015-01-28 10:07:51 -0800349 __u32 handle;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800350 __u32 pad;
Tao Baod7db5942015-01-28 10:07:51 -0800351 __u64 offset;
352 __u64 size;
353 __u64 data_ptr;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800354};
Ben Cheng655a7c02013-10-16 16:09:24 -0700355struct drm_i915_gem_pwrite {
Tao Baod7db5942015-01-28 10:07:51 -0800356 __u32 handle;
357 __u32 pad;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800358 __u64 offset;
Tao Baod7db5942015-01-28 10:07:51 -0800359 __u64 size;
360 __u64 data_ptr;
Ben Cheng655a7c02013-10-16 16:09:24 -0700361};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800362struct drm_i915_gem_mmap {
Tao Baod7db5942015-01-28 10:07:51 -0800363 __u32 handle;
364 __u32 pad;
365 __u64 offset;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800366 __u64 size;
Tao Baod7db5942015-01-28 10:07:51 -0800367 __u64 addr_ptr;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800368 __u64 flags;
369#define I915_MMAP_WC 0x1
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800370};
Ben Cheng655a7c02013-10-16 16:09:24 -0700371struct drm_i915_gem_mmap_gtt {
Tao Baod7db5942015-01-28 10:07:51 -0800372 __u32 handle;
373 __u32 pad;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800374 __u64 offset;
Ben Cheng655a7c02013-10-16 16:09:24 -0700375};
376struct drm_i915_gem_set_domain {
Tao Baod7db5942015-01-28 10:07:51 -0800377 __u32 handle;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800378 __u32 read_domains;
Tao Baod7db5942015-01-28 10:07:51 -0800379 __u32 write_domain;
Ben Cheng655a7c02013-10-16 16:09:24 -0700380};
Ben Cheng655a7c02013-10-16 16:09:24 -0700381struct drm_i915_gem_sw_finish {
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800382 __u32 handle;
Ben Cheng655a7c02013-10-16 16:09:24 -0700383};
384struct drm_i915_gem_relocation_entry {
Tao Baod7db5942015-01-28 10:07:51 -0800385 __u32 target_handle;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800386 __u32 delta;
Tao Baod7db5942015-01-28 10:07:51 -0800387 __u64 offset;
Tao Baod7db5942015-01-28 10:07:51 -0800388 __u64 presumed_offset;
389 __u32 read_domains;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800390 __u32 write_domain;
Ben Cheng655a7c02013-10-16 16:09:24 -0700391};
392#define I915_GEM_DOMAIN_CPU 0x00000001
Ben Cheng655a7c02013-10-16 16:09:24 -0700393#define I915_GEM_DOMAIN_RENDER 0x00000002
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800394#define I915_GEM_DOMAIN_SAMPLER 0x00000004
Ben Cheng655a7c02013-10-16 16:09:24 -0700395#define I915_GEM_DOMAIN_COMMAND 0x00000008
396#define I915_GEM_DOMAIN_INSTRUCTION 0x00000010
Ben Cheng655a7c02013-10-16 16:09:24 -0700397#define I915_GEM_DOMAIN_VERTEX 0x00000020
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800398#define I915_GEM_DOMAIN_GTT 0x00000040
Ben Cheng655a7c02013-10-16 16:09:24 -0700399struct drm_i915_gem_exec_object {
Tao Baod7db5942015-01-28 10:07:51 -0800400 __u32 handle;
401 __u32 relocation_count;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800402 __u64 relocs_ptr;
Tao Baod7db5942015-01-28 10:07:51 -0800403 __u64 alignment;
Tao Baod7db5942015-01-28 10:07:51 -0800404 __u64 offset;
Ben Cheng655a7c02013-10-16 16:09:24 -0700405};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800406struct drm_i915_gem_execbuffer {
Tao Baod7db5942015-01-28 10:07:51 -0800407 __u64 buffers_ptr;
Tao Baod7db5942015-01-28 10:07:51 -0800408 __u32 buffer_count;
409 __u32 batch_start_offset;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800410 __u32 batch_len;
Tao Baod7db5942015-01-28 10:07:51 -0800411 __u32 DR1;
Tao Baod7db5942015-01-28 10:07:51 -0800412 __u32 DR4;
413 __u32 num_cliprects;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800414 __u64 cliprects_ptr;
Ben Cheng655a7c02013-10-16 16:09:24 -0700415};
416struct drm_i915_gem_exec_object2 {
Tao Baod7db5942015-01-28 10:07:51 -0800417 __u32 handle;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800418 __u32 relocation_count;
Tao Baod7db5942015-01-28 10:07:51 -0800419 __u64 relocs_ptr;
Tao Baod7db5942015-01-28 10:07:51 -0800420 __u64 alignment;
421 __u64 offset;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800422#define EXEC_OBJECT_NEEDS_FENCE (1 << 0)
Tao Baod7db5942015-01-28 10:07:51 -0800423#define EXEC_OBJECT_NEEDS_GTT (1 << 1)
Tao Baod7db5942015-01-28 10:07:51 -0800424#define EXEC_OBJECT_WRITE (1 << 2)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800425#define EXEC_OBJECT_SUPPORTS_48B_ADDRESS (1 << 3)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800426#define EXEC_OBJECT_PINNED (1 << 4)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800427#define EXEC_OBJECT_PAD_TO_SIZE (1 << 5)
Christopher Ferris525ce912017-07-26 13:12:53 -0700428#define EXEC_OBJECT_ASYNC (1 << 6)
429#define __EXEC_OBJECT_UNKNOWN_FLAGS - (EXEC_OBJECT_ASYNC << 1)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800430 __u64 flags;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800431 union {
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800432 __u64 rsvd1;
433 __u64 pad_to_size;
434 };
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800435 __u64 rsvd2;
Ben Cheng655a7c02013-10-16 16:09:24 -0700436};
437struct drm_i915_gem_execbuffer2 {
Tao Baod7db5942015-01-28 10:07:51 -0800438 __u64 buffers_ptr;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800439 __u32 buffer_count;
Tao Baod7db5942015-01-28 10:07:51 -0800440 __u32 batch_start_offset;
441 __u32 batch_len;
442 __u32 DR1;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800443 __u32 DR4;
Tao Baod7db5942015-01-28 10:07:51 -0800444 __u32 num_cliprects;
445 __u64 cliprects_ptr;
446#define I915_EXEC_RING_MASK (7 << 0)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800447#define I915_EXEC_DEFAULT (0 << 0)
Tao Baod7db5942015-01-28 10:07:51 -0800448#define I915_EXEC_RENDER (1 << 0)
449#define I915_EXEC_BSD (2 << 0)
450#define I915_EXEC_BLT (3 << 0)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800451#define I915_EXEC_VEBOX (4 << 0)
Tao Baod7db5942015-01-28 10:07:51 -0800452#define I915_EXEC_CONSTANTS_MASK (3 << 6)
453#define I915_EXEC_CONSTANTS_REL_GENERAL (0 << 6)
454#define I915_EXEC_CONSTANTS_ABSOLUTE (1 << 6)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800455#define I915_EXEC_CONSTANTS_REL_SURFACE (2 << 6)
Tao Baod7db5942015-01-28 10:07:51 -0800456 __u64 flags;
457 __u64 rsvd1;
458 __u64 rsvd2;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800459};
Tao Baod7db5942015-01-28 10:07:51 -0800460#define I915_EXEC_GEN7_SOL_RESET (1 << 8)
461#define I915_EXEC_SECURE (1 << 9)
462#define I915_EXEC_IS_PINNED (1 << 10)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800463#define I915_EXEC_NO_RELOC (1 << 11)
Tao Baod7db5942015-01-28 10:07:51 -0800464#define I915_EXEC_HANDLE_LUT (1 << 12)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700465#define I915_EXEC_BSD_SHIFT (13)
466#define I915_EXEC_BSD_MASK (3 << I915_EXEC_BSD_SHIFT)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800467#define I915_EXEC_BSD_DEFAULT (0 << I915_EXEC_BSD_SHIFT)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700468#define I915_EXEC_BSD_RING1 (1 << I915_EXEC_BSD_SHIFT)
469#define I915_EXEC_BSD_RING2 (2 << I915_EXEC_BSD_SHIFT)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800470#define I915_EXEC_RESOURCE_STREAMER (1 << 15)
Christopher Ferris525ce912017-07-26 13:12:53 -0700471#define I915_EXEC_FENCE_IN (1 << 16)
472#define I915_EXEC_FENCE_OUT (1 << 17)
473#define __I915_EXEC_UNKNOWN_FLAGS (- (I915_EXEC_FENCE_OUT << 1))
Christopher Ferris106b3a82016-08-24 12:15:38 -0700474#define I915_EXEC_CONTEXT_ID_MASK (0xffffffff)
Tao Baod7db5942015-01-28 10:07:51 -0800475#define i915_execbuffer2_set_context_id(eb2,context) (eb2).rsvd1 = context & I915_EXEC_CONTEXT_ID_MASK
476#define i915_execbuffer2_get_context_id(eb2) ((eb2).rsvd1 & I915_EXEC_CONTEXT_ID_MASK)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800477struct drm_i915_gem_pin {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700478 __u32 handle;
Tao Baod7db5942015-01-28 10:07:51 -0800479 __u32 pad;
480 __u64 alignment;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800481 __u64 offset;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700482};
Ben Cheng655a7c02013-10-16 16:09:24 -0700483struct drm_i915_gem_unpin {
Tao Baod7db5942015-01-28 10:07:51 -0800484 __u32 handle;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800485 __u32 pad;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700486};
Ben Cheng655a7c02013-10-16 16:09:24 -0700487struct drm_i915_gem_busy {
Tao Baod7db5942015-01-28 10:07:51 -0800488 __u32 handle;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800489 __u32 busy;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700490};
Ben Cheng655a7c02013-10-16 16:09:24 -0700491#define I915_CACHING_NONE 0
Ben Cheng655a7c02013-10-16 16:09:24 -0700492#define I915_CACHING_CACHED 1
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800493#define I915_CACHING_DISPLAY 2
Christopher Ferris106b3a82016-08-24 12:15:38 -0700494struct drm_i915_gem_caching {
Tao Baod7db5942015-01-28 10:07:51 -0800495 __u32 handle;
496 __u32 caching;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800497};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700498#define I915_TILING_NONE 0
Ben Cheng655a7c02013-10-16 16:09:24 -0700499#define I915_TILING_X 1
500#define I915_TILING_Y 2
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800501#define I915_TILING_LAST I915_TILING_Y
Ben Cheng655a7c02013-10-16 16:09:24 -0700502#define I915_BIT_6_SWIZZLE_NONE 0
Christopher Ferris106b3a82016-08-24 12:15:38 -0700503#define I915_BIT_6_SWIZZLE_9 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700504#define I915_BIT_6_SWIZZLE_9_10 2
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800505#define I915_BIT_6_SWIZZLE_9_11 3
Ben Cheng655a7c02013-10-16 16:09:24 -0700506#define I915_BIT_6_SWIZZLE_9_10_11 4
Christopher Ferris106b3a82016-08-24 12:15:38 -0700507#define I915_BIT_6_SWIZZLE_UNKNOWN 5
Ben Cheng655a7c02013-10-16 16:09:24 -0700508#define I915_BIT_6_SWIZZLE_9_17 6
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800509#define I915_BIT_6_SWIZZLE_9_10_17 7
Ben Cheng655a7c02013-10-16 16:09:24 -0700510struct drm_i915_gem_set_tiling {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700511 __u32 handle;
Tao Baod7db5942015-01-28 10:07:51 -0800512 __u32 tiling_mode;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800513 __u32 stride;
Tao Baod7db5942015-01-28 10:07:51 -0800514 __u32 swizzle_mode;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700515};
Ben Cheng655a7c02013-10-16 16:09:24 -0700516struct drm_i915_gem_get_tiling {
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800517 __u32 handle;
Tao Baod7db5942015-01-28 10:07:51 -0800518 __u32 tiling_mode;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700519 __u32 swizzle_mode;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800520 __u32 phys_swizzle_mode;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800521};
Ben Cheng655a7c02013-10-16 16:09:24 -0700522struct drm_i915_gem_get_aperture {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700523 __u64 aper_size;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800524 __u64 aper_available_size;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800525};
Ben Cheng655a7c02013-10-16 16:09:24 -0700526struct drm_i915_get_pipe_from_crtc_id {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700527 __u32 crtc_id;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800528 __u32 pipe;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800529};
Ben Cheng655a7c02013-10-16 16:09:24 -0700530#define I915_MADV_WILLNEED 0
Christopher Ferris106b3a82016-08-24 12:15:38 -0700531#define I915_MADV_DONTNEED 1
Christopher Ferris05d08e92016-02-04 13:16:38 -0800532#define __I915_MADV_PURGED 2
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800533struct drm_i915_gem_madvise {
Tao Baod7db5942015-01-28 10:07:51 -0800534 __u32 handle;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700535 __u32 madv;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800536 __u32 retained;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800537};
Ben Cheng655a7c02013-10-16 16:09:24 -0700538#define I915_OVERLAY_TYPE_MASK 0xff
Christopher Ferris106b3a82016-08-24 12:15:38 -0700539#define I915_OVERLAY_YUV_PLANAR 0x01
Christopher Ferris05d08e92016-02-04 13:16:38 -0800540#define I915_OVERLAY_YUV_PACKED 0x02
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800541#define I915_OVERLAY_RGB 0x03
Ben Cheng655a7c02013-10-16 16:09:24 -0700542#define I915_OVERLAY_DEPTH_MASK 0xff00
Christopher Ferris106b3a82016-08-24 12:15:38 -0700543#define I915_OVERLAY_RGB24 0x1000
Christopher Ferris05d08e92016-02-04 13:16:38 -0800544#define I915_OVERLAY_RGB16 0x2000
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800545#define I915_OVERLAY_RGB15 0x3000
Ben Cheng655a7c02013-10-16 16:09:24 -0700546#define I915_OVERLAY_YUV422 0x0100
Christopher Ferris106b3a82016-08-24 12:15:38 -0700547#define I915_OVERLAY_YUV411 0x0200
Christopher Ferris05d08e92016-02-04 13:16:38 -0800548#define I915_OVERLAY_YUV420 0x0300
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800549#define I915_OVERLAY_YUV410 0x0400
Ben Cheng655a7c02013-10-16 16:09:24 -0700550#define I915_OVERLAY_SWAP_MASK 0xff0000
Christopher Ferris106b3a82016-08-24 12:15:38 -0700551#define I915_OVERLAY_NO_SWAP 0x000000
Christopher Ferris05d08e92016-02-04 13:16:38 -0800552#define I915_OVERLAY_UV_SWAP 0x010000
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800553#define I915_OVERLAY_Y_SWAP 0x020000
Ben Cheng655a7c02013-10-16 16:09:24 -0700554#define I915_OVERLAY_Y_AND_UV_SWAP 0x030000
Christopher Ferris106b3a82016-08-24 12:15:38 -0700555#define I915_OVERLAY_FLAGS_MASK 0xff000000
Christopher Ferris05d08e92016-02-04 13:16:38 -0800556#define I915_OVERLAY_ENABLE 0x01000000
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800557struct drm_intel_overlay_put_image {
Tao Baod7db5942015-01-28 10:07:51 -0800558 __u32 flags;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700559 __u32 bo_handle;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800560 __u16 stride_Y;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800561 __u16 stride_UV;
Tao Baod7db5942015-01-28 10:07:51 -0800562 __u32 offset_Y;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700563 __u32 offset_U;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800564 __u32 offset_V;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800565 __u16 src_width;
Tao Baod7db5942015-01-28 10:07:51 -0800566 __u16 src_height;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700567 __u16 src_scan_width;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800568 __u16 src_scan_height;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800569 __u32 crtc_id;
Tao Baod7db5942015-01-28 10:07:51 -0800570 __u16 dst_x;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700571 __u16 dst_y;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800572 __u16 dst_width;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800573 __u16 dst_height;
Ben Cheng655a7c02013-10-16 16:09:24 -0700574};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700575#define I915_OVERLAY_UPDATE_ATTRS (1 << 0)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800576#define I915_OVERLAY_UPDATE_GAMMA (1 << 1)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800577#define I915_OVERLAY_DISABLE_DEST_COLORKEY (1 << 2)
Ben Cheng655a7c02013-10-16 16:09:24 -0700578struct drm_intel_overlay_attrs {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700579 __u32 flags;
Tao Baod7db5942015-01-28 10:07:51 -0800580 __u32 color_key;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800581 __s32 brightness;
Tao Baod7db5942015-01-28 10:07:51 -0800582 __u32 contrast;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700583 __u32 saturation;
Tao Baod7db5942015-01-28 10:07:51 -0800584 __u32 gamma0;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800585 __u32 gamma1;
Tao Baod7db5942015-01-28 10:07:51 -0800586 __u32 gamma2;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700587 __u32 gamma3;
Tao Baod7db5942015-01-28 10:07:51 -0800588 __u32 gamma4;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800589 __u32 gamma5;
Ben Cheng655a7c02013-10-16 16:09:24 -0700590};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700591#define I915_SET_COLORKEY_NONE (1 << 0)
Tao Baod7db5942015-01-28 10:07:51 -0800592#define I915_SET_COLORKEY_DESTINATION (1 << 1)
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800593#define I915_SET_COLORKEY_SOURCE (1 << 2)
Ben Cheng655a7c02013-10-16 16:09:24 -0700594struct drm_intel_sprite_colorkey {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700595 __u32 plane_id;
Tao Baod7db5942015-01-28 10:07:51 -0800596 __u32 min_value;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800597 __u32 channel_mask;
Tao Baod7db5942015-01-28 10:07:51 -0800598 __u32 max_value;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700599 __u32 flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700600};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800601struct drm_i915_gem_wait {
Tao Baod7db5942015-01-28 10:07:51 -0800602 __u32 bo_handle;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700603 __u32 flags;
Tao Baod7db5942015-01-28 10:07:51 -0800604 __s64 timeout_ns;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800605};
Ben Cheng655a7c02013-10-16 16:09:24 -0700606struct drm_i915_gem_context_create {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700607 __u32 ctx_id;
Tao Baod7db5942015-01-28 10:07:51 -0800608 __u32 pad;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800609};
Ben Cheng655a7c02013-10-16 16:09:24 -0700610struct drm_i915_gem_context_destroy {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700611 __u32 ctx_id;
Tao Baod7db5942015-01-28 10:07:51 -0800612 __u32 pad;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800613};
Ben Cheng655a7c02013-10-16 16:09:24 -0700614struct drm_i915_reg_read {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700615 __u64 offset;
Tao Baod7db5942015-01-28 10:07:51 -0800616 __u64 val;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800617};
Christopher Ferris38062f92014-07-09 15:33:25 -0700618struct drm_i915_reset_stats {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700619 __u32 ctx_id;
Tao Baod7db5942015-01-28 10:07:51 -0800620 __u32 flags;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800621 __u32 reset_count;
Tao Baod7db5942015-01-28 10:07:51 -0800622 __u32 batch_active;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700623 __u32 batch_pending;
Tao Baod7db5942015-01-28 10:07:51 -0800624 __u32 pad;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800625};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700626struct drm_i915_gem_userptr {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700627 __u64 user_ptr;
Tao Baod7db5942015-01-28 10:07:51 -0800628 __u64 user_size;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800629 __u32 flags;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700630#define I915_USERPTR_READ_ONLY 0x1
Christopher Ferris106b3a82016-08-24 12:15:38 -0700631#define I915_USERPTR_UNSYNCHRONIZED 0x80000000
Tao Baod7db5942015-01-28 10:07:51 -0800632 __u32 handle;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800633};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800634struct drm_i915_gem_context_param {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700635 __u32 ctx_id;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800636 __u32 size;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800637 __u64 param;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800638#define I915_CONTEXT_PARAM_BAN_PERIOD 0x1
Christopher Ferris106b3a82016-08-24 12:15:38 -0700639#define I915_CONTEXT_PARAM_NO_ZEROMAP 0x2
640#define I915_CONTEXT_PARAM_GTT_SIZE 0x3
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800641#define I915_CONTEXT_PARAM_NO_ERROR_CAPTURE 0x4
Christopher Ferris525ce912017-07-26 13:12:53 -0700642#define I915_CONTEXT_PARAM_BANNABLE 0x5
Christopher Ferris05d08e92016-02-04 13:16:38 -0800643 __u64 value;
644};
Christopher Ferris525ce912017-07-26 13:12:53 -0700645enum drm_i915_oa_format {
646 I915_OA_FORMAT_A13 = 1,
647 I915_OA_FORMAT_A29,
648 I915_OA_FORMAT_A13_B8_C8,
649 I915_OA_FORMAT_B4_C8,
650 I915_OA_FORMAT_A45_B8_C8,
651 I915_OA_FORMAT_B4_C8_A16,
652 I915_OA_FORMAT_C4_B8,
653 I915_OA_FORMAT_MAX
654};
655enum drm_i915_perf_property_id {
656 DRM_I915_PERF_PROP_CTX_HANDLE = 1,
657 DRM_I915_PERF_PROP_SAMPLE_OA,
658 DRM_I915_PERF_PROP_OA_METRICS_SET,
659 DRM_I915_PERF_PROP_OA_FORMAT,
660 DRM_I915_PERF_PROP_OA_EXPONENT,
661 DRM_I915_PERF_PROP_MAX
662};
663struct drm_i915_perf_open_param {
664 __u32 flags;
665#define I915_PERF_FLAG_FD_CLOEXEC (1 << 0)
666#define I915_PERF_FLAG_FD_NONBLOCK (1 << 1)
667#define I915_PERF_FLAG_DISABLED (1 << 2)
668 __u32 num_properties;
669 __u64 properties_ptr;
670};
671#define I915_PERF_IOCTL_ENABLE _IO('i', 0x0)
672#define I915_PERF_IOCTL_DISABLE _IO('i', 0x1)
673struct drm_i915_perf_record_header {
674 __u32 type;
675 __u16 pad;
676 __u16 size;
677};
678enum drm_i915_perf_record_type {
679 DRM_I915_PERF_RECORD_SAMPLE = 1,
680 DRM_I915_PERF_RECORD_OA_REPORT_LOST = 2,
681 DRM_I915_PERF_RECORD_OA_BUFFER_LOST = 3,
682 DRM_I915_PERF_RECORD_MAX
683};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700684#ifdef __cplusplus
Ben Cheng655a7c02013-10-16 16:09:24 -0700685#endif
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800686#endif