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