VirtualBox

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

Last change on this file since 78375 was 78375, checked in by vboxsync, 6 years ago

Additions/common/crOpengl,GuestHost/OpenGL,HostServices/SharedOpenGL: Eliminate all global variables from the state tracker library (state_tracker) in preparation of the SPU DLL merging, bugref:9435

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision
File size: 20.8 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 "cr_htable.h"
18#include "cr_unpack.h"
19#include "spu_dispatch_table.h"
20#include "cr_dump.h"
21
22#include "state/cr_currentpointers.h"
23
24#include <iprt/types.h>
25#include <iprt/err.h>
26#include <iprt/string.h>
27#include <iprt/list.h>
28#include <iprt/thread.h>
29#include <iprt/critsect.h>
30#include <iprt/semaphore.h>
31#include <iprt/memcache.h>
32
33#include <VBox/vmm/ssm.h>
34
35#include <VBoxVideo.h>
36#include <VBoxVideoVBE.h>
37#include <VBoxVideo3D.h>
38#include <VBoxVideoHost3D.h>
39
40#ifdef __cplusplus
41extern "C" {
42#endif
43
44#define CR_MAX_WINDOWS 100
45#define CR_MAX_CLIENTS 64
46
47/** @todo must match MaxGuestMonitors from SchemaDefs.h*/
48#define CR_MAX_GUEST_MONITORS VBOX_VIDEO_MAX_SCREENS
49
50typedef DECLCALLBACKPTR(void, PFNCRSERVERPRESENTFBO) (void *data, int32_t screenId, int32_t x, int32_t y, uint32_t w, uint32_t h);
51
52/* Callbacks for output of the rendered frames.
53 *
54 * This allows to pass rendered frames to an external component rather than draw them on screen.
55 *
56 * An external component registers the redirection callbacks using crVBoxServerOutputRedirectSet.
57 *
58 * The list of formats supported by the caller is obtained using CRORContextProperty.
59 * The actual format choosed by the service is passed as a CRORBegin parameter.
60 */
61typedef struct {
62 const void *pvContext; /* Supplied by crVBoxServerOutputRedirectSet. */
63 DECLR3CALLBACKMEMBER(void, CRORBegin, (const void *pvContext, void **ppvInstance,
64 const char *pszFormat));
65 DECLR3CALLBACKMEMBER(void, CRORGeometry, (void *pvInstance,
66 int32_t x, int32_t y, uint32_t w, uint32_t h));
67 DECLR3CALLBACKMEMBER(void, CRORVisibleRegion, (void *pvInstance,
68 uint32_t cRects, const RTRECT *paRects));
69 DECLR3CALLBACKMEMBER(void, CRORFrame, (void *pvInstance,
70 void *pvData, uint32_t cbData));
71 DECLR3CALLBACKMEMBER(void, CROREnd, (void *pvInstance));
72 DECLR3CALLBACKMEMBER(int, CRORContextProperty, (const void *pvContext, uint32_t index,
73 void *pvBuffer, uint32_t cbBuffer, uint32_t *pcbOut));
74} CROutputRedirect;
75
76typedef struct {
77 CRrecti imagewindow; /**< coordinates in mural space */
78 CRrectf bounds; /**< normalized coordinates in [-1,-1] x [1,1] */
79 CRrecti outputwindow; /**< coordinates in server's rendering window */
80 CRrecti clippedImagewindow; /**< imagewindow clipped to current viewport */
81 CRmatrix baseProjection; /**< pre-multiplied onto projection matrix */
82 CRrecti scissorBox; /**< passed to back-end OpenGL */
83 CRrecti viewport; /**< passed to back-end OpenGL */
84 GLuint serialNo; /**< an optimization */
85} CRExtent;
86
87struct BucketingInfo;
88
89typedef struct {
90 char *pszDpyName;
91 GLint visualBits;
92 int32_t externalID;
93} CRCreateInfo_t;
94
95typedef struct {
96 char *pszDpyName;
97 int32_t externalID;
98 GLint requestedVisualBits;
99 GLint realVisualBits;
100} CRCreateInfoEx_t;
101
102/* VRAM->RAM worker thread */
103
104typedef enum
105{
106 CR_SERVER_RPW_STATE_UNINITIALIZED = 0,
107 CR_SERVER_RPW_STATE_INITIALIZING,
108 CR_SERVER_RPW_STATE_INITIALIZED,
109 CR_SERVER_RPW_STATE_UNINITIALIZING,
110} CR_SERVER_RPW_STATE;
111
112/* worker control command */
113typedef enum
114{
115 CR_SERVER_RPW_CTL_TYPE_UNDEFINED = 0,
116 CR_SERVER_RPW_CTL_TYPE_WAIT_COMPLETE,
117 CR_SERVER_RPW_CTL_TYPE_TERM
118} CR_SERVER_RPW_CTL_TYPE;
119
120struct CR_SERVER_RPW_ENTRY;
121
122typedef struct CR_SERVER_RPW_CTL {
123 CR_SERVER_RPW_CTL_TYPE enmType;
124 int rc;
125 RTSEMEVENT hCompleteEvent;
126 /* valid for *_WAIT_COMPLETE and *_CANCEL */
127 struct CR_SERVER_RPW_ENTRY *pEntry;
128} CR_SERVER_RPW_CTL;
129
130
131struct CR_SERVER_RPW_ENTRY;
132
133typedef DECLCALLBACKPTR(void, PFNCR_SERVER_RPW_DATA) (const struct CR_SERVER_RPW_ENTRY* pEntry, void *pvEntryTexData);
134
135typedef DECLCALLBACKPTR(void, PFNCRSERVERNOTIFYEVENT) (int32_t screenId, uint32_t uEvent, void* pvData, uint32_t cbData);
136
137typedef struct CR_SERVER_RPW_ENTRY
138{
139 RTRECTSIZE Size;
140 /* We have to use 4 textures here.
141 *
142 * 1. iDrawTex - the texture clients can draw to and then submit it for contents acquisition via crServerRpwEntrySubmit
143 * 2. iSubmittedTex - the texture submitted to the worker for processing and, whose processing has not start yet,
144 * i.e. it is being in the queue and can be safely removed/replaced [from] there
145 * 3. iWorkerTex - the texture being prepared & passed by the worker to the GPU (stage 1 of a worker contents acquisition process)
146 * 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)
147 *
148 * - There can be valid distinct iGpuTex, iWorkerTex, iSubmittedTex and iDrawTex present simultaneously.
149 * - Either or both of iSubmittedTex and iFreeTex are always valid
150 *
151 * Detail:
152 *
153 * - iSubmittedTex and iFreeTex modifications are performed under CR_SERVER_RPW::CritSect lock.
154 *
155 * - 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
156 * - iSubmittedTex and iFreeTex can be modified by both client and worker, so lock is always required
157 *
158 * - iDrawTex can be accessed by client code only
159 * - iWorkerTex and iGpuTex can be accessed by worker code only
160 * - iSubmittedTex and iFreeTex can be accessed under CR_SERVER_RPW::CritSect lock only
161 * - either or both of iSubmittedTex and iFreeTex are always valid (see below for more explanation),
162 * this is why client can easily determine the new iDrawTex value on Submit, i.e. :
163 *
164 * (if initial iSubmittedTex was valid)
165 * ---------------
166 * | ^
167 * > |
168 * Submit-> iDrawTex -> iSubmittedTex
169 * ^
170 * | (if initial iSubmittedTex was NOT valid)
171 * iFreeTex
172 *
173 * - The worker can invalidate the iSubmittedTex (i.e. do iSubmittedTex -> iWorkerTex) only after it is done
174 * with the last iWorkerTex -> iGpuTex transformation freeing the previously used iGpuTex to iFreeTex.
175 *
176 * - A simplified worker iXxxTex transformation logic is:
177 * 1. iFreeTex is initially valid
178 * 2. iSubmittedTex -> iWorkerTex;
179 * 3. submit iWorkerTex acquire request to the GPU
180 * 4. complete current iGpuTex
181 * 5. iGpuTex -> iFreeTex
182 * 6. iWorkerTex -> iGpuTex
183 * 7. goto 1
184 *
185 * */
186 int8_t iTexDraw;
187 int8_t iTexSubmitted;
188 int8_t iTexWorker;
189 int8_t iTexGpu;
190 int8_t iCurPBO;
191 GLuint aidWorkerTexs[4];
192 GLuint aidPBOs[2];
193 RTLISTNODE WorkEntry;
194 RTLISTNODE WorkerWorkEntry;
195 RTLISTNODE GpuSubmittedEntry;
196 PFNCR_SERVER_RPW_DATA pfnData;
197} CR_SERVER_RPW_ENTRY;
198
199typedef struct CR_SERVER_RPW {
200 RTLISTNODE WorkList;
201 RTCRITSECT CritSect;
202 RTSEMEVENT hSubmitEvent;
203 /* only one outstanding command is supported,
204 * and ctl requests must be cynchronized, hold it right here */
205 CR_SERVER_RPW_CTL Ctl;
206 int ctxId;
207 GLint ctxVisBits;
208 RTTHREAD hThread;
209} CR_SERVER_RPW;
210/* */
211
212/* FRAMEBUFFER */
213typedef struct CR_FRAMEBUFFER *HCR_FRAMEBUFFER;
214typedef struct CR_FRAMEBUFFER_ENTRY *HCR_FRAMEBUFFER_ENTRY;
215/* */
216
217typedef struct CR_FBDATA
218{
219 HCR_FRAMEBUFFER hFb;
220 HCR_FRAMEBUFFER_ENTRY hFbEntry;
221 CR_TEXDATA* apTexDatas[2];
222} CR_FBDATA;
223/**
224 * Mural info
225 */
226typedef struct {
227 GLuint width, height;
228 GLint gX, gY; /*guest coordinates*/
229 GLint hX, hY; /*host coordinates, screenID related*/
230
231 int spuWindow; /*the SPU's corresponding window ID */
232
233 int screenId;
234
235 GLboolean bVisible; /*guest window is visible*/
236 GLubyte u8Unused; /*redirect to FBO instead of real host window*/
237 GLboolean bFbDraw; /*GL_FRONT buffer is drawn to directly*/
238 GLboolean fIsDummyRefference;
239
240 GLint cVisibleRects; /*count of visible rects*/
241 GLint *pVisibleRects; /*visible rects left, top, right, bottom*/
242 GLboolean bReceivedRects; /*indicates if guest did any updates for visible regions*/
243
244 GLuint cBuffers;
245 GLuint iBbBuffer;
246 GLuint aidFBOs[2];
247 GLuint aidColorTexs[2];
248
249 void *pvReserved;
250
251 CRCreateInfoEx_t CreateInfo;
252
253 /* to avoid saved state breakage we need to keep RT_OFFSETOF(CRMuralInfo, CreateInfo) intact
254 * this is why we place some FBO stuff to the tail
255 * @todo: once we need to increment a saved state version, we could refactor this structure */
256 GLint iCurDrawBuffer;
257 GLint iCurReadBuffer;
258
259 GLuint idDepthStencilRB;
260 GLuint fboWidth, fboHeight;
261
262 GLboolean fHasParentWindow;
263
264 GLboolean fRedirected;
265 GLboolean fForcePresentState;
266 GLboolean fOrPresentOnReenable;
267
268 GLboolean fIsVisible;
269
270 CR_TEXDATA aTexs[2];
271 uint32_t cUsedFBDatas;
272 CR_FBDATA *apUsedFBDatas[CR_MAX_GUEST_MONITORS];
273 CR_FBDATA aFBDatas[CR_MAX_GUEST_MONITORS];
274
275 /* bitfield representing contexts the mural has been ever current with
276 * we just reuse CR_STATE_SHAREDOBJ_USAGE_XXX API here for simplicity */
277 CRbitvalue ctxUsage[CR_MAX_BITARRAY];
278} CRMuralInfo;
279
280typedef struct {
281 CRContext *pContext;
282 int SpuContext;
283 CRCreateInfoEx_t CreateInfo;
284 CRMuralInfo * currentMural;
285} CRContextInfo;
286
287/**
288 * A client is basically an upstream Cr Node (connected via mothership)
289 */
290typedef struct _crclient {
291 int spu_id; /**< id of the last SPU in the client's SPU chain */
292 CRConnection *conn; /**< network connection from the client */
293 int number; /**< a unique number for each client */
294 uint64_t pid; /*guest pid*/
295 GLint currentContextNumber;
296 CRContextInfo *currentCtxInfo;
297 GLint currentWindow;
298 CRMuralInfo *currentMural;
299 GLint windowList[CR_MAX_WINDOWS];
300 GLint contextList[CR_MAX_CONTEXTS];
301#ifdef VBOXCR_LOGFPS
302 uint64_t timeUsed;
303#endif
304} CRClient;
305
306typedef struct _crclientnode {
307 CRClient *pClient;
308 struct _crclientnode *prev, *next;
309} CRClientNode;
310
311typedef struct CRPoly_t {
312 int npoints;
313 double *points;
314 struct CRPoly_t *next;
315} CRPoly;
316
317/**
318 * There's one of these run queue entries per client
319 * The run queue is a circular, doubly-linked list of these objects.
320 */
321typedef struct RunQueue_t {
322 CRClient *client;
323 int blocked;
324 struct RunQueue_t *next;
325 struct RunQueue_t *prev;
326} RunQueue;
327
328typedef struct {
329 GLint freeWindowID;
330 GLint freeContextID;
331 GLint freeClientID;
332} CRServerFreeIDsPool_t;
333
334typedef struct {
335 int32_t x, y;
336 uint32_t w, h;
337 uint64_t winID;
338} CRScreenInfo;
339
340typedef struct {
341 RTRECT Rect;
342} CRScreenViewportInfo;
343
344/* BFB (BlitFramebuffer Blitter) flags
345 * so far only CR_SERVER_BFB_ON_ALWAIS is supported and is alwais used if any flag is set */
346#define CR_SERVER_BFB_DISABLED 0
347#define CR_SERVER_BFB_ON_INVERTED_BLIT 1
348#define CR_SERVER_BFB_ON_STRAIGHT_BLIT 2
349#define CR_SERVER_BFB_ON_ALWAIS (CR_SERVER_BFB_ON_INVERTED_BLIT | CR_SERVER_BFB_ON_STRAIGHT_BLIT)
350
351typedef struct {
352 unsigned short tcpip_port;
353
354 CRScreenInfo screen[CR_MAX_GUEST_MONITORS];
355 CRScreenViewportInfo screenVieport[CR_MAX_GUEST_MONITORS];
356 int screenCount;
357
358 GLboolean fCrCmdEnabled;
359
360 GLboolean fProcessingPendedCommands;
361
362 int numClients;
363 CRClient *clients[CR_MAX_CLIENTS]; /**< array [numClients] */
364 CRClient *curClient;
365 CRClientNode *pCleanupClient; /*list of clients with pending clean up*/
366 CRHTABLE clientTable;
367 CRCurrentStatePointers current;
368
369 GLboolean firstCallCreateContext;
370 GLboolean firstCallMakeCurrent;
371 GLboolean bIsInLoadingState; /* Indicates if we're in process of loading VM snapshot */
372 GLboolean bIsInSavingState; /* Indicates if we're in process of saving VM snapshot */
373 GLboolean bForceMakeCurrentOnClientSwitch;
374 CRContextInfo *currentCtxInfo;
375 GLint currentWindow;
376 GLint currentNativeWindow;
377 CRMuralInfo *currentMural;
378
379 CRHashTable *muralTable; /**< hash table where all murals are stored */
380
381 int client_spu_id;
382
383 int mtu;
384 int buffer_size;
385 char protocol[1024];
386
387 SPU *head_spu;
388 SPUDispatchTable dispatch;
389
390 CRNetworkPointer return_ptr;
391 CRNetworkPointer writeback_ptr;
392 /*
393 * The current active unpacker state, this hack is required for the server dispatch routines
394 * (see crServerDispatchReadPixels for example) as it needs to read data from the buffer
395 * but it is not possible to supply the state as a parameter unfortunately.
396 */
397 PCrUnpackerState pUnpackerState;
398
399 CRLimitsState limits; /**< GL limits for any contexts we create */
400
401 CRContextInfo MainContextInfo;
402
403 CRHashTable *contextTable; /**< hash table for rendering contexts */
404
405 CRHashTable *programTable; /**< for vertex programs */
406 GLuint currentProgram;
407
408 /* visBits -> dummy mural association */
409 CRHashTable *dummyMuralTable;
410
411 /** State tracker state. */
412 CRStateTracker StateTracker;
413
414 GLboolean fRootVrOn;
415 VBOXVR_LIST RootVr;
416 /* we need to translate Root Vr to each window coords, this one cpecifies the current translation point
417 * note that since window attributes modifications is performed in HGCM thread only and thus is serialized,
418 * we deal with the global RootVr data directly */
419 RTPOINT RootVrCurPoint;
420
421 /* blitter so far used for working around host drivers BlitFramebuffer bugs
422 * by implementing */
423 uint32_t fBlitterMode;
424 CR_BLITTER Blitter;
425
426 CR_SERVER_RPW RpwWorker;
427
428 VBOXCRCMDCTL_HGCMDISABLE_DATA DisableData;
429
430 RTSEMEVENT hCalloutCompletionEvent;
431 VBOXCRCMDCTL *pCurrentCalloutCtl;
432 VBOXCRCLIENT_INFO ClientInfo;
433
434 /** configuration options */
435 /*@{*/
436 int useL2;
437 int ignore_papi;
438 unsigned int maxBarrierCount;
439 unsigned int clearCount;
440 int optimizeBucket;
441 int only_swap_once;
442 int debug_barriers;
443 int sharedDisplayLists;
444 int sharedTextureObjects;
445 int sharedPrograms;
446 int sharedWindows;
447 int uniqueWindows;
448 int localTileSpec;
449 int useDMX;
450 int overlapBlending;
451 int vpProjectionMatrixParameter;
452 const char *vpProjectionMatrixVariable;
453 int stereoView;
454 int vncMode; /* cmd line option */
455 /*@}*/
456 /** view_matrix config */
457 /*@{*/
458 GLboolean viewOverride;
459 CRmatrix viewMatrix[2]; /**< left and right eye */
460 /*@}*/
461 /** projection_matrix config */
462 /*@{*/
463 GLboolean projectionOverride;
464 CRmatrix projectionMatrix[2]; /**< left and right eye */
465 int currentEye;
466 /*@}*/
467
468 /** for warped tiles */
469 /*@{*/
470 GLfloat alignment_matrix[16], unnormalized_alignment_matrix[16];
471 /*@}*/
472
473 /** tile overlap/blending info - this should probably be per-mural */
474 /*@{*/
475 CRPoly **overlap_geom;
476 CRPoly *overlap_knockout;
477 float *overlap_intens;
478 int num_overlap_intens;
479 int num_overlap_levels;
480 /*@}*/
481
482 CRHashTable *barriers, *semaphores;
483
484 RunQueue *run_queue;
485
486 GLuint currentSerialNo;
487
488 GLuint fVisualBitsDefault;
489 GLboolean bUsePBOForReadback; /*Use PBO's for data readback*/
490
491 CROutputRedirect outputRedirect;
492
493 GLboolean bUseMultipleContexts;
494
495 GLboolean bWindowsInitiallyHidden;
496
497 /* OR-ed CR_VBOX_CAP_XXX cap values
498 * describing VBox Chromium functionality caps visible to guest
499 * Currently can have only CR_VBOX_CAP_TEX_PRESENT cap to notify
500 * that the TexPresent mechanism is available and enabled */
501 uint32_t u32Caps;
502
503 PFNCRSERVERNOTIFYEVENT pfnNotifyEventCB;
504
505 SPUDispatchTable TmpCtxDispatch;
506
507 VBOXCRCMD_SVRENABLE_INFO CrCmdClientInfo;
508
509#ifdef VBOX_WITH_CRSERVER_DUMPER
510 CR_RECORDER Recorder;
511 CR_BLITTER RecorderBlitter;
512 CR_DBGPRINT_DUMPER DbgPrintDumper;
513 CR_HTML_DUMPER HtmlDumper;
514 CR_DUMPER *pDumper;
515#endif
516
517 int RcToGuest;
518 int RcToGuestOnce;
519} CRServer;
520
521
522extern DECLEXPORT(void) crServerInit( int argc, char *argv[] );
523extern DECLEXPORT(int) CRServerMain( int argc, char *argv[] );
524extern DECLEXPORT(void) crServerServiceClients(void);
525extern DECLEXPORT(void) crServerAddNewClient(void);
526extern DECLEXPORT(SPU*) crServerHeadSPU(void);
527extern DECLEXPORT(void) crServerSetPort(int port);
528
529extern DECLEXPORT(GLboolean) crVBoxServerInit(void);
530extern DECLEXPORT(void) crVBoxServerTearDown(void);
531extern DECLEXPORT(int32_t) crVBoxServerAddClient(uint32_t u32ClientID);
532extern DECLEXPORT(void) crVBoxServerRemoveClient(uint32_t u32ClientID);
533extern DECLEXPORT(int32_t) crVBoxServerClientWrite(uint32_t u32ClientID, uint8_t *pBuffer, uint32_t cbBuffer);
534extern DECLEXPORT(int32_t) crVBoxServerClientRead(uint32_t u32ClientID, uint8_t *pBuffer, uint32_t *pcbBuffer);
535extern DECLEXPORT(int32_t) crVBoxServerClientSetVersion(uint32_t u32ClientID, uint32_t vMajor, uint32_t vMinor);
536extern DECLEXPORT(int32_t) crVBoxServerClientGetCapsLegacy(uint32_t u32ClientID, uint32_t *pu32Caps);
537extern DECLEXPORT(int32_t) crVBoxServerClientGetCapsNew(uint32_t u32ClientID, CR_CAPS_INFO *pInfo);
538extern DECLEXPORT(int32_t) crVBoxServerClientSetPID(uint32_t u32ClientID, uint64_t pid);
539
540extern DECLEXPORT(int32_t) crVBoxServerSaveState(PSSMHANDLE pSSM);
541extern DECLEXPORT(int32_t) crVBoxServerLoadState(PSSMHANDLE pSSM, uint32_t version);
542
543typedef struct
544{
545 CR_BLITTER_IMG Img;
546 uint32_t u32Screen;
547 uint32_t fDataAllocated;
548} CR_SCREENSHOT;
549
550extern DECLEXPORT(int) crServerVBoxWindowsShow(bool fShow);
551extern DECLEXPORT(int) crServerVBoxScreenshotGet(uint32_t u32Screen, uint32_t width, uint32_t height, uint32_t pitch, void *pvBuffer, CR_SCREENSHOT *pScreenshot);
552extern DECLEXPORT(void) crServerVBoxScreenshotRelease(CR_SCREENSHOT *pScreenshot);
553
554extern DECLEXPORT(void) crServerVBoxCompositionSetEnableStateGlobal(GLboolean fEnable);
555extern DECLEXPORT(int32_t) crVBoxServerSetScreenCount(int sCount);
556extern DECLEXPORT(int32_t) crVBoxServerUnmapScreen(int sIndex);
557extern DECLEXPORT(int32_t) crVBoxServerMapScreen(int sIndex, int32_t x, int32_t y, uint32_t w, uint32_t h, uint64_t winID);
558extern DECLEXPORT(void) crServerVBoxCompositionSetEnableStateGlobal(GLboolean fEnable);
559struct VBVAINFOSCREEN;
560extern DECLEXPORT(int) crVBoxServerNotifyResize(const struct VBVAINFOSCREEN *pScreen, void *pvVRAM);
561extern DECLEXPORT(int32_t) crVBoxServerSetRootVisibleRegion(GLint cRects, const RTRECT *pRects);
562
563extern DECLEXPORT(int32_t) crVBoxServerSetOffscreenRendering(GLboolean value);
564
565extern DECLEXPORT(int32_t) crVBoxServerOutputRedirectSet(const CROutputRedirect *pCallbacks);
566
567extern DECLEXPORT(int32_t) crVBoxServerSetScreenViewport(int sIndex, int32_t x, int32_t y, uint32_t w, uint32_t h);
568
569extern DECLEXPORT(void) crServerVBoxSetNotifyEventCB(PFNCRSERVERNOTIFYEVENT pfnCb);
570
571extern DECLEXPORT(void) crVBoxServerCalloutEnable(VBOXCRCMDCTL *pCtl);
572extern DECLEXPORT(void) crVBoxServerCalloutDisable(void);
573extern DECLEXPORT(void) crServerSetUnscaledHiDPI(bool fEnable);
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
592#endif
593
594extern DECLEXPORT(int32_t) crVBoxServerHgcmEnable(VBOXCRCMDCTL_HGCMENABLE_DATA *pData);
595extern DECLEXPORT(int32_t) crVBoxServerHgcmDisable(VBOXCRCMDCTL_HGCMDISABLE_DATA *pData);
596
597extern int crVBoxServerHostCtl(VBOXCRCMDCTL *pCtl, uint32_t cbCtl);
598
599extern DECLEXPORT(void) crVBoxServerDetachThread(void);
600extern DECLEXPORT(void) crVBoxServerAttachThread(void);
601
602#ifdef __cplusplus
603}
604#endif
605
606#endif
607
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