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 __SAVAGE_DRM_H__ 20 #define __SAVAGE_DRM_H__ 21 #include "drm.h" 22 #ifdef __cplusplus 23 extern "C" { 24 #endif 25 #ifndef __SAVAGE_SAREA_DEFINES__ 26 #define __SAVAGE_SAREA_DEFINES__ 27 #define SAVAGE_CARD_HEAP 0 28 #define SAVAGE_AGP_HEAP 1 29 #define SAVAGE_NR_TEX_HEAPS 2 30 #define SAVAGE_NR_TEX_REGIONS 16 31 #define SAVAGE_LOG_MIN_TEX_REGION_SIZE 16 32 #endif 33 typedef struct _drm_savage_sarea { 34 struct drm_tex_region texList[SAVAGE_NR_TEX_HEAPS][SAVAGE_NR_TEX_REGIONS + 1]; 35 unsigned int texAge[SAVAGE_NR_TEX_HEAPS]; 36 int ctxOwner; 37 } drm_savage_sarea_t, * drm_savage_sarea_ptr; 38 #define DRM_SAVAGE_BCI_INIT 0x00 39 #define DRM_SAVAGE_BCI_CMDBUF 0x01 40 #define DRM_SAVAGE_BCI_EVENT_EMIT 0x02 41 #define DRM_SAVAGE_BCI_EVENT_WAIT 0x03 42 #define DRM_IOCTL_SAVAGE_BCI_INIT DRM_IOW(DRM_COMMAND_BASE + DRM_SAVAGE_BCI_INIT, drm_savage_init_t) 43 #define DRM_IOCTL_SAVAGE_BCI_CMDBUF DRM_IOW(DRM_COMMAND_BASE + DRM_SAVAGE_BCI_CMDBUF, drm_savage_cmdbuf_t) 44 #define DRM_IOCTL_SAVAGE_BCI_EVENT_EMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_SAVAGE_BCI_EVENT_EMIT, drm_savage_event_emit_t) 45 #define DRM_IOCTL_SAVAGE_BCI_EVENT_WAIT DRM_IOW(DRM_COMMAND_BASE + DRM_SAVAGE_BCI_EVENT_WAIT, drm_savage_event_wait_t) 46 #define SAVAGE_DMA_PCI 1 47 #define SAVAGE_DMA_AGP 3 48 typedef struct drm_savage_init { 49 enum { 50 SAVAGE_INIT_BCI = 1, 51 SAVAGE_CLEANUP_BCI = 2 52 } func; 53 unsigned int sarea_priv_offset; 54 unsigned int cob_size; 55 unsigned int bci_threshold_lo, bci_threshold_hi; 56 unsigned int dma_type; 57 unsigned int fb_bpp; 58 unsigned int front_offset, front_pitch; 59 unsigned int back_offset, back_pitch; 60 unsigned int depth_bpp; 61 unsigned int depth_offset, depth_pitch; 62 unsigned int texture_offset; 63 unsigned int texture_size; 64 unsigned long status_offset; 65 unsigned long buffers_offset; 66 unsigned long agp_textures_offset; 67 unsigned long cmd_dma_offset; 68 } drm_savage_init_t; 69 typedef union drm_savage_cmd_header drm_savage_cmd_header_t; 70 typedef struct drm_savage_cmdbuf { 71 drm_savage_cmd_header_t __user * cmd_addr; 72 unsigned int size; 73 unsigned int dma_idx; 74 int discard; 75 unsigned int __user * vb_addr; 76 unsigned int vb_size; 77 unsigned int vb_stride; 78 struct drm_clip_rect __user * box_addr; 79 unsigned int nbox; 80 } drm_savage_cmdbuf_t; 81 #define SAVAGE_WAIT_2D 0x1 82 #define SAVAGE_WAIT_3D 0x2 83 #define SAVAGE_WAIT_IRQ 0x4 84 typedef struct drm_savage_event { 85 unsigned int count; 86 unsigned int flags; 87 } drm_savage_event_emit_t, drm_savage_event_wait_t; 88 #define SAVAGE_CMD_STATE 0 89 #define SAVAGE_CMD_DMA_PRIM 1 90 #define SAVAGE_CMD_VB_PRIM 2 91 #define SAVAGE_CMD_DMA_IDX 3 92 #define SAVAGE_CMD_VB_IDX 4 93 #define SAVAGE_CMD_CLEAR 5 94 #define SAVAGE_CMD_SWAP 6 95 #define SAVAGE_PRIM_TRILIST 0 96 #define SAVAGE_PRIM_TRISTRIP 1 97 #define SAVAGE_PRIM_TRIFAN 2 98 #define SAVAGE_PRIM_TRILIST_201 3 99 #define SAVAGE_SKIP_Z 0x01 100 #define SAVAGE_SKIP_W 0x02 101 #define SAVAGE_SKIP_C0 0x04 102 #define SAVAGE_SKIP_C1 0x08 103 #define SAVAGE_SKIP_S0 0x10 104 #define SAVAGE_SKIP_T0 0x20 105 #define SAVAGE_SKIP_ST0 0x30 106 #define SAVAGE_SKIP_S1 0x40 107 #define SAVAGE_SKIP_T1 0x80 108 #define SAVAGE_SKIP_ST1 0xc0 109 #define SAVAGE_SKIP_ALL_S3D 0x3f 110 #define SAVAGE_SKIP_ALL_S4 0xff 111 #define SAVAGE_FRONT 0x1 112 #define SAVAGE_BACK 0x2 113 #define SAVAGE_DEPTH 0x4 114 union drm_savage_cmd_header { 115 struct { 116 unsigned char cmd; 117 unsigned char pad0; 118 unsigned short pad1; 119 unsigned short pad2; 120 unsigned short pad3; 121 } cmd; 122 struct { 123 unsigned char cmd; 124 unsigned char global; 125 unsigned short count; 126 unsigned short start; 127 unsigned short pad3; 128 } state; 129 struct { 130 unsigned char cmd; 131 unsigned char prim; 132 unsigned short skip; 133 unsigned short count; 134 unsigned short start; 135 } prim; 136 struct { 137 unsigned char cmd; 138 unsigned char prim; 139 unsigned short skip; 140 unsigned short count; 141 unsigned short pad3; 142 } idx; 143 struct { 144 unsigned char cmd; 145 unsigned char pad0; 146 unsigned short pad1; 147 unsigned int flags; 148 } clear0; 149 struct { 150 unsigned int mask; 151 unsigned int value; 152 } clear1; 153 }; 154 #ifdef __cplusplus 155 } 156 #endif 157 #endif 158