xref: /titanic_41/usr/src/uts/common/io/drm/drm_io32.h (revision c7158ae983f5a04c4a998f468ecefba6d23ba721)
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 2008 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #pragma ident	"%Z%%M%	%I%	%E% SMI"
28 
29 #ifndef	_DRM_IO32_H_
30 #define	_DRM_IO32_H_
31 
32 #ifdef _MULTI_DATAMODEL
33 
34 typedef struct drm_version_32 {
35 	int version_major;		/* Major version */
36 	int version_minor;		/* Minor version */
37 	int version_patchlevel;	/* Patch level */
38 	uint32_t name_len;		/* Length of name buffer */
39 	caddr32_t name;			/* Name of driver */
40 	uint32_t date_len;		/* Length of date buffer */
41 	caddr32_t date;			/* User-space buffer to hold date */
42 	uint32_t desc_len;		/* Length of desc buffer */
43 	caddr32_t desc;			/* User-space buffer to hold desc */
44 } drm_version_32_t;
45 
46 typedef struct drm_unique_32 {
47 	uint32_t unique_len;    /* Length of unique */
48 	caddr32_t unique;   /* Unique name for driver instantiation */
49 } drm_unique_32_t;
50 
51 typedef struct drm_ctx_priv_map_32 {
52 	unsigned int ctx_id;	/* Context requesting private mapping */
53 	caddr32_t handle;		/* Handle of map */
54 } drm_ctx_priv_map_32_t;
55 
56 typedef struct drm_map_32 {
57 	unsigned long long offset;
58 	unsigned long long handle;
59 	uint32_t size;
60 	drm_map_type_t type;
61 	drm_map_flags_t flags;
62 	int mtrr;
63 } drm_map_32_t;
64 
65 
66 typedef struct drm_client_32 {
67 	int idx;		/* Which client desired? */
68 	int auth;		/* Is client authenticated? */
69 	uint32_t pid;	/* Process ID */
70 	uint32_t uid;	/* User ID */
71 	uint32_t magic;	/* Magic */
72 	uint32_t iocs;	/* Ioctl count */
73 } drm_client_32_t;
74 
75 
76 typedef struct drm_stats_32 {
77 	uint32_t count;
78 	struct {
79 		uint32_t value;
80 		drm_stat_type_t type;
81 	} data[15];
82 } drm_stats_32_t;
83 
84 
85 typedef struct drm_buf_desc_32 {
86 	int		count;		/* Number of buffers of this size */
87 	int		size;		/* Size in bytes */
88 	int		low_mark;	/* Low water mark */
89 	int		high_mark;	/* High water mark */
90 	drm_buf_flag flags;
91 
92 	/*
93 	 * Start address of where the AGP buffers are
94 	 * in the AGP aperture
95 	 */
96 	uint32_t agp_start;
97 
98 }drm_buf_desc_32_t;
99 
100 typedef struct drm_buf_free_32 {
101 	int count;
102 	uint32_t list;
103 } drm_buf_free_32_t;
104 
105 /*
106  * Used by DRM_IOCTL_MAP_BUFS_32
107  */
108 typedef struct drm_buf_pub_32 {
109 	int idx;		/* Index into the master buffer list */
110 	int total;		/* Buffer size */
111 	int used;		/* Amount of buffer in use (for DMA) */
112 	uint32_t address;	/* Address of buffer */
113 } drm_buf_pub_32_t;
114 
115 typedef struct drm_buf_map_32 {
116 	int		count;	/* Length of the buffer list */
117 #if defined(__cplusplus)
118 	uint32_t c_virtual;
119 #else
120 	uint32_t virtual;	/* Mmap'd area in user-virtual */
121 #endif
122 	uint32_t	list; /* Buffer information */
123 	int    fd;
124 } drm_buf_map_32_t;
125 
126 typedef struct drm_agp_mode_32 {
127     uint32_t mode;  /* AGP mode */
128 } drm_agp_mode_32_t;
129 
130 typedef struct drm_agp_buffer32 {
131 	uint32_t size;		/* In bytes -- will round to page boundary */
132 	uint32_t handle;	/* Used for binding / unbinding */
133 	uint32_t type;		/* Type of memory to allocate */
134 	uint32_t physical;	/* Physical used by i810 */
135 } drm_agp_buffer_32_t;
136 
137 typedef struct drm_agp_binding_32 {
138 	uint32_t handle;	/* From drm_agp_buffer */
139 	uint32_t offset;	/* In bytes -- will round to page boundary */
140 } drm_agp_binding_32_t;
141 
142 typedef struct drm_agp_info_32 {
143 	int agp_version_major;
144 	int agp_version_minor;
145 	uint32_t mode;
146 	uint32_t aperture_base;
147 	uint32_t aperture_size;
148 	uint32_t memory_allowed;
149 	uint32_t memory_used;
150 	unsigned short id_vendor;
151 	unsigned short id_device;
152 } drm_agp_info_32_t;
153 
154 typedef struct drm_scatter_gather_32 {
155 	uint32_t	size;	/* In bytes -- will round to page boundary */
156 	uint32_t	handle;	/* Used for mapping/unmapping */
157 } drm_scatter_gather_32_t;
158 
159 typedef struct drm_ctx_res_32 {
160 	int count;
161 	caddr32_t contexts;
162 } drm_ctx_res_32_t;
163 
164 struct drm_wait_vblank_request_32 {
165 	drm_vblank_seq_type_t type;
166 	unsigned int sequence;
167 	unsigned long signal;
168 };
169 struct drm_wait_vblank_reply_32 {
170 	drm_vblank_seq_type_t type;
171 	unsigned int sequence;
172 	long tval_sec;
173 	long tval_usec;
174 };
175 
176 /*
177  * DRM_IOCTL_WAIT_VBLANK ioctl argument type.
178  *
179  * \sa drmWaitVBlank().
180  */
181 typedef union drm_wait_vblank_32 {
182 	struct drm_wait_vblank_request_32 request;
183 	struct drm_wait_vblank_reply_32 reply;
184 } drm_wait_vblank_32_t;
185 
186 
187 #endif  /* _MULTI_DATAMODEL */
188 
189 #endif	/* _DRM_IO32_H_ */
190