1 | /** @file
|
---|
2 | * OpenGL:
|
---|
3 | * Common header for host service and guest clients.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2007 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | *
|
---|
17 | * The contents of this file may alternatively be used under the terms
|
---|
18 | * of the Common Development and Distribution License Version 1.0
|
---|
19 | * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
20 | * VirtualBox OSE distribution, in which case the provisions of the
|
---|
21 | * CDDL are applicable instead of those of the GPL.
|
---|
22 | *
|
---|
23 | * You may elect to license modified versions of this file under the
|
---|
24 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
25 | */
|
---|
26 |
|
---|
27 | #ifndef ___VBox_HostService_VBoxCrOpenGLSvc_h
|
---|
28 | #define ___VBox_HostService_VBoxCrOpenGLSvc_h
|
---|
29 |
|
---|
30 | #include <VBox/types.h>
|
---|
31 | #include <VBox/VMMDev.h>
|
---|
32 | #include <VBox/VBoxGuest2.h>
|
---|
33 | #include <VBox/hgcmsvc.h>
|
---|
34 |
|
---|
35 | /* crOpenGL host functions */
|
---|
36 | #define SHCRGL_HOST_FN_SET_CONSOLE (1)
|
---|
37 | #define SHCRGL_HOST_FN_SET_VISIBLE_REGION (5)
|
---|
38 | #define SHCRGL_HOST_FN_SET_VM (7)
|
---|
39 | #define SHCRGL_HOST_FN_SCREEN_CHANGED (8)
|
---|
40 | #ifdef VBOX_WITH_CRHGSMI
|
---|
41 | #define SHCRGL_HOST_FN_CRHGSMI_CMD (10)
|
---|
42 | #define SHCRGL_HOST_FN_CRHGSMI_CTL (11)
|
---|
43 | #endif
|
---|
44 | #define SHCRGL_HOST_FN_SET_OUTPUT_REDIRECT (20)
|
---|
45 | /* crOpenGL guest functions */
|
---|
46 | #define SHCRGL_GUEST_FN_WRITE (2)
|
---|
47 | #define SHCRGL_GUEST_FN_READ (3)
|
---|
48 | #define SHCRGL_GUEST_FN_WRITE_READ (4)
|
---|
49 | #define SHCRGL_GUEST_FN_SET_VERSION (6)
|
---|
50 | #define SHCRGL_GUEST_FN_INJECT (9)
|
---|
51 | #define SHCRGL_GUEST_FN_SET_PID (12)
|
---|
52 | #define SHCRGL_GUEST_FN_WRITE_BUFFER (13)
|
---|
53 | #define SHCRGL_GUEST_FN_WRITE_READ_BUFFERED (14)
|
---|
54 |
|
---|
55 | /* Parameters count */
|
---|
56 | #define SHCRGL_CPARMS_SET_CONSOLE (1)
|
---|
57 | #define SHCRGL_CPARMS_SET_VM (1)
|
---|
58 | #define SHCRGL_CPARMS_SET_VISIBLE_REGION (2)
|
---|
59 | #define SHCRGL_CPARMS_WRITE (1)
|
---|
60 | #define SHCRGL_CPARMS_READ (2)
|
---|
61 | #define SHCRGL_CPARMS_WRITE_READ (3)
|
---|
62 | #define SHCRGL_CPARMS_SET_VERSION (2)
|
---|
63 | #define SHCRGL_CPARMS_SCREEN_CHANGED (1)
|
---|
64 | #define SHCRGL_CPARMS_INJECT (2)
|
---|
65 | #define SHCRGL_CPARMS_SET_PID (1)
|
---|
66 | #define SHCRGL_CPARMS_WRITE_BUFFER (4)
|
---|
67 | #define SHCRGL_CPARMS_WRITE_READ_BUFFERED (3)
|
---|
68 | #define SHCRGL_CPARMS_SET_OUTPUT_REDIRECT (1)
|
---|
69 |
|
---|
70 |
|
---|
71 | /* @todo Move to H3DOR.h begin */
|
---|
72 |
|
---|
73 | /* Names of supported output redirect formats. */
|
---|
74 | #define H3DOR_FMT_RGBA_TOPDOWN "H3DOR_FMT_RGBA_TOPDOWN"
|
---|
75 |
|
---|
76 | /* Comma separated list of output formats supported by the output redirect target. */
|
---|
77 | #define H3DOR_PROP_FORMATS 0
|
---|
78 |
|
---|
79 | #pragma pack(1)
|
---|
80 | typedef struct {
|
---|
81 | /* The caller's context of the redirection. */
|
---|
82 | const void *pvContext;
|
---|
83 | /* Inform caller that a new window will be redirected. */
|
---|
84 | DECLR3CALLBACKMEMBER(void, H3DORBegin, (const void *pvContext, void **ppvInstance,
|
---|
85 | const char *pszFormat));
|
---|
86 | /* The window dimension has been changed. */
|
---|
87 | DECLR3CALLBACKMEMBER(void, H3DORGeometry, (void *pvInstance,
|
---|
88 | int32_t x, int32_t y, uint32_t w, uint32_t h));
|
---|
89 | /* Update the window visible region. */
|
---|
90 | DECLR3CALLBACKMEMBER(void, H3DORVisibleRegion, (void *pvInstance,
|
---|
91 | uint32_t cRects, RTRECT *paRects));
|
---|
92 | /* A rendered 3D frame is ready. Format of pvData is "pszFormat" parameter of H3DORBegin. */
|
---|
93 | DECLR3CALLBACKMEMBER(void, H3DORFrame, (void *pvInstance,
|
---|
94 | void *pvData, uint32_t cbData));
|
---|
95 | /* The window is closed. */
|
---|
96 | DECLR3CALLBACKMEMBER(void, H3DOREnd, (void *pvInstance));
|
---|
97 | /* Obtain caller's parameters: the list of supported formats, etc. */
|
---|
98 | DECLR3CALLBACKMEMBER(int, H3DORContextProperty, (const void *pvContext, uint32_t index,
|
---|
99 | void *pvBuffer, uint32_t cbBuffer, uint32_t *pcbOut));
|
---|
100 | } H3DOUTPUTREDIRECT;
|
---|
101 | #pragma pack()
|
---|
102 |
|
---|
103 | /* @todo Move to H3DOR.h end */
|
---|
104 |
|
---|
105 | #ifdef VBOX_WITH_CRHGSMI
|
---|
106 | #pragma pack(1)
|
---|
107 | typedef struct
|
---|
108 | {
|
---|
109 | int32_t result; /**< OUT Host HGSMI return code.*/
|
---|
110 | uint32_t u32ClientID; /**< IN The id of the caller. */
|
---|
111 | uint32_t u32Function; /**< IN Function number. */
|
---|
112 | uint32_t u32Reserved;
|
---|
113 | } CRVBOXHGSMIHDR;
|
---|
114 | AssertCompileSize(CRVBOXHGSMIHDR, 16);
|
---|
115 |
|
---|
116 | /** GUEST_FN_WRITE Parameters structure. */
|
---|
117 | typedef struct
|
---|
118 | {
|
---|
119 | CRVBOXHGSMIHDR hdr;
|
---|
120 | /** buffer index, in
|
---|
121 | * Data buffer
|
---|
122 | */
|
---|
123 | uint32_t iBuffer;
|
---|
124 | } CRVBOXHGSMIWRITE;
|
---|
125 |
|
---|
126 | /** GUEST_FN_READ Parameters structure. */
|
---|
127 | typedef struct
|
---|
128 | {
|
---|
129 | CRVBOXHGSMIHDR hdr;
|
---|
130 |
|
---|
131 | /** buffer index, in/out
|
---|
132 | * Data buffer
|
---|
133 | */
|
---|
134 | uint32_t iBuffer;
|
---|
135 | uint32_t cbBuffer;
|
---|
136 | } CRVBOXHGSMIREAD;
|
---|
137 |
|
---|
138 | /** GUEST_FN_WRITE_READ Parameters structure. */
|
---|
139 | typedef struct
|
---|
140 | {
|
---|
141 | CRVBOXHGSMIHDR hdr;
|
---|
142 |
|
---|
143 | /** buffer index, in
|
---|
144 | * Data buffer
|
---|
145 | */
|
---|
146 | uint32_t iBuffer;
|
---|
147 |
|
---|
148 | /** buffer index, out
|
---|
149 | * Writeback buffer
|
---|
150 | */
|
---|
151 | uint32_t iWriteback;
|
---|
152 | uint32_t cbWriteback;
|
---|
153 | } CRVBOXHGSMIWRITEREAD;
|
---|
154 |
|
---|
155 | /** GUEST_FN_SET_VERSION Parameters structure. */
|
---|
156 | typedef struct
|
---|
157 | {
|
---|
158 | CRVBOXHGSMIHDR hdr;
|
---|
159 |
|
---|
160 | /** 32bit, in
|
---|
161 | * Major version
|
---|
162 | */
|
---|
163 | uint32_t vMajor;
|
---|
164 |
|
---|
165 | /** 32bit, in
|
---|
166 | * Minor version
|
---|
167 | */
|
---|
168 | uint32_t vMinor;
|
---|
169 | } CRVBOXHGSMISETVERSION;
|
---|
170 |
|
---|
171 | /** GUEST_FN_INJECT Parameters structure. */
|
---|
172 | typedef struct
|
---|
173 | {
|
---|
174 | CRVBOXHGSMIHDR hdr;
|
---|
175 |
|
---|
176 | /** 32bit, in
|
---|
177 | * ClientID to inject commands buffer for
|
---|
178 | */
|
---|
179 | uint32_t u32ClientID;
|
---|
180 | /** buffer index, in
|
---|
181 | * Data buffer
|
---|
182 | */
|
---|
183 | uint32_t iBuffer;
|
---|
184 | } CRVBOXHGSMIINJECT;
|
---|
185 |
|
---|
186 | /** GUEST_FN_SET_PID Parameters structure. */
|
---|
187 | typedef struct
|
---|
188 | {
|
---|
189 | CRVBOXHGSMIHDR hdr;
|
---|
190 |
|
---|
191 | /** 64bit, in
|
---|
192 | * PID
|
---|
193 | */
|
---|
194 | uint64_t u64PID;
|
---|
195 | } CRVBOXHGSMISETPID;
|
---|
196 |
|
---|
197 | #pragma pack()
|
---|
198 | #endif
|
---|
199 | /**
|
---|
200 | * SHCRGL_GUEST_FN_WRITE
|
---|
201 | */
|
---|
202 |
|
---|
203 | /** GUEST_FN_WRITE Parameters structure. */
|
---|
204 | typedef struct
|
---|
205 | {
|
---|
206 | VBoxGuestHGCMCallInfo hdr;
|
---|
207 |
|
---|
208 | /** pointer, in
|
---|
209 | * Data buffer
|
---|
210 | */
|
---|
211 | HGCMFunctionParameter pBuffer;
|
---|
212 | } CRVBOXHGCMWRITE;
|
---|
213 |
|
---|
214 | /** GUEST_FN_READ Parameters structure. */
|
---|
215 | typedef struct
|
---|
216 | {
|
---|
217 | VBoxGuestHGCMCallInfo hdr;
|
---|
218 |
|
---|
219 | /** pointer, in/out
|
---|
220 | * Data buffer
|
---|
221 | */
|
---|
222 | HGCMFunctionParameter pBuffer;
|
---|
223 |
|
---|
224 | /** 32bit, out
|
---|
225 | * Count of bytes written to buffer
|
---|
226 | */
|
---|
227 | HGCMFunctionParameter cbBuffer;
|
---|
228 |
|
---|
229 | } CRVBOXHGCMREAD;
|
---|
230 |
|
---|
231 | /** GUEST_FN_WRITE_READ Parameters structure. */
|
---|
232 | typedef struct
|
---|
233 | {
|
---|
234 | VBoxGuestHGCMCallInfo hdr;
|
---|
235 |
|
---|
236 | /** pointer, in
|
---|
237 | * Data buffer
|
---|
238 | */
|
---|
239 | HGCMFunctionParameter pBuffer;
|
---|
240 |
|
---|
241 | /** pointer, out
|
---|
242 | * Writeback buffer
|
---|
243 | */
|
---|
244 | HGCMFunctionParameter pWriteback;
|
---|
245 |
|
---|
246 | /** 32bit, out
|
---|
247 | * Count of bytes written to writeback buffer
|
---|
248 | */
|
---|
249 | HGCMFunctionParameter cbWriteback;
|
---|
250 |
|
---|
251 | } CRVBOXHGCMWRITEREAD;
|
---|
252 |
|
---|
253 | /** GUEST_FN_SET_VERSION Parameters structure. */
|
---|
254 | typedef struct
|
---|
255 | {
|
---|
256 | VBoxGuestHGCMCallInfo hdr;
|
---|
257 |
|
---|
258 | /** 32bit, in
|
---|
259 | * Major version
|
---|
260 | */
|
---|
261 | HGCMFunctionParameter vMajor;
|
---|
262 |
|
---|
263 | /** 32bit, in
|
---|
264 | * Minor version
|
---|
265 | */
|
---|
266 | HGCMFunctionParameter vMinor;
|
---|
267 |
|
---|
268 | } CRVBOXHGCMSETVERSION;
|
---|
269 |
|
---|
270 | /** GUEST_FN_INJECT Parameters structure. */
|
---|
271 | typedef struct
|
---|
272 | {
|
---|
273 | VBoxGuestHGCMCallInfo hdr;
|
---|
274 |
|
---|
275 | /** 32bit, in
|
---|
276 | * ClientID to inject commands buffer for
|
---|
277 | */
|
---|
278 | HGCMFunctionParameter u32ClientID;
|
---|
279 | /** pointer, in
|
---|
280 | * Data buffer
|
---|
281 | */
|
---|
282 | HGCMFunctionParameter pBuffer;
|
---|
283 | } CRVBOXHGCMINJECT;
|
---|
284 |
|
---|
285 | /** GUEST_FN_SET_PID Parameters structure. */
|
---|
286 | typedef struct
|
---|
287 | {
|
---|
288 | VBoxGuestHGCMCallInfo hdr;
|
---|
289 |
|
---|
290 | /** 64bit, in
|
---|
291 | * PID
|
---|
292 | */
|
---|
293 | HGCMFunctionParameter u64PID;
|
---|
294 | } CRVBOXHGCMSETPID;
|
---|
295 |
|
---|
296 | /** GUEST_FN_WRITE_BUFFER Parameters structure. */
|
---|
297 | typedef struct
|
---|
298 | {
|
---|
299 | VBoxGuestHGCMCallInfo hdr;
|
---|
300 |
|
---|
301 | /** 32bit, in/out
|
---|
302 | * Buffer id, 0 means host have to allocate one
|
---|
303 | */
|
---|
304 | HGCMFunctionParameter iBufferID;
|
---|
305 |
|
---|
306 | /** 32bit, in
|
---|
307 | * Buffer size
|
---|
308 | */
|
---|
309 | HGCMFunctionParameter cbBufferSize;
|
---|
310 |
|
---|
311 | /** 32bit, in
|
---|
312 | * Write offset in buffer
|
---|
313 | */
|
---|
314 | HGCMFunctionParameter ui32Offset;
|
---|
315 |
|
---|
316 | /** pointer, in
|
---|
317 | * Data buffer
|
---|
318 | */
|
---|
319 | HGCMFunctionParameter pBuffer;
|
---|
320 |
|
---|
321 | } CRVBOXHGCMWRITEBUFFER;
|
---|
322 |
|
---|
323 | /** GUEST_FN_WRITE_READ_BUFFERED Parameters structure. */
|
---|
324 | typedef struct
|
---|
325 | {
|
---|
326 | VBoxGuestHGCMCallInfo hdr;
|
---|
327 |
|
---|
328 | /** 32bit, in
|
---|
329 | * Buffer id.
|
---|
330 | */
|
---|
331 | HGCMFunctionParameter iBufferID;
|
---|
332 |
|
---|
333 | /** pointer, out
|
---|
334 | * Writeback buffer
|
---|
335 | */
|
---|
336 | HGCMFunctionParameter pWriteback;
|
---|
337 |
|
---|
338 | /** 32bit, out
|
---|
339 | * Count of bytes written to writeback buffer
|
---|
340 | */
|
---|
341 | HGCMFunctionParameter cbWriteback;
|
---|
342 |
|
---|
343 | } CRVBOXHGCMWRITEREADBUFFERED;
|
---|
344 |
|
---|
345 | #endif
|
---|