VirtualBox

source: vbox/trunk/src/VBox/GuestHost/OpenGL/include/cr_server.h@ 46288

Last change on this file since 46288 was 46173, checked in by vboxsync, 12 years ago

crOpenGL: proper support for GL_NONE,AUX,etc. for offscreen rendering

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 21.0 KB
Line 
1/* Copyright (c) 2001, Stanford University
2 * All rights reserved.
3 *
4 * See the file LICENSE.txt for information on redistributing this software.
5 */
6
7#ifndef INCLUDE_CR_SERVER_H
8#define INCLUDE_CR_SERVER_H
9
10#include "cr_spu.h"
11#include "cr_net.h"
12#include "cr_hash.h"
13#include "cr_protocol.h"
14#include "cr_glstate.h"
15#include "cr_vreg.h"
16#include "cr_blitter.h"
17#include "spu_dispatch_table.h"
18
19#include "state/cr_currentpointers.h"
20
21#include <iprt/types.h>
22#include <iprt/err.h>
23#include <iprt/string.h>
24#include <iprt/list.h>
25#include <iprt/thread.h>
26#include <iprt/critsect.h>
27#include <iprt/semaphore.h>
28
29#include <VBox/vmm/ssm.h>
30
31#ifdef VBOX_WITH_CRHGSMI
32# include <VBox/VBoxVideo.h>
33#endif
34#include <VBox/Hardware/VBoxVideoVBE.h>
35
36#include "cr_vreg.h"
37
38#ifdef __cplusplus
39extern "C" {
40#endif
41
42#define CR_MAX_WINDOWS 100
43#define CR_MAX_CLIENTS 64
44
45/*@todo must match MaxGuestMonitors from SchemaDefs.h*/
46#define CR_MAX_GUEST_MONITORS VBOX_VIDEO_MAX_SCREENS
47
48typedef DECLCALLBACKPTR(void, PFNCRSERVERPRESENTFBO) (void *data, int32_t screenId, int32_t x, int32_t y, uint32_t w, uint32_t h);
49
50/* Callbacks for output of the rendered frames.
51 *
52 * This allows to pass rendered frames to an external component rather than draw them on screen.
53 *
54 * An external component registers the redirection callbacks using crVBoxServerOutputRedirectSet.
55 *
56 * The list of formats supported by the caller is obtained using CRORContextProperty.
57 * The actual format choosed by the service is passed as a CRORBegin parameter.
58 */
59typedef struct {
60 const void *pvContext; /* Supplied by crVBoxServerOutputRedirectSet. */
61 DECLR3CALLBACKMEMBER(void, CRORBegin, (const void *pvContext, void **ppvInstance,
62 const char *pszFormat));
63 DECLR3CALLBACKMEMBER(void, CRORGeometry, (void *pvInstance,
64 int32_t x, int32_t y, uint32_t w, uint32_t h));
65 DECLR3CALLBACKMEMBER(void, CRORVisibleRegion, (void *pvInstance,
66 uint32_t cRects, const RTRECT *paRects));
67 DECLR3CALLBACKMEMBER(void, CRORFrame, (void *pvInstance,
68 void *pvData, uint32_t cbData));
69 DECLR3CALLBACKMEMBER(void, CROREnd, (void *pvInstance));
70 DECLR3CALLBACKMEMBER(int, CRORContextProperty, (const void *pvContext, uint32_t index,
71 void *pvBuffer, uint32_t cbBuffer, uint32_t *pcbOut));
72} CROutputRedirect;
73
74typedef struct {
75 CRrecti imagewindow; /**< coordinates in mural space */
76 CRrectf bounds; /**< normalized coordinates in [-1,-1] x [1,1] */
77 CRrecti outputwindow; /**< coordinates in server's rendering window */
78 CRrecti clippedImagewindow; /**< imagewindow clipped to current viewport */
79 CRmatrix baseProjection; /**< pre-multiplied onto projection matrix */
80 CRrecti scissorBox; /**< passed to back-end OpenGL */
81 CRrecti viewport; /**< passed to back-end OpenGL */
82 GLuint serialNo; /**< an optimization */
83} CRExtent;
84
85struct BucketingInfo;
86
87typedef struct {
88 char *pszDpyName;
89 GLint visualBits;
90 int32_t externalID;
91} CRCreateInfo_t;
92
93
94/* VRAM->RAM worker thread */
95
96typedef enum
97{
98 CR_SERVER_RPW_STATE_UNINITIALIZED = 0,
99 CR_SERVER_RPW_STATE_INITIALIZING,
100 CR_SERVER_RPW_STATE_INITIALIZED,
101 CR_SERVER_RPW_STATE_UNINITIALIZING,
102} CR_SERVER_RPW_STATE;
103
104/* worker control command */
105typedef enum
106{
107 CR_SERVER_RPW_CTL_TYPE_UNDEFINED = 0,
108 CR_SERVER_RPW_CTL_TYPE_WAIT_COMPLETE,
109 CR_SERVER_RPW_CTL_TYPE_TERM
110} CR_SERVER_RPW_CTL_TYPE;
111
112struct CR_SERVER_RPW_ENTRY;
113
114typedef struct CR_SERVER_RPW_CTL {
115 CR_SERVER_RPW_CTL_TYPE enmType;
116 int rc;
117 RTSEMEVENT hCompleteEvent;
118 /* valid for *_WAIT_COMPLETE and *_CANCEL */
119 struct CR_SERVER_RPW_ENTRY *pEntry;
120} CR_SERVER_RPW_CTL;
121
122
123struct CR_SERVER_RPW_ENTRY;
124
125typedef DECLCALLBACKPTR(void, PFNCR_SERVER_RPW_DATA) (const struct CR_SERVER_RPW_ENTRY* pEntry, void *pvEntryTexData);
126
127typedef DECLCALLBACKPTR(void, PFNCRSERVERNOTIFYEVENT) (int32_t screenId, uint32_t uEvent, void*pvData);
128
129typedef struct CR_SERVER_RPW_ENTRY
130{
131 RTRECTSIZE Size;
132 /* We have to use 4 textures here.
133 *
134 * 1. iDrawTex - the texture clients can draw to and then submit it for contents acquisition via crServerRpwEntrySubmit
135 * 2. iSubmittedTex - the texture submitted to the worker for processing and, whose processing has not start yet,
136 * i.e. it is being in the queue and can be safely removed/replaced [from] there
137 * 3. iWorkerTex - the texture being prepared & passed by the worker to the GPU (stage 1 of a worker contents acquisition process)
138 * 4. iGpuTex - the texture passed/processed to/by the GPU, whose data is then acquired by the server (stage 2 of a worker contents acquisition process)
139 *
140 * - There can be valid distinct iGpuTex, iWorkerTex, iSubmittedTex and iDrawTex present simultaneously.
141 * - Either or both of iSubmittedTex and iFreeTex are always valid
142 *
143 * Detail:
144 *
145 * - iSubmittedTex and iFreeTex modifications are performed under CR_SERVER_RPW::CritSect lock.
146 *
147 * - iDrawTex can only be changed by client side (i.e. the crServerRpwEntrySubmit caller), this is why client thread can access it w/o a lock
148 * - iSubmittedTex and iFreeTex can be modified by both client and worker, so lock is always required
149 *
150 * - iDrawTex can be accessed by client code only
151 * - iWorkerTex and iGpuTex can be accessed by worker code only
152 * - iSubmittedTex and iFreeTex can be accessed under CR_SERVER_RPW::CritSect lock only
153 * - either or both of iSubmittedTex and iFreeTex are always valid (see below for more explanation),
154 * this is why client can easily determine the new iDrawTex value on Submit, i.e. :
155 *
156 * (if initial iSubmittedTex was valid)
157 * ---------------
158 * | ^
159 * > |
160 * Submit-> iDrawTex -> iSubmittedTex
161 * ^
162 * | (if initial iSubmittedTex was NOT valid)
163 * iFreeTex
164 *
165 * - The worker can invalidate the iSubmittedTex (i.e. do iSubmittedTex -> iWorkerTex) only after it is done
166 * with the last iWorkerTex -> iGpuTex transformation freeing the previously used iGpuTex to iFreeTex.
167 *
168 * - A simplified worker iXxxTex transformation logic is:
169 * 1. iFreeTex is initially valid
170 * 2. iSubmittedTex -> iWorkerTex;
171 * 3. submit iWorkerTex acquire request to the GPU
172 * 4. complete current iGpuTex
173 * 5. iGpuTex -> iFreeTex
174 * 6. iWorkerTex -> iGpuTex
175 * 7. goto 1
176 *
177 * */
178 int8_t iTexDraw;
179 int8_t iTexSubmitted;
180 int8_t iTexWorker;
181 int8_t iTexGpu;
182 int8_t iCurPBO;
183 GLuint aidWorkerTexs[4];
184 GLuint aidPBOs[2];
185 RTLISTNODE WorkEntry;
186 RTLISTNODE WorkerWorkEntry;
187 RTLISTNODE GpuSubmittedEntry;
188 PFNCR_SERVER_RPW_DATA pfnData;
189} CR_SERVER_RPW_ENTRY;
190
191typedef struct CR_SERVER_RPW {
192 RTLISTNODE WorkList;
193 RTCRITSECT CritSect;
194 RTSEMEVENT hSubmitEvent;
195 /* only one outstanding command is supported,
196 * and ctl requests must be cynchronized, hold it right here */
197 CR_SERVER_RPW_CTL Ctl;
198 int ctxId;
199 GLint ctxVisBits;
200 RTTHREAD hThread;
201} CR_SERVER_RPW;
202/* */
203
204
205/**
206 * Mural info
207 */
208typedef struct {
209 GLuint width, height;
210 GLint gX, gY; /*guest coordinates*/
211 GLint hX, hY; /*host coordinates, screenID related*/
212
213 int spuWindow; /*the SPU's corresponding window ID */
214
215 int screenId;
216
217 GLboolean bVisible; /*guest window is visible*/
218 GLubyte u8Unused; /*redirect to FBO instead of real host window*/
219 GLboolean bFbDraw; /*GL_FRONT buffer is drawn to directly*/
220 GLboolean fDataPresented;
221
222 GLint cVisibleRects; /*count of visible rects*/
223 GLint *pVisibleRects; /*visible rects left, top, right, bottom*/
224 GLboolean bReceivedRects; /*indicates if guest did any updates for visible regions*/
225
226 GLuint cBuffers;
227 GLuint iBbBuffer;
228 GLuint aidFBOs[2];
229 GLuint aidColorTexs[2];
230
231 void *pvOutputRedirectInstance;
232
233 CRCreateInfo_t CreateInfo;
234
235 /* to avoid saved state breakage we need to keep RT_OFFSETOF(CRMuralInfo, CreateInfo) intact
236 * this is why we place some FBO stuff to the tail
237 * @todo: once we need to increment a saved state version, we could refactor this structure */
238 GLint iCurDrawBuffer;
239 GLint iCurReadBuffer;
240
241 GLuint idDepthStencilRB;
242 GLuint fboWidth, fboHeight;
243 GLuint idPBO;
244
245 GLuint cDisabled;
246
247 GLuint fPresentMode; /*redirect to FBO instead of real host window*/
248
249 GLboolean fHasParentWindow;
250
251 GLboolean fRootVrOn;
252 GLboolean fForcePresentState;
253
254 VBOXVR_SCR_COMPOSITOR_ENTRY CEntry;
255 VBOXVR_SCR_COMPOSITOR Compositor;
256
257 /* if root Visible regions are set, these two contain actual regions being passed to render spu */
258 VBOXVR_SCR_COMPOSITOR_ENTRY RootVrCEntry;
259 VBOXVR_SCR_COMPOSITOR RootVrCompositor;
260
261 CR_SERVER_RPW_ENTRY RpwEntry;
262
263 /* bitfield representing contexts the mural has been ever current with
264 * we just reuse CR_STATE_SHAREDOBJ_USAGE_XXX API here for simplicity */
265 CRbitvalue ctxUsage[CR_MAX_BITARRAY];
266} CRMuralInfo;
267
268typedef struct {
269 CRContext *pContext;
270 int SpuContext;
271 CRCreateInfo_t CreateInfo;
272 CRMuralInfo * currentMural;
273} CRContextInfo;
274
275/**
276 * A client is basically an upstream Cr Node (connected via mothership)
277 */
278typedef struct _crclient {
279 int spu_id; /**< id of the last SPU in the client's SPU chain */
280 CRConnection *conn; /**< network connection from the client */
281 int number; /**< a unique number for each client */
282 uint64_t pid; /*guest pid*/
283 GLint currentContextNumber;
284 CRContextInfo *currentCtxInfo;
285 GLint currentWindow;
286 CRMuralInfo *currentMural;
287 GLint windowList[CR_MAX_WINDOWS];
288 GLint contextList[CR_MAX_CONTEXTS];
289#ifdef VBOXCR_LOGFPS
290 uint64_t timeUsed;
291#endif
292} CRClient;
293
294typedef struct _crclientnode {
295 CRClient *pClient;
296 struct _crclientnode *prev, *next;
297} CRClientNode;
298
299typedef struct CRPoly_t {
300 int npoints;
301 double *points;
302 struct CRPoly_t *next;
303} CRPoly;
304
305/**
306 * There's one of these run queue entries per client
307 * The run queue is a circular, doubly-linked list of these objects.
308 */
309typedef struct RunQueue_t {
310 CRClient *client;
311 int blocked;
312 struct RunQueue_t *next;
313 struct RunQueue_t *prev;
314} RunQueue;
315
316typedef struct {
317 GLint freeWindowID;
318 GLint freeContextID;
319 GLint freeClientID;
320} CRServerFreeIDsPool_t;
321
322typedef struct {
323 int32_t x, y;
324 uint32_t w, h;
325 uint64_t winID;
326} CRScreenInfo;
327
328typedef struct {
329 int32_t x, y;
330 uint32_t w, h;
331} CRScreenViewportInfo;
332
333
334/* DISPLAY */
335
336typedef struct CR_DISPLAY_ENTRY
337{
338 VBOXVR_SCR_COMPOSITOR_ENTRY CEntry;
339} CR_DISPLAY_ENTRY, *PCR_DISPLAY_ENTRY;
340
341/* @todo:
342 * 1. use compositor stored inside mural to use current MuralFBO and window-related API
343 * 2. CR_SERVER_REDIR_F_NONE and CR_SERVER_REDIR_F_FBO should be trated identically for presented window
344 * since we just need to blit the given textures to it if we are NOT in CR_SERVER_REDIR_F_FBO_RAM mode */
345typedef struct CR_DISPLAY
346{
347 VBOXVR_SCR_COMPOSITOR Compositor;
348 CRMuralInfo Mural;
349} CR_DISPLAY, *PCR_DISPLAY;
350
351int CrDpInit(PCR_DISPLAY pDisplay);
352void CrDpTerm(PCR_DISPLAY pDisplay);
353void CrDpResize(PCR_DISPLAY pDisplay, uint32_t width, uint32_t height,
354 uint32_t stretchedWidth, uint32_t stretchedHeight);
355void CrDpEntryInit(PCR_DISPLAY_ENTRY pEntry, const VBOXVR_TEXTURE *pTextureData);
356void CrDpEntryCleanup(PCR_DISPLAY pDisplay, PCR_DISPLAY_ENTRY pEntry);
357int CrDpEntryRegionsSet(PCR_DISPLAY pDisplay, PCR_DISPLAY_ENTRY pEntry, const RTPOINT *pPos, uint32_t cRegions, const RTRECT *paRegions);
358int CrDpEntryRegionsAdd(PCR_DISPLAY pDisplay, PCR_DISPLAY_ENTRY pEntry, const RTPOINT *pPos, uint32_t cRegions, const RTRECT *paRegions);
359int CrDpPresentEntry(PCR_DISPLAY pDisplay, PCR_DISPLAY_ENTRY pEntry);
360DECLINLINE(bool) CrDpEntryIsUsed(PCR_DISPLAY_ENTRY pEntry)
361{
362 return CrVrScrCompositorEntryIsInList(&pEntry->CEntry);
363}
364
365DECLINLINE(CRMuralInfo*) CrDpGetMural(PCR_DISPLAY pDisplay)
366{
367 return &pDisplay->Mural;
368}
369
370typedef struct CR_DISPLAY_ENTRY_MAP
371{
372 CRHashTable * pTextureMap;
373} CR_DISPLAY_ENTRY_MAP, *PCR_DISPLAY_ENTRY_MAP;
374
375int CrDemInit(PCR_DISPLAY_ENTRY_MAP pMap);
376void CrDemTerm(PCR_DISPLAY_ENTRY_MAP pMap);
377PCR_DISPLAY_ENTRY CrDemEntryGetCreate(PCR_DISPLAY_ENTRY_MAP pMap, GLuint idTexture, CRContextInfo *pCtxInfo);
378void CrDemEntryDestroy(PCR_DISPLAY_ENTRY_MAP pMap, GLuint idTexture);
379
380/* */
381
382/* helpers */
383
384void CrHlpFreeTexImage(CRContext *pCurCtx, GLuint idPBO, void *pvData);
385void* CrHlpGetTexImage(CRContext *pCurCtx, PVBOXVR_TEXTURE pTexture, GLuint idPBO, GLenum enmFormat);
386void CrHlpPutTexImage(CRContext *pCurCtx, PVBOXVR_TEXTURE pTexture, GLenum enmFormat, void *pvData);
387
388/* */
389
390/* BFB (BlitFramebuffer Blitter) flags
391 * so far only CR_SERVER_BFB_ON_ALWAIS is supported and is alwais used if any flag is set */
392#define CR_SERVER_BFB_DISABLED 0
393#define CR_SERVER_BFB_ON_INVERTED_BLIT 1
394#define CR_SERVER_BFB_ON_STRAIGHT_BLIT 2
395#define CR_SERVER_BFB_ON_ALWAIS (CR_SERVER_BFB_ON_INVERTED_BLIT | CR_SERVER_BFB_ON_STRAIGHT_BLIT)
396
397typedef struct {
398 unsigned short tcpip_port;
399
400 CRScreenInfo screen[CR_MAX_GUEST_MONITORS];
401 CRScreenViewportInfo screenVieport[CR_MAX_GUEST_MONITORS];
402 int screenCount;
403
404 int numClients;
405 CRClient *clients[CR_MAX_CLIENTS]; /**< array [numClients] */
406 CRClient *curClient;
407 CRClientNode *pCleanupClient; /*list of clients with pending clean up*/
408 CRCurrentStatePointers current;
409
410 GLboolean firstCallCreateContext;
411 GLboolean firstCallMakeCurrent;
412 GLboolean bIsInLoadingState; /* Indicates if we're in process of loading VM snapshot */
413 GLboolean bIsInSavingState; /* Indicates if we're in process of saving VM snapshot */
414 GLboolean bForceMakeCurrentOnClientSwitch;
415 CRContextInfo *currentCtxInfo;
416 GLint currentWindow;
417 GLint currentNativeWindow;
418 CRMuralInfo *currentMural;
419
420 CRHashTable *muralTable; /**< hash table where all murals are stored */
421
422 int client_spu_id;
423
424 int mtu;
425 int buffer_size;
426 char protocol[1024];
427
428 SPU *head_spu;
429 SPUDispatchTable dispatch;
430
431 CRNetworkPointer return_ptr;
432 CRNetworkPointer writeback_ptr;
433
434 CRLimitsState limits; /**< GL limits for any contexts we create */
435
436 CRContextInfo MainContextInfo;
437
438 CRHashTable *contextTable; /**< hash table for rendering contexts */
439
440 CRHashTable *programTable; /**< for vertex programs */
441 GLuint currentProgram;
442
443 /* visBits -> dummy mural association */
444 CRHashTable *dummyMuralTable;
445
446 GLboolean fRootVrOn;
447 VBOXVR_LIST RootVr;
448 /* we need to translate Root Vr to each window coords, this one cpecifies the current translation point
449 * note that since window attributes modifications is performed in HGCM thread only and thus is serialized,
450 * we deal with the global RootVr data directly */
451 RTPOINT RootVrCurPoint;
452
453 /* blitter so far used for working around host drivers BlitFramebuffer bugs
454 * by implementing */
455 uint32_t fBlitterMode;
456 CR_BLITTER Blitter;
457
458 CR_SERVER_RPW RpwWorker;
459
460 /** configuration options */
461 /*@{*/
462 int useL2;
463 int ignore_papi;
464 unsigned int maxBarrierCount;
465 unsigned int clearCount;
466 int optimizeBucket;
467 int only_swap_once;
468 int debug_barriers;
469 int sharedDisplayLists;
470 int sharedTextureObjects;
471 int sharedPrograms;
472 int sharedWindows;
473 int uniqueWindows;
474 int localTileSpec;
475 int useDMX;
476 int overlapBlending;
477 int vpProjectionMatrixParameter;
478 const char *vpProjectionMatrixVariable;
479 int stereoView;
480 int vncMode; /* cmd line option */
481 /*@}*/
482 /** view_matrix config */
483 /*@{*/
484 GLboolean viewOverride;
485 CRmatrix viewMatrix[2]; /**< left and right eye */
486 /*@}*/
487 /** projection_matrix config */
488 /*@{*/
489 GLboolean projectionOverride;
490 CRmatrix projectionMatrix[2]; /**< left and right eye */
491 int currentEye;
492 /*@}*/
493
494 /** for warped tiles */
495 /*@{*/
496 GLfloat alignment_matrix[16], unnormalized_alignment_matrix[16];
497 /*@}*/
498
499 /** tile overlap/blending info - this should probably be per-mural */
500 /*@{*/
501 CRPoly **overlap_geom;
502 CRPoly *overlap_knockout;
503 float *overlap_intens;
504 int num_overlap_intens;
505 int num_overlap_levels;
506 /*@}*/
507
508 CRHashTable *barriers, *semaphores;
509
510 RunQueue *run_queue;
511
512 GLuint currentSerialNo;
513
514 PFNCRSERVERPRESENTFBO pfnPresentFBO;
515 GLuint fPresentMode; /*Force server to render 3d data offscreen
516 *using callback above to update vbox framebuffers*/
517 GLuint fPresentModeDefault; /*can be set with CR_SERVER_DEFAULT_RENDER_TYPE*/
518 GLuint fVramPresentModeDefault;
519 GLboolean bUsePBOForReadback; /*Use PBO's for data readback*/
520
521 GLboolean bUseOutputRedirect; /* Whether the output redirect was set. */
522 CROutputRedirect outputRedirect;
523
524 GLboolean bUseMultipleContexts;
525
526 GLboolean bWindowsInitiallyHidden;
527
528 uint32_t NotifyEventMap[(CR_MAX_GUEST_MONITORS + 31)/32];
529 uint32_t cDisableEvent;
530 PFNCRSERVERNOTIFYEVENT pfnNotifyEventCB;
531
532 /* @todo: should we use just one blitter?
533 * we use two currently because the drawable attribs can differ*/
534 CR_DISPLAY_ENTRY_MAP PresentTexturepMap;
535 uint32_t DisplaysInitMap[(CR_MAX_GUEST_MONITORS + 31)/32];
536 CR_DISPLAY aDispplays[CR_MAX_GUEST_MONITORS];
537} CRServer;
538
539
540extern DECLEXPORT(void) crServerInit( int argc, char *argv[] );
541extern DECLEXPORT(int) CRServerMain( int argc, char *argv[] );
542extern DECLEXPORT(void) crServerServiceClients(void);
543extern DECLEXPORT(void) crServerAddNewClient(void);
544extern DECLEXPORT(SPU*) crServerHeadSPU(void);
545extern DECLEXPORT(void) crServerSetPort(int port);
546
547extern DECLEXPORT(GLboolean) crVBoxServerInit(void);
548extern DECLEXPORT(void) crVBoxServerTearDown(void);
549extern DECLEXPORT(int32_t) crVBoxServerAddClient(uint32_t u32ClientID);
550extern DECLEXPORT(void) crVBoxServerRemoveClient(uint32_t u32ClientID);
551extern DECLEXPORT(int32_t) crVBoxServerClientWrite(uint32_t u32ClientID, uint8_t *pBuffer, uint32_t cbBuffer);
552extern DECLEXPORT(int32_t) crVBoxServerClientRead(uint32_t u32ClientID, uint8_t *pBuffer, uint32_t *pcbBuffer);
553extern DECLEXPORT(int32_t) crVBoxServerClientSetVersion(uint32_t u32ClientID, uint32_t vMajor, uint32_t vMinor);
554extern DECLEXPORT(int32_t) crVBoxServerClientSetPID(uint32_t u32ClientID, uint64_t pid);
555
556extern DECLEXPORT(int32_t) crVBoxServerSaveState(PSSMHANDLE pSSM);
557extern DECLEXPORT(int32_t) crVBoxServerLoadState(PSSMHANDLE pSSM, uint32_t version);
558
559extern DECLEXPORT(int32_t) crVBoxServerSetScreenCount(int sCount);
560extern DECLEXPORT(int32_t) crVBoxServerUnmapScreen(int sIndex);
561extern DECLEXPORT(int32_t) crVBoxServerMapScreen(int sIndex, int32_t x, int32_t y, uint32_t w, uint32_t h, uint64_t winID);
562extern DECLEXPORT(void) crServerVBoxCompositionSetEnableStateGlobal(GLboolean fEnable);
563extern DECLEXPORT(int32_t) crVBoxServerSetRootVisibleRegion(GLint cRects, const RTRECT *pRects);
564
565extern DECLEXPORT(void) crVBoxServerSetPresentFBOCB(PFNCRSERVERPRESENTFBO pfnPresentFBO);
566
567extern DECLEXPORT(int32_t) crVBoxServerSetOffscreenRendering(GLboolean value);
568
569extern DECLEXPORT(int32_t) crVBoxServerOutputRedirectSet(const CROutputRedirect *pCallbacks);
570
571extern DECLEXPORT(int32_t) crVBoxServerSetScreenViewport(int sIndex, int32_t x, int32_t y, uint32_t w, uint32_t h);
572
573extern DECLEXPORT(void) crServerVBoxSetNotifyEventCB(PFNCRSERVERNOTIFYEVENT pfnCb);
574
575#ifdef VBOX_WITH_CRHGSMI
576/* We moved all CrHgsmi command processing to crserverlib to keep the logic of dealing with CrHgsmi commands in one place.
577 *
578 * For now we need the notion of CrHgdmi commands in the crserver_lib to be able to complete it asynchronously once it is really processed.
579 * This help avoiding the "blocked-client" issues. The client is blocked if another client is doing begin-end stuff.
580 * For now we eliminated polling that could occur on block, which caused a higher-priority thread (in guest) polling for the blocked command complition
581 * to block the lower-priority thread trying to complete the blocking command.
582 * And removed extra memcpy done on blocked command arrival.
583 *
584 * In the future we will extend CrHgsmi functionality to maintain texture data directly in CrHgsmi allocation to avoid extra memcpy-ing with PBO,
585 * implement command completion and stuff necessary for GPU scheduling to work properly for WDDM Windows guests, etc.
586 *
587 * NOTE: it is ALWAYS responsibility of the crVBoxServerCrHgsmiCmd to complete the command!
588 * */
589extern DECLEXPORT(int32_t) crVBoxServerCrHgsmiCmd(struct VBOXVDMACMD_CHROMIUM_CMD *pCmd, uint32_t cbCmd);
590extern DECLEXPORT(int32_t) crVBoxServerCrHgsmiCtl(struct VBOXVDMACMD_CHROMIUM_CTL *pCtl, uint32_t cbCtl);
591#endif
592
593#ifdef __cplusplus
594}
595#endif
596
597#endif
598
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