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