- Timestamp:
- Apr 25, 2014 7:31:35 PM (11 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp
r51121 r51148 6499 6499 } 6500 6500 6501 if (pSrcAlloc->AllocData.hostID) 6502 { 6503 if (pDstAlloc->AllocData.hostID) 6504 { 6505 VBOXCMDVBVA_BLT_OFFPRIMSZFMT_OR_ID *pBlt = (VBOXCMDVBVA_BLT_OFFPRIMSZFMT_OR_ID*)pBltHdr; 6506 pHdr->u8Flags |= VBOXCMDVBVA_OPF_BLT_TYPE_OFFPRIMSZFMT_OR_ID | VBOXCMDVBVA_OPF_OPERAND1_ISID | VBOXCMDVBVA_OPF_OPERAND2_ISID; 6507 pBlt->id = pDstAlloc->AllocData.hostID; 6508 pBlt->alloc.u.id = pSrcAlloc->AllocData.hostID; 6509 cbPrivateData = RT_OFFSETOF(VBOXCMDVBVA_BLT_OFFPRIMSZFMT_OR_ID, aRects); 6510 } 6511 else 6512 { 6513 NTSTATUS Status = vboxWddmCmCmdBltIdNotIdFill(pBltHdr, pSrcAlloc, pDstAlloc, pDst, FALSE, &u32DstPatch, &cbPrivateData); 6514 if (!NT_SUCCESS(Status)) 6515 { 6516 WARN(("vboxWddmCmCmdBltIdNotIdFill failed, %#x", Status)); 6517 return Status; 6518 } 6519 } 6520 } 6521 else 6522 { 6523 if (pDstAlloc->AllocData.hostID) 6524 { 6525 NTSTATUS Status = vboxWddmCmCmdBltIdNotIdFill(pBltHdr, pDstAlloc, pSrcAlloc, pSrc, TRUE, &u32SrcPatch, &cbPrivateData); 6526 if (!NT_SUCCESS(Status)) 6527 { 6528 WARN(("vboxWddmCmCmdBltIdNotIdFill failed, %#x", Status)); 6529 return Status; 6530 } 6531 } 6532 else 6533 { 6534 pBltHdr->Hdr.u8Flags |= VBOXCMDVBVA_OPF_BLT_TYPE_GENERIC_A8R8G8B8; 6535 VBOXCMDVBVA_BLT_GENERIC_A8R8G8B8 *pBlt = (VBOXCMDVBVA_BLT_GENERIC_A8R8G8B8*)pBltHdr; 6536 VBoxCVDdiFillAllocDescOffVRAM(&pBlt->alloc1, pDstAlloc, pDst); 6537 VBoxCVDdiFillAllocDescOffVRAM(&pBlt->alloc2, pSrcAlloc, pSrc); 6538 u32DstPatch = RT_OFFSETOF(VBOXCMDVBVA_BLT_GENERIC_A8R8G8B8, alloc1.Info.u.offVRAM); 6539 u32SrcPatch = RT_OFFSETOF(VBOXCMDVBVA_BLT_GENERIC_A8R8G8B8, alloc2.Info.u.offVRAM); 6540 cbPrivateData = RT_OFFSETOF(VBOXCMDVBVA_BLT_GENERIC_A8R8G8B8, aRects); 6541 } 6542 } 6543 6501 6544 if (fDstPrimary) 6502 { 6503 if (fSrcPrimary) 6504 { 6505 pHdr->u.u8PrimaryID = pDstAlloc->AllocData.SurfDesc.VidPnSourceId; 6506 pHdr->u8Flags |= VBOXCMDVBVA_OPF_BLT_TYPE_PRIMARY_PRIMARY; 6507 VBOXCMDVBVA_BLT_PRIMARY *pBlt = (VBOXCMDVBVA_BLT_PRIMARY*)pBltHdr; 6508 pBlt->alloc.u.id = pSrcAlloc->AllocData.SurfDesc.VidPnSourceId; 6509 cbPrivateData = RT_OFFSETOF(VBOXCMDVBVA_BLT_PRIMARY, aRects); 6510 } 6511 else 6512 { 6513 NTSTATUS Status = vboxWddmCmCmdBltPrimNotPrimFill(pBltHdr, pDstAlloc, pSrcAlloc, pSrc, TRUE, &u32SrcPatch, &cbPrivateData); 6514 if (!NT_SUCCESS(Status)) 6515 { 6516 WARN(("vboxWddmCmCmdBltPrimNotPrimFill failed, %#x", Status)); 6517 return Status; 6518 } 6519 } 6545 pBltHdr->Hdr.u.u8PrimaryID = (uint8_t)pDstAlloc->AllocData.SurfDesc.VidPnSourceId; 6546 else if (fSrcPrimary) 6547 { 6548 pBltHdr->Hdr.u8Flags |= VBOXCMDVBVA_OPF_PRIMARY_HINT_SRC; 6549 pBltHdr->Hdr.u.u8PrimaryID = (uint8_t)pSrcAlloc->AllocData.SurfDesc.VidPnSourceId; 6520 6550 } 6521 6551 else 6522 { 6523 if (fSrcPrimary) 6524 { 6525 NTSTATUS Status = vboxWddmCmCmdBltPrimNotPrimFill(pBltHdr, pSrcAlloc, pDstAlloc, pDst, FALSE, &u32DstPatch, &cbPrivateData); 6526 if (!NT_SUCCESS(Status)) 6527 { 6528 WARN(("vboxWddmCmCmdBltPrimNotPrimFill failed, %#x", Status)); 6529 return Status; 6530 } 6531 } 6532 else 6533 { 6534 if (pSrcAlloc->AllocData.hostID) 6535 { 6536 if (pDstAlloc->AllocData.hostID) 6537 { 6538 VBOXCMDVBVA_BLT_OFFPRIMSZFMT_OR_ID *pBlt = (VBOXCMDVBVA_BLT_OFFPRIMSZFMT_OR_ID*)pBltHdr; 6539 pHdr->u8Flags |= VBOXCMDVBVA_OPF_BLT_TYPE_OFFPRIMSZFMT_OR_ID | VBOXCMDVBVA_OPF_OPERAND1_ISID | VBOXCMDVBVA_OPF_OPERAND2_ISID; 6540 pBlt->id = pDstAlloc->AllocData.hostID; 6541 pBlt->alloc.u.id = pSrcAlloc->AllocData.hostID; 6542 cbPrivateData = RT_OFFSETOF(VBOXCMDVBVA_BLT_OFFPRIMSZFMT_OR_ID, aRects); 6543 } 6544 else 6545 { 6546 NTSTATUS Status = vboxWddmCmCmdBltIdNotIdFill(pBltHdr, pSrcAlloc, pDstAlloc, pDst, FALSE, &u32DstPatch, &cbPrivateData); 6547 if (!NT_SUCCESS(Status)) 6548 { 6549 WARN(("vboxWddmCmCmdBltIdNotIdFill failed, %#x", Status)); 6550 return Status; 6551 } 6552 } 6553 } 6554 else 6555 { 6556 if (pDstAlloc->AllocData.hostID) 6557 { 6558 NTSTATUS Status = vboxWddmCmCmdBltIdNotIdFill(pBltHdr, pDstAlloc, pSrcAlloc, pSrc, TRUE, &u32SrcPatch, &cbPrivateData); 6559 if (!NT_SUCCESS(Status)) 6560 { 6561 WARN(("vboxWddmCmCmdBltIdNotIdFill failed, %#x", Status)); 6562 return Status; 6563 } 6564 } 6565 else 6566 { 6567 pBltHdr->Hdr.u8Flags |= VBOXCMDVBVA_OPF_BLT_TYPE_GENERIC_A8R8G8B8; 6568 VBOXCMDVBVA_BLT_GENERIC_A8R8G8B8 *pBlt = (VBOXCMDVBVA_BLT_GENERIC_A8R8G8B8*)pBltHdr; 6569 VBoxCVDdiFillAllocDescOffVRAM(&pBlt->alloc1, pDstAlloc, pDst); 6570 VBoxCVDdiFillAllocDescOffVRAM(&pBlt->alloc2, pSrcAlloc, pSrc); 6571 u32DstPatch = RT_OFFSETOF(VBOXCMDVBVA_BLT_GENERIC_A8R8G8B8, alloc1.Info.u.offVRAM); 6572 u32SrcPatch = RT_OFFSETOF(VBOXCMDVBVA_BLT_GENERIC_A8R8G8B8, alloc2.Info.u.offVRAM); 6573 cbPrivateData = RT_OFFSETOF(VBOXCMDVBVA_BLT_GENERIC_A8R8G8B8, aRects); 6574 } 6575 } 6576 } 6577 } 6552 pBltHdr->Hdr.u.u8PrimaryID = 0xff; 6578 6553 6579 6554 paRects = (VBOXCMDVBVA_RECT*)(((uint8_t*)pPresent->pDmaBufferPrivateData) + cbPrivateData); … … 6671 6646 pClrFillHdr->u32Color = pPresent->Color; 6672 6647 6648 pHdr->u8Flags = VBOXCMDVBVA_OPF_CLRFILL_TYPE_GENERIC_A8R8G8B8; 6649 pHdr->u.u8PrimaryID = 0; 6650 6651 VBOXCMDVBVA_CLRFILL_GENERIC_A8R8G8B8 *pCFill = (VBOXCMDVBVA_CLRFILL_GENERIC_A8R8G8B8*)pHdr; 6652 VBoxCVDdiFillAllocInfoOffVRAM(&pCFill->dst.Info, pDst); 6653 pCFill->dst.u16Width = (uint16_t)pDstAlloc->AllocData.SurfDesc.width; 6654 pCFill->dst.u16Height = (uint16_t)pDstAlloc->AllocData.SurfDesc.height; 6655 u32DstPatch = RT_OFFSETOF(VBOXCMDVBVA_CLRFILL_GENERIC_A8R8G8B8, dst.Info.u.offVRAM); 6656 paRects = pCFill->aRects; 6657 cbPrivateData = RT_OFFSETOF(VBOXCMDVBVA_CLRFILL_GENERIC_A8R8G8B8, aRects); 6658 6673 6659 if (fDstPrimary) 6674 { 6675 pHdr->u8Flags = VBOXCMDVBVA_OPF_CLRFILL_TYPE_PRIMARY; 6676 pHdr->u.u8PrimaryID = pDstAlloc->AllocData.SurfDesc.VidPnSourceId; 6677 6678 VBOXCMDVBVA_CLRFILL_PRIMARY *pCFill = (VBOXCMDVBVA_CLRFILL_PRIMARY*)pHdr; 6679 paRects = pCFill->aRects; 6680 cbPrivateData = RT_OFFSETOF(VBOXCMDVBVA_CLRFILL_PRIMARY, aRects); 6681 } 6660 pCFill->Hdr.Hdr.u.u8PrimaryID = (uint8_t)pDstAlloc->AllocData.SurfDesc.VidPnSourceId; 6682 6661 else 6683 { 6684 pHdr->u8Flags = VBOXCMDVBVA_OPF_CLRFILL_TYPE_GENERIC_A8R8G8B8; 6685 pHdr->u.u8PrimaryID = 0; 6686 6687 VBOXCMDVBVA_CLRFILL_GENERIC_A8R8G8B8 *pCFill = (VBOXCMDVBVA_CLRFILL_GENERIC_A8R8G8B8*)pHdr; 6688 VBoxCVDdiFillAllocInfoOffVRAM(&pCFill->dst.Info, pDst); 6689 pCFill->dst.u16Width = (uint16_t)pDstAlloc->AllocData.SurfDesc.width; 6690 pCFill->dst.u16Height = (uint16_t)pDstAlloc->AllocData.SurfDesc.height; 6691 u32DstPatch = RT_OFFSETOF(VBOXCMDVBVA_CLRFILL_GENERIC_A8R8G8B8, dst.Info.u.offVRAM); 6692 paRects = pCFill->aRects; 6693 cbPrivateData = RT_OFFSETOF(VBOXCMDVBVA_CLRFILL_GENERIC_A8R8G8B8, aRects); 6694 } 6662 pCFill->Hdr.Hdr.u.u8PrimaryID = 0xff; 6695 6663 6696 6664 cbBuffer = VBOXWDDM_DUMMY_DMABUFFER_SIZE; -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_presenter.cpp
r51147 r51148 4836 4836 } 4837 4837 4838 static void crVBoxServerCrCmdBltPrimaryUpdate(const VBVAINFOSCREEN *pScreen, const RTRECT *pRects, uint32_t cRects, uint32_t u32PrimaryID)4838 static void crVBoxServerCrCmdBltPrimaryUpdate(const VBVAINFOSCREEN *pScreen, uint32_t cRects, const RTRECT *pRects) 4839 4839 { 4840 4840 if (!cRects) 4841 4841 return; 4842 4842 4843 uint32_t u32PrimaryID = pScreen->u32ViewIndex; 4843 4844 bool fDirtyEmpty = true; 4844 4845 RTRECT dirtyRect; … … 5006 5007 } 5007 5008 5008 crVBoxServerCrCmdBltPrimaryUpdate(CrFbGetScreenInfo(hFb), pRects, cRects, u32PrimaryID);5009 crVBoxServerCrCmdBltPrimaryUpdate(CrFbGetScreenInfo(hFb), cRects, pRects); 5009 5010 5010 5011 return 0; … … 5105 5106 { 5106 5107 if (hSrcFb) 5107 WARN(("blit from one framebuffer to another not supported properly")); 5108 { 5109 WARN(("blit from one framebuffer, wow")); 5110 5111 int rc = CrFbUpdateBegin(hSrcFb); 5112 if (RT_SUCCESS(rc)) 5113 { 5114 CrFbRegionsClear(hSrcFb); 5115 5116 CrFbUpdateEnd(hSrcFb); 5117 } 5118 else 5119 WARN(("CrFbUpdateBegin failed %d", rc)); 5120 } 5108 5121 5109 5122 CR_BLITTER_IMG Img; … … 5115 5128 } 5116 5129 5117 int rc = CrFbBltPutContentsNe(hDstFb, pPos, cRects, pRects, &Img); 5118 if (RT_FAILURE(rc)) 5119 { 5120 WARN(("CrFbBltPutContentsNe failed %d", rc)); 5121 return -1; 5122 } 5130 const VBVAINFOSCREEN *pScreen = CrFbGetScreenInfo(hDstFb); 5131 if (pScreen->u32Width == dstWidth && pScreen->u32Height == dstHeight) 5132 { 5133 int rc = CrFbBltPutContentsNe(hDstFb, pPos, cRects, pRects, &Img); 5134 if (RT_FAILURE(rc)) 5135 { 5136 WARN(("CrFbBltPutContentsNe failed %d", rc)); 5137 return -1; 5138 } 5139 } 5140 else 5141 { 5142 int rc = CrFbUpdateBegin(hDstFb); 5143 if (RT_SUCCESS(rc)) 5144 { 5145 CrFbRegionsClear(hDstFb); 5146 5147 CrFbUpdateEnd(hDstFb); 5148 } 5149 else 5150 WARN(("CrFbUpdateBegin failed %d", rc)); 5151 5152 rc = crVBoxServerCrCmdBltVramToVramMem(offSrcVRAM, srcWidth, srcHeight, offDstVRAM, dstWidth, dstHeight, pPos, cRects, pRects); 5153 if (RT_FAILURE(rc)) 5154 { 5155 WARN(("crVBoxServerCrCmdBltVramToVramMem failed, %d", rc)); 5156 return -1; 5157 } 5158 } 5159 5160 crVBoxServerCrCmdBltPrimaryUpdate(pScreen, cRects, pRects); 5123 5161 5124 5162 return 0; … … 5134 5172 } 5135 5173 5136 int rc = CrFbBltGetContents(hSrcFb, pPos, cRects, pRects, &Img); 5137 if (RT_FAILURE(rc)) 5138 { 5139 WARN(("CrFbBltGetContents failed %d", rc)); 5140 return -1; 5174 const VBVAINFOSCREEN *pScreen = CrFbGetScreenInfo(hSrcFb); 5175 if (pScreen->u32Width == srcWidth && pScreen->u32Height == srcHeight) 5176 { 5177 int rc = CrFbBltGetContents(hSrcFb, pPos, cRects, pRects, &Img); 5178 if (RT_FAILURE(rc)) 5179 { 5180 WARN(("CrFbBltGetContents failed %d", rc)); 5181 return -1; 5182 } 5183 } 5184 else 5185 { 5186 int rc = CrFbUpdateBegin(hSrcFb); 5187 if (RT_SUCCESS(rc)) 5188 { 5189 CrFbRegionsClear(hSrcFb); 5190 5191 CrFbUpdateEnd(hSrcFb); 5192 } 5193 else 5194 WARN(("CrFbUpdateBegin failed %d", rc)); 5195 5196 rc = crVBoxServerCrCmdBltVramToVramMem(offSrcVRAM, srcWidth, srcHeight, offDstVRAM, dstWidth, dstHeight, pPos, cRects, pRects); 5197 if (RT_FAILURE(rc)) 5198 { 5199 WARN(("crVBoxServerCrCmdBltVramToVramMem failed, %d", rc)); 5200 return -1; 5201 } 5141 5202 } 5142 5203 … … 5275 5336 } 5276 5337 5277 crVBoxServerCrCmdBltPrimaryUpdate(CrFbGetScreenInfo(hFb), pRects, cRects, u32PrimaryID);5338 crVBoxServerCrCmdBltPrimaryUpdate(CrFbGetScreenInfo(hFb), cRects, pRects); 5278 5339 5279 5340 return 0; … … 5445 5506 } 5446 5507 5447 crVBoxServerCrCmdBltPrimaryUpdate(CrFbGetScreenInfo(hFb), pRects, cRects, u32PrimaryID);5508 crVBoxServerCrCmdBltPrimaryUpdate(CrFbGetScreenInfo(hFb), cRects, pRects); 5448 5509 5449 5510 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.