Changeset 50095 in vbox for trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server.h
- Timestamp:
- Jan 17, 2014 4:34:07 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server.h
r50041 r50095 15 15 16 16 #include "cr_server.h" 17 #include <cr_htable.h> 18 #include <cr_compositor.h> 17 19 18 20 #ifdef VBOX_WITH_CRHGSMI … … 114 116 GLint crServerDispatchCreateContextEx(const char *dpyName, GLint visualBits, GLint shareCtx, GLint preloadCtxID, int32_t internalID); 115 117 GLint crServerDispatchWindowCreateEx(const char *dpyName, GLint visBits, GLint preloadWinID); 116 GLint crServerMuralInit(CRMuralInfo *mural, const char *dpyName, GLint visBits, GLint preloadWinID , GLboolean fUseDefaultDEntry);118 GLint crServerMuralInit(CRMuralInfo *mural, const char *dpyName, GLint visBits, GLint preloadWinID); 117 119 void crServerMuralTerm(CRMuralInfo *mural); 118 120 GLboolean crServerMuralSize(CRMuralInfo *mural, GLint width, GLint height); 119 void crServerMuralPosition(CRMuralInfo *mural, GLint x, GLint y , GLboolean fSkipCheckGeometry);121 void crServerMuralPosition(CRMuralInfo *mural, GLint x, GLint y); 120 122 void crServerMuralVisibleRegion( CRMuralInfo *mural, GLint cRects, const GLint *pRects ); 121 123 void crServerMuralShow( CRMuralInfo *mural, GLint state ); 122 int crServerMuralSynchRootVr(CRMuralInfo *mural, bool *pfChanged);123 124 124 125 GLint crServerGenerateID(GLint *pCounter); … … 129 130 130 131 CRMuralInfo * crServerGetDummyMural(GLint visualBits); 131 132 void crServerPresentOutputRedirect(CRMuralInfo *pMural);133 void crServerOutputRedirectCheckEnableDisable(CRMuralInfo *pMural);134 132 135 133 void crServerCheckMuralGeometry(CRMuralInfo *mural); 136 134 GLboolean crServerSupportRedirMuralFBO(void); 137 135 136 void crVBoxServerMuralFbResizeBegin(HCR_FRAMEBUFFER hFb); 137 void crVBoxServerMuralFbResizeEnd(HCR_FRAMEBUFFER hFb); 138 138 139 void crVBoxServerNotifyEvent(int32_t idScreen, uint32_t uEvent, void*pvData); 139 140 void crVBoxServerCheckVisibilityEvent(int32_t idScreen); 140 141 141 void crServerDisplayTermAll(); 142 143 void crServerWindowSize(CRMuralInfo *pMural); 144 void crServerWindowShow(CRMuralInfo *pMural); 145 void crServerWindowVisibleRegion(CRMuralInfo *pMural); 142 void crServerRedirMuralFbClear(CRMuralInfo *mural); 143 146 144 void crServerWindowReparent(CRMuralInfo *pMural); 147 145 148 void crServerWindowSetIsVisible(CRMuralInfo *pMural, GLboolean fIsVisible); 149 void crServerWindowCheckIsVisible(CRMuralInfo *pMural); 150 151 int crVBoxServerUpdateMuralRootVisibleRegion(CRMuralInfo *pMI); 152 153 #define CR_SERVER_REDIR_F_NONE 0x00 154 /* the data should be displayed on host (unset when is on or when CR_SERVER_REDIR_F_FBO_RAM_VMFB is set) */ 155 #define CR_SERVER_REDIR_F_DISPLAY 0x01 156 /* guest window data get redirected to FBO on host */ 157 #define CR_SERVER_REDIR_F_FBO 0x02 158 /* used with CR_SERVER_REDIR_F_FBO only 159 * indicates that FBO data should be copied to RAM for further processing */ 160 #define CR_SERVER_REDIR_F_FBO_RAM 0x04 161 /* used with CR_SERVER_REDIR_F_FBO_RAM only 162 * indicates that FBO data should be passed to VRDP backend */ 163 #define CR_SERVER_REDIR_F_FBO_RAM_VRDP 0x08 164 /* used with CR_SERVER_REDIR_F_FBO_RAM only 165 * indicates that FBO data should be passed to VM Framebuffer */ 166 #define CR_SERVER_REDIR_F_FBO_RAM_VMFB 0x10 167 /* used with CR_SERVER_REDIR_F_FBO_RAM only 168 * makes the RPW (Read Pixels Worker) mechanism to be used for GPU memory aquisition */ 169 #define CR_SERVER_REDIR_F_FBO_RPW 0x20 170 171 172 #define CR_SERVER_REDIR_F_ALL 0x3f 173 174 #define CR_SERVER_REDIR_FGROUP_REQUIRE_FBO (CR_SERVER_REDIR_F_ALL & ~CR_SERVER_REDIR_F_DISPLAY) 175 #define CR_SERVER_REDIR_FGROUP_REQUIRE_FBO_RAM (CR_SERVER_REDIR_F_FBO_RAM_VRDP | CR_SERVER_REDIR_F_FBO_RAM_VMFB | CR_SERVER_REDIR_F_FBO_RPW) 176 177 DECLINLINE(GLuint) crServerRedirModeAdjust(GLuint value) 178 { 179 /* sanitize values */ 180 value &= CR_SERVER_REDIR_F_ALL; 181 182 if (value & CR_SERVER_REDIR_FGROUP_REQUIRE_FBO) 183 value |= CR_SERVER_REDIR_F_FBO; 184 if (value & CR_SERVER_REDIR_FGROUP_REQUIRE_FBO_RAM) 185 value |= CR_SERVER_REDIR_F_FBO_RAM; 186 187 return value; 188 } 189 190 int32_t crServerSetOffscreenRenderingMode(GLuint value); 191 void crServerRedirMuralFBO(CRMuralInfo *mural, GLuint redir); 146 void crServerRedirMuralFBO(CRMuralInfo *mural, bool fEnabled); 192 147 void crServerDeleteMuralFBO(CRMuralInfo *mural); 193 148 void crServerPresentFBO(CRMuralInfo *mural); … … 196 151 void crServerMuralFBOSwapBuffers(CRMuralInfo *mural); 197 152 198 void crServerVBoxCompositionDisableEnter(CRMuralInfo *mural);199 void crServerVBoxCompositionDisableLeave(CRMuralInfo *mural, GLboolean fForcePresentOnEnabled);200 void crServerVBoxCompositionPresent(CRMuralInfo *mural);201 DECLINLINE(GLboolean) crServerVBoxCompositionPresentNeeded(CRMuralInfo *mural)202 {203 return mural->bVisible204 && mural->width205 && mural->height206 && !mural->fRootVrOn ? !CrVrScrCompositorIsEmpty(&mural->Compositor) : !CrVrScrCompositorIsEmpty(&mural->RootVrCompositor);207 }208 153 209 154 #define CR_SERVER_FBO_BB_IDX(_mural) ((_mural)->iBbBuffer) … … 219 164 int32_t crVBoxServerInternalClientRead(CRClient *pClient, uint8_t *pBuffer, uint32_t *pcbBuffer); 220 165 221 PCR_DISPLAY crServerDisplayGetInitialized(uint32_t idScreen);222 223 166 void crServerPerformMakeCurrent( CRMuralInfo *mural, CRContextInfo *ctxInfo ); 224 167 225 168 PCR_BLITTER crServerVBoxBlitterGet(); 169 PCR_BLITTER crServerVBoxBlitterGetInitialized(); 226 170 227 171 DECLINLINE(void) crServerVBoxBlitterWinInit(CR_BLITTER_WINDOW *win, CRMuralInfo *mural) … … 420 364 int crServerVBoxParseNumerics(const char *pszStr, const int defaultVal); 421 365 422 void CrDpRootUpdate(PCR_DISPLAY pDisplay); 423 void CrDpEnter(PCR_DISPLAY pDisplay); 424 void CrDpLeave(PCR_DISPLAY pDisplay); 425 int CrDpInit(PCR_DISPLAY pDisplay); 426 void CrDpTerm(PCR_DISPLAY pDisplay); 427 428 DECLINLINE(bool) CrDpIsEmpty(PCR_DISPLAY pDisplay) 429 { 430 return CrVrScrCompositorIsEmpty(&pDisplay->Mural.Compositor); 431 } 432 433 int CrDpSaveState(PCR_DISPLAY pDisplay, PSSMHANDLE pSSM); 434 int CrDpLoadState(PCR_DISPLAY pDisplay, PSSMHANDLE pSSM, uint32_t version); 435 436 void CrDpReparent(PCR_DISPLAY pDisplay, CRScreenInfo *pScreen); 437 438 void CrDpResize(PCR_DISPLAY pDisplay, int32_t xPos, int32_t yPos, uint32_t width, uint32_t height); 439 void CrDpEntryInit(PCR_DISPLAY_ENTRY pEntry, const VBOXVR_TEXTURE *pTextureData, uint32_t fFlags, PFNVBOXVRSCRCOMPOSITOR_ENTRY_RELEASED pfnEntryReleased); 440 void CrDpEntryCleanup(PCR_DISPLAY_ENTRY pEntry); 441 int CrDpEntryRegionsSet(PCR_DISPLAY pDisplay, PCR_DISPLAY_ENTRY pEntry, const RTPOINT *pPos, uint32_t cRegions, const RTRECT *paRegions); 442 int CrDpEntryRegionsAdd(PCR_DISPLAY pDisplay, PCR_DISPLAY_ENTRY pEntry, const RTPOINT *pPos, uint32_t cRegions, const RTRECT *paRegions, CR_DISPLAY_ENTRY_MAP *pMap); 443 void CrDpRegionsClear(PCR_DISPLAY pDisplay); 444 DECLINLINE(bool) CrDpEntryIsUsed(PCR_DISPLAY_ENTRY pEntry) 445 { 446 return CrVrScrCompositorEntryIsInList(&pEntry->CEntry); 447 } 448 449 DECLINLINE(CRMuralInfo*) CrDpGetMural(PCR_DISPLAY pDisplay) 450 { 451 return &pDisplay->Mural; 452 } 453 454 int CrDemGlobalInit(); 455 void CrDemTeGlobalTerm(); 456 void CrDemEnter(PCR_DISPLAY_ENTRY_MAP pMap); 457 void CrDemLeave(PCR_DISPLAY_ENTRY_MAP pMap, PCR_DISPLAY_ENTRY pNewEntry, PCR_DISPLAY_ENTRY pReplacedEntry); 458 int CrDemInit(PCR_DISPLAY_ENTRY_MAP pMap); 459 void CrDemTerm(PCR_DISPLAY_ENTRY_MAP pMap); 460 PCR_DISPLAY_ENTRY CrDemEntryAcquire(PCR_DISPLAY_ENTRY_MAP pMap, GLuint idTexture, uint32_t fFlags); 461 void CrDemEntryRelease(PCR_DISPLAY_ENTRY pEntry); 462 int CrDemEntrySaveState(PCR_DISPLAY_ENTRY pEntry, PSSMHANDLE pSSM); 463 int CrDemEntryLoadState(PCR_DISPLAY_ENTRY_MAP pMap, PCR_DISPLAY_ENTRY *ppEntry, PSSMHANDLE pSSM); 464 465 int crServerDisplaySaveState(PSSMHANDLE pSSM); 466 int crServerDisplayLoadState(PSSMHANDLE pSSM, uint32_t u32Version); 467 468 469 void crServerDEntryResized(CRMuralInfo *pMural, CR_DISPLAY_ENTRY *pDEntry); 470 void crServerDEntryMoved(CRMuralInfo *pMural, CR_DISPLAY_ENTRY *pDEntry); 471 void crServerDEntryVibleRegions(CRMuralInfo *pMural, CR_DISPLAY_ENTRY *pDEntry); 472 void crServerDEntryCheckFBO(CRMuralInfo *pMural, CR_DISPLAY_ENTRY *pDEntry, CRContext *ctx); 473 474 void crServerDEntryAllResized(CRMuralInfo *pMural); 475 void crServerDEntryAllMoved(CRMuralInfo *pMural); 476 void crServerDEntryAllVibleRegions(CRMuralInfo *pMural); 366 /*helper function that calls CrFbUpdateBegin for all enabled framebuffers */ 367 int CrPMgrHlpGlblUpdateBegin(); 368 /*helper function that calls CrFbUpdateEnd for all framebuffers being updated */ 369 void CrPMgrHlpGlblUpdateEnd(); 370 HCR_FRAMEBUFFER CrPMgrFbGetFirstEnabled(); 371 HCR_FRAMEBUFFER CrPMgrFbGetNextEnabled(HCR_FRAMEBUFFER hFb); 372 int CrPMgrModeVrdp(bool fEnable); 373 int CrPMgrModeRootVr(bool fEnable); 374 int CrPMgrRootVrUpdate(); 375 int CrPMgrViewportUpdate(uint32_t idScreen); 376 int CrPMgrScreenChanged(uint32_t idScreen); 377 int CrPMgrNotifyResize(HCR_FRAMEBUFFER hFb); 378 int CrPMgrSaveState(PSSMHANDLE pSSM); 379 int CrPMgrLoadState(PSSMHANDLE pSSM, uint32_t version); 380 HCR_FRAMEBUFFER CrPMgrFbGet(uint32_t idScreen); 381 /*cleanup stuff*/ 382 383 int CrPMgrInit(); 384 void CrPMgrTerm(); 385 386 int CrFbResize(HCR_FRAMEBUFFER hFb, const struct VBVAINFOSCREEN * pScreen, void *pvVRAM); 387 bool CrFbIsEnabled(HCR_FRAMEBUFFER hFb); 388 int CrFbEntryCreateForTexId(HCR_FRAMEBUFFER hFb, GLuint idTex, uint32_t fFlags, HCR_FRAMEBUFFER_ENTRY *phEntry); 389 int CrFbEntryCreateForTexData(HCR_FRAMEBUFFER hFb, struct CR_TEXDATA *pTex, uint32_t fFlags, HCR_FRAMEBUFFER_ENTRY *phEntry); 390 void CrFbEntryAddRef(HCR_FRAMEBUFFER hFb, HCR_FRAMEBUFFER_ENTRY hEntry); 391 void CrFbEntryRelease(HCR_FRAMEBUFFER hFb, HCR_FRAMEBUFFER_ENTRY hEntry); 392 const struct VBVAINFOSCREEN* CrFbGetScreenInfo(HCR_FRAMEBUFFER hFb); 393 const struct VBOXVR_SCR_COMPOSITOR* CrFbGetCompositor(HCR_FRAMEBUFFER hFb); 394 const struct VBOXVR_SCR_COMPOSITOR_ENTRY* CrFbEntryGetCompositorEntry(HCR_FRAMEBUFFER_ENTRY hEntry); 395 396 /* start doing modifications to the framebuffer */ 397 int CrFbUpdateBegin(HCR_FRAMEBUFFER hFb); 398 /*below commands can only be used in Framebuffer update mode, i.e. after the CrFbUpdateBegin succeeded */ 399 int CrFbEntryRegions(HCR_FRAMEBUFFER hFb, HCR_FRAMEBUFFER_ENTRY hEntry); 400 401 /* complete doing modifications to the framebuffer */ 402 void CrFbUpdateEnd(HCR_FRAMEBUFFER hFb); 403 404 int CrFbEntryRegionsAdd(HCR_FRAMEBUFFER hFb, HCR_FRAMEBUFFER_ENTRY pEntry, const RTPOINT *pPos, uint32_t cRegions, const RTRECT *paRegions, bool fPosRelated); 405 int CrFbEntryRegionsSet(HCR_FRAMEBUFFER hFb, HCR_FRAMEBUFFER_ENTRY pEntry, const RTPOINT *pPos, uint32_t cRegions, const RTRECT *paRegions, bool fPosRelated); 406 407 int CrFbEntryTexDataUpdate(HCR_FRAMEBUFFER hFb, HCR_FRAMEBUFFER_ENTRY pEntry, struct CR_TEXDATA *pTex); 408 409 CRHTABLE_HANDLE CrFbDDataAllocSlot(HCR_FRAMEBUFFER hFb); 410 void CrFbDDataReleaseSlot(HCR_FRAMEBUFFER hFb, CRHTABLE_HANDLE hSlot); 411 int CrFbDDataEntryPut(HCR_FRAMEBUFFER_ENTRY hEntry, CRHTABLE_HANDLE hSlot, void *pvData); 412 void* CrFbDDataEntryGet(HCR_FRAMEBUFFER_ENTRY hEntry, CRHTABLE_HANDLE hSlot); 413 414 CR_TEXDATA* CrFbTexDataCreate(const VBOXVR_TEXTURE *pTex); 415 void CrFbTexDataInit(CR_TEXDATA* pFbTex, const VBOXVR_TEXTURE *pTex, PFNCRTEXDATA_RELEASED pfnTextureReleased); 477 416 478 417 //#define VBOX_WITH_CRSERVER_DUMPER
Note:
See TracChangeset
for help on using the changeset viewer.