Changeset 80478 in vbox for trunk/src/VBox/Additions/WINNT/Graphics
- Timestamp:
- Aug 28, 2019 1:32:17 PM (5 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Video/mp
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/Makefile.kmk
r80422 r80478 94 94 VBoxWddm_DEFS += LOG_TO_BACKDOOR 95 95 VBoxWddm_DEFS += VBOX_SVN_REV=$(VBOX_SVN_REV) 96 ifdef VBOX_VDMA_WITH_WATCHDOG97 VBoxWddm_DEFS += VBOX_VDMA_WITH_WATCHDOG98 endif99 96 VBoxWddm_INCS += \ 100 97 ../../../include \ -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPDevExt.h
r80422 r80478 166 166 167 167 168 #ifdef VBOX_VDMA_WITH_WATCHDOG169 PKTHREAD pWdThread;170 KEVENT WdEvent;171 #endif172 168 BOOL bVSyncTimerEnabled; 173 169 volatile uint32_t fVSyncInVBlank; -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPMisc.cpp
r80422 r80478 1289 1289 } 1290 1290 1291 #ifdef VBOX_VDMA_WITH_WATCHDOG1292 static int vboxWddmWdProgram(PVBOXMP_DEVEXT pDevExt, uint32_t cMillis)1293 {1294 int rc = VINF_SUCCESS;1295 VBOXVDMA_CTL RT_UNTRUSTED_VOLATILE_GUEST *pCmd1296 = (VBOXVDMA_CTL RT_UNTRUSTED_VOLATILE_GUEST *)VBoxSHGSMICommandAlloc(&VBoxCommonFromDeviceExt(pDevExt)->guestCtx.heapCtx,1297 sizeof(VBOXVDMA_CTL), HGSMI_CH_VBVA, VBVA_VDMA_CTL);1298 if (pCmd)1299 {1300 pCmd->enmCtl = VBOXVDMA_CTL_TYPE_WATCHDOG;1301 pCmd->u32Offset = cMillis;1302 pCmd->i32Result = VERR_NOT_SUPPORTED;1303 1304 const VBOXSHGSMIHEADER* pHdr = VBoxSHGSMICommandPrepSynch(&VBoxCommonFromDeviceExt(pDevExt)->guestCtx.heapCtx, pCmd);1305 Assert(pHdr);1306 if (pHdr)1307 {1308 do1309 {1310 HGSMIOFFSET offCmd = VBoxSHGSMICommandOffset(&VBoxCommonFromDeviceExt(pDevExt)->guestCtx.heapCtx, pHdr);1311 Assert(offCmd != HGSMIOFFSET_VOID);1312 if (offCmd != HGSMIOFFSET_VOID)1313 {1314 VBVO_PORT_WRITE_U32(VBoxCommonFromDeviceExt(pDevExt)->guestCtx.port, offCmd);1315 /* Make the compiler aware that the host has changed memory. */1316 ASMCompilerBarrier();1317 rc = VBoxSHGSMICommandDoneSynch(&VBoxCommonFromDeviceExt(pDevExt)->guestCtx.heapCtx, pHdr);1318 AssertRC(rc);1319 if (RT_SUCCESS(rc))1320 {1321 rc = pCmd->i32Result;1322 AssertRC(rc);1323 }1324 break;1325 }1326 else1327 rc = VERR_INVALID_PARAMETER;1328 /* fail to submit, cancel it */1329 VBoxSHGSMICommandCancelSynch(&VBoxCommonFromDeviceExt(pDevExt)->guestCtx.heapCtx, pHdr);1330 } while (0);1331 }1332 1333 VBoxSHGSMICommandFree(&VBoxCommonFromDeviceExt(pDevExt)->guestCtx.heapCtx, pCmd);1334 }1335 else1336 {1337 LOGREL(("HGSMIHeapAlloc failed"));1338 rc = VERR_OUT_OF_RESOURCES;1339 }1340 return rc;1341 }1342 1343 static uint32_t g_VBoxWdTimeout = 4000;1344 /* if null g_VBoxWdTimeout / 2 is used */1345 static uint32_t g_VBoxWdTimerPeriod = 0;1346 1347 static VOID vboxWddmWdThread(PVOID pvUser)1348 {1349 PVBOXMP_DEVEXT pDevExt = (PVBOXMP_DEVEXT)pvUser;1350 BOOLEAN bExit = FALSE;1351 int rc;1352 while (1)1353 {1354 if (!bExit)1355 {1356 rc = vboxWddmWdProgram(pDevExt, g_VBoxWdTimeout /* ms */);1357 AssertRC(rc);1358 }1359 else1360 {1361 rc = vboxWddmWdProgram(pDevExt, 0 /* to disable WatchDog */);1362 AssertRC(rc);1363 break;1364 }1365 LARGE_INTEGER Timeout;1366 uint32_t timerTimeOut = g_VBoxWdTimerPeriod ? g_VBoxWdTimerPeriod : g_VBoxWdTimeout / 2;1367 Timeout.QuadPart = 10000ULL * timerTimeOut /* ms */;1368 NTSTATUS Status = KeWaitForSingleObject(&pDevExt->WdEvent, Executive, KernelMode, FALSE, &Timeout);1369 if (Status != STATUS_TIMEOUT)1370 bExit = TRUE;1371 }1372 }1373 1374 NTSTATUS vboxWddmWdInit(PVBOXMP_DEVEXT pDevExt)1375 {1376 KeInitializeEvent(&pDevExt->WdEvent, NotificationEvent, FALSE);1377 1378 NTSTATUS Status = vboxWddmThreadCreate(&pDevExt->pWdThread, vboxWddmWdThread, pDevExt);1379 if (!NT_SUCCESS(Status))1380 {1381 WARN(("vboxWddmThreadCreate failed, Status 0x%x", Status));1382 pDevExt->pWdThread = NULL;1383 }1384 return Status;1385 }1386 1387 NTSTATUS vboxWddmWdTerm(PVBOXMP_DEVEXT pDevExt)1388 {1389 if (!pDevExt->pWdThread)1390 return STATUS_SUCCESS;1391 1392 KeSetEvent(&pDevExt->WdEvent, 0, FALSE);1393 1394 KeWaitForSingleObject(pDevExt->pWdThread, Executive, KernelMode, FALSE, NULL);1395 ObDereferenceObject(pDevExt->pWdThread);1396 pDevExt->pWdThread = NULL;1397 return STATUS_SUCCESS;1398 }1399 #endif1400 1401 1291 static int vboxWddmSlConfigure(PVBOXMP_DEVEXT pDevExt, uint32_t fFlags) 1402 1292 { -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPMisc.h
r80422 r80478 154 154 NTSTATUS vboxWddmDrvCfgInit(PUNICODE_STRING pRegStr); 155 155 156 #ifdef VBOX_VDMA_WITH_WATCHDOG157 NTSTATUS vboxWddmWdInit(PVBOXMP_DEVEXT pDevExt);158 NTSTATUS vboxWddmWdTerm(PVBOXMP_DEVEXT pDevExt);159 #endif160 161 156 NTSTATUS VBoxWddmSlEnableVSyncNotification(PVBOXMP_DEVEXT pDevExt, BOOLEAN fEnable); 162 157 NTSTATUS VBoxWddmSlGetScanLine(PVBOXMP_DEVEXT pDevExt, DXGKARG_GETSCANLINE *pSl); -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp
r80435 r80478 820 820 if (RT_SUCCESS(rc)) 821 821 { 822 #ifdef VBOX_VDMA_WITH_WATCHDOG823 vboxWddmWdInit(pDevExt);824 #endif825 822 /* can enable it right away since the host does not need any screen/FB info 826 823 * for basic DMA functionality */ … … 1010 1007 if (RT_SUCCESS(rc)) 1011 1008 { 1012 #ifdef VBOX_VDMA_WITH_WATCHDOG1013 vboxWddmWdTerm(pDevExt);1014 #endif1015 1009 rc = vboxVdmaDestroy(pDevExt, &pDevExt->u.primary.Vdma); 1016 1010 AssertRC(rc); … … 1586 1580 if (bOur) 1587 1581 { 1588 #ifdef VBOX_VDMA_WITH_WATCHDOG1589 if (flags & HGSMIHOSTFLAGS_WATCHDOG)1590 {1591 Assert(0);1592 }1593 #endif1594 1582 if (flags & HGSMIHOSTFLAGS_VSYNC) 1595 1583 { … … 1759 1747 if (bOur) 1760 1748 { 1761 #ifdef VBOX_VDMA_WITH_WATCHDOG1762 if (flags & HGSMIHOSTFLAGS_WATCHDOG)1763 {1764 Assert(0);1765 }1766 #endif1767 1749 if (flags & HGSMIHOSTFLAGS_VSYNC) 1768 1750 {
Note:
See TracChangeset
for help on using the changeset viewer.