Changeset 50184 in vbox
- Timestamp:
- Jan 23, 2014 4:10:13 PM (11 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/include/cr_blitter.h
r50095 r50184 244 244 if (!RT_SUCCESS(rc)) 245 245 { 246 crWarning("CrBltEnter failed rc %d", rc);246 WARN(("CrBltEnter failed rc %d", rc)); 247 247 return rc; 248 248 } … … 262 262 if (!pTex->Flags.Entered) 263 263 { 264 crWarning("invalid Blt Leave");264 WARN(("invalid Blt Leave")); 265 265 return; 266 266 } … … 281 281 VBOXBLITTERDECL(int) CrTdBltDataAcquire(PCR_TEXDATA pTex, GLenum enmFormat, bool fInverted, const CR_BLITTER_IMG**ppImg); 282 282 /* release the texture data, the data remains cached in the CR_TEXDATA object until it is discarded with CrTdBltDataDiscard or CrTdBltDataCleanup */ 283 VBOXBLITTERDECL( void) CrTdBltDataRelease(PCR_TEXDATA pTex);283 VBOXBLITTERDECL(int) CrTdBltDataRelease(PCR_TEXDATA pTex); 284 284 /* discard the texture data cached with previous CrTdBltDataAcquire. 285 285 * Must be called wit data released (CrTdBltDataRelease) */ 286 VBOXBLITTERDECL( void) CrTdBltDataDiscard(PCR_TEXDATA pTex);286 VBOXBLITTERDECL(int) CrTdBltDataDiscard(PCR_TEXDATA pTex); 287 287 /* does same as CrTdBltDataDiscard, and in addition cleans up. 288 288 * this is kind of a texture destructor, which clients should call on texture object destruction, e.g. from the PFNCRTEXDATA_RELEASED callback */ 289 VBOXBLITTERDECL(void) CrTdBltDataCleanup(PCR_TEXDATA pTex); 289 VBOXBLITTERDECL(int) CrTdBltDataCleanup(PCR_TEXDATA pTex); 290 291 VBOXBLITTERDECL(int) CrTdBltDataCleanupNe(PCR_TEXDATA pTex); 290 292 291 293 DECLINLINE(uint32_t) CrTdAddRef(PCR_TEXDATA pTex) … … 302 304 pTex->pfnTextureReleased(pTex); 303 305 else 304 CrTdBltDataCleanup (pTex);306 CrTdBltDataCleanupNe(pTex); 305 307 } 306 308 -
trunk/src/VBox/GuestHost/OpenGL/util/blitter.cpp
r50095 r50184 550 550 if (!CrBltIsEntered(pBlitter)) 551 551 { 552 crWarning("CrBltLeave: blitter not entered");552 WARN(("CrBltLeave: blitter not entered")); 553 553 return; 554 554 } … … 573 573 if (!pBlitter->CurrentMural.Base.id && pBlitter->CtxInfo.Base.id) 574 574 { 575 crWarning("current mural not initialized!");575 WARN(("current mural not initialized!")); 576 576 return VERR_INVALID_STATE; 577 577 } … … 579 579 if (CrBltIsEntered(pBlitter)) 580 580 { 581 crWarning("blitter is entered already!");581 WARN(("blitter is entered already!")); 582 582 return VERR_INVALID_STATE; 583 583 } … … 600 600 } 601 601 602 crWarning("crBltInitOnMakeCurent failed, rc %d", rc);602 WARN(("crBltInitOnMakeCurent failed, rc %d", rc)); 603 603 CrBltLeave(pBlitter); 604 604 return rc; … … 1203 1203 if (pTex->idPBO) 1204 1204 { 1205 Assert(CrBltIsEntered(pBlitter)); 1205 1206 pBlitter->pDispatch->BindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, pTex->idPBO); 1206 1207 pBlitter->pDispatch->UnmapBufferARB(GL_PIXEL_PACK_BUFFER_ARB); … … 1263 1264 1264 1265 /* release the texture data, the data remains cached in the CR_TEXDATA object until it is discarded with CrTdBltDataDiscard or CrTdBltDataCleanup */ 1265 VBOXBLITTERDECL(void) CrTdBltDataRelease(PCR_TEXDATA pTex) 1266 { 1266 VBOXBLITTERDECL(int) CrTdBltDataRelease(PCR_TEXDATA pTex) 1267 { 1268 if (!pTex->Flags.Entered) 1269 { 1270 WARN(("tex not entered")); 1271 return VERR_INVALID_STATE; 1272 } 1267 1273 Assert(pTex->Img.pvData); 1274 return VINF_SUCCESS; 1268 1275 } 1269 1276 1270 1277 /* discard the texture data cached with previous CrTdBltDataAcquire. 1271 1278 * Must be called wit data released (CrTdBltDataRelease) */ 1272 VBOXBLITTERDECL(void) CrTdBltDataDiscard(PCR_TEXDATA pTex) 1273 { 1279 VBOXBLITTERDECL(int) CrTdBltDataDiscard(PCR_TEXDATA pTex) 1280 { 1281 if (!pTex->Flags.Entered) 1282 { 1283 WARN(("tex not entered")); 1284 return VERR_INVALID_STATE; 1285 } 1286 1274 1287 crTdBltImgFree(pTex); 1275 } 1276 /* does same as CrTdBltDataDiscard, and in addition cleans up */ 1277 VBOXBLITTERDECL(void) CrTdBltDataCleanup(PCR_TEXDATA pTex) 1288 1289 return VINF_SUCCESS; 1290 } 1291 1292 static void crTdBltDataCleanup(PCR_TEXDATA pTex) 1278 1293 { 1279 1294 crTdBltImgFree(pTex); … … 1283 1298 if (pTex->idPBO) 1284 1299 { 1300 Assert(CrBltIsEntered(pBlitter)); 1285 1301 pBlitter->pDispatch->DeleteBuffersARB(1, &pTex->idPBO); 1286 1302 pTex->idPBO = 0; … … 1289 1305 if (pTex->idInvertTex) 1290 1306 { 1307 Assert(CrBltIsEntered(pBlitter)); 1291 1308 pBlitter->pDispatch->DeleteTextures(1, &pTex->idInvertTex); 1292 1309 pTex->idInvertTex = 0; 1293 1310 } 1311 } 1312 1313 /* does same as CrTdBltDataDiscard, and in addition cleans up */ 1314 VBOXBLITTERDECL(int) CrTdBltDataCleanup(PCR_TEXDATA pTex) 1315 { 1316 if (!pTex->Flags.Entered) 1317 { 1318 WARN(("tex not entered")); 1319 return VERR_INVALID_STATE; 1320 } 1321 1322 crTdBltDataCleanup(pTex); 1323 1324 return VINF_SUCCESS; 1325 } 1326 1327 VBOXBLITTERDECL(int) CrTdBltDataCleanupNe(PCR_TEXDATA pTex) 1328 { 1329 bool fEntered = false; 1330 if (pTex->idPBO || pTex->idInvertTex) 1331 { 1332 int rc = CrTdBltEnter(pTex); 1333 if (!RT_SUCCESS(rc)) 1334 { 1335 WARN(("err")); 1336 return rc; 1337 } 1338 1339 fEntered = true; 1340 } 1341 1342 crTdBltDataCleanup(pTex); 1343 1344 if (fEntered) 1345 CrTdBltLeave(pTex); 1346 1347 return VINF_SUCCESS; 1294 1348 } 1295 1349 … … 1299 1353 VBOXBLITTERDECL(int) CrTdBltDataAcquire(PCR_TEXDATA pTex, GLenum enmFormat, bool fInverted, const CR_BLITTER_IMG**ppImg) 1300 1354 { 1355 if (!pTex->Flags.Entered) 1356 { 1357 WARN(("tex not entered")); 1358 return VERR_INVALID_STATE; 1359 } 1360 1301 1361 if (pTex->Img.pvData && pTex->Img.enmFormat == enmFormat && !pTex->Flags.DataInverted == !fInverted) 1302 1362 { … … 1316 1376 if (!RT_SUCCESS(rc)) 1317 1377 { 1318 crWarning("crTdBltCheckInvertTex failed rc %d", rc);1378 WARN(("crTdBltCheckInvertTex failed rc %d", rc)); 1319 1379 return rc; 1320 1380 } … … 1342 1402 if (!RT_SUCCESS(rc)) 1343 1403 { 1344 crWarning("crTdBltImgAcquire failed rc %d", rc);1404 WARN(("crTdBltImgAcquire failed rc %d", rc)); 1345 1405 return rc; 1346 1406 } -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_misc.c
r50095 r50184 238 238 } 239 239 cr_server.projectionOverride = GL_TRUE; 240 break; 241 242 case GL_HH_SET_TMPCTX_MAKE_CURRENT: 243 /*we should not receive it from the guest! */ 240 244 break; 241 245 … … 673 677 Ctx.Base.id = cr_server.MainContextInfo.SpuContext; 674 678 Ctx.Base.visualBits = cr_server.MainContextInfo.CreateInfo.visualBits; 675 rc = CrBltInit(&cr_server.Blitter, &Ctx, true, true, NULL, &cr_server. head_spu->dispatch_table);679 rc = CrBltInit(&cr_server.Blitter, &Ctx, true, true, NULL, &cr_server.TmpCtxDispatch); 676 680 if (RT_SUCCESS(rc)) 677 681 { … … 685 689 } 686 690 } 691 692 if (!CrBltMuralGetCurrentInfo(&cr_server.Blitter)->Base.id) 693 { 694 CRMuralInfo *dummy = crServerGetDummyMural(cr_server.MainContextInfo.CreateInfo.visualBits); 695 CR_BLITTER_WINDOW DummyInfo; 696 CRASSERT(dummy); 697 crServerVBoxBlitterWinInit(&DummyInfo, dummy); 698 CrBltMuralSetCurrentInfo(&cr_server.Blitter, &DummyInfo); 699 } 700 687 701 return &cr_server.Blitter; 688 702 } … … 1347 1361 if (pCtx) 1348 1362 { 1349 GLint curSrvSpuCtx = cr_server.currentCtxInfo && cr_server.currentCtxInfo->SpuContext > 0 ? cr_server.currentCtxInfo->SpuContext : cr_server.MainContextInfo.SpuContext;1350 bool fSwitchToTmpCtx = (curSrvSpuCtx != context);1351 1363 CRMuralInfo *pCurrentMural = cr_server.currentMural; 1352 CRContextInfo *pCurCtxInfo = cr_server.currentCtxInfo; 1353 pCurCtx = pCurCtxInfo ? pCurCtxInfo->pContext : NULL; 1354 1355 CRASSERT(pCurCtx == pCtx); 1364 1365 pCurCtx = cr_server.currentCtxInfo ? cr_server.currentCtxInfo->pContext : cr_server.MainContextInfo.pContext; 1366 Assert(pCurCtx == pCtx); 1367 1368 if (!context) 1369 { 1370 if (pCurrentMural) 1371 { 1372 Assert(cr_server.currentCtxInfo); 1373 context = cr_server.currentCtxInfo->SpuContext > 0 ? cr_server.currentCtxInfo->SpuContext : cr_server.MainContextInfo.SpuContext; 1374 window = pCurrentMural->spuWindow; 1375 } 1376 else 1377 { 1378 CRMuralInfo * pDummy; 1379 Assert(!cr_server.currentCtxInfo); 1380 pDummy = crServerGetDummyMural(cr_server.MainContextInfo.CreateInfo.visualBits); 1381 context = cr_server.MainContextInfo.SpuContext; 1382 window = pDummy->spuWindow; 1383 } 1384 1385 1386 fDoPrePostProcess = -1; 1387 } 1388 else 1389 { 1390 fDoPrePostProcess = 1; 1391 } 1356 1392 1357 1393 if (pCurrentMural) … … 1365 1401 idReadFBO = 0; 1366 1402 } 1367 1368 fDoPrePostProcess = fSwitchToTmpCtx ? 1 : -1;1369 1403 } 1370 1404 else … … 1384 1418 void crServerInitTmpCtxDispatch() 1385 1419 { 1420 MakeCurrentFunc_t pfnMakeCurrent; 1421 1386 1422 crSPUInitDispatchTable(&cr_server.TmpCtxDispatch); 1387 1423 crSPUCopyDispatchTable(&cr_server.TmpCtxDispatch, &cr_server.head_spu->dispatch_table); 1388 1424 cr_server.TmpCtxDispatch.MakeCurrent = crServerMakeTmpCtxCurrent; 1425 1426 pfnMakeCurrent = crServerMakeTmpCtxCurrent; 1427 cr_server.head_spu->dispatch_table.ChromiumParametervCR(GL_HH_SET_TMPCTX_MAKE_CURRENT, GL_BYTE, sizeof (void*), &pfnMakeCurrent); 1428 1389 1429 } 1390 1430 -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_presenter.cpp
r50178 r50184 330 330 CRTextureObj *pTobj = pFbTex->pTobj; 331 331 332 CrTdBltDataCleanup (pTex);332 CrTdBltDataCleanupNe(pTex); 333 333 334 334 if (pTobj) … … 2433 2433 } 2434 2434 2435 return vrdpFrame(hNewEntry); 2435 const VBOXVR_SCR_COMPOSITOR_ENTRY* pReplacedEntry = CrFbEntryGetCompositorEntry(hReplacedEntry); 2436 CR_TEXDATA *pReplacedTex = CrVrScrCompositorEntryTexGet(pReplacedEntry); 2437 const VBOXVR_SCR_COMPOSITOR_ENTRY* pNewEntry = CrFbEntryGetCompositorEntry(hNewEntry); 2438 CR_TEXDATA *pNewTex = CrVrScrCompositorEntryTexGet(pNewEntry); 2439 2440 rc = CrTdBltEnter(pReplacedTex); 2441 if (RT_SUCCESS(rc)) 2442 { 2443 if (pNewTex != pReplacedTex) 2444 { 2445 CrTdBltDataDiscard(pReplacedTex); 2446 rc = CrTdBltEnter(pNewTex); 2447 if (RT_SUCCESS(rc)) 2448 { 2449 rc = vrdpFrame(hNewEntry); 2450 CrTdBltLeave(pNewTex); 2451 } 2452 else 2453 WARN(("CrTdBltEnter failed %d", rc)); 2454 } 2455 else 2456 rc = vrdpFrame(hNewEntry); 2457 2458 CrTdBltLeave(pReplacedTex); 2459 } 2460 else 2461 WARN(("CrTdBltEnter failed %d", rc)); 2462 2463 return rc; 2436 2464 } 2437 2465 … … 2445 2473 } 2446 2474 2447 return vrdpFrame(hEntry); 2475 const VBOXVR_SCR_COMPOSITOR_ENTRY* pEntry = CrFbEntryGetCompositorEntry(hEntry); 2476 CR_TEXDATA *pTex = CrVrScrCompositorEntryTexGet(pEntry); 2477 2478 rc = CrTdBltEnter(pTex); 2479 if (RT_SUCCESS(rc)) 2480 { 2481 rc = vrdpFrame(hEntry); 2482 CrTdBltLeave(pTex); 2483 } 2484 else 2485 WARN(("CrTdBltEnter failed %d", rc)); 2486 2487 return rc; 2448 2488 } 2449 2489 … … 2597 2637 CR_TEXDATA *pTex = CrVrScrCompositorEntryTexGet(pEntry); 2598 2638 const CR_BLITTER_IMG *pImg; 2639 CrTdBltDataDiscard(pTex); 2599 2640 int rc = CrTdBltDataAcquire(pTex, GL_BGRA, !!(CrVrScrCompositorEntryFlagsGet(pEntry) & CRBLT_F_INVERT_SRC_YCOORDS), &pImg); 2600 2641 if (!RT_SUCCESS(rc)) -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_window.c
r50123 r50184 196 196 CR_BLITTER_WINDOW DummyInfo; 197 197 CRASSERT(dummy); 198 crServerVBoxBlitterWinInit(&DummyInfo, dummy); 198 199 CrBltMuralSetCurrentInfo(pBlitter, &DummyInfo); 199 200 } -
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.c
r50095 r50184 1545 1545 memcpy(&render_spu.blitterDispatch.MakeCurrent, values, count); 1546 1546 else 1547 crWarning("unexpected type(%#x) - count(%d) pair", type, count);1547 WARN(("unexpected type(%#x) - count(%d) pair", type, count)); 1548 1548 break; 1549 1549 1550 1550 default: 1551 1551 #if 0 1552 crWarning("Unhandled target in renderspuChromiumParametervCR(0x%x)", (int) target);1552 WARN(("Unhandled target in renderspuChromiumParametervCR(0x%x)", (int) target)); 1553 1553 #endif 1554 1554 break;
Note:
See TracChangeset
for help on using the changeset viewer.