Changeset 37300 in vbox
- Timestamp:
- Jun 1, 2011 7:45:51 PM (14 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispDbg.cpp
r37216 r37300 97 97 { 98 98 PVBOXDISPDBG pDbg = vboxDispDbgGet(); 99 #ifdef DEBUG_misha100 Assert(pDbg);101 #endif102 99 if (!pDbg) 100 { 101 /* do not use WARN her esince this would lead to a recursion */ 102 WARN_BREAK(); 103 103 return; 104 } 104 105 105 106 VBOXDISPKMT_ADAPTER Adapter; 106 107 HRESULT hr = vboxDispKmtOpenAdapter(&pDbg->KmtCallbacks, &Adapter); 107 Assert(hr == S_OK);108 108 if (hr == S_OK) 109 109 { … … 111 111 uint32_t cbCmd = RT_OFFSETOF(VBOXDISPIFESCAPE_DBGPRINT, aStringBuf[cbString]); 112 112 PVBOXDISPIFESCAPE_DBGPRINT pCmd = (PVBOXDISPIFESCAPE_DBGPRINT)RTMemAllocZ(cbCmd); 113 Assert(pCmd);114 113 if (pCmd) 115 114 { … … 127 126 128 127 int Status = pDbg->KmtCallbacks.pfnD3DKMTEscape(&EscapeData); 129 Assert(!Status); 128 if (Status) 129 { 130 WARN_BREAK(); 131 } 130 132 131 133 RTMemFree(pCmd); 132 134 } 135 else 136 { 137 WARN_BREAK(); 138 } 133 139 hr = vboxDispKmtCloseAdapter(&Adapter); 134 Assert(hr == S_OK); 140 if(hr != S_OK) 141 { 142 WARN_BREAK(); 143 } 135 144 } 136 145 } -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispDbg.h
r37216 r37300 76 76 # define DbgPrintUsrFlow(_m) do { } while (0) 77 77 #endif 78 #ifdef DEBUG_misha 79 # define WARN_BREAK() do { AssertFailed(); } while (0) 80 #else 81 # define WARN_BREAK() do { } while (0) 82 #endif 83 #define WARN(_m) do { \ 84 Log(_m); \ 85 DbgPrintUsr(_m); \ 86 DbgPrintDrv(_m); \ 87 WARN_BREAK(); \ 88 } while (0) 78 89 #define vboxVDbgPrint(_m) do { \ 79 90 Log(_m); \ -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispKmt.cpp
r36867 r37300 149 149 { 150 150 DWORD winEr = GetLastError(); 151 WARN_BREAK(); 152 hr = HRESULT_FROM_WIN32(winEr); 151 153 #ifdef DEBUG_misha 152 Assert( 0);154 Assert(FAILED(hr)); 153 155 #endif 154 Log((__FUNCTION__": EnumDisplayDevices failed, winEr (%d)\n", winEr)); 155 hr = HRESULT_FROM_WIN32(winEr); 156 Assert(FAILED(hr)); 156 if (!FAILED(hr)) 157 { 158 hr = E_FAIL; 159 } 157 160 break; 158 161 } -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxUhgsmiKmt.cpp
r36867 r37300 412 412 { 413 413 HRESULT hr = vboxDispKmtCallbacksInit(&pHgsmi->Callbacks); 414 Assert(hr == S_OK);415 414 if (hr == S_OK) 416 415 { 417 416 hr = vboxDispKmtOpenAdapter(&pHgsmi->Callbacks, &pHgsmi->Adapter); 418 #ifdef DEBUG_misha419 /* may fail with xpdm driver */420 Assert(hr == S_OK);421 #endif422 417 if (hr == S_OK) 423 418 { 424 419 hr = vboxDispKmtCreateDevice(&pHgsmi->Adapter, &pHgsmi->Device); 425 Assert(hr == S_OK);426 420 if (hr == S_OK) 427 421 { … … 429 423 bD3D ? VBOXWDDM_CONTEXT_TYPE_CUSTOM_UHGSMI_3D : VBOXWDDM_CONTEXT_TYPE_CUSTOM_UHGSMI_GL, 430 424 NULL, 0); 431 Assert(hr == S_OK);432 425 if (hr == S_OK) 433 426 { 434 427 return S_OK; 435 428 } 429 else 430 { 431 WARN(("vboxDispKmtCreateContext failed, hr(0x%x)", hr)); 432 } 436 433 vboxDispKmtDestroyDevice(&pHgsmi->Device); 437 434 } 435 else 436 { 437 WARN(("vboxDispKmtCreateDevice failed, hr(0x%x)", hr)); 438 } 438 439 vboxDispKmtCloseAdapter(&pHgsmi->Adapter); 439 440 } 441 else 442 { 443 WARN(("vboxDispKmtOpenAdapter failed, hr(0x%x)", hr)); 444 } 445 440 446 vboxDispKmtCallbacksTerm(&pHgsmi->Callbacks); 447 } 448 else 449 { 450 WARN(("vboxDispKmtCallbacksInit failed, hr(0x%x)", hr)); 441 451 } 442 452 return hr; -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPMisc.cpp
r36867 r37300 21 21 #include <stdio.h> 22 22 23 /* simple handle -> value table API */ 23 24 NTSTATUS vboxWddmHTableCreate(PVBOXWDDM_HTABLE pTbl, uint32_t cSize) 24 25 { … … 35 36 VOID vboxWddmHTableDestroy(PVBOXWDDM_HTABLE pTbl) 36 37 { 38 if (!pTbl->paData) 39 return; 40 37 41 vboxWddmMemFree(pTbl->paData); 38 42 } … … 54 58 { 55 59 PVOID *pvNewData = (PVOID*)vboxWddmMemAllocZero(sizeof (pTbl->paData[0]) * cNewSize); 60 if (!pvNewData) 61 { 62 WARN(("vboxWddmMemAllocZero failed for size (%d)", sizeof (pTbl->paData[0]) * cNewSize)); 63 return STATUS_NO_MEMORY; 64 } 56 65 memcpy(pvNewData, pTbl->paData, sizeof (pTbl->paData[0]) * pTbl->cSize); 66 vboxWddmMemFree(pTbl->paData); 57 67 pTbl->iNext2Search = pTbl->cSize; 58 68 pTbl->cSize = cNewSize; … … 61 71 } 62 72 else if (cNewSize >= pTbl->cData) 73 { 74 AssertFailed(); 63 75 return STATUS_NOT_IMPLEMENTED; 76 } 64 77 return STATUS_INVALID_PARAMETER; 65 78 … … 324 337 Assert(pTst == pSwapchain); 325 338 RemoveEntryList(&pSwapchain->DevExtListEntry); 326 // pSwapchain->pContext = NULL;327 339 pSwapchain->hSwapchainKm = NULL; 328 340 if (pSwapchain->pLastReportedRects) … … 334 346 } 335 347 348 /* adds the given swapchain to the context's swapchain list 349 * @return true on success */ 336 350 BOOLEAN vboxWddmSwapchainCtxAdd(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_CONTEXT pContext, PVBOXWDDM_SWAPCHAIN pSwapchain) 337 351 { … … 343 357 } 344 358 359 /* removes the given swapchain from the context's swapchain list 360 * */ 345 361 VOID vboxWddmSwapchainCtxRemove(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_CONTEXT pContext, PVBOXWDDM_SWAPCHAIN pSwapchain) 346 362 { … … 350 366 } 351 367 368 /* destroys all swapchains for the given context 369 * */ 352 370 VOID vboxWddmSwapchainCtxDestroyAll(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_CONTEXT pContext) 353 371 { … … 370 388 } 371 389 390 /* process the swapchain info passed from user-mode display driver & synchronizes the driver state with it */ 372 391 NTSTATUS vboxWddmSwapchainCtxEscape(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_CONTEXT pContext, PVBOXDISPIFESCAPE_SWAPCHAININFO pSwapchainInfo, UINT cbSize) 373 392 { … … 403 422 if (pSwapchainInfo->SwapchainInfo.hSwapchainKm) 404 423 { 405 // ExAcquireFastMutex(&pContext->SwapchainMutex);406 424 ExAcquireFastMutex(&pDevExt->ContextMutex); 407 425 pSwapchain = (PVBOXWDDM_SWAPCHAIN)vboxWddmHTableGet(&pContext->Swapchains, (VBOXWDDM_HANDLE)pSwapchainInfo->SwapchainInfo.hSwapchainKm); … … 455 473 } 456 474 457 // ExReleaseFastMutex(&pContext->SwapchainMutex);458 475 ExReleaseFastMutex(&pDevExt->ContextMutex); 459 476 … … 471 488 472 489 return STATUS_SUCCESS; 490 } 491 492 NTSTATUS vboxWddmSwapchainCtxInit(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_CONTEXT pContext) 493 { 494 NTSTATUS Status = vboxWddmHTableCreate(&pContext->Swapchains, 4); 495 if (!NT_SUCCESS(Status)) 496 { 497 WARN(("vboxWddmHTableCreate failes, Status (x%x)", Status)); 498 return Status; 499 } 500 501 return STATUS_SUCCESS; 502 } 503 504 VOID vboxWddmSwapchainCtxTerm(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_CONTEXT pContext) 505 { 506 vboxWddmSwapchainCtxDestroyAll(pDevExt, pContext); 507 vboxWddmHTableDestroy(&pContext->Swapchains); 473 508 } 474 509 -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPMisc.h
r36867 r37300 79 79 VOID vboxWddmSwapchainCtxDestroyAll(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_CONTEXT pContext); 80 80 NTSTATUS vboxWddmSwapchainCtxEscape(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_CONTEXT pContext, PVBOXDISPIFESCAPE_SWAPCHAININFO pSwapchainInfo, UINT cbSize); 81 NTSTATUS vboxWddmSwapchainCtxInit(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_CONTEXT pContext); 82 VOID vboxWddmSwapchainCtxTerm(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_CONTEXT pContext); 81 83 82 84 -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPTypes.h
r36867 r37300 197 197 UINT EngineAffinity; 198 198 // UINT uLastCompletedCmdFenceId; 199 FAST_MUTEX SwapchainMutex;200 199 VBOXWDDM_HTABLE Swapchains; 201 200 VBOXVIDEOCM_CTX CmContext; -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp
r37207 r37300 1228 1228 /* DxgkDdiUnload should be made pageable. */ 1229 1229 PAGED_CODE(); 1230 LOGF((" ENTER"));1230 LOGF((": unloading")); 1231 1231 1232 1232 vboxVDbgBreakFv(); 1233 1233 1234 LOGF(("LEAVE")); 1234 PRTLOGGER pLogger = RTLogRelSetDefaultInstance(NULL); 1235 if (pLogger) 1236 { 1237 RTLogDestroy(pLogger); 1238 } 1239 pLogger = RTLogSetDefaultInstance(NULL); 1240 if (pLogger) 1241 { 1242 RTLogDestroy(pLogger); 1243 } 1235 1244 } 1236 1245 … … 3586 3595 { 3587 3596 /* @todo: check that we actually need the current source->target */ 3588 D3DKMDT_2DREGION Resolution;3589 3597 PVBOXWDDM_VIDEOMODES_INFO pInfo = &pInfos[i]; 3590 3598 VIDEO_MODE_INFORMATION *pModeInfo = &pInfo->aModes[pInfo->iPreferredMode]; 3599 #if 1 3600 D3DKMDT_2DREGION Resolution; 3591 3601 Resolution.cx = pModeInfo->VisScreenWidth; 3592 3602 Resolution.cy = pModeInfo->VisScreenHeight; 3593 3603 Status = vboxVidPnCheckAddMonitorModes(pDevExt, i, D3DKMDT_MCO_DRIVER, &Resolution, 1); 3604 #else 3605 Status = vboxVidPnCheckAddMonitorModes(pDevExt, i, D3DKMDT_MCO_DRIVER, pInfo->aResolutions, pInfo->cResolutions); 3606 #endif 3594 3607 Assert(Status == STATUS_SUCCESS); 3595 3608 if (Status != STATUS_SUCCESS) … … 5053 5066 if (Status == STATUS_SUCCESS) 5054 5067 { 5055 ExInitializeFastMutex(&pContext->SwapchainMutex); 5056 Status = vboxWddmHTableCreate(&pContext->Swapchains, 4); 5068 Status = vboxWddmSwapchainCtxInit(pDevExt, pContext); 5057 5069 Assert(Status == STATUS_SUCCESS); 5058 5070 if (Status == STATUS_SUCCESS) … … 5069 5081 break; 5070 5082 } 5071 vboxWddmHTableDestroy(&pContext->Swapchains); 5083 5084 vboxWddmSwapchainCtxTerm(pDevExt, pContext); 5072 5085 } 5073 5086 } … … 5149 5162 if (Status == STATUS_SUCCESS) 5150 5163 { 5151 vboxWddmSwapchainCtx DestroyAll(pDevExt, pContext);5164 vboxWddmSwapchainCtxTerm(pDevExt, pContext); 5152 5165 vboxWddmMemFree(pContext); 5153 5166 } -
trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/swapchain.c
r37216 r37300 373 373 { 374 374 HWND wnd = WindowFromDC(context->hdc); 375 Assert(context->currentSwapchain && context->win_handle== swapchain->win_handle);375 Assert(context->currentSwapchain && context->win_handle==context->currentSwapchain->win_handle); 376 376 Assert(wnd==context->win_handle); 377 377 Assert(IsWindow(context->win_handle));
Note:
See TracChangeset
for help on using the changeset viewer.