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