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 __R128_DRM_H__
20 #define __R128_DRM_H__
21 #include "drm.h"
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 #ifndef __R128_SAREA_DEFINES__
26 #define __R128_SAREA_DEFINES__
27 #define R128_UPLOAD_CONTEXT 0x001
28 #define R128_UPLOAD_SETUP 0x002
29 #define R128_UPLOAD_TEX0 0x004
30 #define R128_UPLOAD_TEX1 0x008
31 #define R128_UPLOAD_TEX0IMAGES 0x010
32 #define R128_UPLOAD_TEX1IMAGES 0x020
33 #define R128_UPLOAD_CORE 0x040
34 #define R128_UPLOAD_MASKS 0x080
35 #define R128_UPLOAD_WINDOW 0x100
36 #define R128_UPLOAD_CLIPRECTS 0x200
37 #define R128_REQUIRE_QUIESCENCE 0x400
38 #define R128_UPLOAD_ALL 0x7ff
39 #define R128_FRONT 0x1
40 #define R128_BACK 0x2
41 #define R128_DEPTH 0x4
42 #define R128_POINTS 0x1
43 #define R128_LINES 0x2
44 #define R128_LINE_STRIP 0x3
45 #define R128_TRIANGLES 0x4
46 #define R128_TRIANGLE_FAN 0x5
47 #define R128_TRIANGLE_STRIP 0x6
48 #define R128_BUFFER_SIZE 16384
49 #define R128_INDEX_PRIM_OFFSET 20
50 #define R128_HOSTDATA_BLIT_OFFSET 32
51 #define R128_NR_SAREA_CLIPRECTS 12
52 #define R128_LOCAL_TEX_HEAP 0
53 #define R128_AGP_TEX_HEAP 1
54 #define R128_NR_TEX_HEAPS 2
55 #define R128_NR_TEX_REGIONS 64
56 #define R128_LOG_TEX_GRANULARITY 16
57 #define R128_NR_CONTEXT_REGS 12
58 #define R128_MAX_TEXTURE_LEVELS 11
59 #define R128_MAX_TEXTURE_UNITS 2
60 #endif
61 typedef struct {
62   unsigned int dst_pitch_offset_c;
63   unsigned int dp_gui_master_cntl_c;
64   unsigned int sc_top_left_c;
65   unsigned int sc_bottom_right_c;
66   unsigned int z_offset_c;
67   unsigned int z_pitch_c;
68   unsigned int z_sten_cntl_c;
69   unsigned int tex_cntl_c;
70   unsigned int misc_3d_state_cntl_reg;
71   unsigned int texture_clr_cmp_clr_c;
72   unsigned int texture_clr_cmp_msk_c;
73   unsigned int fog_color_c;
74   unsigned int tex_size_pitch_c;
75   unsigned int constant_color_c;
76   unsigned int pm4_vc_fpu_setup;
77   unsigned int setup_cntl;
78   unsigned int dp_write_mask;
79   unsigned int sten_ref_mask_c;
80   unsigned int plane_3d_mask_c;
81   unsigned int window_xy_offset;
82   unsigned int scale_3d_cntl;
83 } drm_r128_context_regs_t;
84 typedef struct {
85   unsigned int tex_cntl;
86   unsigned int tex_combine_cntl;
87   unsigned int tex_size_pitch;
88   unsigned int tex_offset[R128_MAX_TEXTURE_LEVELS];
89   unsigned int tex_border_color;
90 } drm_r128_texture_regs_t;
91 typedef struct drm_r128_sarea {
92   drm_r128_context_regs_t context_state;
93   drm_r128_texture_regs_t tex_state[R128_MAX_TEXTURE_UNITS];
94   unsigned int dirty;
95   unsigned int vertsize;
96   unsigned int vc_format;
97   struct drm_clip_rect boxes[R128_NR_SAREA_CLIPRECTS];
98   unsigned int nbox;
99   unsigned int last_frame;
100   unsigned int last_dispatch;
101   struct drm_tex_region tex_list[R128_NR_TEX_HEAPS][R128_NR_TEX_REGIONS + 1];
102   unsigned int tex_age[R128_NR_TEX_HEAPS];
103   int ctx_owner;
104   int pfAllowPageFlip;
105   int pfCurrentPage;
106 } drm_r128_sarea_t;
107 #define DRM_R128_INIT 0x00
108 #define DRM_R128_CCE_START 0x01
109 #define DRM_R128_CCE_STOP 0x02
110 #define DRM_R128_CCE_RESET 0x03
111 #define DRM_R128_CCE_IDLE 0x04
112 #define DRM_R128_RESET 0x06
113 #define DRM_R128_SWAP 0x07
114 #define DRM_R128_CLEAR 0x08
115 #define DRM_R128_VERTEX 0x09
116 #define DRM_R128_INDICES 0x0a
117 #define DRM_R128_BLIT 0x0b
118 #define DRM_R128_DEPTH 0x0c
119 #define DRM_R128_STIPPLE 0x0d
120 #define DRM_R128_INDIRECT 0x0f
121 #define DRM_R128_FULLSCREEN 0x10
122 #define DRM_R128_CLEAR2 0x11
123 #define DRM_R128_GETPARAM 0x12
124 #define DRM_R128_FLIP 0x13
125 #define DRM_IOCTL_R128_INIT DRM_IOW(DRM_COMMAND_BASE + DRM_R128_INIT, drm_r128_init_t)
126 #define DRM_IOCTL_R128_CCE_START DRM_IO(DRM_COMMAND_BASE + DRM_R128_CCE_START)
127 #define DRM_IOCTL_R128_CCE_STOP DRM_IOW(DRM_COMMAND_BASE + DRM_R128_CCE_STOP, drm_r128_cce_stop_t)
128 #define DRM_IOCTL_R128_CCE_RESET DRM_IO(DRM_COMMAND_BASE + DRM_R128_CCE_RESET)
129 #define DRM_IOCTL_R128_CCE_IDLE DRM_IO(DRM_COMMAND_BASE + DRM_R128_CCE_IDLE)
130 #define DRM_IOCTL_R128_RESET DRM_IO(DRM_COMMAND_BASE + DRM_R128_RESET)
131 #define DRM_IOCTL_R128_SWAP DRM_IO(DRM_COMMAND_BASE + DRM_R128_SWAP)
132 #define DRM_IOCTL_R128_CLEAR DRM_IOW(DRM_COMMAND_BASE + DRM_R128_CLEAR, drm_r128_clear_t)
133 #define DRM_IOCTL_R128_VERTEX DRM_IOW(DRM_COMMAND_BASE + DRM_R128_VERTEX, drm_r128_vertex_t)
134 #define DRM_IOCTL_R128_INDICES DRM_IOW(DRM_COMMAND_BASE + DRM_R128_INDICES, drm_r128_indices_t)
135 #define DRM_IOCTL_R128_BLIT DRM_IOW(DRM_COMMAND_BASE + DRM_R128_BLIT, drm_r128_blit_t)
136 #define DRM_IOCTL_R128_DEPTH DRM_IOW(DRM_COMMAND_BASE + DRM_R128_DEPTH, drm_r128_depth_t)
137 #define DRM_IOCTL_R128_STIPPLE DRM_IOW(DRM_COMMAND_BASE + DRM_R128_STIPPLE, drm_r128_stipple_t)
138 #define DRM_IOCTL_R128_INDIRECT DRM_IOWR(DRM_COMMAND_BASE + DRM_R128_INDIRECT, drm_r128_indirect_t)
139 #define DRM_IOCTL_R128_FULLSCREEN DRM_IOW(DRM_COMMAND_BASE + DRM_R128_FULLSCREEN, drm_r128_fullscreen_t)
140 #define DRM_IOCTL_R128_CLEAR2 DRM_IOW(DRM_COMMAND_BASE + DRM_R128_CLEAR2, drm_r128_clear2_t)
141 #define DRM_IOCTL_R128_GETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_R128_GETPARAM, drm_r128_getparam_t)
142 #define DRM_IOCTL_R128_FLIP DRM_IO(DRM_COMMAND_BASE + DRM_R128_FLIP)
143 typedef struct drm_r128_init {
144   enum {
145     R128_INIT_CCE = 0x01,
146     R128_CLEANUP_CCE = 0x02
147   } func;
148   unsigned long sarea_priv_offset;
149   int is_pci;
150   int cce_mode;
151   int cce_secure;
152   int ring_size;
153   int usec_timeout;
154   unsigned int fb_bpp;
155   unsigned int front_offset, front_pitch;
156   unsigned int back_offset, back_pitch;
157   unsigned int depth_bpp;
158   unsigned int depth_offset, depth_pitch;
159   unsigned int span_offset;
160   unsigned long fb_offset;
161   unsigned long mmio_offset;
162   unsigned long ring_offset;
163   unsigned long ring_rptr_offset;
164   unsigned long buffers_offset;
165   unsigned long agp_textures_offset;
166 } drm_r128_init_t;
167 typedef struct drm_r128_cce_stop {
168   int flush;
169   int idle;
170 } drm_r128_cce_stop_t;
171 typedef struct drm_r128_clear {
172   unsigned int flags;
173   unsigned int clear_color;
174   unsigned int clear_depth;
175   unsigned int color_mask;
176   unsigned int depth_mask;
177 } drm_r128_clear_t;
178 typedef struct drm_r128_vertex {
179   int prim;
180   int idx;
181   int count;
182   int discard;
183 } drm_r128_vertex_t;
184 typedef struct drm_r128_indices {
185   int prim;
186   int idx;
187   int start;
188   int end;
189   int discard;
190 } drm_r128_indices_t;
191 typedef struct drm_r128_blit {
192   int idx;
193   int pitch;
194   int offset;
195   int format;
196   unsigned short x, y;
197   unsigned short width, height;
198 } drm_r128_blit_t;
199 typedef struct drm_r128_depth {
200   enum {
201     R128_WRITE_SPAN = 0x01,
202     R128_WRITE_PIXELS = 0x02,
203     R128_READ_SPAN = 0x03,
204     R128_READ_PIXELS = 0x04
205   } func;
206   int n;
207   int __user * x;
208   int __user * y;
209   unsigned int __user * buffer;
210   unsigned char __user * mask;
211 } drm_r128_depth_t;
212 typedef struct drm_r128_stipple {
213   unsigned int __user * mask;
214 } drm_r128_stipple_t;
215 typedef struct drm_r128_indirect {
216   int idx;
217   int start;
218   int end;
219   int discard;
220 } drm_r128_indirect_t;
221 typedef struct drm_r128_fullscreen {
222   enum {
223     R128_INIT_FULLSCREEN = 0x01,
224     R128_CLEANUP_FULLSCREEN = 0x02
225   } func;
226 } drm_r128_fullscreen_t;
227 #define R128_PARAM_IRQ_NR 1
228 typedef struct drm_r128_getparam {
229   int param;
230   void __user * value;
231 } drm_r128_getparam_t;
232 #ifdef __cplusplus
233 }
234 #endif
235 #endif
236