Changeset 32496 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVdma.cpp
- Timestamp:
- Sep 14, 2010 10:14:46 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVdma.cpp
r32241 r32496 307 307 { 308 308 PVBOXWDDM_CONTEXT pContext = pRectsInfo->pContext; 309 PVBOXWDDM_SWAPCHAIN pSwapchain = pRectsInfo->pSwapchain; 309 310 PDEVICE_EXTENSION pDevExt = pContext->pDevice->pAdapter; 310 311 PVBOXWDDM_RECTS_INFO pRects = &pRectsInfo->ContextsRects.UpdateRects; … … 314 315 Assert(KeGetCurrentIrql() < DISPATCH_LEVEL); 315 316 ExAcquireFastMutex(&pDevExt->ContextMutex); 316 for (PLIST_ENTRY pCur = pDevExt-> ContextList3D.Flink; pCur != &pDevExt->ContextList3D; pCur = pCur->Flink)317 { 318 if (pCur != &p Context->ListEntry)319 { 320 PVBOXWDDM_ CONTEXT pCurContext = VBOXWDDMENTRY_2_CONTEXT(pCur);317 for (PLIST_ENTRY pCur = pDevExt->SwapchainList3D.Flink; pCur != &pDevExt->SwapchainList3D; pCur = pCur->Flink) 318 { 319 if (pCur != &pSwapchain->DevExtListEntry) 320 { 321 PVBOXWDDM_SWAPCHAIN pCurSwapchain = VBOXWDDMENTRY_2_SWAPCHAIN(pCur); 321 322 if (!pCmdInternal) 322 323 { 323 pCmdInternal = (PVBOXVIDEOCM_CMD_RECTS_INTERNAL)vboxVideoCmCmdCreate(&pCur Context->CmContext, cbCmdInternal);324 pCmdInternal = (PVBOXVIDEOCM_CMD_RECTS_INTERNAL)vboxVideoCmCmdCreate(&pCurSwapchain->pContext->CmContext, cbCmdInternal); 324 325 Assert(pCmdInternal); 325 326 if (!pCmdInternal) … … 331 332 else 332 333 { 333 pCmdInternal = (PVBOXVIDEOCM_CMD_RECTS_INTERNAL)vboxVideoCmCmdReinitForContext(pCmdInternal, &pCur Context->CmContext);334 pCmdInternal = (PVBOXVIDEOCM_CMD_RECTS_INTERNAL)vboxVideoCmCmdReinitForContext(pCmdInternal, &pCurSwapchain->pContext->CmContext); 334 335 } 335 336 336 vboxVdmaDirtyRectsCalcIntersection(&pCur Context->ViewRect, pRects, &pCmdInternal->Cmd.RectsInfo);337 vboxVdmaDirtyRectsCalcIntersection(&pCurSwapchain->ViewRect, pRects, &pCmdInternal->Cmd.RectsInfo); 337 338 if (pCmdInternal->Cmd.RectsInfo.cRects) 338 339 { … … 340 341 pCmdInternal->Cmd.fFlags.Value = 0; 341 342 pCmdInternal->Cmd.fFlags.bAddHiddenRects = 1; 342 if (pCur Context->pLastReportedRects)343 { 344 if (pCur Context->pLastReportedRects->Cmd.fFlags.bSetVisibleRects)343 if (pCurSwapchain->pLastReportedRects) 344 { 345 if (pCurSwapchain->pLastReportedRects->Cmd.fFlags.bSetVisibleRects) 345 346 { 346 347 RECT *paPrevRects; 347 348 uint32_t cPrevRects; 348 if (pCur Context->pLastReportedRects->Cmd.fFlags.bSetViewRect)349 if (pCurSwapchain->pLastReportedRects->Cmd.fFlags.bSetViewRect) 349 350 { 350 paPrevRects = &pCur Context->pLastReportedRects->Cmd.RectsInfo.aRects[1];351 cPrevRects = pCur Context->pLastReportedRects->Cmd.RectsInfo.cRects - 1;351 paPrevRects = &pCurSwapchain->pLastReportedRects->Cmd.RectsInfo.aRects[1]; 352 cPrevRects = pCurSwapchain->pLastReportedRects->Cmd.RectsInfo.cRects - 1; 352 353 } 353 354 else 354 355 { 355 paPrevRects = &pCur Context->pLastReportedRects->Cmd.RectsInfo.aRects[0];356 cPrevRects = pCur Context->pLastReportedRects->Cmd.RectsInfo.cRects;356 paPrevRects = &pCurSwapchain->pLastReportedRects->Cmd.RectsInfo.aRects[0]; 357 cPrevRects = pCurSwapchain->pLastReportedRects->Cmd.RectsInfo.cRects; 357 358 } 358 359 … … 365 366 else 366 367 { 367 Assert(pCur Context->pLastReportedRects->Cmd.fFlags.bAddHiddenRects);368 if (!vboxVdmaDirtyRectsIsCover(pCur Context->pLastReportedRects->Cmd.RectsInfo.aRects,369 pCur Context->pLastReportedRects->Cmd.RectsInfo.cRects,368 Assert(pCurSwapchain->pLastReportedRects->Cmd.fFlags.bAddHiddenRects); 369 if (!vboxVdmaDirtyRectsIsCover(pCurSwapchain->pLastReportedRects->Cmd.RectsInfo.aRects, 370 pCurSwapchain->pLastReportedRects->Cmd.RectsInfo.cRects, 370 371 pCmdInternal->Cmd.RectsInfo.aRects, pCmdInternal->Cmd.RectsInfo.cRects)) 371 372 { … … 379 380 if (bSend) 380 381 { 381 if (pCur Context->pLastReportedRects)382 vboxVideoCmCmdRelease(pCur Context->pLastReportedRects);383 384 pCmdInternal-> VidPnSourceId = pRectsInfo->VidPnSourceId;382 if (pCurSwapchain->pLastReportedRects) 383 vboxVideoCmCmdRelease(pCurSwapchain->pLastReportedRects); 384 385 pCmdInternal->hSwapchainUm = pCurSwapchain->hSwapchainUm; 385 386 386 387 vboxVideoCmCmdRetain(pCmdInternal); 387 pCur Context->pLastReportedRects = pCmdInternal;388 pCurSwapchain->pLastReportedRects = pCmdInternal; 388 389 vboxVideoCmCmdSubmit(pCmdInternal, VBOXVIDEOCM_CMD_RECTS_INTERNAL_SIZE4CRECTS(pCmdInternal->Cmd.RectsInfo.cRects)); 389 390 pCmdInternal = NULL; … … 394 395 { 395 396 RECT * pContextRect = &pRectsInfo->ContextsRects.ContextRect; 396 bool bRectShanged = (p Context->ViewRect.left != pContextRect->left397 || p Context->ViewRect.top != pContextRect->top398 || p Context->ViewRect.right != pContextRect->right399 || p Context->ViewRect.bottom != pContextRect->bottom);397 bool bRectShanged = (pSwapchain->ViewRect.left != pContextRect->left 398 || pSwapchain->ViewRect.top != pContextRect->top 399 || pSwapchain->ViewRect.right != pContextRect->right 400 || pSwapchain->ViewRect.bottom != pContextRect->bottom); 400 401 PVBOXVIDEOCM_CMD_RECTS_INTERNAL pDrCmdInternal; 401 402 … … 416 417 pDrCmdInternal->Cmd.fFlags.bSetViewRect = 1; 417 418 pDrCmdInternal->Cmd.RectsInfo.aRects[0] = *pContextRect; 418 p Context->ViewRect = *pContextRect;419 pSwapchain->ViewRect = *pContextRect; 419 420 memcpy(&pDrCmdInternal->Cmd.RectsInfo.aRects[1], pRects->aRects, sizeof (RECT) * pRects->cRects); 420 421 bSend = true; … … 441 442 memcpy(&pDrCmdInternal->Cmd.RectsInfo.aRects[0], pRects->aRects, sizeof (RECT) * pRects->cRects); 442 443 443 if (p Context->pLastReportedRects)444 { 445 if (p Context->pLastReportedRects->Cmd.fFlags.bSetVisibleRects)444 if (pSwapchain->pLastReportedRects) 445 { 446 if (pSwapchain->pLastReportedRects->Cmd.fFlags.bSetVisibleRects) 446 447 { 447 448 RECT *paRects; 448 449 uint32_t cRects; 449 if (p Context->pLastReportedRects->Cmd.fFlags.bSetViewRect)450 if (pSwapchain->pLastReportedRects->Cmd.fFlags.bSetViewRect) 450 451 { 451 paRects = &p Context->pLastReportedRects->Cmd.RectsInfo.aRects[1];452 cRects = p Context->pLastReportedRects->Cmd.RectsInfo.cRects - 1;452 paRects = &pSwapchain->pLastReportedRects->Cmd.RectsInfo.aRects[1]; 453 cRects = pSwapchain->pLastReportedRects->Cmd.RectsInfo.cRects - 1; 453 454 } 454 455 else 455 456 { 456 paRects = &p Context->pLastReportedRects->Cmd.RectsInfo.aRects[0];457 cRects = p Context->pLastReportedRects->Cmd.RectsInfo.cRects;457 paRects = &pSwapchain->pLastReportedRects->Cmd.RectsInfo.aRects[0]; 458 cRects = pSwapchain->pLastReportedRects->Cmd.RectsInfo.cRects; 458 459 } 459 460 bSend = (pDrCmdInternal->Cmd.RectsInfo.cRects != cRects) … … 462 463 else 463 464 { 464 Assert(p Context->pLastReportedRects->Cmd.fFlags.bAddHiddenRects);465 Assert(pSwapchain->pLastReportedRects->Cmd.fFlags.bAddHiddenRects); 465 466 bSend = true; 466 467 } … … 474 475 if (bSend) 475 476 { 476 if (p Context->pLastReportedRects)477 vboxVideoCmCmdRelease(p Context->pLastReportedRects);477 if (pSwapchain->pLastReportedRects) 478 vboxVideoCmCmdRelease(pSwapchain->pLastReportedRects); 478 479 479 480 pDrCmdInternal->Cmd.fFlags.bSetVisibleRects = 1; 480 pDrCmdInternal-> VidPnSourceId = pRectsInfo->VidPnSourceId;481 pDrCmdInternal->hSwapchainUm = pSwapchain->hSwapchainUm; 481 482 482 483 vboxVideoCmCmdRetain(pDrCmdInternal); 483 p Context->pLastReportedRects = pDrCmdInternal;484 pSwapchain->pLastReportedRects = pDrCmdInternal; 484 485 vboxVideoCmCmdSubmit(pDrCmdInternal, VBOXVIDEOCM_SUBMITSIZE_DEFAULT); 485 486 }
Note:
See TracChangeset
for help on using the changeset viewer.