VirtualBox

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

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

crOpenGL: improved GPU data acwuisition mechanism for VRDP (disabled still)

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

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