1450N/A/*
1450N/A * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
1450N/A */
1450N/A
1450N/A/*
1450N/A * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
1450N/A * Copyright (c) 2009, 2013, Intel Corporation.
1450N/A * All Rights Reserved.
1450N/A *
1450N/A * Permission is hereby granted, free of charge, to any person obtaining a
1450N/A * copy of this software and associated documentation files (the
1450N/A * "Software"), to deal in the Software without restriction, including
1450N/A * without limitation the rights to use, copy, modify, merge, publish,
1450N/A * distribute, sub license, and/or sell copies of the Software, and to
1450N/A * permit persons to whom the Software is furnished to do so, subject to
1450N/A * the following conditions:
1450N/A *
1450N/A * The above copyright notice and this permission notice (including the
1450N/A * next paragraph) shall be included in all copies or substantial portions
1450N/A * of the Software.
1450N/A *
1450N/A * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1450N/A * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1450N/A * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
1450N/A * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
1450N/A * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
1450N/A * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
1450N/A * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1450N/A *
1450N/A */
1450N/A
1450N/A#ifndef _I915_DRM_H_
1450N/A#define _I915_DRM_H_
1450N/A
1450N/A#include "drm.h"
1450N/A
1450N/A/* Please note that modifications to all structs defined here are
1450N/A * subject to backwards-compatibility constraints.
1450N/A */
1450N/A
1450N/A/* Each region is a minimum of 16k, and there are at most 255 of them.
1450N/A */
1450N/A#define I915_NR_TEX_REGIONS 255 /* table size 2k - maximum due to use
1450N/A * of chars for next/prev indices */
1450N/A#define I915_LOG_MIN_TEX_REGION_SIZE 14
1450N/A
1450N/Atypedef struct _drm_i915_init {
1450N/A enum {
1450N/A I915_INIT_DMA = 0x01,
1450N/A I915_CLEANUP_DMA = 0x02,
1450N/A I915_RESUME_DMA = 0x03
1450N/A } func;
1450N/A unsigned int mmio_offset;
1450N/A int sarea_priv_offset;
1450N/A unsigned int ring_start;
1450N/A unsigned int ring_end;
1450N/A unsigned int ring_size;
1450N/A unsigned int front_offset;
1450N/A unsigned int back_offset;
1450N/A unsigned int depth_offset;
1450N/A unsigned int w;
1450N/A unsigned int h;
1450N/A unsigned int pitch;
1450N/A unsigned int pitch_bits;
1450N/A unsigned int back_pitch;
1450N/A unsigned int depth_pitch;
1450N/A unsigned int cpp;
1450N/A unsigned int chipset;
1450N/A} drm_i915_init_t;
1450N/A
1450N/Atypedef struct _drm_i915_sarea {
1450N/A struct drm_tex_region texList[I915_NR_TEX_REGIONS + 1];
1450N/A int last_upload; /* last time texture was uploaded */
1450N/A int last_enqueue; /* last time a buffer was enqueued */
1450N/A int last_dispatch; /* age of the most recently dispatched buffer */
1450N/A int ctxOwner; /* last context to upload state */
1450N/A int texAge;
1450N/A int pf_enabled; /* is pageflipping allowed? */
1450N/A int pf_active;
1450N/A int pf_current_page; /* which buffer is being displayed? */
1450N/A int perf_boxes; /* performance boxes to be displayed */
1450N/A int width, height; /* screen size in pixels */
1450N/A int pad0;
1450N/A
1450N/A drm_handle_t front_handle;
1450N/A int front_offset;
1450N/A int front_size;
1450N/A
1450N/A drm_handle_t back_handle;
1450N/A int back_offset;
1450N/A int back_size;
1450N/A
1450N/A drm_handle_t depth_handle;
1450N/A int depth_offset;
1450N/A int depth_size;
1450N/A
1450N/A drm_handle_t tex_handle;
1450N/A int tex_offset;
1450N/A int tex_size;
1450N/A int log_tex_granularity;
1450N/A int pitch;
1450N/A int rotation; /* 0, 90, 180 or 270 */
1450N/A int rotated_offset;
1450N/A int rotated_size;
1450N/A int rotated_pitch;
1450N/A int virtualX, virtualY;
1450N/A
1450N/A unsigned int front_tiled;
1450N/A unsigned int back_tiled;
1450N/A unsigned int depth_tiled;
1450N/A unsigned int rotated_tiled;
1450N/A unsigned int rotated2_tiled;
1450N/A
1450N/A int pipeA_x;
1450N/A int pipeA_y;
1450N/A int pipeA_w;
1450N/A int pipeA_h;
1450N/A int pipeB_x;
1450N/A int pipeB_y;
1450N/A int pipeB_w;
1450N/A int pipeB_h;
1450N/A int pad1;
1450N/A
1450N/A /* fill out some space for old userspace triple buffer */
1450N/A drm_handle_t unused_handle;
1450N/A __u32 unused1, unused2, unused3;
1450N/A
1450N/A /* buffer object handles for static buffers. May change
1450N/A * over the lifetime of the client.
1450N/A */
1450N/A __u32 front_bo_handle;
1450N/A __u32 back_bo_handle;
1450N/A __u32 unused_bo_handle;
1450N/A __u32 depth_bo_handle;
1450N/A
1450N/A} drm_i915_sarea_t;
1450N/A
1450N/A/* due to userspace building against these headers we need some compat here */
1450N/A#define planeA_x pipeA_x
1450N/A#define planeA_y pipeA_y
1450N/A#define planeA_w pipeA_w
1450N/A#define planeA_h pipeA_h
1450N/A#define planeB_x pipeB_x
1450N/A#define planeB_y pipeB_y
1450N/A#define planeB_w pipeB_w
1450N/A#define planeB_h pipeB_h
1450N/A
1450N/A/* Flags for perf_boxes
1450N/A */
1450N/A#define I915_BOX_RING_EMPTY 0x1
1450N/A#define I915_BOX_FLIP 0x2
1450N/A#define I915_BOX_WAIT 0x4
1450N/A#define I915_BOX_TEXTURE_LOAD 0x8
1450N/A#define I915_BOX_LOST_CONTEXT 0x10
1450N/A
1450N/A/* I915 specific ioctls
1450N/A * The device specific ioctl range is 0x40 to 0x79.
1450N/A */
1450N/A#define DRM_I915_INIT 0x00
1450N/A#define DRM_I915_FLUSH 0x01
1450N/A#define DRM_I915_FLIP 0x02
1450N/A#define DRM_I915_BATCHBUFFER 0x03
1450N/A#define DRM_I915_IRQ_EMIT 0x04
1450N/A#define DRM_I915_IRQ_WAIT 0x05
1450N/A#define DRM_I915_GETPARAM 0x06
1450N/A#define DRM_I915_SETPARAM 0x07
1450N/A#define DRM_I915_ALLOC 0x08
1450N/A#define DRM_I915_FREE 0x09
1450N/A#define DRM_I915_INIT_HEAP 0x0a
1450N/A#define DRM_I915_CMDBUFFER 0x0b
1450N/A#define DRM_I915_DESTROY_HEAP 0x0c
1450N/A#define DRM_I915_SET_VBLANK_PIPE 0x0d
1450N/A#define DRM_I915_GET_VBLANK_PIPE 0x0e
1450N/A#define DRM_I915_VBLANK_SWAP 0x0f
1450N/A#define DRM_I915_HWS_ADDR 0x11
1450N/A#define DRM_I915_GEM_INIT 0x13
1450N/A#define DRM_I915_GEM_EXECBUFFER 0x14
1450N/A#define DRM_I915_GEM_PIN 0x15
1450N/A#define DRM_I915_GEM_UNPIN 0x16
1450N/A#define DRM_I915_GEM_BUSY 0x17
1450N/A#define DRM_I915_GEM_THROTTLE 0x18
1450N/A#define DRM_I915_GEM_ENTERVT 0x19
1450N/A#define DRM_I915_GEM_LEAVEVT 0x1a
1450N/A#define DRM_I915_GEM_CREATE 0x1b
1450N/A#define DRM_I915_GEM_PREAD 0x1c
1450N/A#define DRM_I915_GEM_PWRITE 0x1d
1450N/A#define DRM_I915_GEM_MMAP 0x1e
1450N/A#define DRM_I915_GEM_SET_DOMAIN 0x1f
1450N/A#define DRM_I915_GEM_SW_FINISH 0x20
1450N/A#define DRM_I915_GEM_SET_TILING 0x21
1450N/A#define DRM_I915_GEM_GET_TILING 0x22
1450N/A#define DRM_I915_GEM_GET_APERTURE 0x23
1450N/A#define DRM_I915_GEM_MMAP_GTT 0x24
1450N/A#define DRM_I915_GET_PIPE_FROM_CRTC_ID 0x25
1450N/A#define DRM_I915_GEM_MADVISE 0x26
1450N/A#define DRM_I915_OVERLAY_PUT_IMAGE 0x27
1450N/A#define DRM_I915_OVERLAY_ATTRS 0x28
1450N/A#define DRM_I915_GEM_EXECBUFFER2 0x29
1450N/A#define DRM_I915_GET_SPRITE_COLORKEY 0x2a
1450N/A#define DRM_I915_SET_SPRITE_COLORKEY 0x2b
1450N/A#define DRM_I915_GEM_WAIT 0x2c
1450N/A#define DRM_I915_GEM_CONTEXT_CREATE 0x2d
1450N/A#define DRM_I915_GEM_CONTEXT_DESTROY 0x2e
1450N/A#define DRM_I915_GEM_SET_CACHING 0x2f
1450N/A#define DRM_I915_GEM_GET_CACHING 0x30
1450N/A#define DRM_I915_REG_READ 0x31
1450N/A
1450N/A#define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t)
1450N/A#define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH)
1450N/A#define DRM_IOCTL_I915_FLIP DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLIP)
1450N/A#define DRM_IOCTL_I915_BATCHBUFFER DRM_IOW( DRM_COMMAND_BASE + DRM_I915_BATCHBUFFER, drm_i915_batchbuffer_t)
1450N/A#define DRM_IOCTL_I915_IRQ_EMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_IRQ_EMIT, drm_i915_irq_emit_t)
1450N/A#define DRM_IOCTL_I915_IRQ_WAIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_IRQ_WAIT, drm_i915_irq_wait_t)
1450N/A#define DRM_IOCTL_I915_GETPARAM DRM_IOW( DRM_COMMAND_BASE + DRM_I915_GETPARAM, drm_i915_getparam_t)
1450N/A#define DRM_IOCTL_I915_SETPARAM DRM_IOW( DRM_COMMAND_BASE + DRM_I915_SETPARAM, drm_i915_setparam_t)
1450N/A#define DRM_IOCTL_I915_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_ALLOC, drm_i915_mem_alloc_t)
1450N/A#define DRM_IOCTL_I915_FREE DRM_IOW( DRM_COMMAND_BASE + DRM_I915_FREE, drm_i915_mem_free_t)
1450N/A#define DRM_IOCTL_I915_INIT_HEAP DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT_HEAP, drm_i915_mem_init_heap_t)
1450N/A#define DRM_IOCTL_I915_CMDBUFFER DRM_IOW( DRM_COMMAND_BASE + DRM_I915_CMDBUFFER, drm_i915_cmdbuffer_t)
1450N/A#define DRM_IOCTL_I915_DESTROY_HEAP DRM_IOW( DRM_COMMAND_BASE + DRM_I915_DESTROY_HEAP, drm_i915_mem_destroy_heap_t)
1450N/A#define DRM_IOCTL_I915_SET_VBLANK_PIPE DRM_IOW( DRM_COMMAND_BASE + DRM_I915_SET_VBLANK_PIPE, drm_i915_vblank_pipe_t)
1450N/A#define DRM_IOCTL_I915_GET_VBLANK_PIPE DRM_IOR( DRM_COMMAND_BASE + DRM_I915_GET_VBLANK_PIPE, drm_i915_vblank_pipe_t)
1450N/A#define DRM_IOCTL_I915_VBLANK_SWAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_VBLANK_SWAP, drm_i915_vblank_swap_t)
1450N/A#define DRM_IOCTL_I915_HWS_ADDR DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_HWS_ADDR, drm_i915_hws_addr_t)
1450N/A#define DRM_IOCTL_I915_GEM_INIT DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_INIT, struct drm_i915_gem_init)
1450N/A#define DRM_IOCTL_I915_GEM_EXECBUFFER DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER, struct drm_i915_gem_execbuffer)
1450N/A#define DRM_IOCTL_I915_GEM_EXECBUFFER2 DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER2, struct drm_i915_gem_execbuffer2)
1450N/A#define DRM_IOCTL_I915_GEM_PIN DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_PIN, struct drm_i915_gem_pin)
1450N/A#define DRM_IOCTL_I915_GEM_UNPIN DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_UNPIN, struct drm_i915_gem_unpin)
1450N/A#define DRM_IOCTL_I915_GEM_BUSY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_BUSY, struct drm_i915_gem_busy)
1450N/A#define DRM_IOCTL_I915_GEM_SET_CACHING DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_SET_CACHING, struct drm_i915_gem_caching)
1450N/A#define DRM_IOCTL_I915_GEM_GET_CACHING DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_GET_CACHING, struct drm_i915_gem_caching)
1450N/A#define DRM_IOCTL_I915_GEM_THROTTLE DRM_IO ( DRM_COMMAND_BASE + DRM_I915_GEM_THROTTLE)
1450N/A#define DRM_IOCTL_I915_GEM_ENTERVT DRM_IO(DRM_COMMAND_BASE + DRM_I915_GEM_ENTERVT)
1450N/A#define DRM_IOCTL_I915_GEM_LEAVEVT DRM_IO(DRM_COMMAND_BASE + DRM_I915_GEM_LEAVEVT)
1450N/A#define DRM_IOCTL_I915_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_CREATE, struct drm_i915_gem_create)
1450N/A#define DRM_IOCTL_I915_GEM_PREAD DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_PREAD, struct drm_i915_gem_pread)
1450N/A#define DRM_IOCTL_I915_GEM_PWRITE DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_PWRITE, struct drm_i915_gem_pwrite)
1450N/A#define DRM_IOCTL_I915_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MMAP, struct drm_i915_gem_mmap)
1450N/A#define DRM_IOCTL_I915_GEM_MMAP_GTT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MMAP_GTT, struct drm_i915_gem_mmap_gtt)
1450N/A#define DRM_IOCTL_I915_GEM_SET_DOMAIN DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_SET_DOMAIN, struct drm_i915_gem_set_domain)
1450N/A#define DRM_IOCTL_I915_GEM_SW_FINISH DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_SW_FINISH, struct drm_i915_gem_sw_finish)
1450N/A#define DRM_IOCTL_I915_GEM_SET_TILING DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_SET_TILING, struct drm_i915_gem_set_tiling)
1450N/A#define DRM_IOCTL_I915_GEM_GET_TILING DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_TILING, struct drm_i915_gem_get_tiling)
1450N/A#define DRM_IOCTL_I915_GEM_GET_APERTURE DRM_IOR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_APERTURE, struct drm_i915_gem_get_aperture)
1450N/A#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)
1450N/A#define DRM_IOCTL_I915_GEM_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MADVISE, struct drm_i915_gem_madvise)
1450N/A#define DRM_IOCTL_I915_OVERLAY_PUT_IMAGE DRM_IOW(DRM_COMMAND_BASE + DRM_I915_OVERLAY_PUT_IMAGE, struct drm_intel_overlay_put_image)
1450N/A#define DRM_IOCTL_I915_OVERLAY_ATTRS DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_OVERLAY_ATTRS, struct drm_intel_overlay_attrs)
1450N/A#define DRM_IOCTL_I915_SET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_SET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey)
1450N/A#define DRM_IOCTL_I915_GET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_SET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey)
1450N/A#define DRM_IOCTL_I915_GEM_WAIT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_WAIT, struct drm_i915_gem_wait)
1450N/A#define DRM_IOCTL_I915_GEM_CONTEXT_CREATE DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_CREATE, struct drm_i915_gem_context_create)
1450N/A#define DRM_IOCTL_I915_GEM_CONTEXT_DESTROY DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_DESTROY, struct drm_i915_gem_context_destroy)
1450N/A#define DRM_IOCTL_I915_REG_READ DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_REG_READ, struct drm_i915_reg_read)
1450N/A
1450N/A#ifdef _MULTI_DATAMODEL
1450N/A#define I915_IOCTL_DEF(ioctl, _func, _flags, _copyin32, _copyout32) \
1450N/A [DRM_IOCTL_NR(ioctl) - DRM_COMMAND_BASE] = {.cmd = ioctl, .flags = _flags, .func = _func, .copyin32 = _copyin32, .copyout32 = _copyout32}
1450N/A#else
1450N/A#define I915_IOCTL_DEF(ioctl, _func, _flags, _copyin32, _copyout32) \
1450N/A [DRM_IOCTL_NR(ioctl) - DRM_COMMAND_BASE] = {.cmd = ioctl, .flags = _flags, .func = _func, .copyin32 = NULL, .copyout32 = NULL}
1450N/A#endif
1450N/A
1450N/A/* Allow drivers to submit batchbuffers directly to hardware, relying
1450N/A * on the security mechanisms provided by hardware.
1450N/A */
1450N/Atypedef struct drm_i915_batchbuffer {
1450N/A int start; /* agp offset */
1450N/A int used; /* nr bytes in use */
1450N/A int DR1; /* hw flags for GFX_OP_DRAWRECT_INFO */
1450N/A int DR4; /* window origin for GFX_OP_DRAWRECT_INFO */
1450N/A int num_cliprects; /* mulitpass with multiple cliprects? */
1450N/A struct drm_clip_rect __user *cliprects; /* pointer to userspace cliprects */
1450N/A} drm_i915_batchbuffer_t;
1450N/A
1450N/Atypedef struct drm_i915_batchbuffer32 {
1450N/A int start; /* agp offset */
1450N/A int used; /* nr bytes in use */
1450N/A int DR1; /* hw flags for GFX_OP_DRAWRECT_INFO */
1450N/A int DR4; /* window origin for GFX_OP_DRAWRECT_INFO */
1450N/A int num_cliprects; /* mulitpass with multiple cliprects? */
1450N/A caddr32_t cliprects; /* pointer to userspace cliprects */
1450N/A} drm_i915_batchbuffer32_t;
1450N/A
1450N/A/* As above, but pass a pointer to userspace buffer which can be
1450N/A * validated by the kernel prior to sending to hardware.
1450N/A */
1450N/Atypedef struct _drm_i915_cmdbuffer {
1450N/A char __user *buf; /* pointer to userspace command buffer */
1450N/A int sz; /* nr bytes in buf */
1450N/A int DR1; /* hw flags for GFX_OP_DRAWRECT_INFO */
1450N/A int DR4; /* window origin for GFX_OP_DRAWRECT_INFO */
1450N/A int num_cliprects; /* mulitpass with multiple cliprects? */
1450N/A struct drm_clip_rect __user *cliprects; /* pointer to userspace cliprects */
1450N/A} drm_i915_cmdbuffer_t;
1450N/A
1450N/Atypedef struct drm_i915_cmdbuffer32 {
1450N/A caddr32_t buf; /* pointer to userspace command buffer */
1450N/A int sz; /* nr bytes in buf */
1450N/A int DR1; /* hw flags for GFX_OP_DRAWRECT_INFO */
1450N/A int DR4; /* window origin for GFX_OP_DRAWRECT_INFO */
1450N/A int num_cliprects; /* mulitpass with multiple cliprects? */
1450N/A caddr32_t cliprects; /* pointer to userspace cliprects */
1450N/A} drm_i915_cmdbuffer32_t;
1450N/A
1450N/A/* Userspace can request & wait on irq's:
1450N/A */
1450N/Atypedef struct drm_i915_irq_emit {
1450N/A int __user *irq_seq;
1450N/A} drm_i915_irq_emit_t;
1450N/A
1450N/Atypedef struct drm_i915_irq_emit32 {
1450N/A caddr32_t irq_seq;
1450N/A} drm_i915_irq_emit32_t;
1450N/A
1450N/Atypedef struct drm_i915_irq_wait {
1450N/A int irq_seq;
1450N/A} drm_i915_irq_wait_t;
1450N/A
1450N/A/* Ioctl to query kernel params:
1450N/A */
1450N/A#define I915_PARAM_IRQ_ACTIVE 1
1450N/A#define I915_PARAM_ALLOW_BATCHBUFFER 2
1450N/A#define I915_PARAM_LAST_DISPATCH 3
1450N/A#define I915_PARAM_CHIPSET_ID 4
1450N/A#define I915_PARAM_HAS_GEM 5
1450N/A#define I915_PARAM_NUM_FENCES_AVAIL 6
1450N/A#define I915_PARAM_HAS_OVERLAY 7
1450N/A#define I915_PARAM_HAS_PAGEFLIPPING 8
1450N/A#define I915_PARAM_HAS_EXECBUF2 9
1450N/A#define I915_PARAM_HAS_BSD 10
1450N/A#define I915_PARAM_HAS_BLT 11
1450N/A#define I915_PARAM_HAS_RELAXED_FENCING 12
1450N/A#define I915_PARAM_HAS_COHERENT_RINGS 13
1450N/A#define I915_PARAM_HAS_EXEC_CONSTANTS 14
1450N/A#define I915_PARAM_HAS_RELAXED_DELTA 15
1450N/A#define I915_PARAM_HAS_GEN7_SOL_RESET 16
1450N/A#define I915_PARAM_HAS_LLC 17
1450N/A#define I915_PARAM_HAS_ALIASING_PPGTT 18
1450N/A#define I915_PARAM_HAS_WAIT_TIMEOUT 19
1450N/A#define I915_PARAM_HAS_SEMAPHORES 20
1450N/A#define I915_PARAM_HAS_PRIME_VMAP_FLUSH 21
1450N/A#define I915_PARAM_HAS_VEBOX 22
1450N/A#define I915_PARAM_HAS_SECURE_BATCHES 23
1450N/A#define I915_PARAM_HAS_PINNED_BATCHES 24
1450N/A#define I915_PARAM_HAS_EXEC_NO_RELOC 25
1450N/A#define I915_PARAM_HAS_EXEC_HANDLE_LUT 26
1450N/A
1450N/Atypedef struct drm_i915_getparam {
1450N/A int param;
1450N/A int __user *value;
1450N/A} drm_i915_getparam_t;
1450N/A
1450N/Atypedef struct drm_i915_getparam32 {
1450N/A int param;
1450N/A caddr32_t value;
1450N/A} drm_i915_getparam32_t;
1450N/A
1450N/A/* Ioctl to set kernel params:
1450N/A */
1450N/A#define I915_SETPARAM_USE_MI_BATCHBUFFER_START 1
1450N/A#define I915_SETPARAM_TEX_LRU_LOG_GRANULARITY 2
1450N/A#define I915_SETPARAM_ALLOW_BATCHBUFFER 3
1450N/A#define I915_SETPARAM_NUM_USED_FENCES 4
1450N/A
1450N/Atypedef struct drm_i915_setparam {
1450N/A int param;
1450N/A int value;
1450N/A} drm_i915_setparam_t;
1450N/A
1450N/A/* A memory manager for regions of shared memory:
1450N/A */
1450N/A#define I915_MEM_REGION_AGP 1
1450N/A
1450N/Atypedef struct drm_i915_mem_alloc {
1450N/A int region;
1450N/A int alignment;
1450N/A int size;
1450N/A int __user *region_offset; /* offset from start of fb or agp */
1450N/A} drm_i915_mem_alloc_t;
1450N/A
1450N/Atypedef struct drm_i915_mem_alloc32 {
1450N/A int region;
1450N/A int alignment;
1450N/A int size;
1450N/A caddr32_t region_offset; /* offset from start of fb or agp */
1450N/A} drm_i915_mem_alloc32_t;
1450N/A
1450N/Atypedef struct drm_i915_mem_free {
1450N/A int region;
1450N/A int region_offset;
1450N/A} drm_i915_mem_free_t;
1450N/A
1450N/Atypedef struct drm_i915_mem_init_heap {
1450N/A int region;
1450N/A int size;
1450N/A int start;
1450N/A} drm_i915_mem_init_heap_t;
1450N/A
1450N/A/* Allow memory manager to be torn down and re-initialized (eg on
1450N/A * rotate):
1450N/A */
1450N/Atypedef struct drm_i915_mem_destroy_heap {
1450N/A int region;
1450N/A} drm_i915_mem_destroy_heap_t;
1450N/A
1450N/A/* Allow X server to configure which pipes to monitor for vblank signals
1450N/A */
1450N/A#define DRM_I915_VBLANK_PIPE_A 1
1450N/A#define DRM_I915_VBLANK_PIPE_B 2
1450N/A
1450N/Atypedef struct drm_i915_vblank_pipe {
1450N/A int pipe;
1450N/A} drm_i915_vblank_pipe_t;
1450N/A
1450N/A/* Schedule buffer swap at given vertical blank:
1450N/A */
1450N/Atypedef struct drm_i915_vblank_swap {
1450N/A drm_drawable_t drawable;
1450N/A enum drm_vblank_seq_type seqtype;
1450N/A unsigned int sequence;
1450N/A} drm_i915_vblank_swap_t;
1450N/A
1450N/Atypedef struct drm_i915_hws_addr {
1450N/A __u64 addr;
1450N/A} drm_i915_hws_addr_t;
1450N/A
1450N/Astruct drm_i915_gem_init {
1450N/A /**
1450N/A * Beginning offset in the GTT to be managed by the DRM memory
1450N/A * manager.
1450N/A */
1450N/A __u64 gtt_start;
1450N/A /**
1450N/A * Ending offset in the GTT to be managed by the DRM memory
1450N/A * manager.
1450N/A */
1450N/A __u64 gtt_end;
1450N/A};
1450N/A
1450N/Astruct drm_i915_gem_create {
1450N/A /**
1450N/A * Requested size for the object.
1450N/A *
1450N/A * The (page-aligned) allocated size for the object will be returned.
1450N/A */
1450N/A __u64 size;
1450N/A /**
1450N/A * Returned handle for the object.
1450N/A *
1450N/A * Object handles are nonzero.
1450N/A */
1450N/A __u32 handle;
1450N/A __u32 pad;
1450N/A};
1450N/A
1450N/Astruct drm_i915_gem_pread {
1450N/A /** Handle for the object being read. */
1450N/A __u32 handle;
1450N/A __u32 pad;
1450N/A /** Offset into the object to read from */
1450N/A __u64 offset;
1450N/A /** Length of data to read */
1450N/A __u64 size;
1450N/A /**
1450N/A * Pointer to write the data into.
1450N/A *
1450N/A * This is a fixed-size type for 32/64 compatibility.
1450N/A */
1450N/A __u64 data_ptr;
1450N/A};
1450N/A
1450N/Astruct drm_i915_gem_pwrite {
1450N/A /** Handle for the object being written to. */
1450N/A __u32 handle;
1450N/A __u32 pad;
1450N/A /** Offset into the object to write to */
1450N/A __u64 offset;
1450N/A /** Length of data to write */
1450N/A __u64 size;
1450N/A /**
1450N/A * Pointer to read the data from.
1450N/A *
1450N/A * This is a fixed-size type for 32/64 compatibility.
1450N/A */
1450N/A __u64 data_ptr;
1450N/A};
1450N/A
1450N/Astruct drm_i915_gem_mmap {
1450N/A /** Handle for the object being mapped. */
1450N/A __u32 handle;
1450N/A __u32 pad;
1450N/A /** Offset in the object to map. */
1450N/A __u64 offset;
1450N/A /**
1450N/A * Length of data to map.
1450N/A *
1450N/A * The value will be page-aligned.
1450N/A */
1450N/A __u64 size;
1450N/A /**
1450N/A * Returned pointer the data was mapped at.
1450N/A *
1450N/A * This is a fixed-size type for 32/64 compatibility.
1450N/A */
1450N/A __u64 addr_ptr;
1450N/A};
1450N/A
1450N/Astruct drm_i915_gem_mmap_gtt {
1450N/A /** Handle for the object being mapped. */
1450N/A __u32 handle;
1450N/A __u32 pad;
1450N/A /**
1450N/A * Fake offset to use for subsequent mmap call
1450N/A *
1450N/A * This is a fixed-size type for 32/64 compatibility.
1450N/A */
1450N/A __u64 offset;
1450N/A};
1450N/A
1450N/Astruct drm_i915_gem_set_domain {
1450N/A /** Handle for the object */
1450N/A __u32 handle;
1450N/A
1450N/A /** New read domains */
1450N/A __u32 read_domains;
1450N/A
1450N/A /** New write domain */
1450N/A __u32 write_domain;
1450N/A};
1450N/A
1450N/Astruct drm_i915_gem_sw_finish {
1450N/A /** Handle for the object */
1450N/A __u32 handle;
1450N/A};
1450N/A
1450N/Astruct drm_i915_gem_relocation_entry {
1450N/A /**
1450N/A * Handle of the buffer being pointed to by this relocation entry.
1450N/A *
1450N/A * It's appealing to make this be an index into the mm_validate_entry
1450N/A * list to refer to the buffer, but this allows the driver to create
1450N/A * a relocation list for state buffers and not re-write it per
1450N/A * exec using the buffer.
1450N/A */
1450N/A __u32 target_handle;
1450N/A
1450N/A /**
1450N/A * Value to be added to the offset of the target buffer to make up
1450N/A * the relocation entry.
1450N/A */
1450N/A __u32 delta;
1450N/A
1450N/A /** Offset in the buffer the relocation entry will be written into */
1450N/A __u64 offset;
1450N/A
1450N/A /**
1450N/A * Offset value of the target buffer that the relocation entry was last
1450N/A * written as.
1450N/A *
1450N/A * If the buffer has the same offset as last time, we can skip syncing
1450N/A * and writing the relocation. This value is written back out by
1450N/A * the execbuffer ioctl when the relocation is written.
1450N/A */
1450N/A __u64 presumed_offset;
1450N/A
1450N/A /**
1450N/A * Target memory domains read by this operation.
1450N/A */
1450N/A __u32 read_domains;
1450N/A
1450N/A /**
1450N/A * Target memory domains written by this operation.
1450N/A *
1450N/A * Note that only one domain may be written by the whole
1450N/A * execbuffer operation, so that where there are conflicts,
1450N/A * the application will get -EINVAL back.
1450N/A */
1450N/A __u32 write_domain;
1450N/A};
1450N/A
1450N/A/** @{
1450N/A * Intel memory domains
1450N/A *
1450N/A * Most of these just align with the various caches in
1450N/A * the system and are used to flush and invalidate as
1450N/A * objects end up cached in different domains.
1450N/A */
1450N/A/** CPU cache */
1450N/A#define I915_GEM_DOMAIN_CPU 0x00000001
1450N/A/** Render cache, used by 2D and 3D drawing */
1450N/A#define I915_GEM_DOMAIN_RENDER 0x00000002
1450N/A/** Sampler cache, used by texture engine */
1450N/A#define I915_GEM_DOMAIN_SAMPLER 0x00000004
1450N/A/** Command queue, used to load batch buffers */
1450N/A#define I915_GEM_DOMAIN_COMMAND 0x00000008
1450N/A/** Instruction cache, used by shader programs */
1450N/A#define I915_GEM_DOMAIN_INSTRUCTION 0x00000010
1450N/A/** Vertex address cache */
1450N/A#define I915_GEM_DOMAIN_VERTEX 0x00000020
1450N/A/** GTT domain - aperture and scanout */
1450N/A#define I915_GEM_DOMAIN_GTT 0x00000040
1450N/A/** @} */
1450N/A
1450N/Astruct drm_i915_gem_exec_object {
1450N/A /**
1450N/A * User's handle for a buffer to be bound into the GTT for this
1450N/A * operation.
1450N/A */
1450N/A __u32 handle;
1450N/A
1450N/A /** Number of relocations to be performed on this buffer */
1450N/A __u32 relocation_count;
1450N/A /**
1450N/A * Pointer to array of struct drm_i915_gem_relocation_entry containing
1450N/A * the relocations to be performed in this buffer.
1450N/A */
1450N/A __u64 relocs_ptr;
1450N/A
1450N/A /** Required alignment in graphics aperture */
1450N/A __u64 alignment;
1450N/A
1450N/A /**
1450N/A * Returned value of the updated offset of the object, for future
1450N/A * presumed_offset writes.
1450N/A */
1450N/A __u64 offset;
1450N/A};
1450N/A
1450N/Astruct drm_i915_gem_execbuffer {
1450N/A /**
1450N/A * List of buffers to be validated with their relocations to be
1450N/A * performend on them.
1450N/A *
1450N/A * This is a pointer to an array of struct drm_i915_gem_validate_entry.
1450N/A *
1450N/A * These buffers must be listed in an order such that all relocations
1450N/A * a buffer is performing refer to buffers that have already appeared
1450N/A * in the validate list.
1450N/A */
1450N/A __u64 buffers_ptr;
1450N/A __u32 buffer_count;
1450N/A
1450N/A /** Offset in the batchbuffer to start execution from. */
1450N/A __u32 batch_start_offset;
1450N/A /** Bytes used in batchbuffer from batch_start_offset */
1450N/A __u32 batch_len;
1450N/A __u32 DR1;
1450N/A __u32 DR4;
1450N/A __u32 num_cliprects;
1450N/A /** This is a struct drm_clip_rect *cliprects */
1450N/A __u64 cliprects_ptr;
1450N/A};
1450N/A
1450N/Astruct drm_i915_gem_exec_object2 {
1450N/A /**
1450N/A * User's handle for a buffer to be bound into the GTT for this
1450N/A * operation.
1450N/A */
1450N/A __u32 handle;
1450N/A
1450N/A /** Number of relocations to be performed on this buffer */
1450N/A __u32 relocation_count;
1450N/A /**
1450N/A * Pointer to array of struct drm_i915_gem_relocation_entry containing
1450N/A * the relocations to be performed in this buffer.
1450N/A */
1450N/A __u64 relocs_ptr;
1450N/A
1450N/A /** Required alignment in graphics aperture */
1450N/A __u64 alignment;
1450N/A
1450N/A /**
1450N/A * Returned value of the updated offset of the object, for future
1450N/A * presumed_offset writes.
1450N/A */
1450N/A __u64 offset;
1450N/A
1450N/A#define EXEC_OBJECT_NEEDS_FENCE (1<<0)
1450N/A#define EXEC_OBJECT_NEEDS_GTT (1<<1)
1450N/A#define EXEC_OBJECT_WRITE (1<<2)
1450N/A#define __EXEC_OBJECT_UNKNOWN_FLAGS -(EXEC_OBJECT_WRITE<<1)
1450N/A __u64 flags;
1450N/A __u64 rsvd1;
1450N/A __u64 rsvd2;
1450N/A};
1450N/A
1450N/Astruct drm_i915_gem_execbuffer2 {
1450N/A /**
1450N/A * List of gem_exec_object2 structs
1450N/A */
1450N/A __u64 buffers_ptr;
1450N/A __u32 buffer_count;
1450N/A
1450N/A /** Offset in the batchbuffer to start execution from. */
1450N/A __u32 batch_start_offset;
1450N/A /** Bytes used in batchbuffer from batch_start_offset */
1450N/A __u32 batch_len;
1450N/A __u32 DR1;
1450N/A __u32 DR4;
1450N/A __u32 num_cliprects;
1450N/A /** This is a struct drm_clip_rect *cliprects */
1450N/A __u64 cliprects_ptr;
1450N/A#define I915_EXEC_RING_MASK (7<<0)
1450N/A#define I915_EXEC_DEFAULT (0<<0)
1450N/A#define I915_EXEC_RENDER (1<<0)
1450N/A#define I915_EXEC_BSD (2<<0)
1450N/A#define I915_EXEC_BLT (3<<0)
1450N/A#define I915_EXEC_VEBOX (4<<0)
1450N/A
1450N/A/* Used for switching the constants addressing mode on gen4+ RENDER ring.
1450N/A * Gen6+ only supports relative addressing to dynamic state (default) and
1450N/A * absolute addressing.
1450N/A *
1450N/A * These flags are ignored for the BSD and BLT rings.
1450N/A */
1450N/A#define I915_EXEC_CONSTANTS_MASK (3<<6)
1450N/A#define I915_EXEC_CONSTANTS_REL_GENERAL (0<<6) /* default */
1450N/A#define I915_EXEC_CONSTANTS_ABSOLUTE (1<<6)
1450N/A#define I915_EXEC_CONSTANTS_REL_SURFACE (2<<6) /* gen4/5 only */
1450N/A __u64 flags; /* currently unused */
1450N/A __u64 rsvd1;
1450N/A __u64 rsvd2;
1450N/A};
1450N/A
1450N/A/** Resets the SO write offset registers for transform feedback on gen7. */
1450N/A#define I915_EXEC_GEN7_SOL_RESET (1<<8)
1450N/A
1450N/A/** Request a privileged ("secure") batch buffer. Note only available for
1450N/A * DRM_ROOT_ONLY | DRM_MASTER processes.
1450N/A */
1450N/A#define I915_EXEC_SECURE (1<<9)
1450N/A
1450N/A/** Inform the kernel that the batch is and will always be pinned. This
1450N/A * negates the requirement for a workaround to be performed to avoid
1450N/A * an incoherent CS (such as can be found on 830/845). If this flag is
1450N/A * not passed, the kernel will endeavour to make sure the batch is
1450N/A * coherent with the CS before execution. If this flag is passed,
1450N/A * userspace assumes the responsibility for ensuring the same.
1450N/A */
1450N/A#define I915_EXEC_IS_PINNED (1<<10)
1450N/A
1450N/A/** Provide a hint to the kernel that the command stream and auxilliary
1450N/A * state buffers already holds the correct presumed addresses and so the
1450N/A * relocation process may be skipped if no buffers need to be moved in
1450N/A * preparation for the execbuffer.
1450N/A */
1450N/A#define I915_EXEC_NO_RELOC (1<<11)
1450N/A
1450N/A/** Use the reloc.handle as an index into the exec object array rather
1450N/A * than as the per-file handle.
1450N/A */
1450N/A#define I915_EXEC_HANDLE_LUT (1<<12)
1450N/A
1450N/A#define __I915_EXEC_UNKNOWN_FLAGS -(I915_EXEC_HANDLE_LUT<<1)
1450N/A
1450N/A#define I915_EXEC_CONTEXT_ID_MASK (0xffffffff)
1450N/A#define i915_execbuffer2_set_context_id(eb2, context) \
1450N/A (eb2).rsvd1 = context & I915_EXEC_CONTEXT_ID_MASK
1450N/A#define i915_execbuffer2_get_context_id(eb2) \
1450N/A ((eb2).rsvd1 & I915_EXEC_CONTEXT_ID_MASK)
1450N/A
1450N/Astruct drm_i915_gem_pin {
1450N/A /** Handle of the buffer to be pinned. */
1450N/A __u32 handle;
1450N/A __u32 pad;
1450N/A
1450N/A /** alignment required within the aperture */
1450N/A __u64 alignment;
1450N/A
1450N/A /** Returned GTT offset of the buffer. */
1450N/A __u64 offset;
1450N/A};
1450N/A
1450N/Astruct drm_i915_gem_unpin {
1450N/A /** Handle of the buffer to be unpinned. */
1450N/A __u32 handle;
1450N/A __u32 pad;
1450N/A};
1450N/A
1450N/Astruct drm_i915_gem_busy {
1450N/A /** Handle of the buffer to check for busy */
1450N/A __u32 handle;
1450N/A
1450N/A /** Return busy status (1 if busy, 0 if idle).
1450N/A * The high word is used to indicate on which rings the object
1450N/A * currently resides:
1450N/A * 16:31 - busy (r or r/w) rings (16 render, 17 bsd, 18 blt, etc)
1450N/A */
1450N/A __u32 busy;
1450N/A};
1450N/A
1450N/A#define I915_CACHING_NONE 0
1450N/A#define I915_CACHING_CACHED 1
1450N/A
1450N/Astruct drm_i915_gem_caching {
1450N/A /**
1450N/A * Handle of the buffer to set/get the caching level of. */
1450N/A __u32 handle;
1450N/A
1450N/A /**
1450N/A * Cacheing level to apply or return value
1450N/A *
1450N/A * bits0-15 are for generic caching control (i.e. the above defined
1450N/A * values). bits16-31 are reserved for platform-specific variations
1450N/A * (e.g. l3$ caching on gen7). */
1450N/A __u32 caching;
1450N/A};
1450N/A
1450N/A#define I915_TILING_NONE 0
1450N/A#define I915_TILING_X 1
1450N/A#define I915_TILING_Y 2
1450N/A
1450N/A#define I915_BIT_6_SWIZZLE_NONE 0
1450N/A#define I915_BIT_6_SWIZZLE_9 1
1450N/A#define I915_BIT_6_SWIZZLE_9_10 2
1450N/A#define I915_BIT_6_SWIZZLE_9_11 3
1450N/A#define I915_BIT_6_SWIZZLE_9_10_11 4
1450N/A/* Not seen by userland */
1450N/A#define I915_BIT_6_SWIZZLE_UNKNOWN 5
1450N/A/* Seen by userland. */
1450N/A#define I915_BIT_6_SWIZZLE_9_17 6
1450N/A#define I915_BIT_6_SWIZZLE_9_10_17 7
1450N/A
1450N/Astruct drm_i915_gem_set_tiling {
1450N/A /** Handle of the buffer to have its tiling state updated */
1450N/A __u32 handle;
1450N/A
1450N/A /**
1450N/A * Tiling mode for the object (I915_TILING_NONE, I915_TILING_X,
1450N/A * I915_TILING_Y).
1450N/A *
1450N/A * This value is to be set on request, and will be updated by the
1450N/A * kernel on successful return with the actual chosen tiling layout.
1450N/A *
1450N/A * The tiling mode may be demoted to I915_TILING_NONE when the system
1450N/A * has bit 6 swizzling that can't be managed correctly by GEM.
1450N/A *
1450N/A * Buffer contents become undefined when changing tiling_mode.
1450N/A */
1450N/A __u32 tiling_mode;
1450N/A
1450N/A /**
1450N/A * Stride in bytes for the object when in I915_TILING_X or
1450N/A * I915_TILING_Y.
1450N/A */
1450N/A __u32 stride;
1450N/A
1450N/A /**
1450N/A * Returned address bit 6 swizzling required for CPU access through
1450N/A * mmap mapping.
1450N/A */
1450N/A __u32 swizzle_mode;
1450N/A};
1450N/A
1450N/Astruct drm_i915_gem_get_tiling {
1450N/A /** Handle of the buffer to get tiling state for. */
1450N/A __u32 handle;
1450N/A
1450N/A /**
1450N/A * Current tiling mode for the object (I915_TILING_NONE, I915_TILING_X,
1450N/A * I915_TILING_Y).
1450N/A */
1450N/A __u32 tiling_mode;
1450N/A
1450N/A /**
1450N/A * Returned address bit 6 swizzling required for CPU access through
1450N/A * mmap mapping.
1450N/A */
1450N/A __u32 swizzle_mode;
1450N/A};
1450N/A
1450N/Astruct drm_i915_gem_get_aperture {
1450N/A /** Total size of the aperture used by i915_gem_execbuffer, in bytes */
1450N/A __u64 aper_size;
1450N/A
1450N/A /**
1450N/A * Available space in the aperture used by i915_gem_execbuffer, in
1450N/A * bytes
1450N/A */
1450N/A __u64 aper_available_size;
1450N/A};
1450N/A
1450N/Astruct drm_i915_get_pipe_from_crtc_id {
1450N/A /** ID of CRTC being requested **/
1450N/A __u32 crtc_id;
1450N/A
1450N/A /** pipe of requested CRTC **/
1450N/A __u32 pipe;
1450N/A};
1450N/A
1450N/A#define I915_MADV_WILLNEED 0
1450N/A#define I915_MADV_DONTNEED 1
1450N/A#define __I915_MADV_PURGED 2 /* internal state */
1450N/A
1450N/Astruct drm_i915_gem_madvise {
1450N/A /** Handle of the buffer to change the backing store advice */
1450N/A __u32 handle;
1450N/A
1450N/A /* Advice: either the buffer will be needed again in the near future,
1450N/A * or wont be and could be discarded under memory pressure.
1450N/A */
1450N/A __u32 madv;
1450N/A
1450N/A /** Whether the backing store still exists. */
1450N/A __u32 retained;
1450N/A};
1450N/A
1450N/A/* flags */
1450N/A#define I915_OVERLAY_TYPE_MASK 0xff
1450N/A#define I915_OVERLAY_YUV_PLANAR 0x01
1450N/A#define I915_OVERLAY_YUV_PACKED 0x02
1450N/A#define I915_OVERLAY_RGB 0x03
1450N/A
1450N/A#define I915_OVERLAY_DEPTH_MASK 0xff00
1450N/A#define I915_OVERLAY_RGB24 0x1000
1450N/A#define I915_OVERLAY_RGB16 0x2000
1450N/A#define I915_OVERLAY_RGB15 0x3000
1450N/A#define I915_OVERLAY_YUV422 0x0100
1450N/A#define I915_OVERLAY_YUV411 0x0200
1450N/A#define I915_OVERLAY_YUV420 0x0300
1450N/A#define I915_OVERLAY_YUV410 0x0400
1450N/A
1450N/A#define I915_OVERLAY_SWAP_MASK 0xff0000
1450N/A#define I915_OVERLAY_NO_SWAP 0x000000
1450N/A#define I915_OVERLAY_UV_SWAP 0x010000
1450N/A#define I915_OVERLAY_Y_SWAP 0x020000
1450N/A#define I915_OVERLAY_Y_AND_UV_SWAP 0x030000
1450N/A
1450N/A#define I915_OVERLAY_FLAGS_MASK 0xff000000
1450N/A#define I915_OVERLAY_ENABLE 0x01000000
1450N/A
1450N/Astruct drm_intel_overlay_put_image {
1450N/A /* various flags and src format description */
1450N/A __u32 flags;
1450N/A /* source picture description */
1450N/A __u32 bo_handle;
1450N/A /* stride values and offsets are in bytes, buffer relative */
1450N/A __u16 stride_Y; /* stride for packed formats */
1450N/A __u16 stride_UV;
1450N/A __u32 offset_Y; /* offset for packet formats */
1450N/A __u32 offset_U;
1450N/A __u32 offset_V;
1450N/A /* in pixels */
1450N/A __u16 src_width;
1450N/A __u16 src_height;
1450N/A /* to compensate the scaling factors for partially covered surfaces */
1450N/A __u16 src_scan_width;
1450N/A __u16 src_scan_height;
1450N/A /* output crtc description */
1450N/A __u32 crtc_id;
1450N/A __u16 dst_x;
1450N/A __u16 dst_y;
1450N/A __u16 dst_width;
1450N/A __u16 dst_height;
1450N/A};
1450N/A
1450N/A/* flags */
1450N/A#define I915_OVERLAY_UPDATE_ATTRS (1<<0)
1450N/A#define I915_OVERLAY_UPDATE_GAMMA (1<<1)
1450N/Astruct drm_intel_overlay_attrs {
1450N/A __u32 flags;
1450N/A __u32 color_key;
1450N/A __s32 brightness;
1450N/A __u32 contrast;
1450N/A __u32 saturation;
1450N/A __u32 gamma0;
1450N/A __u32 gamma1;
1450N/A __u32 gamma2;
1450N/A __u32 gamma3;
1450N/A __u32 gamma4;
1450N/A __u32 gamma5;
1450N/A};
1450N/A
1450N/A/*
1450N/A * Intel sprite handling
1450N/A *
1450N/A * Color keying works with a min/mask/max tuple. Both source and destination
1450N/A * color keying is allowed.
1450N/A *
1450N/A * Source keying:
1450N/A * Sprite pixels within the min & max values, masked against the color channels
1450N/A * specified in the mask field, will be transparent. All other pixels will
1450N/A * be displayed on top of the primary plane. For RGB surfaces, only the min
1450N/A * and mask fields will be used; ranged compares are not allowed.
1450N/A *
1450N/A * Destination keying:
1450N/A * Primary plane pixels that match the min value, masked against the color
1450N/A * channels specified in the mask field, will be replaced by corresponding
1450N/A * pixels from the sprite plane.
1450N/A *
1450N/A * Note that source & destination keying are exclusive; only one can be
1450N/A * active on a given plane.
1450N/A */
1450N/A
1450N/A#define I915_SET_COLORKEY_NONE (1<<0) /* disable color key matching */
1450N/A#define I915_SET_COLORKEY_DESTINATION (1<<1)
1450N/A#define I915_SET_COLORKEY_SOURCE (1<<2)
1450N/Astruct drm_intel_sprite_colorkey {
1450N/A __u32 plane_id;
1450N/A __u32 min_value;
1450N/A __u32 channel_mask;
1450N/A __u32 max_value;
1450N/A __u32 flags;
1450N/A};
1450N/A
1450N/Astruct drm_i915_gem_wait {
1450N/A /** Handle of BO we shall wait on */
1450N/A __u32 bo_handle;
1450N/A __u32 flags;
1450N/A /** Number of nanoseconds to wait, Returns time remaining. */
1450N/A __s64 timeout_ns;
1450N/A};
1450N/A
1450N/Astruct drm_i915_gem_context_create {
1450N/A /* output: id of new context*/
1450N/A __u32 ctx_id;
1450N/A __u32 pad;
1450N/A};
1450N/A
1450N/Astruct drm_i915_gem_context_destroy {
1450N/A __u32 ctx_id;
1450N/A __u32 pad;
1450N/A};
1450N/A
1450N/Astruct drm_i915_reg_read {
1450N/A __u64 offset;
1450N/A __u64 val; /* Return value */
1450N/A};
1450N/A#endif /* _I915_DRM_H_ */