Changeset 50928 in vbox for trunk/src/VBox
- Timestamp:
- Mar 31, 2014 2:14:11 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 93073
- Location:
- trunk/src/VBox
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispKmt.cpp
r49591 r50928 166 166 { 167 167 FreeLibrary(pCallbacks->hGdi32); 168 #ifdef DEBUG_misha 169 memset(pCallbacks, 0, sizeof (*pCallbacks)); 170 #endif 168 171 return S_OK; 169 172 } … … 319 322 { 320 323 DeleteDC(pAdapter->hDc); 324 #ifdef DEBUG_misha 325 memset(pAdapter, 0, sizeof (*pAdapter)); 326 #endif 321 327 return S_OK; 322 328 } … … 358 364 if (!Status) 359 365 { 366 #ifdef DEBUG_misha 367 memset(pDevice, 0, sizeof (*pDevice)); 368 #endif 360 369 return S_OK; 361 370 } … … 406 415 Assert(!Status); 407 416 if (!Status) 408 return S_OK; 409 return E_FAIL; 410 } 417 { 418 #ifdef DEBUG_misha 419 memset(pContext, 0, sizeof (*pContext)); 420 #endif 421 return S_OK; 422 } 423 return E_FAIL; 424 } -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxUhgsmiDisp.cpp
r50921 r50928 36 36 if (hr == S_OK) 37 37 { 38 #ifdef DEBUG_misha 39 memset(pBuffer, 0, sizeof (*pBuffer)); 40 #endif 38 41 RTMemFree(pBuffer); 39 42 return VINF_SUCCESS; -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxUhgsmiKmt.cpp
r50921 r50928 42 42 if (NT_SUCCESS(Status)) 43 43 { 44 #ifdef DEBUG_misha 45 memset(pBuffer, 0, sizeof(*pBuffer)); 46 #endif 44 47 RTMemFree(pBuffer); 45 48 return VINF_SUCCESS; … … 371 374 Assert(hr == S_OK); 372 375 if (hr == S_OK) 376 { 377 #ifdef DEBUG_misha 378 memset(pHgsmi, 0, sizeof (*pHgsmi)); 379 #endif 373 380 return S_OK; 381 } 374 382 } 375 383 } -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPUtils.cpp
r46876 r50928 29 29 #ifdef DEBUG_misha 30 30 /* specifies whether the vboxVDbgBreakF should break in the debugger 31 * windbg seems to have some issues when there is a lot ( > ~50) of sw breakpoints defined31 * windbg seems to have some issues when there is a lot ( >32) of sw breakpoints defined 32 32 * to simplify things we just insert breaks for the case of intensive debugging WDDM driver*/ 33 33 #ifndef VBOX_WDDM_WIN8 34 int g_bVBoxVDbgBreakF = false;35 int g_bVBoxVDbgBreakFv = false;34 int g_bVBoxVDbgBreakF = 1; 35 int g_bVBoxVDbgBreakFv = 0; 36 36 #else 37 int g_bVBoxVDbgBreakF = false;38 int g_bVBoxVDbgBreakFv = false;37 int g_bVBoxVDbgBreakF = 1; 38 int g_bVBoxVDbgBreakFv = 0; 39 39 #endif 40 40 #endif -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVbva.cpp
r50921 r50928 1133 1133 uint32_t cbInitBuffer = cbBuffer; 1134 1134 uint32_t i = 0; 1135 VBOXCMDVBVAPAGEIDX *pPageNumbers = pCmd-> aPageNumbers;1136 1137 cbBuffer -= RT_OFFSETOF(VBOXCMDVBVA_PAGING_TRANSFER, aPageNumbers);1135 VBOXCMDVBVAPAGEIDX *pPageNumbers = pCmd->Data.aPageNumbers; 1136 1137 cbBuffer -= RT_OFFSETOF(VBOXCMDVBVA_PAGING_TRANSFER, Data.aPageNumbers); 1138 1138 1139 1139 for (; i < cPages && cbBuffer >= sizeof (*pPageNumbers); ++i, cbBuffer -= sizeof (*pPageNumbers)) … … 1143 1143 1144 1144 *pcPagesWritten = i; 1145 Assert(cbInitBuffer - cbBuffer == RT_OFFSETOF(VBOXCMDVBVA_PAGING_TRANSFER, aPageNumbers[i]));1145 Assert(cbInitBuffer - cbBuffer == RT_OFFSETOF(VBOXCMDVBVA_PAGING_TRANSFER, Data.aPageNumbers[i])); 1146 1146 return cbInitBuffer - cbBuffer; 1147 1147 } -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp
r50921 r50928 3109 3109 else 3110 3110 { 3111 Assert(!pSubmitCommand->DmaBufferPrivateDataSubmissionStartOffset); 3112 Assert(!pSubmitCommand->DmaBufferSubmissionStartOffset); 3113 3111 3114 if (cbCmd < sizeof (VBOXCMDVBVA_HDR)) 3112 3115 { … … 3133 3136 return STATUS_INVALID_PARAMETER; 3134 3137 } 3135 SysMem. iPage = (VBOXCMDVBVAPAGEIDX)(pSubmitCommand->DmaBufferPhysicalAddress.QuadPart >> PAGE_SHIFT);3138 SysMem.phCmd = (VBOXCMDVBVAPHADDR)(pSubmitCommand->DmaBufferPhysicalAddress.QuadPart + pSubmitCommand->DmaBufferSubmissionStartOffset); 3136 3139 3137 3140 cbCmd = sizeof (SysMem); … … 3142 3145 else 3143 3146 { 3147 Assert(!pSubmitCommand->DmaBufferPrivateDataSubmissionStartOffset); 3148 Assert(!pSubmitCommand->DmaBufferSubmissionStartOffset); 3149 3144 3150 if (cbCmd < sizeof (VBOXCMDVBVA_HDR)) 3145 3151 { … … 3153 3159 pHdr = (VBOXCMDVBVA_HDR*)((uint8_t*)pSubmitCommand->pDmaBufferPrivateData + pSubmitCommand->DmaBufferPrivateDataSubmissionStartOffset); 3154 3160 } 3161 3155 3162 pHdr->u32FenceID = pSubmitCommand->SubmissionFenceId; 3156 3163 int rc = VBoxCmdVbvaSubmit(pDevExt, &pDevExt->CmdVbva, pHdr, cbCmd); … … 3413 3420 case DXGK_OPERATION_TRANSFER: 3414 3421 { 3422 if (!pBuildPagingBuffer->Transfer.Flags.AllocationIsIdle) 3423 { 3424 WARN(("allocation is not idle")); 3425 return STATUS_GRAPHICS_ALLOCATION_BUSY; 3426 } 3427 3428 Assert(!pBuildPagingBuffer->Transfer.MdlOffset); 3429 3415 3430 if ((!pBuildPagingBuffer->Transfer.Source.SegmentId) == (!pBuildPagingBuffer->Transfer.Destination.SegmentId)) 3416 3431 { … … 3478 3493 offVRAM += pBuildPagingBuffer->Transfer.TransferOffset + (pBuildPagingBuffer->MultipassOffset << PAGE_SHIFT); 3479 3494 3480 pPaging-> Alloc.u.offVRAM = offVRAM;3495 pPaging->Data.Alloc.u.offVRAM = offVRAM; 3481 3496 if (fIn) 3482 3497 pPaging->Hdr.u8Flags |= VBOXCMDVBVA_OPF_PAGING_TRANSFER_IN; -
trunk/src/VBox/Devices/Graphics/DevVGA_VDMA.cpp
r50921 r50928 1263 1263 } 1264 1264 1265 static int8_t vboxVDMACrCmdVbvaPagingDataInit(PVGASTATE pVGAState, const VBOXCMDVBVA_HDR *p Cmd, uint32_t cbCmd,1265 static int8_t vboxVDMACrCmdVbvaPagingDataInit(PVGASTATE pVGAState, const VBOXCMDVBVA_HDR *pHdr, const VBOXCMDVBVA_PAGING_TRANSFER_DATA *pData, uint32_t cbCmd, 1266 1266 const VBOXCMDVBVAPAGEIDX **ppPages, VBOXCMDVBVAPAGEIDX *pcPages, 1267 1267 uint8_t **ppu8Vram, bool *pfIn) … … 1273 1273 } 1274 1274 1275 VBOXCMDVBVAPAGEIDX cPages = cbCmd - RT_OFFSETOF(VBOXCMDVBVA_PAGING_TRANSFER, aPageNumbers);1275 VBOXCMDVBVAPAGEIDX cPages = cbCmd - RT_OFFSETOF(VBOXCMDVBVA_PAGING_TRANSFER, Data.aPageNumbers); 1276 1276 if (cPages % sizeof (VBOXCMDVBVAPAGEIDX)) 1277 1277 { … … 1281 1281 cPages /= sizeof (VBOXCMDVBVAPAGEIDX); 1282 1282 1283 VBOXCMDVBVA_PAGING_TRANSFER *pTransfer = (VBOXCMDVBVA_PAGING_TRANSFER*)pCmd; 1284 VBOXCMDVBVAOFFSET offVRAM = pTransfer->Alloc.u.offVRAM; 1283 VBOXCMDVBVAOFFSET offVRAM = pData->Alloc.u.offVRAM; 1285 1284 if (offVRAM & PAGE_OFFSET_MASK) 1286 1285 { … … 1288 1287 return -1; 1289 1288 } 1290 const VBOXCMDVBVAPAGEIDX *pPages = p Transfer->aPageNumbers;1289 const VBOXCMDVBVAPAGEIDX *pPages = pData->aPageNumbers; 1291 1290 1292 1291 uint8_t * pu8VramBase = pVGAState->vram_ptrR3; … … 1305 1304 1306 1305 uint8_t *pu8Vram = pu8VramBase + offVRAM; 1307 bool fIn = !!(p Transfer->Hdr.u8Flags & VBOXCMDVBVA_OPF_PAGING_TRANSFER_IN);1306 bool fIn = !!(pHdr->u8Flags & VBOXCMDVBVA_OPF_PAGING_TRANSFER_IN); 1308 1307 1309 1308 *ppPages = pPages; … … 1327 1326 uint8_t *pu8Vram; 1328 1327 bool fIn; 1329 int8_t i8Result = vboxVDMACrCmdVbvaPagingDataInit(pVGAState, pCmd, cbCmd,1328 int8_t i8Result = vboxVDMACrCmdVbvaPagingDataInit(pVGAState, pCmd, &((VBOXCMDVBVA_PAGING_TRANSFER*)pCmd)->Data, cbCmd, 1330 1329 &pPages, &cPages, 1331 1330 &pu8Vram, &fIn); … … 1380 1379 { 1381 1380 VBOXCMDVBVA_SYSMEMCMD *pSysmemCmd = (VBOXCMDVBVA_SYSMEMCMD*)pCmd; 1382 const VBOXCMDVBVA_HDR *pRealCmd ;1381 const VBOXCMDVBVA_HDR *pRealCmdHdr; 1383 1382 uint32_t cbRealCmd = pCmd->u8Flags; 1384 1383 cbRealCmd |= (pCmd->u.u8PrimaryID << 8); … … 1389 1388 } 1390 1389 1391 VBOXCMDVBVAPAGEIDX iPage = pSysmemCmd->iPage; 1392 RTGCPHYS phPage = (RTGCPHYS)(iPage << PAGE_SHIFT); 1390 RTGCPHYS phCmd = (RTGCPHYS)pSysmemCmd->phCmd; 1393 1391 1394 1392 PGMPAGEMAPLOCK Lock; … … 1396 1394 PPDMDEVINS pDevIns = pVGAState->pDevInsR3; 1397 1395 const void * pvCmd; 1398 int rc = PDMDevHlpPhysGCPhys2CCPtrReadOnly(pDevIns, ph Page, 0, &pvCmd, &Lock);1396 int rc = PDMDevHlpPhysGCPhys2CCPtrReadOnly(pDevIns, phCmd, 0, &pvCmd, &Lock); 1399 1397 if (!RT_SUCCESS(rc)) 1400 1398 { … … 1403 1401 } 1404 1402 1405 pRealCmd = (const VBOXCMDVBVA_HDR *)pvCmd; 1406 1407 if (cbRealCmd <= PAGE_SIZE) 1408 { 1409 uint8_t i8Result = vboxVDMACrCmdVbvaProcessCmdData(pVdma, pRealCmd, cbRealCmd); 1403 Assert((phCmd & PAGE_OFFSET_MASK) == (((uintptr_t)pvCmd) & PAGE_OFFSET_MASK)); 1404 1405 uint32_t cbCmdPart = PAGE_SIZE - (((uintptr_t)pvCmd) & PAGE_OFFSET_MASK); 1406 1407 if (cbRealCmd <= cbCmdPart) 1408 { 1409 pRealCmdHdr = (const VBOXCMDVBVA_HDR *)pvCmd; 1410 uint8_t i8Result = vboxVDMACrCmdVbvaProcessCmdData(pVdma, pRealCmdHdr, cbRealCmd); 1410 1411 PDMDevHlpPhysReleasePageMappingLock(pDevIns, &Lock); 1411 1412 return i8Result; 1412 1413 } 1413 1414 1415 VBOXCMDVBVA_HDR Hdr; 1416 const void *pvCurCmdTail; 1417 uint32_t cbCurCmdTail; 1418 if (cbCmdPart >= sizeof (*pRealCmdHdr)) 1419 { 1420 pRealCmdHdr = (const VBOXCMDVBVA_HDR *)pvCmd; 1421 pvCurCmdTail = (const void*)(pRealCmdHdr + 1); 1422 cbCurCmdTail = cbCmdPart - sizeof (*pRealCmdHdr); 1423 } 1424 else 1425 { 1426 memcpy(&Hdr, pvCmd, cbCmdPart); 1427 PDMDevHlpPhysReleasePageMappingLock(pDevIns, &Lock); 1428 phCmd += cbCmdPart; 1429 Assert(!(phCmd & PAGE_OFFSET_MASK)); 1430 rc = PDMDevHlpPhysGCPhys2CCPtrReadOnly(pDevIns, phCmd, 0, &pvCmd, &Lock); 1431 if (!RT_SUCCESS(rc)) 1432 { 1433 WARN(("PDMDevHlpPhysGCPhys2CCPtrReadOnly failed %d\n", rc)); 1434 return -1; 1435 } 1436 1437 cbCmdPart = sizeof (*pRealCmdHdr) - cbCmdPart; 1438 memcpy(((uint8_t*)(&Hdr)) + cbCmdPart, pvCmd, cbCmdPart); 1439 pvCurCmdTail = (const void*)(((uint8_t*)pvCmd) + cbCmdPart); 1440 cbCurCmdTail = PAGE_SIZE - cbCmdPart; 1441 } 1442 1443 if (cbCurCmdTail > cbRealCmd - sizeof (*pRealCmdHdr)) 1444 cbCurCmdTail = cbRealCmd - sizeof (*pRealCmdHdr); 1445 1414 1446 int8_t i8Result = 0; 1415 1447 1416 switch (pRealCmd ->u8OpCode)1448 switch (pRealCmdHdr->u8OpCode) 1417 1449 { 1418 1450 case VBOXCMDVBVA_OPTYPE_PAGING_TRANSFER: … … 1422 1454 uint8_t *pu8Vram; 1423 1455 bool fIn; 1424 i8Result = vboxVDMACrCmdVbvaPagingDataInit(pVGAState, p Cmd, cbCmd,1456 i8Result = vboxVDMACrCmdVbvaPagingDataInit(pVGAState, pRealCmdHdr, (const VBOXCMDVBVA_PAGING_TRANSFER_DATA*)pvCurCmdTail, cbRealCmd, 1425 1457 &pPages, &cPages, 1426 1458 &pu8Vram, &fIn); … … 1428 1460 { 1429 1461 WARN(("vboxVDMACrCmdVbvaPagingDataInit failed %d", i8Result)); 1430 return i8Result; 1462 /* we need to break, not return, to ensure currently locked page is released */ 1463 break; 1431 1464 } 1432 1465 1433 uint32_t cCurPages = PAGE_SIZE - RT_OFFSETOF(VBOXCMDVBVA_PAGING_TRANSFER, aPageNumbers); 1434 cCurPages /= sizeof (VBOXCMDVBVAPAGEIDX); 1466 if (cbCurCmdTail & 3) 1467 { 1468 WARN(("command is not alligned properly %d", cbCurCmdTail)); 1469 i8Result = -1; 1470 /* we need to break, not return, to ensure currently locked page is released */ 1471 break; 1472 } 1473 1474 uint32_t cCurPages = cbCurCmdTail / sizeof (VBOXCMDVBVAPAGEIDX); 1435 1475 Assert(cCurPages < cPages); 1436 1476 … … 1442 1482 WARN(("vboxVDMACrCmdVbvaProcessPagingEls failed %d", rc)); 1443 1483 i8Result = -1; 1484 /* we need to break, not return, to ensure currently locked page is released */ 1444 1485 break; 1445 1486 } … … 1453 1494 PDMDevHlpPhysReleasePageMappingLock(pDevIns, &Lock); 1454 1495 1455 phPage += PAGE_SIZE; 1496 Assert(!(phCmd & PAGE_OFFSET_MASK)); 1497 1498 phCmd += PAGE_SIZE; 1456 1499 pu8Vram += (cCurPages << PAGE_SHIFT); 1457 1500 1458 rc = PDMDevHlpPhysGCPhys2CCPtrReadOnly(pDevIns, ph Page, 0, &pvCmd, &Lock);1501 rc = PDMDevHlpPhysGCPhys2CCPtrReadOnly(pDevIns, phCmd, 0, &pvCmd, &Lock); 1459 1502 if (!RT_SUCCESS(rc)) 1460 1503 { 1461 1504 WARN(("PDMDevHlpPhysGCPhys2CCPtrReadOnly failed %d\n", rc)); 1505 /* the page is not locked, return */ 1462 1506 return -1; 1463 1507 } -
trunk/src/VBox/GuestHost/OpenGL/util/vboxhgcm.c
r49591 r50928 1638 1638 PVBOXUHGSMI_BUFFER pBuf = _crVBoxHGSMIBufFromHdr(hgcm_buffer); 1639 1639 PCRVBOXHGSMI_CLIENT pClient = (PCRVBOXHGSMI_CLIENT)pBuf->pvUserData; 1640 pBuf->pfnUnlock(pBuf);1641 1640 _crVBoxHGSMIBufFree(pClient, pBuf); 1642 1641 }
Note:
See TracChangeset
for help on using the changeset viewer.