blob: e710697f989d3664d53b90586cbb1ac5184037b5 [file] [log] [blame]
cg149915d0538f62008-01-09 19:45:15 -08001/*
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/*
miao chen - Sun Microsystems - Beijing Chinad0231072009-02-17 16:22:10 +080023 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
cg149915d0538f62008-01-09 19:45:15 -080024 * Use is subject to license terms.
25 */
26
cg149915d0538f62008-01-09 19:45:15 -080027#ifndef _DRM_IO32_H_
28#define _DRM_IO32_H_
29
30#ifdef _MULTI_DATAMODEL
31
32typedef 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
44typedef 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
49typedef 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
54typedef 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
64typedef 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
74typedef 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
83typedef 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
98typedef 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 */
106typedef 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
113typedef 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
124typedef struct drm_agp_mode_32 {
125 uint32_t mode; /* AGP mode */
126} drm_agp_mode_32_t;
127
128typedef 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
135typedef 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
140typedef 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
152typedef 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
157typedef struct drm_ctx_res_32 {
158 int count;
159 caddr32_t contexts;
160} drm_ctx_res_32_t;
161
162struct drm_wait_vblank_request_32 {
163 drm_vblank_seq_type_t type;
miao chen - Sun Microsystems - Beijing Chinad0231072009-02-17 16:22:10 +0800164 uint32_t sequence;
165 uint32_t signal;
cg149915d0538f62008-01-09 19:45:15 -0800166};
167struct drm_wait_vblank_reply_32 {
168 drm_vblank_seq_type_t type;
miao chen - Sun Microsystems - Beijing Chinad0231072009-02-17 16:22:10 +0800169 uint32_t sequence;
170 int32_t tval_sec;
171 int32_t tval_usec;
cg149915d0538f62008-01-09 19:45:15 -0800172};
173
174/*
175 * DRM_IOCTL_WAIT_VBLANK ioctl argument type.
176 *
177 * \sa drmWaitVBlank().
178 */
179typedef 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_ */