cr_server.h revision d9e5b8858afd747624f37b858d3c1e51c8d620b4
2N/A * See the file LICENSE.txt for information on redistributing this software.
2N/A#ifndef INCLUDE_CR_SERVER_H
2N/A#define INCLUDE_CR_SERVER_H
2N/A#include "cr_protocol.h"
2N/A#include "cr_glstate.h"
2N/A#include "cr_blitter.h"
2N/A#include "spu_dispatch_table.h"
2N/A#include "state/cr_currentpointers.h"
2N/A#ifdef VBOX_WITH_CRHGSMI
2N/A#ifdef __cplusplus
/*@todo must match MaxGuestMonitors from SchemaDefs.h*/
typedef DECLCALLBACKPTR(void, PFNCRSERVERPRESENTFBO) (void *data, int32_t screenId, int32_t x, int32_t y, uint32_t w, uint32_t h);
const char *pszFormat));
} CRExtent;
struct BucketingInfo;
char *pszDpyName;
struct CR_SERVER_RPW_ENTRY;
typedef struct CR_SERVER_RPW_CTL {
int rc;
struct CR_SERVER_RPW_ENTRY;
typedef DECLCALLBACKPTR(void, PFNCR_SERVER_RPW_DATA) (const struct CR_SERVER_RPW_ENTRY* pEntry, void *pvEntryTexData);
typedef DECLCALLBACKPTR(void, PFNCRSERVERNOTIFYEVENT) (int32_t screenId, uint32_t uEvent, void*pvData);
typedef struct CR_SERVER_RPW_ENTRY
* 1. iDrawTex - the texture clients can draw to and then submit it for contents acquisition via crServerRpwEntrySubmit
* 2. iSubmittedTex - the texture submitted to the worker for processing and, whose processing has not start yet,
* 3. iWorkerTex - the texture being prepared & passed by the worker to the GPU (stage 1 of a worker contents acquisition process)
* 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)
* - There can be valid distinct iGpuTex, iWorkerTex, iSubmittedTex and iDrawTex present simultaneously.
* - 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
* - iSubmittedTex and iFreeTex can be modified by both client and worker, so lock is always required
* - The worker can invalidate the iSubmittedTex (i.e. do iSubmittedTex -> iWorkerTex) only after it is done
* with the last iWorkerTex -> iGpuTex transformation freeing the previously used iGpuTex to iFreeTex.
typedef struct CR_SERVER_RPW {
int ctxId;
typedef struct CR_DISPLAY_ENTRY
void *pvUserData1;
void *pvUserData2;
int screenId;
void *pvOutputRedirectInstance;
} CRMuralInfo;
int SpuContext;
typedef struct _crclient {
#ifdef VBOXCR_LOGFPS
} CRClient;
typedef struct _crclientnode {
} CRClientNode;
typedef struct CRPoly_t {
int npoints;
double *points;
} CRPoly;
typedef struct RunQueue_t {
int blocked;
} RunQueue;
int32_t x, y;
uint32_t w, h;
} CRScreenInfo;
int32_t x, y;
uint32_t w, h;
* 2. CR_SERVER_REDIR_F_NONE and CR_SERVER_REDIR_F_FBO should be trated identically for presented window
* since we just need to blit the given textures to it if we are NOT in CR_SERVER_REDIR_F_FBO_RAM mode */
typedef struct CR_DISPLAY
int CrDpEntryRegionsSet(PCR_DISPLAY pDisplay, PCR_DISPLAY_ENTRY pEntry, const RTPOINT *pPos, uint32_t cRegions, const RTRECT *paRegions);
int CrDpEntryRegionsAdd(PCR_DISPLAY pDisplay, PCR_DISPLAY_ENTRY pEntry, const RTPOINT *pPos, uint32_t cRegions, const RTRECT *paRegions);
typedef struct CR_DISPLAY_ENTRY_MAP
void* CrHlpGetTexImage(CRContext *pCurCtx, PVBOXVR_TEXTURE pTexture, GLuint idPBO, GLenum enmFormat);
void CrHlpPutTexImage(CRContext *pCurCtx, PVBOXVR_TEXTURE pTexture, GLenum enmFormat, void *pvData);
#define CR_SERVER_BFB_DISABLED 0
unsigned short tcpip_port;
int screenCount;
int numClients;
int client_spu_id;
int mtu;
int buffer_size;
/* we need to translate Root Vr to each window coords, this one cpecifies the current translation point
* note that since window attributes modifications is performed in HGCM thread only and thus is serialized,
int useL2;
int ignore_papi;
unsigned int maxBarrierCount;
unsigned int clearCount;
int optimizeBucket;
int only_swap_once;
int debug_barriers;
int sharedDisplayLists;
int sharedTextureObjects;
int sharedPrograms;
int sharedWindows;
int uniqueWindows;
int localTileSpec;
int useDMX;
int overlapBlending;
const char *vpProjectionMatrixVariable;
int stereoView;
int currentEye;
float *overlap_intens;
int num_overlap_intens;
int num_overlap_levels;
#ifdef VBOX_WITH_CRSERVER_DUMPER
int RcToGuest;
int RcToGuestOnce;
} CRServer;
extern DECLEXPORT(int32_t) crVBoxServerClientWrite(uint32_t u32ClientID, uint8_t *pBuffer, uint32_t cbBuffer);
extern DECLEXPORT(int32_t) crVBoxServerClientRead(uint32_t u32ClientID, uint8_t *pBuffer, uint32_t *pcbBuffer);
extern DECLEXPORT(int32_t) crVBoxServerClientSetVersion(uint32_t u32ClientID, uint32_t vMajor, uint32_t vMinor);
extern DECLEXPORT(int32_t) crVBoxServerMapScreen(int sIndex, int32_t x, int32_t y, uint32_t w, uint32_t h, uint64_t winID);
extern DECLEXPORT(int32_t) crVBoxServerSetScreenViewport(int sIndex, int32_t x, int32_t y, uint32_t w, uint32_t h);
#ifdef VBOX_WITH_CRHGSMI
/* We moved all CrHgsmi command processing to crserverlib to keep the logic of dealing with CrHgsmi commands in one place.
* 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.
* This help avoiding the "blocked-client" issues. The client is blocked if another client is doing begin-end stuff.
* For now we eliminated polling that could occur on block, which caused a higher-priority thread (in guest) polling for the blocked command complition
* In the future we will extend CrHgsmi functionality to maintain texture data directly in CrHgsmi allocation to avoid extra memcpy-ing with PBO,
* implement command completion and stuff necessary for GPU scheduling to work properly for WDDM Windows guests, etc.
extern DECLEXPORT(int32_t) crVBoxServerCrHgsmiCmd(struct VBOXVDMACMD_CHROMIUM_CMD *pCmd, uint32_t cbCmd);
extern DECLEXPORT(int32_t) crVBoxServerCrHgsmiCtl(struct VBOXVDMACMD_CHROMIUM_CTL *pCtl, uint32_t cbCtl);
#ifdef __cplusplus