Changeset 84658 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Jun 3, 2020 11:30:37 AM (5 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPMisc.cpp
r83842 r84658 1251 1251 g_VBoxLogUm = dwValue; 1252 1252 1253 g_RefreshRate = 0; 1254 Status = vboxWddmRegQueryValueDword(hKey, VBOXWDDM_CFG_STR_RATE, &dwValue); 1255 if (NT_SUCCESS(Status)) 1256 g_RefreshRate = dwValue; 1257 1258 if (g_RefreshRate == 0 || g_RefreshRate > 240) 1259 g_RefreshRate = VBOXWDDM_DEFAULT_REFRESH_RATE; 1260 1253 1261 ZwClose(hKey); 1254 1262 … … 1323 1331 1324 1332 LARGE_INTEGER DueTime; 1325 DueTime.QuadPart = -1 66666LL; /* 60Hz */1326 KeSetTimerEx(&pDevExt->VSyncTimer, DueTime, 1 6, &pDevExt->VSyncDpc);1333 DueTime.QuadPart = -10000000LL / g_RefreshRate; /* 100ns units per second / Freq Hz */ 1334 KeSetTimerEx(&pDevExt->VSyncTimer, DueTime, 1000 / g_RefreshRate, &pDevExt->VSyncDpc); 1327 1335 } 1328 1336 … … 1356 1364 VSyncTime.QuadPart = VSyncTime.QuadPart - DevVSyncTime.QuadPart; 1357 1365 /* 1358 * Check whether we are in VBlank state or actively drawing a scan line 1359 * 10% of the 60Hzare dedicated to VBlank.1366 * Check whether we are in VBlank state or actively drawing a scan line. 1367 * 10% of the VSync interval are dedicated to VBlank. 1360 1368 * 1361 1369 * Time intervals are in 100ns steps. 1362 1370 */ 1363 1371 LARGE_INTEGER VSyncPeriod; 1364 VSyncPeriod.QuadPart = VSyncTime.QuadPart % 166666LL; /* ASSUMES 60Hz*/ 1365 if (VSyncPeriod.QuadPart >= 150000LL) 1372 VSyncPeriod.QuadPart = VSyncTime.QuadPart % (10000000LL / g_RefreshRate); 1373 LARGE_INTEGER VBlankStart; 1374 VBlankStart.QuadPart = ((10000000LL / g_RefreshRate) * 9) / 10; 1375 if (VSyncPeriod.QuadPart >= VBlankStart.QuadPart) 1366 1376 bVBlank = TRUE; 1367 1377 else 1368 curScanLine = (uint32_t)((pTarget->Size.cy * VSyncPeriod.QuadPart) / 150000LL);1378 curScanLine = (uint32_t)((pTarget->Size.cy * VSyncPeriod.QuadPart) / VBlankStart.QuadPart); 1369 1379 } 1370 1380 … … 1475 1485 pAllocData->SurfDesc.cbSize = pInfo->Pitch * pInfo->Height; 1476 1486 pAllocData->SurfDesc.VidPnSourceId = pInfo->TargetId; 1477 pAllocData->SurfDesc.RefreshRate.Numerator = 60000;1487 pAllocData->SurfDesc.RefreshRate.Numerator = g_RefreshRate * 1000; 1478 1488 pAllocData->SurfDesc.RefreshRate.Denominator = 1000; 1479 1489 -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPTypes.h
r82968 r84658 38 38 #include <iprt/avl.h> 39 39 #endif 40 41 #define VBOXWDDM_DEFAULT_REFRESH_RATE 60 40 42 41 43 #ifndef VBOX_WITH_MESA3D -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVidPn.cpp
r82968 r84658 202 202 static void vboxVidPnPopulateMonitorModeInfo(D3DKMDT_MONITOR_SOURCE_MODE *pMonitorSourceMode, const RTRECTSIZE *pResolution) 203 203 { 204 vboxVidPnPopulateVideoSignalInfo(&pMonitorSourceMode->VideoSignalInfo, pResolution, 60 /* ULONG VSync */);204 vboxVidPnPopulateVideoSignalInfo(&pMonitorSourceMode->VideoSignalInfo, pResolution, g_RefreshRate); 205 205 pMonitorSourceMode->ColorBasis = D3DKMDT_CB_SRGB; 206 206 pMonitorSourceMode->ColorCoeffDynamicRanges.FirstChannel = 8; … … 215 215 { 216 216 pNewVidPnTargetModeInfo->Preference = D3DKMDT_MP_NOTPREFERRED; 217 return vboxVidPnPopulateVideoSignalInfo(&pNewVidPnTargetModeInfo->VideoSignalInfo, pResolution, 60 /* ULONG VSync */);217 return vboxVidPnPopulateVideoSignalInfo(&pNewVidPnTargetModeInfo->VideoSignalInfo, pResolution, g_RefreshRate); 218 218 } 219 219 -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp
r84465 r84658 48 48 DWORD g_VBoxLogUm = 0; 49 49 #endif 50 DWORD g_RefreshRate = 0; 50 51 51 52 /* Whether the driver is display-only (no 3D) for Windows 8 or newer guests. */ … … 2328 2329 pDescribeAllocation->Format = pAllocation->AllocData.SurfDesc.format; 2329 2330 memset (&pDescribeAllocation->MultisampleMethod, 0, sizeof (pDescribeAllocation->MultisampleMethod)); 2330 pDescribeAllocation->RefreshRate.Numerator = 60000;2331 pDescribeAllocation->RefreshRate.Numerator = g_RefreshRate * 1000; 2331 2332 pDescribeAllocation->RefreshRate.Denominator = 1000; 2332 2333 pDescribeAllocation->PrivateDriverFormatAttribute = 0; -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.h
r83840 r84658 38 38 #define VBOXWDDM_CFG_LOG_UM_DBGPRINT 0x00000002 39 39 #define VBOXWDDM_CFG_STR_LOG_UM L"VBoxLogUm" 40 #define VBOXWDDM_CFG_STR_RATE L"RefreshRate" 40 41 41 42 #define VBOXWDDM_REG_DRV_FLAGS_NAME L"VBoxFlags" … … 57 58 58 59 extern DWORD g_VBoxLogUm; 60 extern DWORD g_RefreshRate; 59 61 60 62 RT_C_DECLS_BEGIN
Note:
See TracChangeset
for help on using the changeset viewer.