Changeset 30317 in vbox for trunk/src/VBox/Additions/WINNT/Graphics
- Timestamp:
- Jun 18, 2010 9:51:03 PM (15 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.cpp
r30308 r30317 36 36 37 37 #define VBOXWDDMDISP_WITH_TMPWORKAROUND 1 38 39 #define VBOXWDDMOVERLAY_TEST 38 40 39 41 static FORMATOP gVBoxFormatOps3D[] = { … … 3011 3013 pAllocInfo->SurfDesc.height = pSurf->Height; 3012 3014 pAllocInfo->SurfDesc.format = pResource->Format; 3013 pAllocInfo->SurfDesc.bpp = vboxWddmCalcBitsPerPixel(pResource->Format); 3015 if (!vboxWddmFormatToFourcc(pResource->Format)) 3016 pAllocInfo->SurfDesc.bpp = vboxWddmCalcBitsPerPixel(pResource->Format); 3017 else 3018 pAllocInfo->SurfDesc.bpp = 0; 3014 3019 3015 3020 if (pSurf->SysMemPitch) … … 3139 3144 PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice; 3140 3145 Assert(pDevice); 3141 Assert(pDevice->pDevice9If); 3146 HRESULT hr = S_OK; 3147 if (VBOXDISPMODE_IS_3D(pDevice->pAdapter)) 3148 { 3149 Assert(pDevice->pDevice9If); 3142 3150 #if 0 3143 HRESULT hr = pDevice->pDevice9If->Present(NULL, /* CONST RECT * pSourceRect */ 3144 NULL, /* CONST RECT * pDestRect */ 3145 NULL, /* HWND hDestWindowOverride */ 3146 NULL /*CONST RGNDATA * pDirtyRegion */ 3147 ); 3148 Assert(hr == S_OK); 3149 #else 3150 HRESULT hr = S_OK; 3151 hr = pDevice->pDevice9If->Present(NULL, /* CONST RECT * pSourceRect */ 3152 NULL, /* CONST RECT * pDestRect */ 3153 NULL, /* HWND hDestWindowOverride */ 3154 NULL /*CONST RGNDATA * pDirtyRegion */ 3155 ); 3156 Assert(hr == S_OK); 3151 3157 #endif 3158 } 3159 else 3160 { 3161 D3DDDICB_PRESENT DdiPresent = {0}; 3162 if (pData->hSrcResource) 3163 { 3164 PVBOXWDDMDISP_RESOURCE pRc = (PVBOXWDDMDISP_RESOURCE)pData->hSrcResource; 3165 Assert(pRc->cAllocations > pData->SrcSubResourceIndex); 3166 PVBOXWDDMDISP_ALLOCATION pAlloc = &pRc->aAllocations[pData->SrcSubResourceIndex]; 3167 Assert(pAlloc->hAllocation); 3168 DdiPresent.hSrcAllocation = pAlloc->hAllocation; 3169 } 3170 if (pData->hDstResource) 3171 { 3172 PVBOXWDDMDISP_RESOURCE pRc = (PVBOXWDDMDISP_RESOURCE)pData->hDstResource; 3173 Assert(pRc->cAllocations > pData->DstSubResourceIndex); 3174 PVBOXWDDMDISP_ALLOCATION pAlloc = &pRc->aAllocations[pData->DstSubResourceIndex]; 3175 Assert(pAlloc->hAllocation); 3176 DdiPresent.hDstAllocation = pAlloc->hAllocation; 3177 } 3178 DdiPresent.hContext = pDevice->DefaultContext.ContextInfo.hContext; 3179 // DdiPresent.BroadcastContextCount; 3180 // DdiPresent.BroadcastContext[D3DDDI_MAX_BROADCAST_CONTEXT]; 3181 3182 hr = pDevice->RtCallbacks.pfnPresentCb(pDevice->hDevice, &DdiPresent); 3183 Assert(hr == S_OK); 3184 } 3152 3185 vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p), hr(0x%x)\n", hDevice, hr)); 3153 3186 return hr; … … 3655 3688 OverInfo.OverlayInfo.PrivateDriverDataSize = sizeof (OurInfo); 3656 3689 OverInfo.hKernelOverlay = NULL; /* <-- out */ 3690 #ifndef VBOXWDDMOVERLAY_TEST 3657 3691 hr = pDevice->RtCallbacks.pfnCreateOverlayCb(pDevice->hDevice, &OverInfo); 3658 3692 Assert(hr == S_OK); … … 3676 3710 RTMemFree(pOverlay); 3677 3711 } 3712 #else 3713 pData->hOverlay = pOverlay; 3714 #endif 3678 3715 } 3679 3716 else … … 3709 3746 OverInfo.OverlayInfo.pPrivateDriverData = &OurInfo; 3710 3747 OverInfo.OverlayInfo.PrivateDriverDataSize = sizeof (OurInfo); 3748 #ifndef VBOXWDDMOVERLAY_TEST 3711 3749 hr = pDevice->RtCallbacks.pfnUpdateOverlayCb(pDevice->hDevice, &OverInfo); 3712 3750 Assert(hr == S_OK); 3713 3751 if (hr == S_OK) 3752 #endif 3714 3753 { 3715 3754 Assert(!pAlloc->LockInfo.cLocks); … … 3743 3782 OverInfo.pPrivateDriverData = &OurInfo; 3744 3783 OverInfo.PrivateDriverDataSize = sizeof (OurInfo); 3784 #ifndef VBOXWDDMOVERLAY_TEST 3745 3785 hr = pDevice->RtCallbacks.pfnFlipOverlayCb(pDevice->hDevice, &OverInfo); 3746 3786 Assert(hr == S_OK); 3747 3787 if (hr == S_OK) 3788 #endif 3748 3789 { 3749 3790 Assert(!pAlloc->LockInfo.cLocks); … … 3779 3820 D3DDDICB_DESTROYOVERLAY OverInfo; 3780 3821 OverInfo.hKernelOverlay = pOverlay->hOverlay; 3822 #ifndef VBOXWDDMOVERLAY_TEST 3781 3823 HRESULT hr = pDevice->RtCallbacks.pfnDestroyOverlayCb(pDevice->hDevice, &OverInfo); 3782 3824 Assert(hr == S_OK); 3783 3825 if (hr == S_OK) 3826 #else 3827 HRESULT hr = S_OK; 3828 #endif 3784 3829 { 3785 3830 RTMemFree(pOverlay); -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVhwa.cpp
r30308 r30317 201 201 } 202 202 203 void vboxV HWAFreeHostInfo1(PDEVICE_EXTENSION pDevExt, VBOXVHWACMD_QUERYINFO1* pInfo)203 void vboxVhwaFreeHostInfo1(PDEVICE_EXTENSION pDevExt, VBOXVHWACMD_QUERYINFO1* pInfo) 204 204 { 205 205 VBOXVHWACMD* pCmd = VBOXVHWACMD_HEAD(pInfo); … … 207 207 } 208 208 209 void vboxV HWAFreeHostInfo2(PDEVICE_EXTENSION pDevExt, VBOXVHWACMD_QUERYINFO2* pInfo)209 void vboxVhwaFreeHostInfo2(PDEVICE_EXTENSION pDevExt, VBOXVHWACMD_QUERYINFO2* pInfo) 210 210 { 211 211 VBOXVHWACMD* pCmd = VBOXVHWACMD_HEAD(pInfo); … … 213 213 } 214 214 215 VBOXVHWACMD_QUERYINFO1* vboxV HWAQueryHostInfo1(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId)215 VBOXVHWACMD_QUERYINFO1* vboxVhwaQueryHostInfo1(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId) 216 216 { 217 217 VBOXVHWACMD* pCmd = vboxVhwaCommandCreate(pDevExt, srcId, VBOXVHWACMD_TYPE_QUERY_INFO1, sizeof(VBOXVHWACMD_QUERYINFO1)); … … 221 221 if (!pCmd) 222 222 { 223 drprintf((0, "VBoxDISP::vboxV HWAQueryHostInfo1: vboxVHWACommandCreate failed\n"));223 drprintf((0, "VBoxDISP::vboxVhwaQueryHostInfo1: vboxVhwaCommandCreate failed\n")); 224 224 return NULL; 225 225 } … … 245 245 } 246 246 247 VBOXVHWACMD_QUERYINFO2* vboxV HWAQueryHostInfo2(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId, uint32_t numFourCC)247 VBOXVHWACMD_QUERYINFO2* vboxVhwaQueryHostInfo2(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId, uint32_t numFourCC) 248 248 { 249 249 VBOXVHWACMD* pCmd = vboxVhwaCommandCreate(pDevExt, srcId, VBOXVHWACMD_TYPE_QUERY_INFO2, VBOXVHWAINFO2_SIZE(numFourCC)); … … 252 252 if (!pCmd) 253 253 { 254 drprintf((0, "VBoxDISP::vboxV HWAQueryHostInfo2: vboxVHWACommandCreate failed\n"));254 drprintf((0, "VBoxDISP::vboxVhwaQueryHostInfo2: vboxVhwaCommandCreate failed\n")); 255 255 return NULL; 256 256 } … … 277 277 } 278 278 279 int vboxV HWAEnable(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId)279 int vboxVhwaEnable(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId) 280 280 { 281 281 int rc = VERR_GENERAL_FAILURE; … … 286 286 if (!pCmd) 287 287 { 288 drprintf((0, "VBoxDISP::vboxV HWAEnable: vboxVHWACommandCreate failed\n"));288 drprintf((0, "VBoxDISP::vboxVhwaEnable: vboxVhwaCommandCreate failed\n")); 289 289 return rc; 290 290 } … … 305 305 } 306 306 307 int vboxV HWADisable(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId)307 int vboxVhwaDisable(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId) 308 308 { 309 309 int rc = VERR_GENERAL_FAILURE; … … 314 314 if (!pCmd) 315 315 { 316 drprintf((0, "VBoxDISP::vboxV HWADisable: vboxVHWACommandCreate failed\n"));316 drprintf((0, "VBoxDISP::vboxVhwaDisable: vboxVhwaCommandCreate failed\n")); 317 317 return rc; 318 318 } … … 333 333 } 334 334 335 static void vboxV HWAInitSrc(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId)335 static void vboxVhwaInitSrc(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId) 336 336 { 337 337 Assert(srcId < (D3DDDI_VIDEO_PRESENT_SOURCE_ID)pDevExt->u.primary.cDisplays); … … 339 339 memset (pSettings, 0, sizeof (VBOXVHWA_INFO)); 340 340 341 VBOXVHWACMD_QUERYINFO1* pInfo1 = vboxV HWAQueryHostInfo1(pDevExt, srcId);341 VBOXVHWACMD_QUERYINFO1* pInfo1 = vboxVhwaQueryHostInfo1(pDevExt, srcId); 342 342 if (pInfo1) 343 343 { … … 379 379 && (pInfo1->u.out.caps & VBOXVHWA_CAPS_OVERLAYFOURCC)) 380 380 { 381 VBOXVHWACMD_QUERYINFO2* pInfo2 = vboxV HWAQueryHostInfo2(pDevExt, srcId, pInfo1->u.out.numFourCC);381 VBOXVHWACMD_QUERYINFO2* pInfo2 = vboxVhwaQueryHostInfo2(pDevExt, srcId, pInfo1->u.out.numFourCC); 382 382 if (pInfo2) 383 383 { … … 387 387 ++pSettings->cFormats; 388 388 } 389 vboxV HWAFreeHostInfo2(pDevExt, pInfo2);389 vboxVhwaFreeHostInfo2(pDevExt, pInfo2); 390 390 } 391 391 } 392 392 } 393 393 } 394 vboxV HWAFreeHostInfo1(pDevExt, pInfo1);395 } 396 } 397 398 void vboxV HWAInit(PDEVICE_EXTENSION pDevExt)394 vboxVhwaFreeHostInfo1(pDevExt, pInfo1); 395 } 396 } 397 398 void vboxVhwaInit(PDEVICE_EXTENSION pDevExt) 399 399 { 400 400 for (int i = 0; i < pDevExt->u.primary.cDisplays; ++i) 401 401 { 402 vboxV HWAInitSrc(pDevExt, (D3DDDI_VIDEO_PRESENT_SOURCE_ID)i);403 } 404 } 405 406 void vboxV HWAFree(PDEVICE_EXTENSION pDevExt)402 vboxVhwaInitSrc(pDevExt, (D3DDDI_VIDEO_PRESENT_SOURCE_ID)i); 403 } 404 } 405 406 void vboxVhwaFree(PDEVICE_EXTENSION pDevExt) 407 407 { 408 408 /* we do not allocate/map anything, just issue a Disable command … … 410 410 for (int i = 0; i < pDevExt->u.primary.cDisplays; ++i) 411 411 { 412 vboxV HWADisable(pDevExt, i);412 vboxVhwaDisable(pDevExt, i); 413 413 } 414 414 } … … 715 715 if (cNew == 1) 716 716 { 717 rc = vboxVhwa HlpCreatePrimary(pDevExt, pSource, VidPnSourceId);717 rc = vboxVhwaEnable(pDevExt, VidPnSourceId); 718 718 AssertRC(rc); 719 if (RT_SUCCESS(rc)) 720 { 721 rc = vboxVhwaHlpCreatePrimary(pDevExt, pSource, VidPnSourceId); 722 AssertRC(rc); 723 if (RT_FAILURE(rc)) 724 { 725 int tmpRc = vboxVhwaDisable(pDevExt, VidPnSourceId); 726 AssertRC(tmpRc); 727 } 728 } 719 729 } 720 730 else -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVhwa.h
r30239 r30317 45 45 #endif 46 46 47 void vboxV HWAFreeHostInfo1(PDEVICE_EXTENSION pDevExt, VBOXVHWACMD_QUERYINFO1* pInfo);48 void vboxV HWAFreeHostInfo2(PDEVICE_EXTENSION pDevExt, VBOXVHWACMD_QUERYINFO2* pInfo);49 VBOXVHWACMD_QUERYINFO1* vboxV HWAQueryHostInfo1(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId);50 VBOXVHWACMD_QUERYINFO2* vboxV HWAQueryHostInfo2(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId, uint32_t numFourCC);51 int vboxV HWAEnable(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId);52 int vboxV HWADisable(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId);53 void vboxV HWAInit(PDEVICE_EXTENSION pDevExt);54 void vboxV HWAFree(PDEVICE_EXTENSION pDevExt);47 void vboxVhwaFreeHostInfo1(PDEVICE_EXTENSION pDevExt, VBOXVHWACMD_QUERYINFO1* pInfo); 48 void vboxVhwaFreeHostInfo2(PDEVICE_EXTENSION pDevExt, VBOXVHWACMD_QUERYINFO2* pInfo); 49 VBOXVHWACMD_QUERYINFO1* vboxVhwaQueryHostInfo1(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId); 50 VBOXVHWACMD_QUERYINFO2* vboxVhwaQueryHostInfo2(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId, uint32_t numFourCC); 51 int vboxVhwaEnable(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId); 52 int vboxVhwaDisable(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId); 53 void vboxVhwaInit(PDEVICE_EXTENSION pDevExt); 54 void vboxVhwaFree(PDEVICE_EXTENSION pDevExt); 55 55 56 56 int vboxVhwaHlpOverlayFlip(PVBOXWDDM_OVERLAY pOverlay, const DXGKARG_FLIPOVERLAY *pFlipInfo); -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp
r30308 r30317 649 649 dprintf(("VBoxVideoWddm: sources(%d), children(%d)\n", *NumberOfVideoPresentSources, *NumberOfChildren)); 650 650 #ifdef VBOX_WITH_VIDEOHWACCEL 651 vboxV HWAInit(pContext);651 vboxVhwaInit(pContext); 652 652 #endif 653 653 } … … 699 699 /* do everything we did on DxgkDdiStartDevice in the reverse order */ 700 700 #ifdef VBOX_WITH_VIDEOHWACCEL 701 vboxV HWAFree(pDevExt);701 vboxVhwaFree(pDevExt); 702 702 #endif 703 703 … … 1511 1511 pAllocationInfo->SupportedWriteSegmentSet = 2; 1512 1512 #endif 1513 //#ifndef VBOXWDDM_RENDER_FROM_SHADOW1513 #ifndef VBOXWDDM_RENDER_FROM_SHADOW 1514 1514 pAllocationInfo->Flags.CpuVisible = 1; 1515 //#endif1515 #endif 1516 1516 break; 1517 1517 case VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC:
Note:
See TracChangeset
for help on using the changeset viewer.