Changeset 46783 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Jun 25, 2013 4:09:37 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 86715
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/common/wddm/VBoxMPIf.h
r46757 r46783 35 35 36 36 /* One would increase this whenever definitions in this file are changed */ 37 #define VBOXVIDEOIF_VERSION 1 737 #define VBOXVIDEOIF_VERSION 18 38 38 39 39 #define VBOXWDDM_NODE_ID_SYSTEM 0 … … 485 485 { 486 486 uint32_t u32Version; 487 uint32_t u32VBox3DCaps; 487 488 uint32_t cInfos; 488 489 VBOXVHWA_INFO aInfos[VBOX_VIDEO_MAX_SCREENS]; -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxD3DIf.cpp
r43621 r46783 571 571 HANDLE hSharedHandle = pAllocation->hSharedHandle; 572 572 IDirect3DSurface9* pD3D9Surf; 573 switch (pAllocation->enmType) 574 { 575 case VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC: 576 { 577 hr = pDevice9If->CreateRenderTarget(pAllocation->SurfDesc.width, 578 pAllocation->SurfDesc.height, 579 vboxDDI2D3DFormat(pRc->RcDesc.enmFormat), 580 vboxDDI2D3DMultiSampleType(pRc->RcDesc.enmMultisampleType), 581 pRc->RcDesc.MultisampleQuality, 582 !pRc->RcDesc.fFlags.NotLockable /* BOOL Lockable */, 583 &pD3D9Surf, 573 if ((pDevice->pAdapter->u32VBox3DCaps & CR_VBOX_CAP_TEX_PRESENT) || pAllocation->enmType == VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC) 574 { 575 hr = pDevice9If->CreateRenderTarget(pAllocation->SurfDesc.width, 576 pAllocation->SurfDesc.height, 577 vboxDDI2D3DFormat(pRc->RcDesc.enmFormat), 578 vboxDDI2D3DMultiSampleType(pRc->RcDesc.enmMultisampleType), 579 pRc->RcDesc.MultisampleQuality, 580 !pRc->RcDesc.fFlags.NotLockable /* BOOL Lockable */, 581 &pD3D9Surf, 584 582 #ifdef VBOXWDDMDISP_DEBUG_NOSHARED 585 583 NULL 586 584 #else 587 585 pRc->RcDesc.fFlags.SharedResource ? &hSharedHandle : NULL 588 586 #endif 589 590 591 break;592 }593 case VBOXWDDM_ALLOC_TYPE_STD_SHAREDPRIMARYSURFACE:594 {587 ); 588 Assert(hr == S_OK); 589 } 590 else if (pAllocation->enmType == VBOXWDDM_ALLOC_TYPE_STD_SHAREDPRIMARYSURFACE) 591 { 592 do { 595 593 BOOL bNeedPresent; 596 594 if (pRc->cAllocations != 1) … … 623 621 pD3D9Surf = (IDirect3DSurface9*)pAllocation->pD3DIf; 624 622 break; 625 } 626 default: 627 { 628 WARN(("unexpected alloc type %d", pAllocation->enmType)); 629 hr = E_FAIL; 630 break; 631 } 623 } while (0); 624 } 625 else 626 { 627 WARN(("unexpected alloc type %d", pAllocation->enmType)); 628 hr = E_FAIL; 632 629 } 633 630 -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3D.cpp
r46757 r46783 4493 4493 VBOXDISPCRHGSMI_SCOPE_SET_DEV(pDevice); 4494 4494 HRESULT hr = S_OK; 4495 if (VBOXDISPMODE_IS_3D(pDevice->pAdapter)) 4495 PVBOXWDDMDISP_ADAPTER pAdapter = pDevice->pAdapter; 4496 PVBOXWDDMDISP_RESOURCE pSrcRc = NULL, pDstRc = NULL; 4497 PVBOXWDDMDISP_ALLOCATION pSrcAlloc = NULL, pDstAlloc = NULL; 4498 4499 if (pData->hSrcResource) 4500 { 4501 pSrcRc = (PVBOXWDDMDISP_RESOURCE)pData->hSrcResource; 4502 Assert(pSrcRc->cAllocations > pData->SrcSubResourceIndex); 4503 pSrcAlloc = &pSrcRc->aAllocations[pData->SrcSubResourceIndex]; 4504 Assert(pSrcAlloc->hAllocation); 4505 } 4506 4507 if (pData->hDstResource) 4508 { 4509 pDstRc = (PVBOXWDDMDISP_RESOURCE)pData->hDstResource; 4510 Assert(pDstRc->cAllocations > pData->DstSubResourceIndex); 4511 pDstAlloc = &pDstRc->aAllocations[pData->DstSubResourceIndex]; 4512 Assert(pDstAlloc->hAllocation); 4513 } 4514 4515 if (VBOXDISPMODE_IS_3D(pAdapter)) 4496 4516 { 4497 4517 #ifdef VBOXWDDM_TEST_UHGSMI … … 4504 4524 } 4505 4525 #endif 4506 pDevice->pAdapter->D3D.D3D.pfnVBoxWineExD3DDev9FlushToHost((IDirect3DDevice9Ex*)pDevice->pDevice9If); 4507 PVBOXWDDMDISP_RESOURCE pRc = (PVBOXWDDMDISP_RESOURCE)pData->hSrcResource; 4508 Assert(pRc); 4509 Assert(pRc->cAllocations > pData->SrcSubResourceIndex); 4510 PVBOXWDDMDISP_ALLOCATION pAlloc = &pRc->aAllocations[pData->SrcSubResourceIndex]; 4511 hr = vboxWddmSwapchainPresent(pDevice, pAlloc); 4512 Assert(hr == S_OK); 4513 } 4514 4515 { 4516 D3DDDICB_PRESENT DdiPresent = {0}; 4517 if (pData->hSrcResource) 4518 { 4526 if (pAdapter->u32VBox3DCaps & CR_VBOX_CAP_TEX_PRESENT) 4527 { 4528 IDirect3DSurface9 *pSrcSurfIf = NULL; 4529 hr = VBoxD3DIfSurfGet(pSrcRc, pData->DstSubResourceIndex, &pSrcSurfIf); 4530 if (SUCCEEDED(hr)) 4531 { 4532 pAdapter->D3D.D3D.pfnVBoxWineExD3DSurf9SyncToHost(pSrcSurfIf); 4533 } 4534 else 4535 { 4536 WARN(("VBoxD3DIfSurfGet failed, hr = 0x%x", hr)); 4537 return hr; 4538 } 4539 4540 pAdapter->D3D.D3D.pfnVBoxWineExD3DDev9FlushToHost((IDirect3DDevice9Ex*)pDevice->pDevice9If); 4541 } 4542 else 4543 { 4544 pAdapter->D3D.D3D.pfnVBoxWineExD3DDev9FlushToHost((IDirect3DDevice9Ex*)pDevice->pDevice9If); 4519 4545 PVBOXWDDMDISP_RESOURCE pRc = (PVBOXWDDMDISP_RESOURCE)pData->hSrcResource; 4546 Assert(pRc); 4520 4547 Assert(pRc->cAllocations > pData->SrcSubResourceIndex); 4521 4548 PVBOXWDDMDISP_ALLOCATION pAlloc = &pRc->aAllocations[pData->SrcSubResourceIndex]; 4522 Assert(pAlloc->hAllocation); 4523 DdiPresent.hSrcAllocation = pAlloc->hAllocation; 4524 } 4525 if (pData->hDstResource) 4526 { 4527 PVBOXWDDMDISP_RESOURCE pRc = (PVBOXWDDMDISP_RESOURCE)pData->hDstResource; 4528 Assert(pRc->cAllocations > pData->DstSubResourceIndex); 4529 PVBOXWDDMDISP_ALLOCATION pAlloc = &pRc->aAllocations[pData->DstSubResourceIndex]; 4530 Assert(pAlloc->hAllocation); 4531 DdiPresent.hDstAllocation = pAlloc->hAllocation; 4532 } 4533 DdiPresent.hContext = pDevice->DefaultContext.ContextInfo.hContext; 4549 hr = vboxWddmSwapchainPresent(pDevice, pAlloc); 4550 Assert(hr == S_OK); 4551 } 4552 } 4553 4554 D3DDDICB_PRESENT DdiPresent = {0}; 4555 if (pSrcAlloc) 4556 DdiPresent.hSrcAllocation = pSrcAlloc->hAllocation; 4557 4558 if (pDstAlloc) 4559 DdiPresent.hDstAllocation = pDstAlloc->hAllocation; 4560 4561 DdiPresent.hContext = pDevice->DefaultContext.ContextInfo.hContext; 4534 4562 4535 4563 #if 0 //def VBOX_WDDMDISP_WITH_PROFILE 4536 4564 VBoxDispProfileScopeLogger<VBoxDispProfileEntry> profilePresentCbLogger(pDevice->ProfileDdiPresentCb.alloc("pfnPresentCb")); 4537 4565 #endif 4566 4538 4567 #ifdef VBOXWDDMDISP_DEBUG_TIMER 4539 4540 4568 HANDLE hTimer = NULL; 4569 vboxVDbgTimerStart(pDevice->hTimerQueue, &hTimer, 1000); 4541 4570 #endif 4542 4571 hr = pDevice->RtCallbacks.pfnPresentCb(pDevice->hDevice, &DdiPresent); 4543 4572 #ifdef VBOXWDDMDISP_DEBUG_TIMER 4544 4573 vboxVDbgTimerStop(pDevice->hTimerQueue, hTimer); 4545 4574 #endif 4546 4575 #if 0 //def VBOX_WDDMDISP_WITH_PROFILE 4547 4548 4549 4550 4551 4552 4576 profilePresentCbLogger.logAndDisable(); 4577 if (pDevice->ProfileDdiPresentCb.getNumEntries() == 64) 4578 { 4579 pDevice->ProfileDdiPresentCb.dump(pDevice); 4580 pDevice->ProfileDdiPresentCb.reset(); 4581 } 4553 4582 #endif 4554 Assert(hr == S_OK); 4555 } 4583 Assert(hr == S_OK); 4556 4584 4557 4585 vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p), hr(0x%x)\n", hDevice, hr)); … … 6180 6208 pAdapter->RtCallbacks = *pOpenData->pAdapterCallbacks; 6181 6209 6210 pAdapter->u32VBox3DCaps = Query.u32VBox3DCaps; 6211 6182 6212 pAdapter->cHeads = Query.cInfos; 6183 6184 6213 6185 6214 pOpenData->hAdapter = pAdapter; -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3D.h
r44529 r46783 79 79 VBOXWDDMDISP_D3D D3D; 80 80 VBOXWDDMDISP_FORMATS Formats; 81 uint32_t u32VBox3DCaps; 81 82 #ifdef VBOX_WDDMDISP_WITH_PROFILE 82 83 VBoxDispProfileFpsCounter ProfileDdiFps; -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3DCmn.h
r44529 r46783 67 67 #include "VBoxD3DIf.h" 68 68 #endif 69 #include <cr_protocol.h> 69 70 70 71 # ifdef VBOXWDDMDISP -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3DIf.cpp
r46757 r46783 146 146 { 147 147 WARN(("no VBoxWineExD3DSurf9GetHostId")); 148 break; 149 } 150 151 pD3D->pfnVBoxWineExD3DSurf9SyncToHost = (PFNVBOXWINEEXD3DSURF9_SYNCTOHOST)GetProcAddress(pD3D->hD3DLib, "VBoxWineExD3DSurf9SyncToHost"); 152 if (!pD3D->pfnVBoxWineExD3DSurf9SyncToHost) 153 { 154 WARN(("no VBoxWineExD3DSurf9SyncToHost")); 148 155 break; 149 156 } -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3DIf.h
r46757 r46783 81 81 PFNVBOXWINEEXD3DSURF9_GETHOSTID pfnVBoxWineExD3DSurf9GetHostId; 82 82 83 PFNVBOXWINEEXD3DSURF9_SYNCTOHOST pfnVBoxWineExD3DSurf9SyncToHost; 84 83 85 PFNVBOXWINEEXD3DSWAPCHAIN9_GETHOSTWINID pfnVBoxWineExD3DSwapchain9GetHostWinID; 84 86 -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPCr.cpp
r46757 r46783 24 24 #ifdef VBOX_WITH_CROGL 25 25 #include <cr_protocol.h> 26 27 static uint32_t g_VBoxMpCrHostCaps = 0; 28 29 uint32_t VBoxMpCrGetHostCaps() 30 { 31 return g_VBoxMpCrHostCaps; 32 } 26 33 27 34 static void* vboxMpCrShgsmiBufferAlloc(PVBOXMP_DEVEXT pDevExt, HGSMISIZE cbData) … … 527 534 CRVBOXHGSMIWRITEREAD *pCmd = &pWrData->Cmd; 528 535 529 pDr->fFlags = VBOXVDMACBUF_FLAG_BUF_ VRAM_OFFSET;536 pDr->fFlags = VBOXVDMACBUF_FLAG_BUF_FOLLOWS_DR; 530 537 pDr->cbBuf = cbCmd; 531 538 pDr->rc = VERR_NOT_IMPLEMENTED; 532 pDr->Location.offVramBuf = vboxMpCrShgsmiTransportBufOffset(pCon, pCmd); 539 // pDr->Location.offVramBuf = vboxMpCrShgsmiTransportBufOffset(pCon, pCmd); 540 533 541 534 542 pHdr->enmType = VBOXVDMACMD_TYPE_CHROMIUM_CMD; … … 546 554 547 555 VBOXVDMACMD_CHROMIUM_BUFFER *pBufCmd = &pBody->aBuffers[0]; 548 pBufCmd->offBuffer = vbox MpCrShgsmiTransportBufOffset(pCon, pCmd);556 pBufCmd->offBuffer = vboxVdmaCBufDrPtrOffset(&pDevExt->u.primary.Vdma, pCmd); 549 557 pBufCmd->cbBuffer = sizeof (*pCmd); 550 558 pBufCmd->u32GuestData = 0; … … 569 577 PFNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEASYNC_COMPLETION pfnCompletion, uint32_t cbContextData) 570 578 { 571 572 579 const uint32_t cBuffers = 2; 573 580 const uint32_t cbCmd = VBOXMP_CRSHGSMICON_DR_SIZE(cBuffers, sizeof (VBOXMP_CRHGSMICMD_WRITE), cbContextData); … … 708 715 return parms.hdr.result; 709 716 } 717 return VINF_SUCCESS; 718 } 719 720 static int vboxMpCrCtlConGetCaps(PVBOXMP_CRCTLCON pCrCtlCon, uint32_t u32ClientID, uint32_t *pu32Caps) 721 { 722 CRVBOXHGCMGETCAPS parms; 723 int rc; 724 725 parms.hdr.result = VERR_WRONG_ORDER; 726 parms.hdr.u32ClientID = u32ClientID; 727 parms.hdr.u32Function = SHCRGL_GUEST_FN_GET_CAPS; 728 parms.hdr.cParms = SHCRGL_CPARMS_GET_CAPS; 729 730 parms.Caps.type = VMMDevHGCMParmType_32bit; 731 parms.Caps.u.value32 = 0; 732 733 *pu32Caps = 0; 734 735 rc = vboxCrCtlConCall(pCrCtlCon->hCrCtl, &parms.hdr, sizeof (parms)); 736 if (RT_FAILURE(rc)) 737 { 738 WARN(("vboxCrCtlConCall failed, rc (%d)", rc)); 739 return rc; 740 } 741 742 if (RT_FAILURE(parms.hdr.result)) 743 { 744 WARN(("SHCRGL_GUEST_FN_GET_CAPS failed, rc (%d)", parms.hdr.result)); 745 return parms.hdr.result; 746 } 747 748 *pu32Caps = parms.Caps.u.value32; 749 710 750 return VINF_SUCCESS; 711 751 } … … 835 875 } 836 876 877 rc = vboxMpCrCtlConGetCaps(&CrCtlCon, u32ClientID, &g_VBoxMpCrHostCaps); 878 if (RT_FAILURE(rc)) 879 { 880 WARN(("vboxMpCrCtlConGetCaps failed rc (%d), ignoring..", rc)); 881 g_VBoxMpCrHostCaps = 0; 882 } 883 837 884 rc = VBoxMpCrCtlConDisconnect(&CrCtlCon, u32ClientID); 838 885 if (RT_FAILURE(rc)) 839 WARN(("VBoxMpCrCtlConDisconnect failed , ignoring.."));886 WARN(("VBoxMpCrCtlConDisconnect failed rc (%d), ignoring..", rc)); 840 887 841 888 return true; … … 844 891 #endif 845 892 } 893 894 int VBoxMpCrCmdRxReadbackHandler(CRMessageReadback *pRx, uint32_t cbRx) 895 { 896 if (cbRx < sizeof (*pRx)) 897 { 898 WARN(("invalid rx size %d", cbRx)); 899 return VERR_INVALID_PARAMETER; 900 } 901 void* pvData = VBoxMpCrCmdRxReadbackData(pRx); 902 uint32_t cbData = VBoxMpCrCmdRxReadbackDataSize(pRx, cbRx); 903 void *pvDataPtr = *((void**)&pRx->readback_ptr); 904 memcpy(pvDataPtr, pvData, cbData); 905 return VINF_SUCCESS; 906 } 907 908 int VBoxMpCrCmdRxHandler(CRMessageHeader *pRx, uint32_t cbRx) 909 { 910 if (cbRx < sizeof (*pRx)) 911 { 912 WARN(("invalid rx size %d", cbRx)); 913 return VERR_INVALID_PARAMETER; 914 } 915 CRMessageHeader *pHdr = (CRMessageHeader*)pRx; 916 switch (pHdr->type) 917 { 918 case CR_MESSAGE_READBACK: 919 return VBoxMpCrCmdRxReadbackHandler((CRMessageReadback*)pRx, cbRx); 920 default: 921 WARN(("unsupported rx message type: %d", pHdr->type)); 922 return VERR_INVALID_PARAMETER; 923 } 924 } 925 -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPCr.h
r46757 r46783 217 217 } 218 218 } 219 220 DECLINLINE(void*) VBoxMpCrCmdRxReadbackData(CRMessageReadback *pRx) 221 { 222 return (void*)(pRx+1); 223 } 224 225 DECLINLINE(uint32_t) VBoxMpCrCmdRxReadbackDataSize(CRMessageReadback *pRx, uint32_t cbRx) 226 { 227 return cbRx - sizeof (*pRx); 228 } 229 int VBoxMpCrCmdRxReadbackHandler(CRMessageReadback *pRx, uint32_t cbRx); 230 int VBoxMpCrCmdRxHandler(CRMessageHeader *pRx, uint32_t cbRx); 231 232 /* must be called after calling VBoxMpCrCtlConIs3DSupported only */ 233 uint32_t VBoxMpCrGetHostCaps(); 234 219 235 #define VBOXMP_CRCMD_HEADER_SIZE sizeof (CRMessageOpcodes) 220 236 /* last +4 below is 4-aligned comand opcode size (i.e. ((1 + 3) & ~3)) */ … … 224 240 #define VBOXMP_CRCMD_SIZE_WINDOWSHOW (16 + 4) 225 241 #define VBOXMP_CRCMD_SIZE_WINDOWSIZE (20 + 4) 242 #define VBOXMP_CRCMD_SIZE_GETCHROMIUMPARAMETERVCR (36 + 4) 226 243 227 244 #endif /* #ifndef ___VBoxMPCr_h__ */ -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVdma.cpp
r46757 r46783 322 322 } 323 323 324 NTSTATUS vboxVdmaCrSubmitWriteAsync(PVBOXMP_DEVEXT pDevExt, VBOXMP_CRPACKER *pCrPacker, uint32_t u32CrConClientID) 324 typedef struct VBOXMP_VDMACR_WRITEREADCOMPLETION 325 { 326 void *pvBufferToFree; 327 void *pvContext; 328 } VBOXMP_VDMACR_WRITEREADCOMPLETION, *PVBOXMP_VDMACR_WRITEREADCOMPLETION; 329 330 void vboxVdmaCrSubmitWriteReadAsyncGenericCompletion(PVBOXMP_CRSHGSMITRANSPORT pCon, void *pvCtx) 331 { 332 PVBOXMP_VDMACR_WRITEREADCOMPLETION pData = (PVBOXMP_VDMACR_WRITEREADCOMPLETION)pvCtx; 333 void* pvBufferToFree = pData->pvBufferToFree; 334 if (pvBufferToFree) 335 VBoxMpCrShgsmiTransportBufFree(pCon, pvBufferToFree); 336 337 VBoxMpCrShgsmiTransportCmdTermWriteReadAsync(pCon, pvCtx); 338 } 339 340 NTSTATUS vboxVdmaCrSubmitWriteReadAsync(PVBOXMP_DEVEXT pDevExt, VBOXMP_CRPACKER *pCrPacker, uint32_t u32CrConClientID, PFNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEREADASYNC_COMPLETION pfnCompletion, void *pvCompletion) 325 341 { 326 342 Assert(u32CrConClientID); … … 331 347 if (pvBuffer) 332 348 { 349 PVBOXMP_VDMACR_WRITEREADCOMPLETION pvCompletionData = (PVBOXMP_VDMACR_WRITEREADCOMPLETION)VBoxMpCrShgsmiTransportCmdCreateWriteReadAsync(&pDevExt->CrHgsmiTransport, u32CrConClientID, pvBuffer, cbBuffer, 350 pfnCompletion, sizeof (*pvCompletionData)); 351 if (pvCompletionData) 352 { 353 pvCompletionData->pvBufferToFree = pvPackBuffer; 354 pvCompletionData->pvContext = pvCompletion; 355 int rc = VBoxMpCrShgsmiTransportCmdSubmitWriteReadAsync(&pDevExt->CrHgsmiTransport, pvCompletionData); 356 if (RT_SUCCESS(rc)) 357 { 358 return STATUS_SUCCESS; 359 } 360 WARN(("VBoxMpCrShgsmiTransportCmdSubmitWriteAsync failed, rc %d", rc)); 361 Status = STATUS_UNSUCCESSFUL; 362 VBoxMpCrShgsmiTransportCmdTermWriteReadAsync(&pDevExt->CrHgsmiTransport, pvCompletionData); 363 } 364 else 365 { 366 WARN(("VBoxMpCrShgsmiTransportCmdCreateWriteAsync failed")); 367 Status = STATUS_INSUFFICIENT_RESOURCES; 368 } 369 } 370 371 return Status; 372 } 373 374 NTSTATUS vboxVdmaCrSubmitWriteAsync(PVBOXMP_DEVEXT pDevExt, VBOXMP_CRPACKER *pCrPacker, uint32_t u32CrConClientID) 375 { 376 Assert(u32CrConClientID); 377 NTSTATUS Status = STATUS_SUCCESS; 378 uint32_t cbBuffer; 379 void * pvPackBuffer; 380 void * pvBuffer = VBoxMpCrPackerTxBufferComplete(pCrPacker, &cbBuffer, &pvPackBuffer); 381 if (pvBuffer) 382 { 333 383 PVBOXMP_VDMACR_WRITECOMPLETION pvCompletionData = (PVBOXMP_VDMACR_WRITECOMPLETION)VBoxMpCrShgsmiTransportCmdCreateWriteAsync(&pDevExt->CrHgsmiTransport, u32CrConClientID, pvBuffer, cbBuffer, 334 384 vboxVdmaCrWriteCompletion, sizeof (*pvCompletionData)); … … 337 387 pvCompletionData->pvBufferToFree = pvPackBuffer; 338 388 int rc = VBoxMpCrShgsmiTransportCmdSubmitWriteAsync(&pDevExt->CrHgsmiTransport, pvCompletionData); 339 if ( !RT_SUCCESS(rc))389 if (RT_SUCCESS(rc)) 340 390 { 341 WARN(("VBoxMpCrShgsmiTransportCmdSubmitWriteAsync failed, rc %d", rc)); 342 Status = STATUS_UNSUCCESSFUL; 391 return STATUS_SUCCESS; 343 392 } 393 WARN(("VBoxMpCrShgsmiTransportCmdSubmitWriteAsync failed, rc %d", rc)); 394 Status = STATUS_UNSUCCESSFUL; 395 VBoxMpCrShgsmiTransportCmdTermWriteAsync(&pDevExt->CrHgsmiTransport, pvCompletionData); 344 396 } 345 397 else 346 398 { 347 399 WARN(("VBoxMpCrShgsmiTransportCmdCreateWriteAsync failed")); 348 Status = STATUS_ NO_MEMORY;400 Status = STATUS_INSUFFICIENT_RESOURCES; 349 401 } 350 402 } … … 550 602 { 551 603 WARN(("VBoxMpCrShgsmiTransportBufAlloc failed!")); 552 Status = STATUS_ NO_MEMORY;604 Status = STATUS_INSUFFICIENT_RESOURCES; 553 605 goto done; 554 606 } … … 793 845 } 794 846 847 typedef struct VBOXVDMA_CRRXGENERICSYNC 848 { 849 int rc; 850 KEVENT Event; 851 } VBOXVDMA_CRRXGENERICSYNC, *PVBOXVDMA_CRRXGENERICSYNC; 852 853 static DECLCALLBACK(void) vboxVdmaCrRxGenericSyncCompletion(PVBOXMP_CRSHGSMITRANSPORT pCon, int rc, void *pvRx, uint32_t cbRx, void *pvCtx) 854 { 855 PVBOXMP_VDMACR_WRITEREADCOMPLETION pvCompletionData = (PVBOXMP_VDMACR_WRITEREADCOMPLETION)pvCtx; 856 PVBOXVDMA_CRRXGENERICSYNC pData = (PVBOXVDMA_CRRXGENERICSYNC)pvCompletionData->pvContext; 857 if (RT_SUCCESS(rc)) 858 { 859 rc = VBoxMpCrCmdRxHandler((CRMessageHeader*)pvRx, cbRx); 860 if (!RT_SUCCESS(rc)) 861 { 862 WARN(("VBoxMpCrCmdRxHandler failed %d", rc)); 863 } 864 } 865 else 866 { 867 WARN(("rx failure %d", rc)); 868 } 869 870 pData->rc = rc; 871 872 KeSetEvent(&pData->Event, 0, FALSE); 873 874 vboxVdmaCrSubmitWriteReadAsyncGenericCompletion(pCon, pvCtx); 875 } 876 877 NTSTATUS vboxVdmaCrRxGenericSync(PVBOXMP_DEVEXT pDevExt, VBOXMP_CRPACKER *pCrPacker, uint32_t u32CrConClientID) 878 { 879 VBOXVDMA_CRRXGENERICSYNC Data; 880 Data.rc = VERR_NOT_SUPPORTED; 881 KeInitializeEvent(&Data.Event, SynchronizationEvent, FALSE); 882 NTSTATUS Status = vboxVdmaCrSubmitWriteReadAsync(pDevExt, pCrPacker, u32CrConClientID, vboxVdmaCrRxGenericSyncCompletion, &Data); 883 if (!NT_SUCCESS(Status)) 884 { 885 WARN(("vboxVdmaCrSubmitWriteAsync failed Status 0x%x", Status)); 886 return Status; 887 } 888 889 Status = KeWaitForSingleObject(&Data.Event, Executive, KernelMode, FALSE, NULL /* PLARGE_INTEGER Timeout */); 890 if (!NT_SUCCESS(Status)) 891 { 892 WARN(("KeWaitForSingleObject failed Status 0x%x", Status)); 893 return Status; 894 } 895 896 return STATUS_SUCCESS; 897 } 898 899 #if 0 900 NTSTATUS vboxVdmaCrCmdGetChromiumParametervCR(PVBOXMP_DEVEXT pDevExt, uint32_t u32CrConClientID, GLenum target, GLuint index, GLenum type, GLsizei count, GLvoid * values) 901 { 902 uint32_t cbCommandBuffer = VBOXMP_CRCMD_HEADER_SIZE + VBOXMP_CRCMD_SIZE_GETCHROMIUMPARAMETERVCR; 903 uint32_t cCommands = 1; 904 void *pvCommandBuffer = VBoxMpCrShgsmiTransportBufAlloc(&pDevExt->CrHgsmiTransport, cbCommandBuffer); 905 if (!pvCommandBuffer) 906 { 907 WARN(("VBoxMpCrShgsmiTransportBufAlloc failed!")); 908 return VERR_OUT_OF_RESOURCES; 909 } 910 911 VBOXMP_CRPACKER CrPacker; 912 VBoxMpCrPackerInit(&CrPacker); 913 914 VBoxMpCrPackerTxBufferInit(&CrPacker, pvCommandBuffer, cbCommandBuffer, cCommands); 915 916 int dummy = 1; 917 918 crPackGetChromiumParametervCR(&CrPacker.CrPacker, target, index, type, count, values, &dummy); 919 920 921 NTSTATUS Status = vboxVdmaCrRxGenericSync(pDevExt, &CrPacker, u32CrConClientID); 922 if (!NT_SUCCESS(Status)) 923 { 924 WARN(("vboxVdmaCrRxGenericSync failed Status 0x%x", Status)); 925 VBoxMpCrShgsmiTransportBufFree(&pDevExt->CrHgsmiTransport, pvCommandBuffer); 926 return Status; 927 } 928 929 930 return STATUS_SUCCESS; 931 } 932 #endif 933 795 934 static NTSTATUS vboxVdmaSubitVBoxTexPresent(PVBOXMP_DEVEXT pDevExt, 796 935 VBOXMP_CRPACKER *pCrPacker, -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp
r46757 r46783 1166 1166 1167 1167 VBoxMpCrShgsmiTransportCreate(&pDevExt->CrHgsmiTransport, pDevExt); 1168 /* @todo: implement detection */ 1169 pDevExt->fTexPresentEnabled = FALSE;1168 1169 pDevExt->fTexPresentEnabled = !!(VBoxMpCrGetHostCaps() & CR_VBOX_CAP_TEX_PRESENT); 1170 1170 1171 1171 for (UINT i = 0; i < (UINT)VBoxCommonFromDeviceExt(pDevExt)->cDisplays; ++i) … … 1988 1988 #endif 1989 1989 { 1990 Assert (pQueryAdapterInfo->OutputDataSize >= sizeof (VBOXWDDM_QI)); 1991 if (pQueryAdapterInfo->OutputDataSize >= sizeof (VBOXWDDM_QI)) 1990 if (pQueryAdapterInfo->OutputDataSize == sizeof (VBOXWDDM_QI)) 1992 1991 { 1993 1992 VBOXWDDM_QI * pQi = (VBOXWDDM_QI*)pQueryAdapterInfo->pOutputData; … … 2004 2003 else 2005 2004 { 2006 LOGREL(("buffer too small"));2005 WARN(("incorrect buffer size %d, expected %d", pQueryAdapterInfo->OutputDataSize, sizeof (VBOXWDDM_QI))); 2007 2006 Status = STATUS_BUFFER_TOO_SMALL; 2008 2007 } … … 6077 6076 Assert(tmpStatus == STATUS_SUCCESS); 6078 6077 } 6078 6079 int rc = VBoxMpCrCtlConConnect(&pDevExt->CrCtlCon, CR_PROTOCOL_VERSION_MAJOR, CR_PROTOCOL_VERSION_MINOR, &pContext->u32CrConClientID); 6080 if (RT_SUCCESS(rc)) 6081 { 6082 VBoxMpCrPackerInit(&pContext->CrPacker); 6083 } 6084 else 6085 { 6086 WARN(("VBoxMpCrCtlConConnect failed rc (%d)", rc)); 6087 Status = STATUS_UNSUCCESSFUL; 6088 } 6079 6089 } 6080 6090 else … … 6103 6113 if (Status == STATUS_SUCCESS) 6104 6114 { 6105 int rc = VINF_SUCCESS;6106 6115 if (pInfo->crVersionMajor || pInfo->crVersionMinor) 6107 6116 { 6108 rc = VBoxMpCrCtlConConnect(&pDevExt->CrCtlCon,6117 int rc = VBoxMpCrCtlConConnect(&pDevExt->CrCtlCon, 6109 6118 pInfo->crVersionMajor, pInfo->crVersionMinor, 6110 6119 &pContext->u32CrConClientID); … … 6120 6129 } 6121 6130 6122 if ( RT_SUCCESS(rc))6131 if (NT_SUCCESS(Status)) 6123 6132 { 6124 6133 ASMAtomicIncU32(&pDevExt->cContexts3D); … … 6141 6150 if (Status == STATUS_SUCCESS) 6142 6151 { 6143 int rc = VINF_SUCCESS;6144 6152 if (pInfo->crVersionMajor || pInfo->crVersionMinor) 6145 6153 { 6146 rc = VBoxMpCrCtlConConnect(&pDevExt->CrCtlCon,6154 int rc = VBoxMpCrCtlConConnect(&pDevExt->CrCtlCon, 6147 6155 pInfo->crVersionMajor, pInfo->crVersionMinor, 6148 6156 &pContext->u32CrConClientID); … … 6154 6162 } 6155 6163 6156 if ( RT_SUCCESS(rc))6164 if (NT_SUCCESS(Status)) 6157 6165 { 6158 6166 ASMAtomicIncU32(&pDevExt->cContexts3D); … … 6220 6228 uint32_t cContexts = ASMAtomicDecU32(&pDevExt->cContexts3D); 6221 6229 Assert(cContexts < UINT32_MAX/2); 6222 if (pContext->u32CrConClientID)6223 {6224 VBoxMpCrCtlConDisconnect(&pDevExt->CrCtlCon, pContext->u32CrConClientID);6225 }6226 6230 break; 6227 6231 } … … 6234 6238 default: 6235 6239 break; 6240 } 6241 6242 if (pContext->u32CrConClientID) 6243 { 6244 VBoxMpCrCtlConDisconnect(&pDevExt->CrCtlCon, pContext->u32CrConClientID); 6236 6245 } 6237 6246 … … 6674 6683 ULONG major, minor, build; 6675 6684 BOOLEAN checkedBuild = PsGetVersion(&major, &minor, &build, NULL); 6676 BOOLEAN f3D CheckRequired = FALSE;6685 BOOLEAN f3DRequired = FALSE; 6677 6686 6678 6687 LOGREL(("OsVersion( %d, %d, %d )", major, minor, build)); … … 6686 6695 { 6687 6696 WARN(("Unknow win version, newer major release, assuming 3D check is required")); 6688 f3D CheckRequired = TRUE;6697 f3DRequired = TRUE; 6689 6698 } 6690 6699 else if (major == 6) … … 6693 6702 { 6694 6703 WARN(("Unknow win version, newer minor release, assuming 3D check is required")); 6695 f3D CheckRequired = TRUE;6704 f3DRequired = TRUE; 6696 6705 } 6697 6706 else if (minor == 2) 6698 6707 { 6699 6708 LOG(("3D check is required!")); 6700 f3D CheckRequired = TRUE;6709 f3DRequired = TRUE; 6701 6710 } 6702 6711 else 6703 6712 { 6704 6713 LOG(("3D is NOT required!")); 6705 f3D CheckRequired = FALSE;6714 f3DRequired = FALSE; 6706 6715 } 6707 6716 } … … 6709 6718 { 6710 6719 WARN(("Unsupported OLDER win version, ignore and assume 3D is NOT required")); 6711 f3D CheckRequired = FALSE;6720 f3DRequired = FALSE; 6712 6721 } 6713 6722 6714 6723 Status = STATUS_SUCCESS; 6715 6724 6716 if (f3DCheckRequired) 6717 { 6718 LOG(("3D check is required, doing the 3D check..")); 6719 if (!VBoxMpCrCtlConIs3DSupported()) 6720 { 6725 /* always need to do the check to request host caps */ 6726 LOG(("Doing the 3D check..")); 6727 if (!VBoxMpCrCtlConIs3DSupported()) 6728 { 6721 6729 #ifdef VBOX_WDDM_WIN8 6722 LOGREL(("3D is NOT supported by the host, falling back to display-only mode..")); 6723 g_VBoxDisplayOnly = 1; 6730 Assert(f3DRequired); 6731 LOGREL(("3D is NOT supported by the host, falling back to display-only mode..")); 6732 g_VBoxDisplayOnly = 1; 6724 6733 #else 6734 if (f3DRequired) 6735 { 6725 6736 LOGREL(("3D is NOT supported by the host, but is required for the current guest version using this driver..")); 6726 6737 Status = STATUS_UNSUCCESSFUL; 6727 #endif 6728 } 6738 } 6739 else 6740 LOGREL(("3D is NOT supported by the host, but is NOT required for the current guest version using this driver, continuing with Disabled 3D..")); 6741 #endif 6729 6742 } 6730 6743 -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/wined3d_gl.h
r44306 r46783 3818 3818 #define GL_RCUSAGE_TEXTURE_CLEAR_CR 0x8B2A 3819 3819 /*configures host to create windows initially hidden*/ 3820 #define GL_HOST_WND_CREATED_HIDDEN 0x8B2B3820 #define GL_HOST_WND_CREATED_HIDDEN_CR 0x8B2B 3821 3821 3822 3822 typedef void (WINE_GLAPI *PGLFNCHROMIUMPARAMETERUCR)(GLenum param, GLint value); -
trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/d3d9/d3d9wddm.def
r46757 r46783 24 24 VBoxWineExD3DSurf9GetHostId 25 25 VBoxWineExD3DSwapchain9GetHostWinID 26 VBoxWineExD3DSurf9SyncToHost -
trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/d3d9/surface.c
r46662 r46783 469 469 return hr; 470 470 } 471 472 VBOXWINEEX_DECL(HRESULT) VBoxWineExD3DSurf9SyncToHost(IDirect3DSurface9 *iface) 473 { 474 struct d3d9_surface *surface = impl_from_IDirect3DSurface9(iface); 475 HRESULT hr; 476 wined3d_mutex_lock(); 477 hr = wined3d_surface_sync_to_host(surface->wined3d_surface); 478 wined3d_mutex_unlock(); 479 return hr; 480 } 471 481 #endif -
trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/vbox/VBoxWineEx.h
r46757 r46783 81 81 typedef FNVBOXWINEEXD3DSURF9_GETHOSTID *PFNVBOXWINEEXD3DSURF9_GETHOSTID; 82 82 83 typedef VBOXWINEEX_DECL(HRESULT) FNVBOXWINEEXD3DSURF9_SYNCTOHOST(IDirect3DSurface9 *iface); 84 typedef FNVBOXWINEEXD3DSURF9_SYNCTOHOST *PFNVBOXWINEEXD3DSURF9_SYNCTOHOST; 85 83 86 typedef VBOXWINEEX_DECL(HRESULT) FNVBOXWINEEXD3DSWAPCHAIN9_PRESENT(IDirect3DSwapChain9 *iface, IDirect3DSurface9 *surf); 84 87 typedef FNVBOXWINEEXD3DSWAPCHAIN9_PRESENT *PFNVBOXWINEEXD3DSWAPCHAIN9_PRESENT; … … 128 131 VBOXWINEEX_DECL(HRESULT) VBoxWineExD3DSurf9GetHostId(IDirect3DSurface9 *iface, uint32_t *pu32Id); 129 132 133 /* makes the surface contents to be synched with host, 134 * i.e. typically in case wine surface's location is in sysmem, puts it to texture*/ 135 VBOXWINEEX_DECL(HRESULT) VBoxWineExD3DSurf9SyncToHost(IDirect3DSurface9 *iface); 136 130 137 /* used for backwards compatibility purposes only with older host versions not supportgin new present mechanism */ 131 138 VBOXWINEEX_DECL(HRESULT) VBoxWineExD3DSwapchain9Present(IDirect3DSwapChain9 *iface, -
trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/vbox/libWineStub/include/wine/wined3d.h
r46662 r46783 2480 2480 HRESULT __cdecl wined3d_device_blt_voltex(struct wined3d_device *device, struct wined3d_texture *src, struct wined3d_texture *dst, const struct wined3d_box *pSrcBoxArg, const struct VBOXPOINT3D *pDstPoin3D); 2481 2481 HRESULT __cdecl wined3d_surface_get_host_id(struct wined3d_surface *surface, uint32_t *id); 2482 HRESULT __cdecl wined3d_surface_sync_to_host(struct wined3d_surface *surface); 2482 2483 2483 2484 HRESULT __cdecl wined3d_swapchain_present_rt(struct wined3d_swapchain *swapchain, struct wined3d_surface *rt); -
trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/context.c
r46545 r46783 1928 1928 # endif 1929 1929 # if defined(VBOX_WITH_WDDM) 1930 pglChromiumParameteriCR(GL_HOST_WND_CREATED_HIDDEN , GL_TRUE);1930 pglChromiumParameteriCR(GL_HOST_WND_CREATED_HIDDEN_CR, GL_TRUE); 1931 1931 # endif 1932 1932 #endif -
trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/surface.c
r46662 r46783 7789 7789 return S_OK; 7790 7790 } 7791 7792 HRESULT CDECL wined3d_surface_sync_to_host(struct wined3d_surface *surface) 7793 { 7794 HRESULT hr = surface_load_location(surface, SFLAG_INTEXTURE, NULL); 7795 if (!SUCCEEDED(hr)) 7796 { 7797 ERR("surface_load_location failed hr 0x%x", hr); 7798 return hr; 7799 } 7800 7801 return S_OK; 7802 } 7791 7803 #endif -
trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/wined3d_gl.h
r46757 r46783 177 177 #define GL_RCUSAGE_TEXTURE_CLEAR_CR 0x8B2A 178 178 /*configures host to create windows initially hidden*/ 179 #define GL_HOST_WND_CREATED_HIDDEN 179 #define GL_HOST_WND_CREATED_HIDDEN_CR 0x8B2B 180 180 181 181 typedef void (WINE_GLAPI *PGLFNCHROMIUMPARAMETERUCR)(GLenum param, GLint value); -
trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/wined3dwddm.def
r46757 r46783 259 259 wined3d_swapchain_present_rt 260 260 wined3d_surface_get_host_id 261 wined3d_surface_sync_to_host 261 262 wined3d_swapchain_get_host_win_id
Note:
See TracChangeset
for help on using the changeset viewer.