122851890Sopenharmony_ci/* 222851890Sopenharmony_ci * This header was generated from the Linux kernel headers by update_headers.py, 322851890Sopenharmony_ci * to provide necessary information from kernel to userspace, such as constants, 422851890Sopenharmony_ci * structures, and macros, and thus, contains no copyrightable information. 522851890Sopenharmony_ci */ 622851890Sopenharmony_ci#ifndef _UAPI_I915_DRM_H_ 722851890Sopenharmony_ci#define _UAPI_I915_DRM_H_ 822851890Sopenharmony_ci#include "drm.h" 922851890Sopenharmony_ci#if defined(__cplusplus) 1022851890Sopenharmony_ciextern "C" { 1122851890Sopenharmony_ci#endif 1222851890Sopenharmony_ci#define I915_L3_PARITY_UEVENT "L3_PARITY_ERROR" 1322851890Sopenharmony_ci#define I915_ERROR_UEVENT "ERROR" 1422851890Sopenharmony_ci#define I915_RESET_UEVENT "RESET" 1522851890Sopenharmony_cienum i915_mocs_table_index { 1622851890Sopenharmony_ci 1722851890Sopenharmony_ci I915_MOCS_UNCACHED, 1822851890Sopenharmony_ci 1922851890Sopenharmony_ci I915_MOCS_PTE, 2022851890Sopenharmony_ci 2122851890Sopenharmony_ci I915_MOCS_CACHED, 2222851890Sopenharmony_ci}; 2322851890Sopenharmony_cienum drm_i915_gem_engine_class { 2422851890Sopenharmony_ci I915_ENGINE_CLASS_RENDER = 0, 2522851890Sopenharmony_ci I915_ENGINE_CLASS_COPY = 1, 2622851890Sopenharmony_ci I915_ENGINE_CLASS_VIDEO = 2, 2722851890Sopenharmony_ci I915_ENGINE_CLASS_VIDEO_ENHANCE = 3, 2822851890Sopenharmony_ci I915_ENGINE_CLASS_INVALID = -1 2922851890Sopenharmony_ci}; 3022851890Sopenharmony_cienum drm_i915_pmu_engine_sample { 3122851890Sopenharmony_ci I915_SAMPLE_BUSY = 0, 3222851890Sopenharmony_ci I915_SAMPLE_WAIT = 1, 3322851890Sopenharmony_ci I915_SAMPLE_SEMA = 2 3422851890Sopenharmony_ci}; 3522851890Sopenharmony_ci#define I915_PMU_SAMPLE_BITS (4) 3622851890Sopenharmony_ci#define I915_PMU_SAMPLE_MASK (0xf) 3722851890Sopenharmony_ci#define I915_PMU_SAMPLE_INSTANCE_BITS (8) 3822851890Sopenharmony_ci#define I915_PMU_CLASS_SHIFT \ 3922851890Sopenharmony_ci (I915_PMU_SAMPLE_BITS + I915_PMU_SAMPLE_INSTANCE_BITS) 4022851890Sopenharmony_ci#define __I915_PMU_ENGINE(class, instance, sample) \ 4122851890Sopenharmony_ci ((class) << I915_PMU_CLASS_SHIFT | \ 4222851890Sopenharmony_ci (instance) << I915_PMU_SAMPLE_BITS | \ 4322851890Sopenharmony_ci (sample)) 4422851890Sopenharmony_ci#define I915_PMU_ENGINE_BUSY(class, instance) \ 4522851890Sopenharmony_ci __I915_PMU_ENGINE(class, instance, I915_SAMPLE_BUSY) 4622851890Sopenharmony_ci#define I915_PMU_ENGINE_WAIT(class, instance) \ 4722851890Sopenharmony_ci __I915_PMU_ENGINE(class, instance, I915_SAMPLE_WAIT) 4822851890Sopenharmony_ci#define I915_PMU_ENGINE_SEMA(class, instance) \ 4922851890Sopenharmony_ci __I915_PMU_ENGINE(class, instance, I915_SAMPLE_SEMA) 5022851890Sopenharmony_ci#define __I915_PMU_OTHER(x) (__I915_PMU_ENGINE(0xff, 0xff, 0xf) + 1 + (x)) 5122851890Sopenharmony_ci#define I915_PMU_ACTUAL_FREQUENCY __I915_PMU_OTHER(0) 5222851890Sopenharmony_ci#define I915_PMU_REQUESTED_FREQUENCY __I915_PMU_OTHER(1) 5322851890Sopenharmony_ci#define I915_PMU_INTERRUPTS __I915_PMU_OTHER(2) 5422851890Sopenharmony_ci#define I915_PMU_RC6_RESIDENCY __I915_PMU_OTHER(3) 5522851890Sopenharmony_ci#define I915_PMU_LAST I915_PMU_RC6_RESIDENCY 5622851890Sopenharmony_ci#define I915_NR_TEX_REGIONS 255 5722851890Sopenharmony_ci#define I915_LOG_MIN_TEX_REGION_SIZE 14 5822851890Sopenharmony_citypedef struct _drm_i915_init { 5922851890Sopenharmony_ci enum { 6022851890Sopenharmony_ci I915_INIT_DMA = 0x01, 6122851890Sopenharmony_ci I915_CLEANUP_DMA = 0x02, 6222851890Sopenharmony_ci I915_RESUME_DMA = 0x03 6322851890Sopenharmony_ci } func; 6422851890Sopenharmony_ci unsigned int mmio_offset; 6522851890Sopenharmony_ci int sarea_priv_offset; 6622851890Sopenharmony_ci unsigned int ring_start; 6722851890Sopenharmony_ci unsigned int ring_end; 6822851890Sopenharmony_ci unsigned int ring_size; 6922851890Sopenharmony_ci unsigned int front_offset; 7022851890Sopenharmony_ci unsigned int back_offset; 7122851890Sopenharmony_ci unsigned int depth_offset; 7222851890Sopenharmony_ci unsigned int w; 7322851890Sopenharmony_ci unsigned int h; 7422851890Sopenharmony_ci unsigned int pitch; 7522851890Sopenharmony_ci unsigned int pitch_bits; 7622851890Sopenharmony_ci unsigned int back_pitch; 7722851890Sopenharmony_ci unsigned int depth_pitch; 7822851890Sopenharmony_ci unsigned int cpp; 7922851890Sopenharmony_ci unsigned int chipset; 8022851890Sopenharmony_ci} drm_i915_init_t; 8122851890Sopenharmony_citypedef struct _drm_i915_sarea { 8222851890Sopenharmony_ci struct drm_tex_region texList[I915_NR_TEX_REGIONS + 1]; 8322851890Sopenharmony_ci int last_upload; 8422851890Sopenharmony_ci int last_enqueue; 8522851890Sopenharmony_ci int last_dispatch; 8622851890Sopenharmony_ci int ctxOwner; 8722851890Sopenharmony_ci int texAge; 8822851890Sopenharmony_ci int pf_enabled; 8922851890Sopenharmony_ci int pf_active; 9022851890Sopenharmony_ci int pf_current_page; 9122851890Sopenharmony_ci int perf_boxes; 9222851890Sopenharmony_ci int width, height; 9322851890Sopenharmony_ci drm_handle_t front_handle; 9422851890Sopenharmony_ci int front_offset; 9522851890Sopenharmony_ci int front_size; 9622851890Sopenharmony_ci drm_handle_t back_handle; 9722851890Sopenharmony_ci int back_offset; 9822851890Sopenharmony_ci int back_size; 9922851890Sopenharmony_ci drm_handle_t depth_handle; 10022851890Sopenharmony_ci int depth_offset; 10122851890Sopenharmony_ci int depth_size; 10222851890Sopenharmony_ci drm_handle_t tex_handle; 10322851890Sopenharmony_ci int tex_offset; 10422851890Sopenharmony_ci int tex_size; 10522851890Sopenharmony_ci int log_tex_granularity; 10622851890Sopenharmony_ci int pitch; 10722851890Sopenharmony_ci int rotation; 10822851890Sopenharmony_ci int rotated_offset; 10922851890Sopenharmony_ci int rotated_size; 11022851890Sopenharmony_ci int rotated_pitch; 11122851890Sopenharmony_ci int virtualX, virtualY; 11222851890Sopenharmony_ci unsigned int front_tiled; 11322851890Sopenharmony_ci unsigned int back_tiled; 11422851890Sopenharmony_ci unsigned int depth_tiled; 11522851890Sopenharmony_ci unsigned int rotated_tiled; 11622851890Sopenharmony_ci unsigned int rotated2_tiled; 11722851890Sopenharmony_ci int pipeA_x; 11822851890Sopenharmony_ci int pipeA_y; 11922851890Sopenharmony_ci int pipeA_w; 12022851890Sopenharmony_ci int pipeA_h; 12122851890Sopenharmony_ci int pipeB_x; 12222851890Sopenharmony_ci int pipeB_y; 12322851890Sopenharmony_ci int pipeB_w; 12422851890Sopenharmony_ci int pipeB_h; 12522851890Sopenharmony_ci 12622851890Sopenharmony_ci drm_handle_t unused_handle; 12722851890Sopenharmony_ci __u32 unused1, unused2, unused3; 12822851890Sopenharmony_ci 12922851890Sopenharmony_ci __u32 front_bo_handle; 13022851890Sopenharmony_ci __u32 back_bo_handle; 13122851890Sopenharmony_ci __u32 unused_bo_handle; 13222851890Sopenharmony_ci __u32 depth_bo_handle; 13322851890Sopenharmony_ci} drm_i915_sarea_t; 13422851890Sopenharmony_ci#define planeA_x pipeA_x 13522851890Sopenharmony_ci#define planeA_y pipeA_y 13622851890Sopenharmony_ci#define planeA_w pipeA_w 13722851890Sopenharmony_ci#define planeA_h pipeA_h 13822851890Sopenharmony_ci#define planeB_x pipeB_x 13922851890Sopenharmony_ci#define planeB_y pipeB_y 14022851890Sopenharmony_ci#define planeB_w pipeB_w 14122851890Sopenharmony_ci#define planeB_h pipeB_h 14222851890Sopenharmony_ci#define I915_BOX_RING_EMPTY 0x1 14322851890Sopenharmony_ci#define I915_BOX_FLIP 0x2 14422851890Sopenharmony_ci#define I915_BOX_WAIT 0x4 14522851890Sopenharmony_ci#define I915_BOX_TEXTURE_LOAD 0x8 14622851890Sopenharmony_ci#define I915_BOX_LOST_CONTEXT 0x10 14722851890Sopenharmony_ci#define DRM_I915_INIT 0x00 14822851890Sopenharmony_ci#define DRM_I915_FLUSH 0x01 14922851890Sopenharmony_ci#define DRM_I915_FLIP 0x02 15022851890Sopenharmony_ci#define DRM_I915_BATCHBUFFER 0x03 15122851890Sopenharmony_ci#define DRM_I915_IRQ_EMIT 0x04 15222851890Sopenharmony_ci#define DRM_I915_IRQ_WAIT 0x05 15322851890Sopenharmony_ci#define DRM_I915_GETPARAM 0x06 15422851890Sopenharmony_ci#define DRM_I915_SETPARAM 0x07 15522851890Sopenharmony_ci#define DRM_I915_ALLOC 0x08 15622851890Sopenharmony_ci#define DRM_I915_FREE 0x09 15722851890Sopenharmony_ci#define DRM_I915_INIT_HEAP 0x0a 15822851890Sopenharmony_ci#define DRM_I915_CMDBUFFER 0x0b 15922851890Sopenharmony_ci#define DRM_I915_DESTROY_HEAP 0x0c 16022851890Sopenharmony_ci#define DRM_I915_SET_VBLANK_PIPE 0x0d 16122851890Sopenharmony_ci#define DRM_I915_GET_VBLANK_PIPE 0x0e 16222851890Sopenharmony_ci#define DRM_I915_VBLANK_SWAP 0x0f 16322851890Sopenharmony_ci#define DRM_I915_HWS_ADDR 0x11 16422851890Sopenharmony_ci#define DRM_I915_GEM_INIT 0x13 16522851890Sopenharmony_ci#define DRM_I915_GEM_EXECBUFFER 0x14 16622851890Sopenharmony_ci#define DRM_I915_GEM_PIN 0x15 16722851890Sopenharmony_ci#define DRM_I915_GEM_UNPIN 0x16 16822851890Sopenharmony_ci#define DRM_I915_GEM_BUSY 0x17 16922851890Sopenharmony_ci#define DRM_I915_GEM_THROTTLE 0x18 17022851890Sopenharmony_ci#define DRM_I915_GEM_ENTERVT 0x19 17122851890Sopenharmony_ci#define DRM_I915_GEM_LEAVEVT 0x1a 17222851890Sopenharmony_ci#define DRM_I915_GEM_CREATE 0x1b 17322851890Sopenharmony_ci#define DRM_I915_GEM_PREAD 0x1c 17422851890Sopenharmony_ci#define DRM_I915_GEM_PWRITE 0x1d 17522851890Sopenharmony_ci#define DRM_I915_GEM_MMAP 0x1e 17622851890Sopenharmony_ci#define DRM_I915_GEM_SET_DOMAIN 0x1f 17722851890Sopenharmony_ci#define DRM_I915_GEM_SW_FINISH 0x20 17822851890Sopenharmony_ci#define DRM_I915_GEM_SET_TILING 0x21 17922851890Sopenharmony_ci#define DRM_I915_GEM_GET_TILING 0x22 18022851890Sopenharmony_ci#define DRM_I915_GEM_GET_APERTURE 0x23 18122851890Sopenharmony_ci#define DRM_I915_GEM_MMAP_GTT 0x24 18222851890Sopenharmony_ci#define DRM_I915_GET_PIPE_FROM_CRTC_ID 0x25 18322851890Sopenharmony_ci#define DRM_I915_GEM_MADVISE 0x26 18422851890Sopenharmony_ci#define DRM_I915_OVERLAY_PUT_IMAGE 0x27 18522851890Sopenharmony_ci#define DRM_I915_OVERLAY_ATTRS 0x28 18622851890Sopenharmony_ci#define DRM_I915_GEM_EXECBUFFER2 0x29 18722851890Sopenharmony_ci#define DRM_I915_GEM_EXECBUFFER2_WR DRM_I915_GEM_EXECBUFFER2 18822851890Sopenharmony_ci#define DRM_I915_GET_SPRITE_COLORKEY 0x2a 18922851890Sopenharmony_ci#define DRM_I915_SET_SPRITE_COLORKEY 0x2b 19022851890Sopenharmony_ci#define DRM_I915_GEM_WAIT 0x2c 19122851890Sopenharmony_ci#define DRM_I915_GEM_CONTEXT_CREATE 0x2d 19222851890Sopenharmony_ci#define DRM_I915_GEM_CONTEXT_DESTROY 0x2e 19322851890Sopenharmony_ci#define DRM_I915_GEM_SET_CACHING 0x2f 19422851890Sopenharmony_ci#define DRM_I915_GEM_GET_CACHING 0x30 19522851890Sopenharmony_ci#define DRM_I915_REG_READ 0x31 19622851890Sopenharmony_ci#define DRM_I915_GET_RESET_STATS 0x32 19722851890Sopenharmony_ci#define DRM_I915_GEM_USERPTR 0x33 19822851890Sopenharmony_ci#define DRM_I915_GEM_CONTEXT_GETPARAM 0x34 19922851890Sopenharmony_ci#define DRM_I915_GEM_CONTEXT_SETPARAM 0x35 20022851890Sopenharmony_ci#define DRM_I915_PERF_OPEN 0x36 20122851890Sopenharmony_ci#define DRM_I915_PERF_ADD_CONFIG 0x37 20222851890Sopenharmony_ci#define DRM_I915_PERF_REMOVE_CONFIG 0x38 20322851890Sopenharmony_ci#define DRM_I915_QUERY 0x39 20422851890Sopenharmony_ci#define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t) 20522851890Sopenharmony_ci#define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH) 20622851890Sopenharmony_ci#define DRM_IOCTL_I915_FLIP DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLIP) 20722851890Sopenharmony_ci#define DRM_IOCTL_I915_BATCHBUFFER DRM_IOW( DRM_COMMAND_BASE + DRM_I915_BATCHBUFFER, drm_i915_batchbuffer_t) 20822851890Sopenharmony_ci#define DRM_IOCTL_I915_IRQ_EMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_IRQ_EMIT, drm_i915_irq_emit_t) 20922851890Sopenharmony_ci#define DRM_IOCTL_I915_IRQ_WAIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_IRQ_WAIT, drm_i915_irq_wait_t) 21022851890Sopenharmony_ci#define DRM_IOCTL_I915_GETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GETPARAM, drm_i915_getparam_t) 21122851890Sopenharmony_ci#define DRM_IOCTL_I915_SETPARAM DRM_IOW( DRM_COMMAND_BASE + DRM_I915_SETPARAM, drm_i915_setparam_t) 21222851890Sopenharmony_ci#define DRM_IOCTL_I915_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_ALLOC, drm_i915_mem_alloc_t) 21322851890Sopenharmony_ci#define DRM_IOCTL_I915_FREE DRM_IOW( DRM_COMMAND_BASE + DRM_I915_FREE, drm_i915_mem_free_t) 21422851890Sopenharmony_ci#define DRM_IOCTL_I915_INIT_HEAP DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT_HEAP, drm_i915_mem_init_heap_t) 21522851890Sopenharmony_ci#define DRM_IOCTL_I915_CMDBUFFER DRM_IOW( DRM_COMMAND_BASE + DRM_I915_CMDBUFFER, drm_i915_cmdbuffer_t) 21622851890Sopenharmony_ci#define DRM_IOCTL_I915_DESTROY_HEAP DRM_IOW( DRM_COMMAND_BASE + DRM_I915_DESTROY_HEAP, drm_i915_mem_destroy_heap_t) 21722851890Sopenharmony_ci#define DRM_IOCTL_I915_SET_VBLANK_PIPE DRM_IOW( DRM_COMMAND_BASE + DRM_I915_SET_VBLANK_PIPE, drm_i915_vblank_pipe_t) 21822851890Sopenharmony_ci#define DRM_IOCTL_I915_GET_VBLANK_PIPE DRM_IOR( DRM_COMMAND_BASE + DRM_I915_GET_VBLANK_PIPE, drm_i915_vblank_pipe_t) 21922851890Sopenharmony_ci#define DRM_IOCTL_I915_VBLANK_SWAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_VBLANK_SWAP, drm_i915_vblank_swap_t) 22022851890Sopenharmony_ci#define DRM_IOCTL_I915_HWS_ADDR DRM_IOW(DRM_COMMAND_BASE + DRM_I915_HWS_ADDR, struct drm_i915_gem_init) 22122851890Sopenharmony_ci#define DRM_IOCTL_I915_GEM_INIT DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_INIT, struct drm_i915_gem_init) 22222851890Sopenharmony_ci#define DRM_IOCTL_I915_GEM_EXECBUFFER DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER, struct drm_i915_gem_execbuffer) 22322851890Sopenharmony_ci#define DRM_IOCTL_I915_GEM_EXECBUFFER2 DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER2, struct drm_i915_gem_execbuffer2) 22422851890Sopenharmony_ci#define DRM_IOCTL_I915_GEM_EXECBUFFER2_WR DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER2_WR, struct drm_i915_gem_execbuffer2) 22522851890Sopenharmony_ci#define DRM_IOCTL_I915_GEM_PIN DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_PIN, struct drm_i915_gem_pin) 22622851890Sopenharmony_ci#define DRM_IOCTL_I915_GEM_UNPIN DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_UNPIN, struct drm_i915_gem_unpin) 22722851890Sopenharmony_ci#define DRM_IOCTL_I915_GEM_BUSY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_BUSY, struct drm_i915_gem_busy) 22822851890Sopenharmony_ci#define DRM_IOCTL_I915_GEM_SET_CACHING DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_SET_CACHING, struct drm_i915_gem_caching) 22922851890Sopenharmony_ci#define DRM_IOCTL_I915_GEM_GET_CACHING DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_GET_CACHING, struct drm_i915_gem_caching) 23022851890Sopenharmony_ci#define DRM_IOCTL_I915_GEM_THROTTLE DRM_IO ( DRM_COMMAND_BASE + DRM_I915_GEM_THROTTLE) 23122851890Sopenharmony_ci#define DRM_IOCTL_I915_GEM_ENTERVT DRM_IO(DRM_COMMAND_BASE + DRM_I915_GEM_ENTERVT) 23222851890Sopenharmony_ci#define DRM_IOCTL_I915_GEM_LEAVEVT DRM_IO(DRM_COMMAND_BASE + DRM_I915_GEM_LEAVEVT) 23322851890Sopenharmony_ci#define DRM_IOCTL_I915_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_CREATE, struct drm_i915_gem_create) 23422851890Sopenharmony_ci#define DRM_IOCTL_I915_GEM_PREAD DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_PREAD, struct drm_i915_gem_pread) 23522851890Sopenharmony_ci#define DRM_IOCTL_I915_GEM_PWRITE DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_PWRITE, struct drm_i915_gem_pwrite) 23622851890Sopenharmony_ci#define DRM_IOCTL_I915_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MMAP, struct drm_i915_gem_mmap) 23722851890Sopenharmony_ci#define DRM_IOCTL_I915_GEM_MMAP_GTT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MMAP_GTT, struct drm_i915_gem_mmap_gtt) 23822851890Sopenharmony_ci#define DRM_IOCTL_I915_GEM_SET_DOMAIN DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_SET_DOMAIN, struct drm_i915_gem_set_domain) 23922851890Sopenharmony_ci#define DRM_IOCTL_I915_GEM_SW_FINISH DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_SW_FINISH, struct drm_i915_gem_sw_finish) 24022851890Sopenharmony_ci#define DRM_IOCTL_I915_GEM_SET_TILING DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_SET_TILING, struct drm_i915_gem_set_tiling) 24122851890Sopenharmony_ci#define DRM_IOCTL_I915_GEM_GET_TILING DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_TILING, struct drm_i915_gem_get_tiling) 24222851890Sopenharmony_ci#define DRM_IOCTL_I915_GEM_GET_APERTURE DRM_IOR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_APERTURE, struct drm_i915_gem_get_aperture) 24322851890Sopenharmony_ci#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) 24422851890Sopenharmony_ci#define DRM_IOCTL_I915_GEM_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MADVISE, struct drm_i915_gem_madvise) 24522851890Sopenharmony_ci#define DRM_IOCTL_I915_OVERLAY_PUT_IMAGE DRM_IOW(DRM_COMMAND_BASE + DRM_I915_OVERLAY_PUT_IMAGE, struct drm_intel_overlay_put_image) 24622851890Sopenharmony_ci#define DRM_IOCTL_I915_OVERLAY_ATTRS DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_OVERLAY_ATTRS, struct drm_intel_overlay_attrs) 24722851890Sopenharmony_ci#define DRM_IOCTL_I915_SET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_SET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey) 24822851890Sopenharmony_ci#define DRM_IOCTL_I915_GET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey) 24922851890Sopenharmony_ci#define DRM_IOCTL_I915_GEM_WAIT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_WAIT, struct drm_i915_gem_wait) 25022851890Sopenharmony_ci#define DRM_IOCTL_I915_GEM_CONTEXT_CREATE DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_CREATE, struct drm_i915_gem_context_create) 25122851890Sopenharmony_ci#define DRM_IOCTL_I915_GEM_CONTEXT_DESTROY DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_DESTROY, struct drm_i915_gem_context_destroy) 25222851890Sopenharmony_ci#define DRM_IOCTL_I915_REG_READ DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_REG_READ, struct drm_i915_reg_read) 25322851890Sopenharmony_ci#define DRM_IOCTL_I915_GET_RESET_STATS DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GET_RESET_STATS, struct drm_i915_reset_stats) 25422851890Sopenharmony_ci#define DRM_IOCTL_I915_GEM_USERPTR DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_USERPTR, struct drm_i915_gem_userptr) 25522851890Sopenharmony_ci#define DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_GETPARAM, struct drm_i915_gem_context_param) 25622851890Sopenharmony_ci#define DRM_IOCTL_I915_GEM_CONTEXT_SETPARAM DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_SETPARAM, struct drm_i915_gem_context_param) 25722851890Sopenharmony_ci#define DRM_IOCTL_I915_PERF_OPEN DRM_IOW(DRM_COMMAND_BASE + DRM_I915_PERF_OPEN, struct drm_i915_perf_open_param) 25822851890Sopenharmony_ci#define DRM_IOCTL_I915_PERF_ADD_CONFIG DRM_IOW(DRM_COMMAND_BASE + DRM_I915_PERF_ADD_CONFIG, struct drm_i915_perf_oa_config) 25922851890Sopenharmony_ci#define DRM_IOCTL_I915_PERF_REMOVE_CONFIG DRM_IOW(DRM_COMMAND_BASE + DRM_I915_PERF_REMOVE_CONFIG, __u64) 26022851890Sopenharmony_ci#define DRM_IOCTL_I915_QUERY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_QUERY, struct drm_i915_query) 26122851890Sopenharmony_citypedef struct drm_i915_batchbuffer { 26222851890Sopenharmony_ci int start; 26322851890Sopenharmony_ci int used; 26422851890Sopenharmony_ci int DR1; 26522851890Sopenharmony_ci int DR4; 26622851890Sopenharmony_ci int num_cliprects; 26722851890Sopenharmony_ci struct drm_clip_rect __user *cliprects; 26822851890Sopenharmony_ci} drm_i915_batchbuffer_t; 26922851890Sopenharmony_citypedef struct _drm_i915_cmdbuffer { 27022851890Sopenharmony_ci char __user *buf; 27122851890Sopenharmony_ci int sz; 27222851890Sopenharmony_ci int DR1; 27322851890Sopenharmony_ci int DR4; 27422851890Sopenharmony_ci int num_cliprects; 27522851890Sopenharmony_ci struct drm_clip_rect __user *cliprects; 27622851890Sopenharmony_ci} drm_i915_cmdbuffer_t; 27722851890Sopenharmony_citypedef struct drm_i915_irq_emit { 27822851890Sopenharmony_ci int __user *irq_seq; 27922851890Sopenharmony_ci} drm_i915_irq_emit_t; 28022851890Sopenharmony_citypedef struct drm_i915_irq_wait { 28122851890Sopenharmony_ci int irq_seq; 28222851890Sopenharmony_ci} drm_i915_irq_wait_t; 28322851890Sopenharmony_ci#define I915_PARAM_IRQ_ACTIVE 1 28422851890Sopenharmony_ci#define I915_PARAM_ALLOW_BATCHBUFFER 2 28522851890Sopenharmony_ci#define I915_PARAM_LAST_DISPATCH 3 28622851890Sopenharmony_ci#define I915_PARAM_CHIPSET_ID 4 28722851890Sopenharmony_ci#define I915_PARAM_HAS_GEM 5 28822851890Sopenharmony_ci#define I915_PARAM_NUM_FENCES_AVAIL 6 28922851890Sopenharmony_ci#define I915_PARAM_HAS_OVERLAY 7 29022851890Sopenharmony_ci#define I915_PARAM_HAS_PAGEFLIPPING 8 29122851890Sopenharmony_ci#define I915_PARAM_HAS_EXECBUF2 9 29222851890Sopenharmony_ci#define I915_PARAM_HAS_BSD 10 29322851890Sopenharmony_ci#define I915_PARAM_HAS_BLT 11 29422851890Sopenharmony_ci#define I915_PARAM_HAS_RELAXED_FENCING 12 29522851890Sopenharmony_ci#define I915_PARAM_HAS_COHERENT_RINGS 13 29622851890Sopenharmony_ci#define I915_PARAM_HAS_EXEC_CONSTANTS 14 29722851890Sopenharmony_ci#define I915_PARAM_HAS_RELAXED_DELTA 15 29822851890Sopenharmony_ci#define I915_PARAM_HAS_GEN7_SOL_RESET 16 29922851890Sopenharmony_ci#define I915_PARAM_HAS_LLC 17 30022851890Sopenharmony_ci#define I915_PARAM_HAS_ALIASING_PPGTT 18 30122851890Sopenharmony_ci#define I915_PARAM_HAS_WAIT_TIMEOUT 19 30222851890Sopenharmony_ci#define I915_PARAM_HAS_SEMAPHORES 20 30322851890Sopenharmony_ci#define I915_PARAM_HAS_PRIME_VMAP_FLUSH 21 30422851890Sopenharmony_ci#define I915_PARAM_HAS_VEBOX 22 30522851890Sopenharmony_ci#define I915_PARAM_HAS_SECURE_BATCHES 23 30622851890Sopenharmony_ci#define I915_PARAM_HAS_PINNED_BATCHES 24 30722851890Sopenharmony_ci#define I915_PARAM_HAS_EXEC_NO_RELOC 25 30822851890Sopenharmony_ci#define I915_PARAM_HAS_EXEC_HANDLE_LUT 26 30922851890Sopenharmony_ci#define I915_PARAM_HAS_WT 27 31022851890Sopenharmony_ci#define I915_PARAM_CMD_PARSER_VERSION 28 31122851890Sopenharmony_ci#define I915_PARAM_HAS_COHERENT_PHYS_GTT 29 31222851890Sopenharmony_ci#define I915_PARAM_MMAP_VERSION 30 31322851890Sopenharmony_ci#define I915_PARAM_HAS_BSD2 31 31422851890Sopenharmony_ci#define I915_PARAM_REVISION 32 31522851890Sopenharmony_ci#define I915_PARAM_SUBSLICE_TOTAL 33 31622851890Sopenharmony_ci#define I915_PARAM_EU_TOTAL 34 31722851890Sopenharmony_ci#define I915_PARAM_HAS_GPU_RESET 35 31822851890Sopenharmony_ci#define I915_PARAM_HAS_RESOURCE_STREAMER 36 31922851890Sopenharmony_ci#define I915_PARAM_HAS_EXEC_SOFTPIN 37 32022851890Sopenharmony_ci#define I915_PARAM_HAS_POOLED_EU 38 32122851890Sopenharmony_ci#define I915_PARAM_MIN_EU_IN_POOL 39 32222851890Sopenharmony_ci#define I915_PARAM_MMAP_GTT_VERSION 40 32322851890Sopenharmony_ci#define I915_PARAM_HAS_SCHEDULER 41 32422851890Sopenharmony_ci#define I915_SCHEDULER_CAP_ENABLED (1ul << 0) 32522851890Sopenharmony_ci#define I915_SCHEDULER_CAP_PRIORITY (1ul << 1) 32622851890Sopenharmony_ci#define I915_SCHEDULER_CAP_PREEMPTION (1ul << 2) 32722851890Sopenharmony_ci#define I915_PARAM_HUC_STATUS 42 32822851890Sopenharmony_ci#define I915_PARAM_HAS_EXEC_ASYNC 43 32922851890Sopenharmony_ci#define I915_PARAM_HAS_EXEC_FENCE 44 33022851890Sopenharmony_ci#define I915_PARAM_HAS_EXEC_CAPTURE 45 33122851890Sopenharmony_ci#define I915_PARAM_SLICE_MASK 46 33222851890Sopenharmony_ci#define I915_PARAM_SUBSLICE_MASK 47 33322851890Sopenharmony_ci#define I915_PARAM_HAS_EXEC_BATCH_FIRST 48 33422851890Sopenharmony_ci#define I915_PARAM_HAS_EXEC_FENCE_ARRAY 49 33522851890Sopenharmony_ci#define I915_PARAM_HAS_CONTEXT_ISOLATION 50 33622851890Sopenharmony_ci#define I915_PARAM_CS_TIMESTAMP_FREQUENCY 51 33722851890Sopenharmony_citypedef struct drm_i915_getparam { 33822851890Sopenharmony_ci __s32 param; 33922851890Sopenharmony_ci 34022851890Sopenharmony_ci int __user *value; 34122851890Sopenharmony_ci} drm_i915_getparam_t; 34222851890Sopenharmony_ci#define I915_SETPARAM_USE_MI_BATCHBUFFER_START 1 34322851890Sopenharmony_ci#define I915_SETPARAM_TEX_LRU_LOG_GRANULARITY 2 34422851890Sopenharmony_ci#define I915_SETPARAM_ALLOW_BATCHBUFFER 3 34522851890Sopenharmony_ci#define I915_SETPARAM_NUM_USED_FENCES 4 34622851890Sopenharmony_citypedef struct drm_i915_setparam { 34722851890Sopenharmony_ci int param; 34822851890Sopenharmony_ci int value; 34922851890Sopenharmony_ci} drm_i915_setparam_t; 35022851890Sopenharmony_ci#define I915_MEM_REGION_AGP 1 35122851890Sopenharmony_citypedef struct drm_i915_mem_alloc { 35222851890Sopenharmony_ci int region; 35322851890Sopenharmony_ci int alignment; 35422851890Sopenharmony_ci int size; 35522851890Sopenharmony_ci int __user *region_offset; 35622851890Sopenharmony_ci} drm_i915_mem_alloc_t; 35722851890Sopenharmony_citypedef struct drm_i915_mem_free { 35822851890Sopenharmony_ci int region; 35922851890Sopenharmony_ci int region_offset; 36022851890Sopenharmony_ci} drm_i915_mem_free_t; 36122851890Sopenharmony_citypedef struct drm_i915_mem_init_heap { 36222851890Sopenharmony_ci int region; 36322851890Sopenharmony_ci int size; 36422851890Sopenharmony_ci int start; 36522851890Sopenharmony_ci} drm_i915_mem_init_heap_t; 36622851890Sopenharmony_citypedef struct drm_i915_mem_destroy_heap { 36722851890Sopenharmony_ci int region; 36822851890Sopenharmony_ci} drm_i915_mem_destroy_heap_t; 36922851890Sopenharmony_ci#define DRM_I915_VBLANK_PIPE_A 1 37022851890Sopenharmony_ci#define DRM_I915_VBLANK_PIPE_B 2 37122851890Sopenharmony_citypedef struct drm_i915_vblank_pipe { 37222851890Sopenharmony_ci int pipe; 37322851890Sopenharmony_ci} drm_i915_vblank_pipe_t; 37422851890Sopenharmony_citypedef struct drm_i915_vblank_swap { 37522851890Sopenharmony_ci drm_drawable_t drawable; 37622851890Sopenharmony_ci enum drm_vblank_seq_type seqtype; 37722851890Sopenharmony_ci unsigned int sequence; 37822851890Sopenharmony_ci} drm_i915_vblank_swap_t; 37922851890Sopenharmony_citypedef struct drm_i915_hws_addr { 38022851890Sopenharmony_ci __u64 addr; 38122851890Sopenharmony_ci} drm_i915_hws_addr_t; 38222851890Sopenharmony_cistruct drm_i915_gem_init { 38322851890Sopenharmony_ci 38422851890Sopenharmony_ci __u64 gtt_start; 38522851890Sopenharmony_ci 38622851890Sopenharmony_ci __u64 gtt_end; 38722851890Sopenharmony_ci}; 38822851890Sopenharmony_cistruct drm_i915_gem_create { 38922851890Sopenharmony_ci 39022851890Sopenharmony_ci __u64 size; 39122851890Sopenharmony_ci 39222851890Sopenharmony_ci __u32 handle; 39322851890Sopenharmony_ci __u32 pad; 39422851890Sopenharmony_ci}; 39522851890Sopenharmony_cistruct drm_i915_gem_pread { 39622851890Sopenharmony_ci 39722851890Sopenharmony_ci __u32 handle; 39822851890Sopenharmony_ci __u32 pad; 39922851890Sopenharmony_ci 40022851890Sopenharmony_ci __u64 offset; 40122851890Sopenharmony_ci 40222851890Sopenharmony_ci __u64 size; 40322851890Sopenharmony_ci 40422851890Sopenharmony_ci __u64 data_ptr; 40522851890Sopenharmony_ci}; 40622851890Sopenharmony_cistruct drm_i915_gem_pwrite { 40722851890Sopenharmony_ci 40822851890Sopenharmony_ci __u32 handle; 40922851890Sopenharmony_ci __u32 pad; 41022851890Sopenharmony_ci 41122851890Sopenharmony_ci __u64 offset; 41222851890Sopenharmony_ci 41322851890Sopenharmony_ci __u64 size; 41422851890Sopenharmony_ci 41522851890Sopenharmony_ci __u64 data_ptr; 41622851890Sopenharmony_ci}; 41722851890Sopenharmony_cistruct drm_i915_gem_mmap { 41822851890Sopenharmony_ci 41922851890Sopenharmony_ci __u32 handle; 42022851890Sopenharmony_ci __u32 pad; 42122851890Sopenharmony_ci 42222851890Sopenharmony_ci __u64 offset; 42322851890Sopenharmony_ci 42422851890Sopenharmony_ci __u64 size; 42522851890Sopenharmony_ci 42622851890Sopenharmony_ci __u64 addr_ptr; 42722851890Sopenharmony_ci 42822851890Sopenharmony_ci __u64 flags; 42922851890Sopenharmony_ci#define I915_MMAP_WC 0x1 43022851890Sopenharmony_ci}; 43122851890Sopenharmony_cistruct drm_i915_gem_mmap_gtt { 43222851890Sopenharmony_ci 43322851890Sopenharmony_ci __u32 handle; 43422851890Sopenharmony_ci __u32 pad; 43522851890Sopenharmony_ci 43622851890Sopenharmony_ci __u64 offset; 43722851890Sopenharmony_ci}; 43822851890Sopenharmony_cistruct drm_i915_gem_set_domain { 43922851890Sopenharmony_ci 44022851890Sopenharmony_ci __u32 handle; 44122851890Sopenharmony_ci 44222851890Sopenharmony_ci __u32 read_domains; 44322851890Sopenharmony_ci 44422851890Sopenharmony_ci __u32 write_domain; 44522851890Sopenharmony_ci}; 44622851890Sopenharmony_cistruct drm_i915_gem_sw_finish { 44722851890Sopenharmony_ci 44822851890Sopenharmony_ci __u32 handle; 44922851890Sopenharmony_ci}; 45022851890Sopenharmony_cistruct drm_i915_gem_relocation_entry { 45122851890Sopenharmony_ci 45222851890Sopenharmony_ci __u32 target_handle; 45322851890Sopenharmony_ci 45422851890Sopenharmony_ci __u32 delta; 45522851890Sopenharmony_ci 45622851890Sopenharmony_ci __u64 offset; 45722851890Sopenharmony_ci 45822851890Sopenharmony_ci __u64 presumed_offset; 45922851890Sopenharmony_ci 46022851890Sopenharmony_ci __u32 read_domains; 46122851890Sopenharmony_ci 46222851890Sopenharmony_ci __u32 write_domain; 46322851890Sopenharmony_ci}; 46422851890Sopenharmony_ci#define I915_GEM_DOMAIN_CPU 0x00000001 46522851890Sopenharmony_ci#define I915_GEM_DOMAIN_RENDER 0x00000002 46622851890Sopenharmony_ci#define I915_GEM_DOMAIN_SAMPLER 0x00000004 46722851890Sopenharmony_ci#define I915_GEM_DOMAIN_COMMAND 0x00000008 46822851890Sopenharmony_ci#define I915_GEM_DOMAIN_INSTRUCTION 0x00000010 46922851890Sopenharmony_ci#define I915_GEM_DOMAIN_VERTEX 0x00000020 47022851890Sopenharmony_ci#define I915_GEM_DOMAIN_GTT 0x00000040 47122851890Sopenharmony_ci#define I915_GEM_DOMAIN_WC 0x00000080 47222851890Sopenharmony_cistruct drm_i915_gem_exec_object { 47322851890Sopenharmony_ci 47422851890Sopenharmony_ci __u32 handle; 47522851890Sopenharmony_ci 47622851890Sopenharmony_ci __u32 relocation_count; 47722851890Sopenharmony_ci 47822851890Sopenharmony_ci __u64 relocs_ptr; 47922851890Sopenharmony_ci 48022851890Sopenharmony_ci __u64 alignment; 48122851890Sopenharmony_ci 48222851890Sopenharmony_ci __u64 offset; 48322851890Sopenharmony_ci}; 48422851890Sopenharmony_cistruct drm_i915_gem_execbuffer { 48522851890Sopenharmony_ci 48622851890Sopenharmony_ci __u64 buffers_ptr; 48722851890Sopenharmony_ci __u32 buffer_count; 48822851890Sopenharmony_ci 48922851890Sopenharmony_ci __u32 batch_start_offset; 49022851890Sopenharmony_ci 49122851890Sopenharmony_ci __u32 batch_len; 49222851890Sopenharmony_ci __u32 DR1; 49322851890Sopenharmony_ci __u32 DR4; 49422851890Sopenharmony_ci __u32 num_cliprects; 49522851890Sopenharmony_ci 49622851890Sopenharmony_ci __u64 cliprects_ptr; 49722851890Sopenharmony_ci}; 49822851890Sopenharmony_cistruct drm_i915_gem_exec_object2 { 49922851890Sopenharmony_ci 50022851890Sopenharmony_ci __u32 handle; 50122851890Sopenharmony_ci 50222851890Sopenharmony_ci __u32 relocation_count; 50322851890Sopenharmony_ci 50422851890Sopenharmony_ci __u64 relocs_ptr; 50522851890Sopenharmony_ci 50622851890Sopenharmony_ci __u64 alignment; 50722851890Sopenharmony_ci 50822851890Sopenharmony_ci __u64 offset; 50922851890Sopenharmony_ci#define EXEC_OBJECT_NEEDS_FENCE (1<<0) 51022851890Sopenharmony_ci#define EXEC_OBJECT_NEEDS_GTT (1<<1) 51122851890Sopenharmony_ci#define EXEC_OBJECT_WRITE (1<<2) 51222851890Sopenharmony_ci#define EXEC_OBJECT_SUPPORTS_48B_ADDRESS (1<<3) 51322851890Sopenharmony_ci#define EXEC_OBJECT_PINNED (1<<4) 51422851890Sopenharmony_ci#define EXEC_OBJECT_PAD_TO_SIZE (1<<5) 51522851890Sopenharmony_ci#define EXEC_OBJECT_ASYNC (1<<6) 51622851890Sopenharmony_ci#define EXEC_OBJECT_CAPTURE (1<<7) 51722851890Sopenharmony_ci#define __EXEC_OBJECT_UNKNOWN_FLAGS -(EXEC_OBJECT_CAPTURE<<1) 51822851890Sopenharmony_ci __u64 flags; 51922851890Sopenharmony_ci union { 52022851890Sopenharmony_ci __u64 rsvd1; 52122851890Sopenharmony_ci __u64 pad_to_size; 52222851890Sopenharmony_ci }; 52322851890Sopenharmony_ci __u64 rsvd2; 52422851890Sopenharmony_ci}; 52522851890Sopenharmony_cistruct drm_i915_gem_exec_fence { 52622851890Sopenharmony_ci 52722851890Sopenharmony_ci __u32 handle; 52822851890Sopenharmony_ci#define I915_EXEC_FENCE_WAIT (1<<0) 52922851890Sopenharmony_ci#define I915_EXEC_FENCE_SIGNAL (1<<1) 53022851890Sopenharmony_ci#define __I915_EXEC_FENCE_UNKNOWN_FLAGS (-(I915_EXEC_FENCE_SIGNAL << 1)) 53122851890Sopenharmony_ci __u32 flags; 53222851890Sopenharmony_ci}; 53322851890Sopenharmony_cistruct drm_i915_gem_execbuffer2 { 53422851890Sopenharmony_ci 53522851890Sopenharmony_ci __u64 buffers_ptr; 53622851890Sopenharmony_ci __u32 buffer_count; 53722851890Sopenharmony_ci 53822851890Sopenharmony_ci __u32 batch_start_offset; 53922851890Sopenharmony_ci 54022851890Sopenharmony_ci __u32 batch_len; 54122851890Sopenharmony_ci __u32 DR1; 54222851890Sopenharmony_ci __u32 DR4; 54322851890Sopenharmony_ci __u32 num_cliprects; 54422851890Sopenharmony_ci 54522851890Sopenharmony_ci __u64 cliprects_ptr; 54622851890Sopenharmony_ci#define I915_EXEC_RING_MASK (0x3f) 54722851890Sopenharmony_ci#define I915_EXEC_DEFAULT (0<<0) 54822851890Sopenharmony_ci#define I915_EXEC_RENDER (1<<0) 54922851890Sopenharmony_ci#define I915_EXEC_BSD (2<<0) 55022851890Sopenharmony_ci#define I915_EXEC_BLT (3<<0) 55122851890Sopenharmony_ci#define I915_EXEC_VEBOX (4<<0) 55222851890Sopenharmony_ci#define I915_EXEC_CONSTANTS_MASK (3<<6) 55322851890Sopenharmony_ci#define I915_EXEC_CONSTANTS_REL_GENERAL (0<<6) 55422851890Sopenharmony_ci#define I915_EXEC_CONSTANTS_ABSOLUTE (1<<6) 55522851890Sopenharmony_ci#define I915_EXEC_CONSTANTS_REL_SURFACE (2<<6) 55622851890Sopenharmony_ci __u64 flags; 55722851890Sopenharmony_ci __u64 rsvd1; 55822851890Sopenharmony_ci __u64 rsvd2; 55922851890Sopenharmony_ci}; 56022851890Sopenharmony_ci#define I915_EXEC_GEN7_SOL_RESET (1<<8) 56122851890Sopenharmony_ci#define I915_EXEC_SECURE (1<<9) 56222851890Sopenharmony_ci#define I915_EXEC_IS_PINNED (1<<10) 56322851890Sopenharmony_ci#define I915_EXEC_NO_RELOC (1<<11) 56422851890Sopenharmony_ci#define I915_EXEC_HANDLE_LUT (1<<12) 56522851890Sopenharmony_ci#define I915_EXEC_BSD_SHIFT (13) 56622851890Sopenharmony_ci#define I915_EXEC_BSD_MASK (3 << I915_EXEC_BSD_SHIFT) 56722851890Sopenharmony_ci#define I915_EXEC_BSD_DEFAULT (0 << I915_EXEC_BSD_SHIFT) 56822851890Sopenharmony_ci#define I915_EXEC_BSD_RING1 (1 << I915_EXEC_BSD_SHIFT) 56922851890Sopenharmony_ci#define I915_EXEC_BSD_RING2 (2 << I915_EXEC_BSD_SHIFT) 57022851890Sopenharmony_ci#define I915_EXEC_RESOURCE_STREAMER (1<<15) 57122851890Sopenharmony_ci#define I915_EXEC_FENCE_IN (1<<16) 57222851890Sopenharmony_ci#define I915_EXEC_FENCE_OUT (1<<17) 57322851890Sopenharmony_ci#define I915_EXEC_BATCH_FIRST (1<<18) 57422851890Sopenharmony_ci#define I915_EXEC_FENCE_ARRAY (1<<19) 57522851890Sopenharmony_ci#define __I915_EXEC_UNKNOWN_FLAGS (-(I915_EXEC_FENCE_ARRAY<<1)) 57622851890Sopenharmony_ci#define I915_EXEC_CONTEXT_ID_MASK (0xffffffff) 57722851890Sopenharmony_ci#define i915_execbuffer2_set_context_id(eb2, context) \ 57822851890Sopenharmony_ci (eb2).rsvd1 = context & I915_EXEC_CONTEXT_ID_MASK 57922851890Sopenharmony_ci#define i915_execbuffer2_get_context_id(eb2) \ 58022851890Sopenharmony_ci ((eb2).rsvd1 & I915_EXEC_CONTEXT_ID_MASK) 58122851890Sopenharmony_cistruct drm_i915_gem_pin { 58222851890Sopenharmony_ci 58322851890Sopenharmony_ci __u32 handle; 58422851890Sopenharmony_ci __u32 pad; 58522851890Sopenharmony_ci 58622851890Sopenharmony_ci __u64 alignment; 58722851890Sopenharmony_ci 58822851890Sopenharmony_ci __u64 offset; 58922851890Sopenharmony_ci}; 59022851890Sopenharmony_cistruct drm_i915_gem_unpin { 59122851890Sopenharmony_ci 59222851890Sopenharmony_ci __u32 handle; 59322851890Sopenharmony_ci __u32 pad; 59422851890Sopenharmony_ci}; 59522851890Sopenharmony_cistruct drm_i915_gem_busy { 59622851890Sopenharmony_ci 59722851890Sopenharmony_ci __u32 handle; 59822851890Sopenharmony_ci 59922851890Sopenharmony_ci __u32 busy; 60022851890Sopenharmony_ci}; 60122851890Sopenharmony_ci#define I915_CACHING_NONE 0 60222851890Sopenharmony_ci#define I915_CACHING_CACHED 1 60322851890Sopenharmony_ci#define I915_CACHING_DISPLAY 2 60422851890Sopenharmony_cistruct drm_i915_gem_caching { 60522851890Sopenharmony_ci 60622851890Sopenharmony_ci __u32 handle; 60722851890Sopenharmony_ci 60822851890Sopenharmony_ci __u32 caching; 60922851890Sopenharmony_ci}; 61022851890Sopenharmony_ci#define I915_TILING_NONE 0 61122851890Sopenharmony_ci#define I915_TILING_X 1 61222851890Sopenharmony_ci#define I915_TILING_Y 2 61322851890Sopenharmony_ci#define I915_TILING_LAST I915_TILING_Y 61422851890Sopenharmony_ci#define I915_BIT_6_SWIZZLE_NONE 0 61522851890Sopenharmony_ci#define I915_BIT_6_SWIZZLE_9 1 61622851890Sopenharmony_ci#define I915_BIT_6_SWIZZLE_9_10 2 61722851890Sopenharmony_ci#define I915_BIT_6_SWIZZLE_9_11 3 61822851890Sopenharmony_ci#define I915_BIT_6_SWIZZLE_9_10_11 4 61922851890Sopenharmony_ci#define I915_BIT_6_SWIZZLE_UNKNOWN 5 62022851890Sopenharmony_ci#define I915_BIT_6_SWIZZLE_9_17 6 62122851890Sopenharmony_ci#define I915_BIT_6_SWIZZLE_9_10_17 7 62222851890Sopenharmony_cistruct drm_i915_gem_set_tiling { 62322851890Sopenharmony_ci 62422851890Sopenharmony_ci __u32 handle; 62522851890Sopenharmony_ci 62622851890Sopenharmony_ci __u32 tiling_mode; 62722851890Sopenharmony_ci 62822851890Sopenharmony_ci __u32 stride; 62922851890Sopenharmony_ci 63022851890Sopenharmony_ci __u32 swizzle_mode; 63122851890Sopenharmony_ci}; 63222851890Sopenharmony_cistruct drm_i915_gem_get_tiling { 63322851890Sopenharmony_ci 63422851890Sopenharmony_ci __u32 handle; 63522851890Sopenharmony_ci 63622851890Sopenharmony_ci __u32 tiling_mode; 63722851890Sopenharmony_ci 63822851890Sopenharmony_ci __u32 swizzle_mode; 63922851890Sopenharmony_ci 64022851890Sopenharmony_ci __u32 phys_swizzle_mode; 64122851890Sopenharmony_ci}; 64222851890Sopenharmony_cistruct drm_i915_gem_get_aperture { 64322851890Sopenharmony_ci 64422851890Sopenharmony_ci __u64 aper_size; 64522851890Sopenharmony_ci 64622851890Sopenharmony_ci __u64 aper_available_size; 64722851890Sopenharmony_ci}; 64822851890Sopenharmony_cistruct drm_i915_get_pipe_from_crtc_id { 64922851890Sopenharmony_ci 65022851890Sopenharmony_ci __u32 crtc_id; 65122851890Sopenharmony_ci 65222851890Sopenharmony_ci __u32 pipe; 65322851890Sopenharmony_ci}; 65422851890Sopenharmony_ci#define I915_MADV_WILLNEED 0 65522851890Sopenharmony_ci#define I915_MADV_DONTNEED 1 65622851890Sopenharmony_ci#define __I915_MADV_PURGED 2 65722851890Sopenharmony_cistruct drm_i915_gem_madvise { 65822851890Sopenharmony_ci 65922851890Sopenharmony_ci __u32 handle; 66022851890Sopenharmony_ci 66122851890Sopenharmony_ci __u32 madv; 66222851890Sopenharmony_ci 66322851890Sopenharmony_ci __u32 retained; 66422851890Sopenharmony_ci}; 66522851890Sopenharmony_ci#define I915_OVERLAY_TYPE_MASK 0xff 66622851890Sopenharmony_ci#define I915_OVERLAY_YUV_PLANAR 0x01 66722851890Sopenharmony_ci#define I915_OVERLAY_YUV_PACKED 0x02 66822851890Sopenharmony_ci#define I915_OVERLAY_RGB 0x03 66922851890Sopenharmony_ci#define I915_OVERLAY_DEPTH_MASK 0xff00 67022851890Sopenharmony_ci#define I915_OVERLAY_RGB24 0x1000 67122851890Sopenharmony_ci#define I915_OVERLAY_RGB16 0x2000 67222851890Sopenharmony_ci#define I915_OVERLAY_RGB15 0x3000 67322851890Sopenharmony_ci#define I915_OVERLAY_YUV422 0x0100 67422851890Sopenharmony_ci#define I915_OVERLAY_YUV411 0x0200 67522851890Sopenharmony_ci#define I915_OVERLAY_YUV420 0x0300 67622851890Sopenharmony_ci#define I915_OVERLAY_YUV410 0x0400 67722851890Sopenharmony_ci#define I915_OVERLAY_SWAP_MASK 0xff0000 67822851890Sopenharmony_ci#define I915_OVERLAY_NO_SWAP 0x000000 67922851890Sopenharmony_ci#define I915_OVERLAY_UV_SWAP 0x010000 68022851890Sopenharmony_ci#define I915_OVERLAY_Y_SWAP 0x020000 68122851890Sopenharmony_ci#define I915_OVERLAY_Y_AND_UV_SWAP 0x030000 68222851890Sopenharmony_ci#define I915_OVERLAY_FLAGS_MASK 0xff000000 68322851890Sopenharmony_ci#define I915_OVERLAY_ENABLE 0x01000000 68422851890Sopenharmony_cistruct drm_intel_overlay_put_image { 68522851890Sopenharmony_ci 68622851890Sopenharmony_ci __u32 flags; 68722851890Sopenharmony_ci 68822851890Sopenharmony_ci __u32 bo_handle; 68922851890Sopenharmony_ci 69022851890Sopenharmony_ci __u16 stride_Y; 69122851890Sopenharmony_ci __u16 stride_UV; 69222851890Sopenharmony_ci __u32 offset_Y; 69322851890Sopenharmony_ci __u32 offset_U; 69422851890Sopenharmony_ci __u32 offset_V; 69522851890Sopenharmony_ci 69622851890Sopenharmony_ci __u16 src_width; 69722851890Sopenharmony_ci __u16 src_height; 69822851890Sopenharmony_ci 69922851890Sopenharmony_ci __u16 src_scan_width; 70022851890Sopenharmony_ci __u16 src_scan_height; 70122851890Sopenharmony_ci 70222851890Sopenharmony_ci __u32 crtc_id; 70322851890Sopenharmony_ci __u16 dst_x; 70422851890Sopenharmony_ci __u16 dst_y; 70522851890Sopenharmony_ci __u16 dst_width; 70622851890Sopenharmony_ci __u16 dst_height; 70722851890Sopenharmony_ci}; 70822851890Sopenharmony_ci#define I915_OVERLAY_UPDATE_ATTRS (1<<0) 70922851890Sopenharmony_ci#define I915_OVERLAY_UPDATE_GAMMA (1<<1) 71022851890Sopenharmony_ci#define I915_OVERLAY_DISABLE_DEST_COLORKEY (1<<2) 71122851890Sopenharmony_cistruct drm_intel_overlay_attrs { 71222851890Sopenharmony_ci __u32 flags; 71322851890Sopenharmony_ci __u32 color_key; 71422851890Sopenharmony_ci __s32 brightness; 71522851890Sopenharmony_ci __u32 contrast; 71622851890Sopenharmony_ci __u32 saturation; 71722851890Sopenharmony_ci __u32 gamma0; 71822851890Sopenharmony_ci __u32 gamma1; 71922851890Sopenharmony_ci __u32 gamma2; 72022851890Sopenharmony_ci __u32 gamma3; 72122851890Sopenharmony_ci __u32 gamma4; 72222851890Sopenharmony_ci __u32 gamma5; 72322851890Sopenharmony_ci}; 72422851890Sopenharmony_ci#define I915_SET_COLORKEY_NONE (1<<0) 72522851890Sopenharmony_ci#define I915_SET_COLORKEY_DESTINATION (1<<1) 72622851890Sopenharmony_ci#define I915_SET_COLORKEY_SOURCE (1<<2) 72722851890Sopenharmony_cistruct drm_intel_sprite_colorkey { 72822851890Sopenharmony_ci __u32 plane_id; 72922851890Sopenharmony_ci __u32 min_value; 73022851890Sopenharmony_ci __u32 channel_mask; 73122851890Sopenharmony_ci __u32 max_value; 73222851890Sopenharmony_ci __u32 flags; 73322851890Sopenharmony_ci}; 73422851890Sopenharmony_cistruct drm_i915_gem_wait { 73522851890Sopenharmony_ci 73622851890Sopenharmony_ci __u32 bo_handle; 73722851890Sopenharmony_ci __u32 flags; 73822851890Sopenharmony_ci 73922851890Sopenharmony_ci __s64 timeout_ns; 74022851890Sopenharmony_ci}; 74122851890Sopenharmony_cistruct drm_i915_gem_context_create { 74222851890Sopenharmony_ci 74322851890Sopenharmony_ci __u32 ctx_id; 74422851890Sopenharmony_ci __u32 pad; 74522851890Sopenharmony_ci}; 74622851890Sopenharmony_cistruct drm_i915_gem_context_destroy { 74722851890Sopenharmony_ci __u32 ctx_id; 74822851890Sopenharmony_ci __u32 pad; 74922851890Sopenharmony_ci}; 75022851890Sopenharmony_cistruct drm_i915_reg_read { 75122851890Sopenharmony_ci 75222851890Sopenharmony_ci __u64 offset; 75322851890Sopenharmony_ci#define I915_REG_READ_8B_WA (1ul << 0) 75422851890Sopenharmony_ci __u64 val; 75522851890Sopenharmony_ci}; 75622851890Sopenharmony_cistruct drm_i915_reset_stats { 75722851890Sopenharmony_ci __u32 ctx_id; 75822851890Sopenharmony_ci __u32 flags; 75922851890Sopenharmony_ci 76022851890Sopenharmony_ci __u32 reset_count; 76122851890Sopenharmony_ci 76222851890Sopenharmony_ci __u32 batch_active; 76322851890Sopenharmony_ci 76422851890Sopenharmony_ci __u32 batch_pending; 76522851890Sopenharmony_ci __u32 pad; 76622851890Sopenharmony_ci}; 76722851890Sopenharmony_cistruct drm_i915_gem_userptr { 76822851890Sopenharmony_ci __u64 user_ptr; 76922851890Sopenharmony_ci __u64 user_size; 77022851890Sopenharmony_ci __u32 flags; 77122851890Sopenharmony_ci#define I915_USERPTR_READ_ONLY 0x1 77222851890Sopenharmony_ci#define I915_USERPTR_UNSYNCHRONIZED 0x80000000 77322851890Sopenharmony_ci 77422851890Sopenharmony_ci __u32 handle; 77522851890Sopenharmony_ci}; 77622851890Sopenharmony_cistruct drm_i915_gem_context_param { 77722851890Sopenharmony_ci __u32 ctx_id; 77822851890Sopenharmony_ci __u32 size; 77922851890Sopenharmony_ci __u64 param; 78022851890Sopenharmony_ci#define I915_CONTEXT_PARAM_BAN_PERIOD 0x1 78122851890Sopenharmony_ci#define I915_CONTEXT_PARAM_NO_ZEROMAP 0x2 78222851890Sopenharmony_ci#define I915_CONTEXT_PARAM_GTT_SIZE 0x3 78322851890Sopenharmony_ci#define I915_CONTEXT_PARAM_NO_ERROR_CAPTURE 0x4 78422851890Sopenharmony_ci#define I915_CONTEXT_PARAM_BANNABLE 0x5 78522851890Sopenharmony_ci#define I915_CONTEXT_PARAM_PRIORITY 0x6 78622851890Sopenharmony_ci#define I915_CONTEXT_MAX_USER_PRIORITY 1023 78722851890Sopenharmony_ci#define I915_CONTEXT_DEFAULT_PRIORITY 0 78822851890Sopenharmony_ci#define I915_CONTEXT_MIN_USER_PRIORITY -1023 78922851890Sopenharmony_ci __u64 value; 79022851890Sopenharmony_ci}; 79122851890Sopenharmony_cienum drm_i915_oa_format { 79222851890Sopenharmony_ci I915_OA_FORMAT_A13 = 1, 79322851890Sopenharmony_ci I915_OA_FORMAT_A29, 79422851890Sopenharmony_ci I915_OA_FORMAT_A13_B8_C8, 79522851890Sopenharmony_ci I915_OA_FORMAT_B4_C8, 79622851890Sopenharmony_ci I915_OA_FORMAT_A45_B8_C8, 79722851890Sopenharmony_ci I915_OA_FORMAT_B4_C8_A16, 79822851890Sopenharmony_ci I915_OA_FORMAT_C4_B8, 79922851890Sopenharmony_ci 80022851890Sopenharmony_ci I915_OA_FORMAT_A12, 80122851890Sopenharmony_ci I915_OA_FORMAT_A12_B8_C8, 80222851890Sopenharmony_ci I915_OA_FORMAT_A32u40_A4u32_B8_C8, 80322851890Sopenharmony_ci I915_OA_FORMAT_MAX 80422851890Sopenharmony_ci}; 80522851890Sopenharmony_cienum drm_i915_perf_property_id { 80622851890Sopenharmony_ci 80722851890Sopenharmony_ci DRM_I915_PERF_PROP_CTX_HANDLE = 1, 80822851890Sopenharmony_ci 80922851890Sopenharmony_ci DRM_I915_PERF_PROP_SAMPLE_OA, 81022851890Sopenharmony_ci 81122851890Sopenharmony_ci DRM_I915_PERF_PROP_OA_METRICS_SET, 81222851890Sopenharmony_ci 81322851890Sopenharmony_ci DRM_I915_PERF_PROP_OA_FORMAT, 81422851890Sopenharmony_ci 81522851890Sopenharmony_ci DRM_I915_PERF_PROP_OA_EXPONENT, 81622851890Sopenharmony_ci DRM_I915_PERF_PROP_MAX 81722851890Sopenharmony_ci}; 81822851890Sopenharmony_cistruct drm_i915_perf_open_param { 81922851890Sopenharmony_ci __u32 flags; 82022851890Sopenharmony_ci#define I915_PERF_FLAG_FD_CLOEXEC (1<<0) 82122851890Sopenharmony_ci#define I915_PERF_FLAG_FD_NONBLOCK (1<<1) 82222851890Sopenharmony_ci#define I915_PERF_FLAG_DISABLED (1<<2) 82322851890Sopenharmony_ci 82422851890Sopenharmony_ci __u32 num_properties; 82522851890Sopenharmony_ci 82622851890Sopenharmony_ci __u64 properties_ptr; 82722851890Sopenharmony_ci}; 82822851890Sopenharmony_ci#define I915_PERF_IOCTL_ENABLE _IO('i', 0x0) 82922851890Sopenharmony_ci#define I915_PERF_IOCTL_DISABLE _IO('i', 0x1) 83022851890Sopenharmony_cistruct drm_i915_perf_record_header { 83122851890Sopenharmony_ci __u32 type; 83222851890Sopenharmony_ci __u16 pad; 83322851890Sopenharmony_ci __u16 size; 83422851890Sopenharmony_ci}; 83522851890Sopenharmony_cienum drm_i915_perf_record_type { 83622851890Sopenharmony_ci 83722851890Sopenharmony_ci DRM_I915_PERF_RECORD_SAMPLE = 1, 83822851890Sopenharmony_ci 83922851890Sopenharmony_ci DRM_I915_PERF_RECORD_OA_REPORT_LOST = 2, 84022851890Sopenharmony_ci 84122851890Sopenharmony_ci DRM_I915_PERF_RECORD_OA_BUFFER_LOST = 3, 84222851890Sopenharmony_ci DRM_I915_PERF_RECORD_MAX 84322851890Sopenharmony_ci}; 84422851890Sopenharmony_cistruct drm_i915_perf_oa_config { 84522851890Sopenharmony_ci 84622851890Sopenharmony_ci char uuid[36]; 84722851890Sopenharmony_ci __u32 n_mux_regs; 84822851890Sopenharmony_ci __u32 n_boolean_regs; 84922851890Sopenharmony_ci __u32 n_flex_regs; 85022851890Sopenharmony_ci 85122851890Sopenharmony_ci __u64 mux_regs_ptr; 85222851890Sopenharmony_ci __u64 boolean_regs_ptr; 85322851890Sopenharmony_ci __u64 flex_regs_ptr; 85422851890Sopenharmony_ci}; 85522851890Sopenharmony_cistruct drm_i915_query_item { 85622851890Sopenharmony_ci __u64 query_id; 85722851890Sopenharmony_ci#define DRM_I915_QUERY_TOPOLOGY_INFO 1 85822851890Sopenharmony_ci 85922851890Sopenharmony_ci __s32 length; 86022851890Sopenharmony_ci 86122851890Sopenharmony_ci __u32 flags; 86222851890Sopenharmony_ci 86322851890Sopenharmony_ci __u64 data_ptr; 86422851890Sopenharmony_ci}; 86522851890Sopenharmony_cistruct drm_i915_query { 86622851890Sopenharmony_ci __u32 num_items; 86722851890Sopenharmony_ci 86822851890Sopenharmony_ci __u32 flags; 86922851890Sopenharmony_ci 87022851890Sopenharmony_ci __u64 items_ptr; 87122851890Sopenharmony_ci}; 87222851890Sopenharmony_cistruct drm_i915_query_topology_info { 87322851890Sopenharmony_ci 87422851890Sopenharmony_ci __u16 flags; 87522851890Sopenharmony_ci __u16 max_slices; 87622851890Sopenharmony_ci __u16 max_subslices; 87722851890Sopenharmony_ci __u16 max_eus_per_subslice; 87822851890Sopenharmony_ci 87922851890Sopenharmony_ci __u16 subslice_offset; 88022851890Sopenharmony_ci 88122851890Sopenharmony_ci __u16 subslice_stride; 88222851890Sopenharmony_ci 88322851890Sopenharmony_ci __u16 eu_offset; 88422851890Sopenharmony_ci 88522851890Sopenharmony_ci __u16 eu_stride; 88622851890Sopenharmony_ci __u8 data[]; 88722851890Sopenharmony_ci}; 88822851890Sopenharmony_ci#if defined(__cplusplus) 88922851890Sopenharmony_ci} 89022851890Sopenharmony_ci#endif 89122851890Sopenharmony_ci#endif 892