Changeset 61548 in vbox for trunk/src/VBox
- Timestamp:
- Jun 7, 2016 5:01:38 PM (9 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVidPn.cpp
r59518 r61548 20 20 #include "VBoxMPVidPn.h" 21 21 #include "common/VBoxMPCommon.h" 22 23 24 static NTSTATUS vboxVidPnCheckMonitorModes(PVBOXMP_DEVEXT pDevExt, uint32_t u32Target, const CR_SORTARRAY *pSupportedTargetModes = NULL); 22 25 23 26 static D3DDDIFORMAT vboxWddmCalcPixelFormat(const VIDEO_MODE_INFORMATION *pInfo) … … 658 661 if (!NT_SUCCESS(Status)) 659 662 { 660 WARN(("pfnAddMode failed, Status 0x%x", Status));663 WARN(("pfnAddMode (%d x %d) failed, Status 0x%x", size.cx, size.cy, Status)); 661 664 NTSTATUS tmpStatus = pVidPnModeSetInterface->pfnReleaseModeInfo(hVidPnModeSet, pVidPnModeInfo); 662 665 Assert(tmpStatus == STATUS_SUCCESS); 663 return Status; 664 } 666 continue; 667 } 668 669 LOGF(("mode (%d x %d) added to monitor modeset", size.cx, size.cy)); 665 670 } 666 671 … … 882 887 return Status; 883 888 } 889 890 Status = vboxVidPnCheckMonitorModes(pDevExt, VidPnTargetId, &aModes[VidPnTargetId]); 891 892 if (!NT_SUCCESS(Status)) 893 { 894 WARN(("vboxVidPnCheckMonitorModes failed, Status(0x%x)", Status)); 895 return Status; 896 } 884 897 885 898 return STATUS_SUCCESS; … … 1110 1123 } 1111 1124 1112 static NTSTATUS vboxVidPnCheckMonitorModes(PVBOXMP_DEVEXT pDevExt, uint32_t u32Target )1125 static NTSTATUS vboxVidPnCheckMonitorModes(PVBOXMP_DEVEXT pDevExt, uint32_t u32Target, const CR_SORTARRAY *pSupportedModes) 1113 1126 { 1114 1127 NTSTATUS Status; … … 1124 1137 CONST DXGK_MONITORSOURCEMODESET_INTERFACE *pVidPnModeSetInterface; 1125 1138 1126 const CR_SORTARRAY *pSupportedModes = VBoxWddmVModesGet(pDevExt, u32Target); 1139 if (!pSupportedModes) 1140 { 1141 pSupportedModes = VBoxWddmVModesGet(pDevExt, u32Target); 1142 } 1143 1127 1144 CR_SORTARRAY DiffModes; 1128 1145 int rc = CrSaInit(&DiffModes, CrSaGetSize(pSupportedModes)); … … 1165 1182 size.cy = pVidPnModeInfo->VideoSignalInfo.ActiveSize.cy; 1166 1183 CrSaRemove(&DiffModes, CR_RSIZE2U64(size)); 1184 LOG(("mode (%d x %d) is already in monitor modeset\n", size.cx, size.cy)); 1167 1185 } 1168 1186 … … 1175 1193 goto done; 1176 1194 } 1195 1196 LOG(("Adding %d additional modes to monitor modeset\n", CrSaGetSize(&DiffModes))); 1177 1197 1178 1198 Status = vboxVidPnMonitorModeSetFromArray(hVidPnModeSet, pVidPnModeSetInterface, &DiffModes); … … 1276 1296 NTSTATUS VBoxVidPnUpdateModes(PVBOXMP_DEVEXT pDevExt, uint32_t u32TargetId, const RTRECTSIZE *pSize) 1277 1297 { 1298 LOGF(("ENTER u32TargetId(%d) mode(%d x %d)", u32TargetId, pSize->cx, pSize->cy)); 1299 1278 1300 if (u32TargetId >= (uint32_t)VBoxCommonFromDeviceExt(pDevExt)->cDisplays) 1279 1301 { … … 1283 1305 1284 1306 int rc = VBoxWddmVModesAdd(pDevExt, u32TargetId, pSize, TRUE); 1307 LOGF(("VBoxWddmVModesAdd returned (%d)", rc)); 1308 1285 1309 if (RT_FAILURE(rc)) 1286 1310 { … … 1293 1317 /* mode was already in list, just return */ 1294 1318 Assert(CrSaContains(VBoxWddmVModesGet(pDevExt, u32TargetId), CR_RSIZE2U64(*pSize))); 1319 LOGF(("LEAVE mode was already in modeset, just return")); 1295 1320 return STATUS_SUCCESS; 1296 1321 } 1297 1322 1298 1323 /* modes have changed, need to replug */ 1324 /* The VBOXESC_UPDATEMODES is a hint for VBoxVideoW8.sys to use new display mode as soon as VidPn manager will ask for it. 1325 Probably, some new interface is required to plug/unplug displays by calling VBoxWddmChildStatusReportReconnected. 1326 But it is a bad idea to mix sending a display mode hint and (un)plug displays in VBOXESC_UPDATEMODES. 1327 1299 1328 NTSTATUS Status = VBoxWddmChildStatusReportReconnected(pDevExt, u32TargetId); 1329 LOG(("VBoxWddmChildStatusReportReconnected returned (%d)", Status)); 1300 1330 if (!NT_SUCCESS(Status)) 1301 1331 { … … 1303 1333 return Status; 1304 1334 } 1305 1335 */ 1336 LOGF(("LEAVE u32TargetId(%d)", u32TargetId)); 1306 1337 return STATUS_SUCCESS; 1307 1338 } … … 1734 1765 1735 1766 #ifdef VBOXWDDM_DEBUG_VIDPN 1736 vboxVidPnDumpCofuncModalityArg(">>>>MODALITY Args: ", pEnumCofuncModalityArg, "\n");1737 vboxVidPnDumpVidPn(">>>>MODALITY VidPN (IN) : >>>>\n", pDevExt, pEnumCofuncModalityArg->hConstrainingVidPn, pVidPnInterface, "<<<<<<<<<<<<<<<<<<<<\n");1767 vboxVidPnDumpCofuncModalityArg(">>>>MODALITY Args: ", enmPivot, pPivot, "\n"); 1768 vboxVidPnDumpVidPn(">>>>MODALITY VidPN (IN) : >>>>\n", pDevExt, hVidPn, pVidPnInterface, "<<<<<<<<<<<<<<<<<<<<\n"); 1738 1769 #endif 1739 1770 … … 3042 3073 } 3043 3074 3044 void vboxVidPnDumpCofuncModalityArg(const char *pPrefix, CONST DXGKARG_ENUMVIDPNCOFUNCMODALITY* CONST pEnumCofuncModalityArg, const char *pSuffix)3045 { 3046 LOGREL_EXACT(("%sPivotType(%s), SourceId(0x%x), TargetId(0x%x),%s", pPrefix, vboxVidPnDumpStrCFMPivotType( pEnumCofuncModalityArg->EnumPivotType),3047 p EnumCofuncModalityArg->EnumPivot.VidPnSourceId, pEnumCofuncModalityArg->EnumPivot.VidPnTargetId, pSuffix));3075 void vboxVidPnDumpCofuncModalityArg(const char *pPrefix, D3DKMDT_ENUMCOFUNCMODALITY_PIVOT_TYPE enmPivot, const DXGK_ENUM_PIVOT *pPivot, const char *pSuffix) 3076 { 3077 LOGREL_EXACT(("%sPivotType(%s), SourceId(0x%x), TargetId(0x%x),%s", pPrefix, vboxVidPnDumpStrCFMPivotType(enmPivot), 3078 pPivot->VidPnSourceId, pPivot->VidPnTargetId, pSuffix)); 3048 3079 } 3049 3080 -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVidPn.h
r52631 r61548 103 103 104 104 void vboxVidPnDumpVidPn(const char * pPrefix, PVBOXMP_DEVEXT pDevExt, D3DKMDT_HVIDPN hVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, const char * pSuffix); 105 void vboxVidPnDumpCofuncModalityArg(const char *pPrefix, CONST DXGKARG_ENUMVIDPNCOFUNCMODALITY* CONST pEnumCofuncModalityArg, const char *pSuffix);105 void vboxVidPnDumpCofuncModalityArg(const char *pPrefix, D3DKMDT_ENUMCOFUNCMODALITY_PIVOT_TYPE enmPivot, const DXGK_ENUM_PIVOT *pPivot, const char *pSuffix); 106 106 DECLCALLBACK(BOOLEAN) vboxVidPnDumpSourceModeSetEnum(D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet, const DXGK_VIDPNSOURCEMODESET_INTERFACE *pVidPnSourceModeSetInterface, 107 107 const D3DKMDT_VIDPN_SOURCE_MODE *pNewVidPnSourceModeInfo, PVOID pContext); -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp
r60012 r61548 5081 5081 } 5082 5082 5083 LOGF(("LEAVE, status(0x%x), context(0x%x)", Status, hAdapter));5083 LOGF(("LEAVE, isSupported(%d), context(0x%x)", pIsSupportedVidPnArg->IsVidPnSupported, hAdapter)); 5084 5084 5085 5085 return STATUS_SUCCESS; -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDispIf.cpp
r61530 r61548 1341 1341 } 1342 1342 1343 /* The code below was commented out because VBOXESC_UPDATEMODES should not cause (un)plugging virtual displays. 1343 1344 winEr = vboxDispIfWaitDisplayDataInited(pOp); 1344 1345 if (winEr != NO_ERROR) 1345 1346 WARN(("VBoxTray: (WDDM) Failed vboxDispIfWaitDisplayDataInited winEr %d\n", winEr)); 1346 1347 */ 1347 1348 return winEr; 1348 1349 } … … 1379 1380 static DWORD vboxDispIfResizePerform(PCVBOXDISPIF const pIf, UINT iChangedMode, BOOL fEnable, BOOL fExtDispSup, DISPLAY_DEVICE *paDisplayDevices, DEVMODE *paDeviceModes, UINT cDevModes) 1380 1381 { 1382 LogFunc((" ENTER")); 1381 1383 DWORD winEr; 1384 1382 1385 if (pIf->enmMode > VBOXDISPIF_MODE_WDDM) 1383 1386 { … … 1392 1395 WARN(("VBoxTray: (WDDM) Failed vboxDispIfWddmResizeDisplayVista winEr %d\n", winEr)); 1393 1396 } 1397 1398 LogFunc((" LEAVE")); 1394 1399 return winEr; 1395 1400 } … … 1399 1404 DWORD winEr = NO_ERROR; 1400 1405 1401 Log(("VBoxTray: vboxDispIfResizeModesWDDM iChanged %d cDevModes %d \n", iChangedMode, cDevModes));1406 Log(("VBoxTray: vboxDispIfResizeModesWDDM iChanged %d cDevModes %d fEnable %d fExtDispSup %d\n", iChangedMode, cDevModes, fEnable, fExtDispSup)); 1402 1407 VBoxRrRetryStop(); 1403 1408 … … 1430 1435 } 1431 1436 1432 D3DKMT_INVALIDATEACTIVEVIDPN DdiData = {0}; 1433 1434 DdiData.hAdapter = Op.Adapter.hAdapter; 1435 DdiData.pPrivateDriverData = &VidPnData; 1436 DdiData.PrivateDriverDataSize = sizeof (VidPnData); 1437 1438 NTSTATUS Status = Op.pIf->modeData.wddm.KmtCallbacks.pfnD3DKMTInvalidateActiveVidPn(&DdiData); 1439 LogFunc(("InvalidateActiveVidPn 0x%08x\n", Status)); 1437 /* The pfnD3DKMTInvalidateActiveVidPn was deprecated since Win7 and causes deadlocks since Win10 TH2. 1438 Instead, the VidPn Manager can replace an old VidPn as soon as SetDisplayConfig or ChangeDisplaySettingsEx will try to set a new display mode. 1439 On Vista D3DKMTInvalidateActiveVidPn is still required. TBD: Get rid of it. */ 1440 if (Op.pIf->enmMode < VBOXDISPIF_MODE_WDDM_W7) 1441 { 1442 D3DKMT_INVALIDATEACTIVEVIDPN DdiData = {0}; 1443 1444 DdiData.hAdapter = Op.Adapter.hAdapter; 1445 DdiData.pPrivateDriverData = &VidPnData; 1446 DdiData.PrivateDriverDataSize = sizeof (VidPnData); 1447 1448 NTSTATUS Status; 1449 Status = Op.pIf->modeData.wddm.KmtCallbacks.pfnD3DKMTInvalidateActiveVidPn(&DdiData); 1450 LogFunc(("D3DKMTInvalidateActiveVidPn returned %d)\n", Status)); 1451 } 1440 1452 1441 1453 /* Resize displays always to keep the display layout because … … 1451 1463 Size.cx = paDeviceModes[iChangedMode].dmPelsWidth; 1452 1464 Size.cy = paDeviceModes[iChangedMode].dmPelsHeight; 1465 LogFunc(("Calling vboxDispIfUpdateModesWDDM to change target %d mode to (%d x %d)\n", iChangedMode, Size.cx, Size.cy)); 1453 1466 winEr = vboxDispIfUpdateModesWDDM(&Op, iChangedMode, &Size); 1467 LogFunc(("vboxDispIfUpdateModesWDDM returned %d\n", winEr)); 1468 1454 1469 if (winEr != NO_ERROR) 1455 1470 WARN(("vboxDispIfUpdateModesWDDM failed %d\n", winEr)); … … 1460 1475 winEr = vboxDispIfResizePerform(pIf, i, fEnable, fExtDispSup, paDisplayDevices, paDeviceModes, cDevModes); 1461 1476 1477 LogFunc(("vboxDispIfResizePerform returned %d\n", winEr)); 1478 1462 1479 if (winEr == ERROR_RETRY) 1463 1480 { 1464 1481 VBoxRrRetrySchedule(pIf, i, fEnable, fExtDispSup, paDisplayDevices, paDeviceModes, cDevModes); 1465 /* just pretend everything is fine so far */ 1482 1466 1483 winEr = NO_ERROR; 1467 1484 }
Note:
See TracChangeset
for help on using the changeset viewer.