blob: fd4948dc6f5a529a739a5cff6788c6c50700468e [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 _VIA_DRM_H_
20#define _VIA_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
Ben Cheng655a7c02013-10-16 16:09:24 -070024#ifndef _VIA_DEFINES_
Ben Cheng655a7c02013-10-16 16:09:24 -070025#define _VIA_DEFINES_
Ben Cheng655a7c02013-10-16 16:09:24 -070026#define VIA_NR_SAREA_CLIPRECTS 8
Christopher Ferris106b3a82016-08-24 12:15:38 -070027#define VIA_NR_XVMC_PORTS 10
Ben Cheng655a7c02013-10-16 16:09:24 -070028#define VIA_NR_XVMC_LOCKS 5
29#define VIA_MAX_CACHELINE_SIZE 64
Tao Baod7db5942015-01-28 10:07:51 -080030#define XVMCLOCKPTR(saPriv,lockNo) ((volatile struct drm_hw_lock *) (((((unsigned long) (saPriv)->XvMCLockArea) + (VIA_MAX_CACHELINE_SIZE - 1)) & ~(VIA_MAX_CACHELINE_SIZE - 1)) + VIA_MAX_CACHELINE_SIZE * (lockNo)))
Christopher Ferris106b3a82016-08-24 12:15:38 -070031#define VIA_NR_TEX_REGIONS 64
Ben Cheng655a7c02013-10-16 16:09:24 -070032#define VIA_LOG_MIN_TEX_REGION_SIZE 16
33#endif
34#define VIA_UPLOAD_TEX0IMAGE 0x1
Christopher Ferris106b3a82016-08-24 12:15:38 -070035#define VIA_UPLOAD_TEX1IMAGE 0x2
Ben Cheng655a7c02013-10-16 16:09:24 -070036#define VIA_UPLOAD_CTX 0x4
37#define VIA_UPLOAD_BUFFERS 0x8
38#define VIA_UPLOAD_TEX0 0x10
Christopher Ferris106b3a82016-08-24 12:15:38 -070039#define VIA_UPLOAD_TEX1 0x20
Ben Cheng655a7c02013-10-16 16:09:24 -070040#define VIA_UPLOAD_CLIPRECTS 0x40
41#define VIA_UPLOAD_ALL 0xff
42#define DRM_VIA_ALLOCMEM 0x00
Christopher Ferris106b3a82016-08-24 12:15:38 -070043#define DRM_VIA_FREEMEM 0x01
Ben Cheng655a7c02013-10-16 16:09:24 -070044#define DRM_VIA_AGP_INIT 0x02
45#define DRM_VIA_FB_INIT 0x03
46#define DRM_VIA_MAP_INIT 0x04
Christopher Ferris106b3a82016-08-24 12:15:38 -070047#define DRM_VIA_DEC_FUTEX 0x05
Ben Cheng655a7c02013-10-16 16:09:24 -070048#define NOT_USED
49#define DRM_VIA_DMA_INIT 0x07
50#define DRM_VIA_CMDBUFFER 0x08
Christopher Ferris106b3a82016-08-24 12:15:38 -070051#define DRM_VIA_FLUSH 0x09
Ben Cheng655a7c02013-10-16 16:09:24 -070052#define DRM_VIA_PCICMD 0x0a
53#define DRM_VIA_CMDBUF_SIZE 0x0b
54#define NOT_USED
Christopher Ferris106b3a82016-08-24 12:15:38 -070055#define DRM_VIA_WAIT_IRQ 0x0d
Ben Cheng655a7c02013-10-16 16:09:24 -070056#define DRM_VIA_DMA_BLIT 0x0e
57#define DRM_VIA_BLIT_SYNC 0x0f
58#define DRM_IOCTL_VIA_ALLOCMEM DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_ALLOCMEM, drm_via_mem_t)
Christopher Ferris106b3a82016-08-24 12:15:38 -070059#define DRM_IOCTL_VIA_FREEMEM DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_FREEMEM, drm_via_mem_t)
Ben Cheng655a7c02013-10-16 16:09:24 -070060#define DRM_IOCTL_VIA_AGP_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_AGP_INIT, drm_via_agp_t)
61#define DRM_IOCTL_VIA_FB_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_FB_INIT, drm_via_fb_t)
62#define DRM_IOCTL_VIA_MAP_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_MAP_INIT, drm_via_init_t)
Christopher Ferris106b3a82016-08-24 12:15:38 -070063#define DRM_IOCTL_VIA_DEC_FUTEX DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_DEC_FUTEX, drm_via_futex_t)
Ben Cheng655a7c02013-10-16 16:09:24 -070064#define DRM_IOCTL_VIA_DMA_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_DMA_INIT, drm_via_dma_init_t)
Tao Baod7db5942015-01-28 10:07:51 -080065#define DRM_IOCTL_VIA_CMDBUFFER DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_CMDBUFFER, drm_via_cmdbuffer_t)
66#define DRM_IOCTL_VIA_FLUSH DRM_IO(DRM_COMMAND_BASE + DRM_VIA_FLUSH)
Christopher Ferris106b3a82016-08-24 12:15:38 -070067#define DRM_IOCTL_VIA_PCICMD DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_PCICMD, drm_via_cmdbuffer_t)
Tao Baod7db5942015-01-28 10:07:51 -080068#define DRM_IOCTL_VIA_CMDBUF_SIZE DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_CMDBUF_SIZE, drm_via_cmdbuf_size_t)
69#define DRM_IOCTL_VIA_WAIT_IRQ DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_WAIT_IRQ, drm_via_irqwait_t)
Ben Cheng655a7c02013-10-16 16:09:24 -070070#define DRM_IOCTL_VIA_DMA_BLIT DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_DMA_BLIT, drm_via_dmablit_t)
Christopher Ferris106b3a82016-08-24 12:15:38 -070071#define DRM_IOCTL_VIA_BLIT_SYNC DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_BLIT_SYNC, drm_via_blitsync_t)
Ben Cheng655a7c02013-10-16 16:09:24 -070072#define VIA_TEX_SETUP_SIZE 8
73#define VIA_FRONT 0x1
74#define VIA_BACK 0x2
Christopher Ferris106b3a82016-08-24 12:15:38 -070075#define VIA_DEPTH 0x4
Ben Cheng655a7c02013-10-16 16:09:24 -070076#define VIA_STENCIL 0x8
77#define VIA_MEM_VIDEO 0
78#define VIA_MEM_AGP 1
Christopher Ferris106b3a82016-08-24 12:15:38 -070079#define VIA_MEM_SYSTEM 2
Ben Cheng655a7c02013-10-16 16:09:24 -070080#define VIA_MEM_MIXED 3
81#define VIA_MEM_UNKNOWN 4
82typedef struct {
Christopher Ferris106b3a82016-08-24 12:15:38 -070083 __u32 offset;
Tao Baod7db5942015-01-28 10:07:51 -080084 __u32 size;
Ben Cheng655a7c02013-10-16 16:09:24 -070085} drm_via_agp_t;
86typedef struct {
Christopher Ferris106b3a82016-08-24 12:15:38 -070087 __u32 offset;
Tao Baod7db5942015-01-28 10:07:51 -080088 __u32 size;
Ben Cheng655a7c02013-10-16 16:09:24 -070089} drm_via_fb_t;
90typedef struct {
Christopher Ferris106b3a82016-08-24 12:15:38 -070091 __u32 context;
Tao Baod7db5942015-01-28 10:07:51 -080092 __u32 type;
93 __u32 size;
94 unsigned long index;
Christopher Ferris106b3a82016-08-24 12:15:38 -070095 unsigned long offset;
Ben Cheng655a7c02013-10-16 16:09:24 -070096} drm_via_mem_t;
97typedef struct _drm_via_init {
Tao Baod7db5942015-01-28 10:07:51 -080098 enum {
Christopher Ferris106b3a82016-08-24 12:15:38 -070099 VIA_INIT_MAP = 0x01,
Tao Baod7db5942015-01-28 10:07:51 -0800100 VIA_CLEANUP_MAP = 0x02
101 } func;
102 unsigned long sarea_priv_offset;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700103 unsigned long fb_offset;
Tao Baod7db5942015-01-28 10:07:51 -0800104 unsigned long mmio_offset;
105 unsigned long agpAddr;
Ben Cheng655a7c02013-10-16 16:09:24 -0700106} drm_via_init_t;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700107typedef struct _drm_via_futex {
Tao Baod7db5942015-01-28 10:07:51 -0800108 enum {
109 VIA_FUTEX_WAIT = 0x00,
110 VIA_FUTEX_WAKE = 0X01
Christopher Ferris106b3a82016-08-24 12:15:38 -0700111 } func;
Tao Baod7db5942015-01-28 10:07:51 -0800112 __u32 ms;
113 __u32 lock;
114 __u32 val;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700115} drm_via_futex_t;
Ben Cheng655a7c02013-10-16 16:09:24 -0700116typedef struct _drm_via_dma_init {
Tao Baod7db5942015-01-28 10:07:51 -0800117 enum {
118 VIA_INIT_DMA = 0x01,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700119 VIA_CLEANUP_DMA = 0x02,
Tao Baod7db5942015-01-28 10:07:51 -0800120 VIA_DMA_INITIALIZED = 0x03
121 } func;
122 unsigned long offset;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700123 unsigned long size;
Tao Baod7db5942015-01-28 10:07:51 -0800124 unsigned long reg_pause_addr;
Ben Cheng655a7c02013-10-16 16:09:24 -0700125} drm_via_dma_init_t;
126typedef struct _drm_via_cmdbuffer {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700127 char __user * buf;
Tao Baod7db5942015-01-28 10:07:51 -0800128 unsigned long size;
Ben Cheng655a7c02013-10-16 16:09:24 -0700129} drm_via_cmdbuffer_t;
130typedef struct _drm_via_tex_region {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700131 unsigned char next, prev;
Tao Baod7db5942015-01-28 10:07:51 -0800132 unsigned char inUse;
133 int age;
Ben Cheng655a7c02013-10-16 16:09:24 -0700134} drm_via_tex_region_t;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700135typedef struct _drm_via_sarea {
Tao Baod7db5942015-01-28 10:07:51 -0800136 unsigned int dirty;
137 unsigned int nbox;
138 struct drm_clip_rect boxes[VIA_NR_SAREA_CLIPRECTS];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700139 drm_via_tex_region_t texList[VIA_NR_TEX_REGIONS + 1];
Tao Baod7db5942015-01-28 10:07:51 -0800140 int texAge;
141 int ctxOwner;
142 int vertexPrim;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700143 char XvMCLockArea[VIA_MAX_CACHELINE_SIZE * (VIA_NR_XVMC_LOCKS + 1)];
Tao Baod7db5942015-01-28 10:07:51 -0800144 unsigned int XvMCDisplaying[VIA_NR_XVMC_PORTS];
145 unsigned int XvMCSubPicOn[VIA_NR_XVMC_PORTS];
146 unsigned int XvMCCtxNoGrabbed;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700147 unsigned int pfCurrentOffset;
Ben Cheng655a7c02013-10-16 16:09:24 -0700148} drm_via_sarea_t;
149typedef struct _drm_via_cmdbuf_size {
Tao Baod7db5942015-01-28 10:07:51 -0800150 enum {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700151 VIA_CMDBUF_SPACE = 0x01,
Tao Baod7db5942015-01-28 10:07:51 -0800152 VIA_CMDBUF_LAG = 0x02
153 } func;
154 int wait;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700155 __u32 size;
Ben Cheng655a7c02013-10-16 16:09:24 -0700156} drm_via_cmdbuf_size_t;
157typedef enum {
Tao Baod7db5942015-01-28 10:07:51 -0800158 VIA_IRQ_ABSOLUTE = 0x0,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700159 VIA_IRQ_RELATIVE = 0x1,
Tao Baod7db5942015-01-28 10:07:51 -0800160 VIA_IRQ_SIGNAL = 0x10000000,
161 VIA_IRQ_FORCE_SEQUENCE = 0x20000000
Ben Cheng655a7c02013-10-16 16:09:24 -0700162} via_irq_seq_type_t;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700163#define VIA_IRQ_FLAGS_MASK 0xF0000000
Ben Cheng655a7c02013-10-16 16:09:24 -0700164enum drm_via_irqs {
Tao Baod7db5942015-01-28 10:07:51 -0800165 drm_via_irq_hqv0 = 0,
166 drm_via_irq_hqv1,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700167 drm_via_irq_dma0_dd,
Tao Baod7db5942015-01-28 10:07:51 -0800168 drm_via_irq_dma0_td,
169 drm_via_irq_dma1_dd,
170 drm_via_irq_dma1_td,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700171 drm_via_irq_num
Ben Cheng655a7c02013-10-16 16:09:24 -0700172};
173struct drm_via_wait_irq_request {
Tao Baod7db5942015-01-28 10:07:51 -0800174 unsigned irq;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700175 via_irq_seq_type_t type;
Tao Baod7db5942015-01-28 10:07:51 -0800176 __u32 sequence;
177 __u32 signal;
Ben Cheng655a7c02013-10-16 16:09:24 -0700178};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700179typedef union drm_via_irqwait {
Tao Baod7db5942015-01-28 10:07:51 -0800180 struct drm_via_wait_irq_request request;
181 struct drm_wait_vblank_reply reply;
Ben Cheng655a7c02013-10-16 16:09:24 -0700182} drm_via_irqwait_t;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700183typedef struct drm_via_blitsync {
Tao Baod7db5942015-01-28 10:07:51 -0800184 __u32 sync_handle;
185 unsigned engine;
Ben Cheng655a7c02013-10-16 16:09:24 -0700186} drm_via_blitsync_t;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700187typedef struct drm_via_dmablit {
Tao Baod7db5942015-01-28 10:07:51 -0800188 __u32 num_lines;
189 __u32 line_length;
190 __u32 fb_addr;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700191 __u32 fb_stride;
Tao Baod7db5942015-01-28 10:07:51 -0800192 unsigned char * mem_addr;
193 __u32 mem_stride;
194 __u32 flags;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700195 int to_fb;
Tao Baod7db5942015-01-28 10:07:51 -0800196 drm_via_blitsync_t sync;
Ben Cheng655a7c02013-10-16 16:09:24 -0700197} drm_via_dmablit_t;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700198#ifdef __cplusplus
Christopher Ferris106b3a82016-08-24 12:15:38 -0700199#endif
Ben Cheng655a7c02013-10-16 16:09:24 -0700200#endif