1 /****************************************************************************
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_
21 #include "drm.h"
22 #ifdef __cplusplus
23 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24 #endif
25 #ifndef _VIA_DEFINES_
26 #define _VIA_DEFINES_
27 #define VIA_NR_SAREA_CLIPRECTS 8
28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29 #define VIA_NR_XVMC_PORTS 10
30 #define VIA_NR_XVMC_LOCKS 5
31 #define VIA_MAX_CACHELINE_SIZE 64
32 #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)))
33 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34 #define VIA_NR_TEX_REGIONS 64
35 #define VIA_LOG_MIN_TEX_REGION_SIZE 16
36 #endif
37 #define VIA_UPLOAD_TEX0IMAGE 0x1
38 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39 #define VIA_UPLOAD_TEX1IMAGE 0x2
40 #define VIA_UPLOAD_CTX 0x4
41 #define VIA_UPLOAD_BUFFERS 0x8
42 #define VIA_UPLOAD_TEX0 0x10
43 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44 #define VIA_UPLOAD_TEX1 0x20
45 #define VIA_UPLOAD_CLIPRECTS 0x40
46 #define VIA_UPLOAD_ALL 0xff
47 #define DRM_VIA_ALLOCMEM 0x00
48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49 #define DRM_VIA_FREEMEM 0x01
50 #define DRM_VIA_AGP_INIT 0x02
51 #define DRM_VIA_FB_INIT 0x03
52 #define DRM_VIA_MAP_INIT 0x04
53 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54 #define DRM_VIA_DEC_FUTEX 0x05
55 #define NOT_USED
56 #define DRM_VIA_DMA_INIT 0x07
57 #define DRM_VIA_CMDBUFFER 0x08
58 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59 #define DRM_VIA_FLUSH 0x09
60 #define DRM_VIA_PCICMD 0x0a
61 #define DRM_VIA_CMDBUF_SIZE 0x0b
62 #define NOT_USED
63 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
64 #define DRM_VIA_WAIT_IRQ 0x0d
65 #define DRM_VIA_DMA_BLIT 0x0e
66 #define DRM_VIA_BLIT_SYNC 0x0f
67 #define DRM_IOCTL_VIA_ALLOCMEM DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_ALLOCMEM, drm_via_mem_t)
68 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69 #define DRM_IOCTL_VIA_FREEMEM DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_FREEMEM, drm_via_mem_t)
70 #define DRM_IOCTL_VIA_AGP_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_AGP_INIT, drm_via_agp_t)
71 #define DRM_IOCTL_VIA_FB_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_FB_INIT, drm_via_fb_t)
72 #define DRM_IOCTL_VIA_MAP_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_MAP_INIT, drm_via_init_t)
73 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
74 #define DRM_IOCTL_VIA_DEC_FUTEX DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_DEC_FUTEX, drm_via_futex_t)
75 #define DRM_IOCTL_VIA_DMA_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_DMA_INIT, drm_via_dma_init_t)
76 #define DRM_IOCTL_VIA_CMDBUFFER DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_CMDBUFFER, drm_via_cmdbuffer_t)
77 #define DRM_IOCTL_VIA_FLUSH DRM_IO(DRM_COMMAND_BASE + DRM_VIA_FLUSH)
78 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
79 #define DRM_IOCTL_VIA_PCICMD DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_PCICMD, drm_via_cmdbuffer_t)
80 #define DRM_IOCTL_VIA_CMDBUF_SIZE DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_CMDBUF_SIZE, drm_via_cmdbuf_size_t)
81 #define DRM_IOCTL_VIA_WAIT_IRQ DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_WAIT_IRQ, drm_via_irqwait_t)
82 #define DRM_IOCTL_VIA_DMA_BLIT DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_DMA_BLIT, drm_via_dmablit_t)
83 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
84 #define DRM_IOCTL_VIA_BLIT_SYNC DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_BLIT_SYNC, drm_via_blitsync_t)
85 #define VIA_TEX_SETUP_SIZE 8
86 #define VIA_FRONT 0x1
87 #define VIA_BACK 0x2
88 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
89 #define VIA_DEPTH 0x4
90 #define VIA_STENCIL 0x8
91 #define VIA_MEM_VIDEO 0
92 #define VIA_MEM_AGP 1
93 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
94 #define VIA_MEM_SYSTEM 2
95 #define VIA_MEM_MIXED 3
96 #define VIA_MEM_UNKNOWN 4
97 typedef struct {
98 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
99   __u32 offset;
100   __u32 size;
101 } drm_via_agp_t;
102 typedef struct {
103 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
104   __u32 offset;
105   __u32 size;
106 } drm_via_fb_t;
107 typedef struct {
108 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
109   __u32 context;
110   __u32 type;
111   __u32 size;
112   unsigned long index;
113 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
114   unsigned long offset;
115 } drm_via_mem_t;
116 typedef struct _drm_via_init {
117   enum {
118 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
119     VIA_INIT_MAP = 0x01,
120     VIA_CLEANUP_MAP = 0x02
121   } func;
122   unsigned long sarea_priv_offset;
123 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
124   unsigned long fb_offset;
125   unsigned long mmio_offset;
126   unsigned long agpAddr;
127 } drm_via_init_t;
128 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
129 typedef struct _drm_via_futex {
130   enum {
131     VIA_FUTEX_WAIT = 0x00,
132     VIA_FUTEX_WAKE = 0X01
133 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
134   } func;
135   __u32 ms;
136   __u32 lock;
137   __u32 val;
138 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
139 } drm_via_futex_t;
140 typedef struct _drm_via_dma_init {
141   enum {
142     VIA_INIT_DMA = 0x01,
143 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
144     VIA_CLEANUP_DMA = 0x02,
145     VIA_DMA_INITIALIZED = 0x03
146   } func;
147   unsigned long offset;
148 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
149   unsigned long size;
150   unsigned long reg_pause_addr;
151 } drm_via_dma_init_t;
152 typedef struct _drm_via_cmdbuffer {
153 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
154   char __user * buf;
155   unsigned long size;
156 } drm_via_cmdbuffer_t;
157 typedef struct _drm_via_tex_region {
158 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
159   unsigned char next, prev;
160   unsigned char inUse;
161   int age;
162 } drm_via_tex_region_t;
163 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
164 typedef struct _drm_via_sarea {
165   unsigned int dirty;
166   unsigned int nbox;
167   struct drm_clip_rect boxes[VIA_NR_SAREA_CLIPRECTS];
168 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
169   drm_via_tex_region_t texList[VIA_NR_TEX_REGIONS + 1];
170   int texAge;
171   int ctxOwner;
172   int vertexPrim;
173 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
174   char XvMCLockArea[VIA_MAX_CACHELINE_SIZE * (VIA_NR_XVMC_LOCKS + 1)];
175   unsigned int XvMCDisplaying[VIA_NR_XVMC_PORTS];
176   unsigned int XvMCSubPicOn[VIA_NR_XVMC_PORTS];
177   unsigned int XvMCCtxNoGrabbed;
178 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
179   unsigned int pfCurrentOffset;
180 } drm_via_sarea_t;
181 typedef struct _drm_via_cmdbuf_size {
182   enum {
183 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
184     VIA_CMDBUF_SPACE = 0x01,
185     VIA_CMDBUF_LAG = 0x02
186   } func;
187   int wait;
188 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
189   __u32 size;
190 } drm_via_cmdbuf_size_t;
191 typedef enum {
192   VIA_IRQ_ABSOLUTE = 0x0,
193 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
194   VIA_IRQ_RELATIVE = 0x1,
195   VIA_IRQ_SIGNAL = 0x10000000,
196   VIA_IRQ_FORCE_SEQUENCE = 0x20000000
197 } via_irq_seq_type_t;
198 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
199 #define VIA_IRQ_FLAGS_MASK 0xF0000000
200 enum drm_via_irqs {
201   drm_via_irq_hqv0 = 0,
202   drm_via_irq_hqv1,
203 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
204   drm_via_irq_dma0_dd,
205   drm_via_irq_dma0_td,
206   drm_via_irq_dma1_dd,
207   drm_via_irq_dma1_td,
208 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
209   drm_via_irq_num
210 };
211 struct drm_via_wait_irq_request {
212   unsigned irq;
213 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
214   via_irq_seq_type_t type;
215   __u32 sequence;
216   __u32 signal;
217 };
218 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
219 typedef union drm_via_irqwait {
220   struct drm_via_wait_irq_request request;
221   struct drm_wait_vblank_reply reply;
222 } drm_via_irqwait_t;
223 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
224 typedef struct drm_via_blitsync {
225   __u32 sync_handle;
226   unsigned engine;
227 } drm_via_blitsync_t;
228 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
229 typedef struct drm_via_dmablit {
230   __u32 num_lines;
231   __u32 line_length;
232   __u32 fb_addr;
233 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
234   __u32 fb_stride;
235   unsigned char * mem_addr;
236   __u32 mem_stride;
237   __u32 flags;
238 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
239   int to_fb;
240   drm_via_blitsync_t sync;
241 } drm_via_dmablit_t;
242 #ifdef __cplusplus
243 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
244 #endif
245 #endif
246