Changeset 48726 in vbox for trunk/src/VBox
- Timestamp:
- Sep 27, 2013 10:19:54 AM (11 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/include/cr_vreg.h
r48325 r48726 156 156 VBOXVREGDECL(void) VBoxVrListClear(PVBOXVR_LIST pList); 157 157 158 /* moves list data to pDstList and empties the pList */ 159 VBOXVREGDECL(void) VBoxVrListMoveTo(PVBOXVR_LIST pList, PVBOXVR_LIST pDstList); 160 158 161 VBOXVREGDECL(void) VBoxVrListTranslate(PVBOXVR_LIST pList, int32_t x, int32_t y); 159 162 … … 265 268 266 269 VBOXVREGDECL(bool) VBoxVrCompositorEntryRemove(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry); 270 VBOXVREGDECL(bool) VBoxVrCompositorEntryReplace(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, PVBOXVR_COMPOSITOR_ENTRY pNewEntry); 267 271 VBOXVREGDECL(int) VBoxVrCompositorEntryRegionsAdd(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, uint32_t cRegions, const RTRECT *paRegions, PVBOXVR_COMPOSITOR_ENTRY *ppReplacedEntry, uint32_t *pfChangeFlags); 268 272 VBOXVREGDECL(int) VBoxVrCompositorEntryRegionsSubst(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, uint32_t cRegions, const RTRECT *paRegions, bool *pfChanged); … … 417 421 VBOXVREGDECL(int) CrVrScrCompositorEntryRegionsGet(PVBOXVR_SCR_COMPOSITOR pCompositor, PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry, uint32_t *pcRegions, const RTRECT **ppaSrcRegions, const RTRECT **ppaDstRegions, const RTRECT **ppaDstUnstretchedRects); 418 422 VBOXVREGDECL(int) CrVrScrCompositorEntryRemove(PVBOXVR_SCR_COMPOSITOR pCompositor, PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry); 423 VBOXVREGDECL(bool) CrVrScrCompositorEntryReplace(PVBOXVR_SCR_COMPOSITOR pCompositor, PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry, PVBOXVR_SCR_COMPOSITOR_ENTRY pNewEntry); 419 424 VBOXVREGDECL(void) CrVrScrCompositorEntryFlagsSet(PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry, uint32_t fFlags); 420 425 VBOXVREGDECL(uint32_t) CrVrScrCompositorEntryFlagsCombinedGet(PVBOXVR_SCR_COMPOSITOR pCompositor, PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry); -
trunk/src/VBox/GuestHost/OpenGL/util/vreg.cpp
r47623 r48726 161 161 } 162 162 163 /* moves list data to pDstList and empties the pList */ 164 VBOXVREGDECL(void) VBoxVrListMoveTo(PVBOXVR_LIST pList, PVBOXVR_LIST pDstList) 165 { 166 *pDstList = *pList; 167 pDstList->ListHead.pNext->pPrev = &pDstList->ListHead; 168 pDstList->ListHead.pPrev->pNext = &pDstList->ListHead; 169 VBoxVrListInit(pList); 170 } 171 163 172 #define VBOXVR_MEMTAG 'vDBV' 164 173 … … 1221 1230 } 1222 1231 1232 static void vboxVrCompositorEntryReplace(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, PVBOXVR_COMPOSITOR_ENTRY pReplacingEntry) 1233 { 1234 VBoxVrListMoveTo(&pEntry->Vr, &pReplacingEntry->Vr); 1235 1236 pReplacingEntry->Node = pEntry->Node; 1237 pReplacingEntry->Node.pNext->pPrev = &pReplacingEntry->Node; 1238 pReplacingEntry->Node.pPrev->pNext = &pReplacingEntry->Node; 1239 pEntry->Node.pNext = NULL; 1240 pEntry->Node.pPrev = NULL; 1241 1242 vboxVrCompositorEntryAcquire(pReplacingEntry); 1243 vboxVrCompositorEntryRelease(pCompositor, pEntry, pReplacingEntry); 1244 } 1245 1246 1247 1223 1248 VBOXVREGDECL(void) VBoxVrCompositorEntryInit(PVBOXVR_COMPOSITOR_ENTRY pEntry) 1224 1249 { … … 1229 1254 VBOXVREGDECL(bool) VBoxVrCompositorEntryRemove(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry) 1230 1255 { 1256 if (!VBoxVrCompositorEntryIsInList(pEntry)) 1257 return false; 1258 1231 1259 vboxVrCompositorEntryAcquire(pEntry); 1232 1260 1233 if (!VBoxVrCompositorEntryIsInList(pEntry))1234 {1235 vboxVrCompositorEntryRelease(pCompositor, pEntry, NULL);1236 return false;1237 }1238 1261 VBoxVrListClear(&pEntry->Vr); 1239 1262 vboxVrCompositorEntryRemove(pCompositor, pEntry, NULL); 1240 1263 vboxVrCompositorEntryRelease(pCompositor, pEntry, NULL); 1264 return true; 1265 } 1266 1267 VBOXVREGDECL(bool) VBoxVrCompositorEntryReplace(PVBOXVR_COMPOSITOR pCompositor, PVBOXVR_COMPOSITOR_ENTRY pEntry, PVBOXVR_COMPOSITOR_ENTRY pNewEntry) 1268 { 1269 if (!VBoxVrCompositorEntryIsInList(pEntry)) 1270 return false; 1271 1272 vboxVrCompositorEntryReplace(pCompositor, pEntry, pNewEntry); 1273 1241 1274 return true; 1242 1275 } … … 2318 2351 } 2319 2352 2320 VBOXVREGDECL(int) CrVrScrCompositorEntryRemove(PVBOXVR_SCR_COMPOSITOR pCompositor, PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry) 2321 { 2322 if (!VBoxVrCompositorEntryRemove(&pCompositor->Compositor, &pEntry->Ce)) 2323 return VINF_SUCCESS; 2324 2325 CrVrScrCompositorEntrySetChanged(pEntry, true); 2353 static void crVrScrCompositorEntryDataCleanup(PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry) 2354 { 2326 2355 pEntry->cRects = 0; 2327 2356 pEntry->paSrcRects = NULL; 2328 2357 pEntry->paDstRects = NULL; 2329 2358 pEntry->paDstUnstretchedRects = NULL; 2359 } 2360 2361 static void crVrScrCompositorEntryDataCopy(PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry, PVBOXVR_SCR_COMPOSITOR_ENTRY pToEntry) 2362 { 2363 pToEntry->cRects = pEntry->cRects; 2364 pToEntry->paSrcRects = pEntry->paSrcRects; 2365 pToEntry->paDstRects = pEntry->paDstRects; 2366 pToEntry->paDstUnstretchedRects = pEntry->paDstUnstretchedRects; 2367 crVrScrCompositorEntryDataCleanup(pEntry); 2368 } 2369 2370 VBOXVREGDECL(int) CrVrScrCompositorEntryRemove(PVBOXVR_SCR_COMPOSITOR pCompositor, PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry) 2371 { 2372 if (!VBoxVrCompositorEntryRemove(&pCompositor->Compositor, &pEntry->Ce)) 2373 return VINF_SUCCESS; 2374 2375 CrVrScrCompositorEntrySetChanged(pEntry, true); 2376 crVrScrCompositorEntryDataCleanup(pEntry); 2330 2377 2331 2378 crVrScrCompositorRectsInvalidate(pCompositor); 2332 2379 return VINF_SUCCESS; 2380 } 2381 2382 VBOXVREGDECL(bool) CrVrScrCompositorEntryReplace(PVBOXVR_SCR_COMPOSITOR pCompositor, PVBOXVR_SCR_COMPOSITOR_ENTRY pEntry, PVBOXVR_SCR_COMPOSITOR_ENTRY pNewEntry) 2383 { 2384 Assert(!CrVrScrCompositorEntryIsUsed(pNewEntry)); 2385 2386 if (!VBoxVrCompositorEntryReplace(&pCompositor->Compositor, &pEntry->Ce, &pNewEntry->Ce)) 2387 return false; 2388 2389 CrVrScrCompositorEntrySetChanged(pEntry, true); 2390 crVrScrCompositorEntryDataCopy(pEntry, pNewEntry); 2391 CrVrScrCompositorEntrySetChanged(pNewEntry, true); 2392 2393 return true; 2333 2394 } 2334 2395 -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server.h
r48719 r48726 119 119 void crServerMuralVisibleRegion( CRMuralInfo *mural, GLint cRects, const GLint *pRects ); 120 120 void crServerMuralShow( CRMuralInfo *mural, GLint state ); 121 int crServerMuralSynchRootVr(CRMuralInfo *mural );121 int crServerMuralSynchRootVr(CRMuralInfo *mural, bool *pfChanged); 122 122 123 123 GLint crServerGenerateID(GLint *pCounter); -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c
r48719 r48726 332 332 #endif 333 333 334 cr_server.bUseMultipleContexts = (crGetenv( "CR_SERVER_ENABLE_MULTIPLE_CONTEXTS" ) != NULL);334 // cr_server.bUseMultipleContexts = (crGetenv( "CR_SERVER_ENABLE_MULTIPLE_CONTEXTS" ) != NULL); 335 335 336 336 if (cr_server.bUseMultipleContexts) … … 443 443 #endif 444 444 445 cr_server.bUseMultipleContexts = (crGetenv( "CR_SERVER_ENABLE_MULTIPLE_CONTEXTS" ) != NULL);445 // cr_server.bUseMultipleContexts = (crGetenv( "CR_SERVER_ENABLE_MULTIPLE_CONTEXTS" ) != NULL); 446 446 447 447 if (cr_server.bUseMultipleContexts) … … 2849 2849 } 2850 2850 2851 rc = crServerMuralSynchRootVr(pMI );2851 rc = crServerMuralSynchRootVr(pMI, NULL); 2852 2852 if (!RT_SUCCESS(rc)) 2853 2853 { … … 2913 2913 2914 2914 crHashtableWalk(cr_server.muralTable, crVBoxServerSetRootVisibleRegionCB, NULL); 2915 #if 0 2915 2916 2916 for (i = 0; i < cr_server.screenCount; ++i) 2917 2917 { … … 2922 2922 CrDpRootUpdate(pDisplay); 2923 2923 } 2924 #endif 2924 2925 2925 return VINF_SUCCESS; 2926 2926 } -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_presenter.cpp
r48719 r48726 47 47 } 48 48 49 crServerMuralVisibleRegion(&pDisplay->Mural, 0, NULL); 49 crServerWindowVisibleRegion(&pDisplay->Mural); 50 crServerDEntryAllVibleRegions(&pDisplay->Mural); 51 50 52 crServerMuralShow(&pDisplay->Mural, GL_TRUE); 51 53 … … 226 228 uint32_t cRects; 227 229 const RTRECT *pRects; 228 rc = CrVrScrCompositorRegionsGet(&pDisplay->Mural.Compositor, &cRects, NULL, &pRects, NULL); 229 if (RT_SUCCESS(rc)) 230 crServerMuralVisibleRegion(&pDisplay->Mural, cRects, (GLint *)pRects); 230 bool fChanged = true; 231 if (pDisplay->Mural.fRootVrOn) 232 { 233 int rc = crServerMuralSynchRootVr(&pDisplay->Mural, &fChanged); 234 if (!RT_SUCCESS(rc)) 235 { 236 crWarning("crServerMuralSynchRootVr failed, rc %d", rc); 237 fChanged = false; 238 } 239 } 240 241 if (fChanged) 242 crServerWindowVisibleRegion(&pDisplay->Mural); 243 244 crServerDEntryAllVibleRegions(&pDisplay->Mural); 245 246 Assert(!pReplacedScrEntry); 247 } 248 else if (fChangeFlags & VBOXVR_COMPOSITOR_CF_ENTRY_REGIONS_CHANGED) 249 { 250 if (fChangeFlags & VBOXVR_COMPOSITOR_CF_ENTRY_REPLACED) 251 { 252 Assert(pReplacedScrEntry); 253 Assert(pEntry); 254 if (pDisplay->Mural.fRootVrOn) 255 { 256 CR_DISPLAY_ENTRY *pReplacedDEntry = CR_DENTRY_FROM_CENTRY(pReplacedScrEntry); 257 Assert(CrVrScrCompositorEntryIsUsed(&pReplacedDEntry->RootVrCEntry)); 258 Assert(!CrVrScrCompositorEntryIsUsed(&pEntry->RootVrCEntry)); 259 CrVrScrCompositorEntryInit(&pEntry->RootVrCEntry, CrVrScrCompositorEntryTexGet(&pEntry->CEntry), NULL); 260 CrVrScrCompositorEntryFlagsSet(&pEntry->RootVrCEntry, CrVrScrCompositorEntryFlagsGet(&pEntry->CEntry)); 261 CrVrScrCompositorEntryReplace(&pDisplay->Mural.RootVrCompositor, &pReplacedDEntry->RootVrCEntry, &pEntry->RootVrCEntry); 262 } 263 } 231 264 else 232 crWarning("CrVrScrCompositorRegionsGet failed, rc %d", rc); 233 234 Assert(!pReplacedScrEntry); 235 } 236 else if (fChangeFlags & VBOXVR_COMPOSITOR_CF_ENTRY_REPLACED) 237 { 238 Assert(pReplacedScrEntry); 265 { 266 Assert(!pReplacedScrEntry); 267 if (pDisplay->Mural.fRootVrOn) 268 { 269 bool fChanged = false; 270 int rc = crServerMuralSynchRootVr(&pDisplay->Mural, &fChanged); 271 if (RT_SUCCESS(rc)) 272 { 273 if (fChanged) 274 crServerWindowVisibleRegion(&pDisplay->Mural); 275 } 276 else 277 crWarning("crServerMuralSynchRootVr failed, rc %d", rc); 278 } 279 } 239 280 } 240 281 else 241 282 { 283 Assert(!(fChangeFlags & VBOXVR_COMPOSITOR_CF_ENTRY_REPLACED)); 242 284 Assert(!pReplacedScrEntry); 243 285 } -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_window.c
r48095 r48726 216 216 uint32_t cRects; 217 217 const RTRECT *pRects; 218 int rc = crServerMuralSynchRootVr(mural );218 int rc = crServerMuralSynchRootVr(mural, NULL); 219 219 if (RT_SUCCESS(rc)) 220 220 { … … 504 504 Assert(!CrVrScrCompositorEntryIsUsed(&pDEntry->RootVrCEntry)); 505 505 CrVrScrCompositorEntryInit(&pDEntry->RootVrCEntry, CrVrScrCompositorEntryTexGet(pEntry), NULL); 506 CrVrScrCompositorEntryFlagsSet(&pDEntry->RootVrCEntry, CrVrScrCompositorEntryFlagsGet(pEntry)); 506 507 return &pDEntry->RootVrCEntry; 507 508 } 508 509 509 int crServerMuralSynchRootVr(CRMuralInfo *mural )510 int crServerMuralSynchRootVr(CRMuralInfo *mural, bool *pfChanged) 510 511 { 511 512 int rc; … … 517 518 CrVrScrCompositorClear(&mural->RootVrCompositor); 518 519 519 rc = CrVrScrCompositorIntersectedList(&mural->Compositor, &cr_server.RootVr, &mural->RootVrCompositor, crServerMuralGetRootVrCEntry, NULL, NULL);520 rc = CrVrScrCompositorIntersectedList(&mural->Compositor, &cr_server.RootVr, &mural->RootVrCompositor, crServerMuralGetRootVrCEntry, NULL, pfChanged); 520 521 if (!RT_SUCCESS(rc)) 521 522 { … … 609 610 if (mural->fRootVrOn) 610 611 { 611 rc = crServerMuralSynchRootVr(mural );612 rc = crServerMuralSynchRootVr(mural, NULL); 612 613 if (!RT_SUCCESS(rc)) 613 614 { … … 693 694 if (mural->fRootVrOn) 694 695 { 695 int rc = crServerMuralSynchRootVr(mural );696 int rc = crServerMuralSynchRootVr(mural, NULL); 696 697 if (RT_SUCCESS(rc)) 697 698 { … … 764 765 } 765 766 766 if (mural->fUseDefaultDEntry) 767 { 768 /* NOTE: we can do it even if !(mural->fPresentMode & CR_SERVER_REDIR_F_DISPLAY) to make sure the compositor data is always up to date */ 769 /* the compositor lock is not needed actually since we have prevented renderspu from using the compositor */ 770 /* CrVrScrCompositorLock(&mural->Compositor); */ 771 rc = CrVrScrCompositorEntryRegionsSet(&mural->Compositor, &mural->DefaultDEntry.CEntry, NULL, cRects, (const RTRECT *)pRects, false, &fRegionsChanged); 772 /*CrVrScrCompositorUnlock(&mural->Compositor);*/ 773 if (!RT_SUCCESS(rc)) 774 { 775 crWarning("CrVrScrCompositorEntryRegionsSet failed, rc %d", rc); 776 goto end; 777 } 778 } 779 else 780 { 781 fRegionsChanged = true; 767 Assert(mural->fUseDefaultDEntry); 768 /* NOTE: we can do it even if !(mural->fPresentMode & CR_SERVER_REDIR_F_DISPLAY) to make sure the compositor data is always up to date */ 769 /* the compositor lock is not needed actually since we have prevented renderspu from using the compositor */ 770 /* CrVrScrCompositorLock(&mural->Compositor); */ 771 rc = CrVrScrCompositorEntryRegionsSet(&mural->Compositor, &mural->DefaultDEntry.CEntry, NULL, cRects, (const RTRECT *)pRects, false, &fRegionsChanged); 772 /*CrVrScrCompositorUnlock(&mural->Compositor);*/ 773 if (!RT_SUCCESS(rc)) 774 { 775 crWarning("CrVrScrCompositorEntryRegionsSet failed, rc %d", rc); 776 goto end; 782 777 } 783 778 … … 786 781 if (mural->fRootVrOn) 787 782 { 788 rc = crServerMuralSynchRootVr(mural );783 rc = crServerMuralSynchRootVr(mural, NULL); 789 784 if (!RT_SUCCESS(rc)) 790 785 { -
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.c
r48356 r48726 698 698 } 699 699 700 #ifdef DEBUG_misha 701 # define CR_DBG_DUMP_VISIBLE_REGIONS 702 #endif 703 704 #ifdef CR_DBG_DUMP_VISIBLE_REGIONS 705 static void renderspuDbgDumpVisibleRegion(GLint win, GLint cRects, const GLint *pRects) 706 { 707 GLint i; 708 const RTRECT *pRtRects = (const RTRECT *)((const void*)pRects); 709 710 crInfo("Window %d, Vidible Regions%d", win, cRects); 711 for (i = 0; i < cRects; ++i) 712 { 713 crInfo("%d: (%d,%d), (%d,%d)", i, pRtRects[i].xLeft, pRtRects[i].yTop, pRtRects[i].xRight, pRtRects[i].yBottom); 714 } 715 crInfo("======"); 716 } 717 #endif 718 700 719 static void RENDER_APIENTRY 701 720 renderspuWindowVisibleRegion(GLint win, GLint cRects, const GLint *pRects) … … 703 722 WindowInfo *window; 704 723 CRASSERT(win >= 0); 724 725 #ifdef CR_DBG_DUMP_VISIBLE_REGIONS 726 renderspuDbgDumpVisibleRegion(win, cRects, pRects); 727 #endif 728 705 729 window = (WindowInfo *) crHashtableSearch(render_spu.windowTable, win); 706 730 if (window) { … … 708 732 } 709 733 else { 710 cr Debug("Render SPU: Attempt to set VisibleRegion for invalid window (%d)", win);734 crWarning("Render SPU: Attempt to set VisibleRegion for invalid window (%d)", win); 711 735 } 712 736 }
Note:
See TracChangeset
for help on using the changeset viewer.