1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 * or http://www.opensolaris.org/os/licensing. 10 * See the License for the specific language governing permissions 11 * and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL HEADER in each 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21 22 /* 23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 24 * Use is subject to license terms. 25 */ 26 27 #ifndef _DRM_IO32_H_ 28 #define _DRM_IO32_H_ 29 30 #ifdef _MULTI_DATAMODEL 31 32 typedef struct drm_version_32 { 33 int version_major; /* Major version */ 34 int version_minor; /* Minor version */ 35 int version_patchlevel; /* Patch level */ 36 uint32_t name_len; /* Length of name buffer */ 37 caddr32_t name; /* Name of driver */ 38 uint32_t date_len; /* Length of date buffer */ 39 caddr32_t date; /* User-space buffer to hold date */ 40 uint32_t desc_len; /* Length of desc buffer */ 41 caddr32_t desc; /* User-space buffer to hold desc */ 42 } drm_version_32_t; 43 44 typedef struct drm_unique_32 { 45 uint32_t unique_len; /* Length of unique */ 46 caddr32_t unique; /* Unique name for driver instantiation */ 47 } drm_unique_32_t; 48 49 typedef struct drm_ctx_priv_map_32 { 50 unsigned int ctx_id; /* Context requesting private mapping */ 51 caddr32_t handle; /* Handle of map */ 52 } drm_ctx_priv_map_32_t; 53 54 typedef struct drm_map_32 { 55 unsigned long long offset; 56 unsigned long long handle; 57 uint32_t size; 58 drm_map_type_t type; 59 drm_map_flags_t flags; 60 int mtrr; 61 } drm_map_32_t; 62 63 64 typedef struct drm_client_32 { 65 int idx; /* Which client desired? */ 66 int auth; /* Is client authenticated? */ 67 uint32_t pid; /* Process ID */ 68 uint32_t uid; /* User ID */ 69 uint32_t magic; /* Magic */ 70 uint32_t iocs; /* Ioctl count */ 71 } drm_client_32_t; 72 73 74 typedef struct drm_stats_32 { 75 uint32_t count; 76 struct { 77 uint32_t value; 78 drm_stat_type_t type; 79 } data[15]; 80 } drm_stats_32_t; 81 82 83 typedef struct drm_buf_desc_32 { 84 int count; /* Number of buffers of this size */ 85 int size; /* Size in bytes */ 86 int low_mark; /* Low water mark */ 87 int high_mark; /* High water mark */ 88 drm_buf_flag flags; 89 90 /* 91 * Start address of where the AGP buffers are 92 * in the AGP aperture 93 */ 94 uint32_t agp_start; 95 96 }drm_buf_desc_32_t; 97 98 typedef struct drm_buf_free_32 { 99 int count; 100 uint32_t list; 101 } drm_buf_free_32_t; 102 103 /* 104 * Used by DRM_IOCTL_MAP_BUFS_32 105 */ 106 typedef struct drm_buf_pub_32 { 107 int idx; /* Index into the master buffer list */ 108 int total; /* Buffer size */ 109 int used; /* Amount of buffer in use (for DMA) */ 110 uint32_t address; /* Address of buffer */ 111 } drm_buf_pub_32_t; 112 113 typedef struct drm_buf_map_32 { 114 int count; /* Length of the buffer list */ 115 #if defined(__cplusplus) 116 uint32_t c_virtual; 117 #else 118 uint32_t virtual; /* Mmap'd area in user-virtual */ 119 #endif 120 uint32_t list; /* Buffer information */ 121 int fd; 122 } drm_buf_map_32_t; 123 124 typedef struct drm_agp_mode_32 { 125 uint32_t mode; /* AGP mode */ 126 } drm_agp_mode_32_t; 127 128 typedef struct drm_agp_buffer32 { 129 uint32_t size; /* In bytes -- will round to page boundary */ 130 uint32_t handle; /* Used for binding / unbinding */ 131 uint32_t type; /* Type of memory to allocate */ 132 uint32_t physical; /* Physical used by i810 */ 133 } drm_agp_buffer_32_t; 134 135 typedef struct drm_agp_binding_32 { 136 uint32_t handle; /* From drm_agp_buffer */ 137 uint32_t offset; /* In bytes -- will round to page boundary */ 138 } drm_agp_binding_32_t; 139 140 typedef struct drm_agp_info_32 { 141 int agp_version_major; 142 int agp_version_minor; 143 uint32_t mode; 144 uint32_t aperture_base; 145 uint32_t aperture_size; 146 uint32_t memory_allowed; 147 uint32_t memory_used; 148 unsigned short id_vendor; 149 unsigned short id_device; 150 } drm_agp_info_32_t; 151 152 typedef struct drm_scatter_gather_32 { 153 uint32_t size; /* In bytes -- will round to page boundary */ 154 uint32_t handle; /* Used for mapping/unmapping */ 155 } drm_scatter_gather_32_t; 156 157 typedef struct drm_ctx_res_32 { 158 int count; 159 caddr32_t contexts; 160 } drm_ctx_res_32_t; 161 162 struct drm_wait_vblank_request_32 { 163 drm_vblank_seq_type_t type; 164 uint32_t sequence; 165 uint32_t signal; 166 }; 167 struct drm_wait_vblank_reply_32 { 168 drm_vblank_seq_type_t type; 169 uint32_t sequence; 170 int32_t tval_sec; 171 int32_t tval_usec; 172 }; 173 174 /* 175 * DRM_IOCTL_WAIT_VBLANK ioctl argument type. 176 * 177 * \sa drmWaitVBlank(). 178 */ 179 typedef union drm_wait_vblank_32 { 180 struct drm_wait_vblank_request_32 request; 181 struct drm_wait_vblank_reply_32 reply; 182 } drm_wait_vblank_32_t; 183 184 185 #endif /* _MULTI_DATAMODEL */ 186 187 #endif /* _DRM_IO32_H_ */ 188