VirtualBox

source: vbox/trunk/include/VBox/HostServices/VBoxCrOpenGLSvc.h@ 50305

Last change on this file since 50305 was 50251, checked in by vboxsync, 11 years ago

crOpenGL: disable some async notifications for now

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

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette