Changeset 37207 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm
- Timestamp:
- May 24, 2011 11:11:29 PM (14 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVidPn.cpp
r37189 r37207 117 117 } 118 118 return -1; 119 }120 121 122 NTSTATUS vboxVidPnCheckTopology(PVBOXMP_DEVEXT pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn,123 D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface,124 BOOLEAN *pbSupported)125 {126 const D3DKMDT_VIDPN_PRESENT_PATH *pNewVidPnPresentPathInfo = NULL;127 NTSTATUS Status = pVidPnTopologyInterface->pfnAcquireFirstPathInfo(hVidPnTopology, &pNewVidPnPresentPathInfo);128 BOOLEAN bSupported = TRUE;129 130 if (Status == STATUS_SUCCESS)131 {132 BOOLEAN bFoundPrimary = FALSE;133 134 while (1)135 {136 if (pNewVidPnPresentPathInfo->VidPnSourceId != pNewVidPnPresentPathInfo->VidPnTargetId)137 {138 LOG(("unsupported source(%d)->target(%d) pair", pNewVidPnPresentPathInfo->VidPnSourceId, pNewVidPnPresentPathInfo->VidPnTargetId));139 bSupported = FALSE;140 break;141 }142 143 if (pNewVidPnPresentPathInfo->VidPnSourceId == 0)144 {145 bFoundPrimary = TRUE;146 }147 148 /*149 ImportanceOrdinal does not matter for now150 pNewVidPnPresentPathInfo->ImportanceOrdinal151 */152 153 if (pNewVidPnPresentPathInfo->ContentTransformation.Scaling != D3DKMDT_VPPS_UNPINNED154 && pNewVidPnPresentPathInfo->ContentTransformation.Scaling != D3DKMDT_VPPS_IDENTITY155 && pNewVidPnPresentPathInfo->ContentTransformation.Scaling != D3DKMDT_VPPS_CENTERED156 && pNewVidPnPresentPathInfo->ContentTransformation.Scaling != D3DKMDT_VPPS_NOTSPECIFIED)157 {158 LOG(("unsupported Scaling (%d)", pNewVidPnPresentPathInfo->ContentTransformation.Scaling));159 AssertBreakpoint();160 bSupported = FALSE;161 break;162 }163 164 if (pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport.Stretched)165 {166 LOG(("unsupported Scaling support (Stretched)"));167 AssertBreakpoint();168 bSupported = FALSE;169 break;170 }171 172 if (!pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport.Identity173 && !pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport.Centered)174 {175 LOG(("\"Identity\" or \"Centered\" Scaling support not set"));176 AssertBreakpoint();177 bSupported = FALSE;178 break;179 }180 181 if (pNewVidPnPresentPathInfo->ContentTransformation.Rotation != D3DKMDT_VPPR_UNPINNED182 && pNewVidPnPresentPathInfo->ContentTransformation.Rotation != D3DKMDT_VPPR_IDENTITY)183 {184 LOG(("unsupported rotation (%d)", pNewVidPnPresentPathInfo->ContentTransformation.Rotation));185 AssertBreakpoint();186 bSupported = FALSE;187 break;188 }189 190 if (pNewVidPnPresentPathInfo->ContentTransformation.RotationSupport.Rotate180191 || pNewVidPnPresentPathInfo->ContentTransformation.RotationSupport.Rotate270192 || pNewVidPnPresentPathInfo->ContentTransformation.RotationSupport.Rotate90)193 {194 LOG(("unsupported RotationSupport"));195 AssertBreakpoint();196 bSupported = FALSE;197 break;198 }199 200 if (!pNewVidPnPresentPathInfo->ContentTransformation.RotationSupport.Identity)201 {202 LOG(("\"Identity\" RotationSupport not set"));203 AssertBreakpoint();204 bSupported = FALSE;205 break;206 }207 208 if (pNewVidPnPresentPathInfo->VisibleFromActiveTLOffset.cx209 || pNewVidPnPresentPathInfo->VisibleFromActiveTLOffset.cy)210 {211 LOG(("Non-zero TLOffset: cx(%d), cy(%d)",212 pNewVidPnPresentPathInfo->VisibleFromActiveTLOffset.cx,213 pNewVidPnPresentPathInfo->VisibleFromActiveTLOffset.cy));214 AssertBreakpoint();215 bSupported = FALSE;216 break;217 }218 219 if (pNewVidPnPresentPathInfo->VisibleFromActiveBROffset.cx220 || pNewVidPnPresentPathInfo->VisibleFromActiveBROffset.cy)221 {222 LOG(("Non-zero TLOffset: cx(%d), cy(%d)",223 pNewVidPnPresentPathInfo->VisibleFromActiveBROffset.cx,224 pNewVidPnPresentPathInfo->VisibleFromActiveBROffset.cy));225 AssertBreakpoint();226 bSupported = FALSE;227 break;228 }229 230 if (pNewVidPnPresentPathInfo->VidPnTargetColorBasis != D3DKMDT_CB_SRGB231 && pNewVidPnPresentPathInfo->VidPnTargetColorBasis != D3DKMDT_CB_UNINITIALIZED)232 {233 LOG(("unsupported VidPnTargetColorBasis (%d)", pNewVidPnPresentPathInfo->VidPnTargetColorBasis));234 AssertBreakpoint();235 bSupported = FALSE;236 break;237 }238 239 /* channels?240 pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.FirstChannel;241 pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.SecondChannel;242 pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.ThirdChannel;243 we definitely not support fourth channel244 */245 if (pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.FourthChannel)246 {247 LOG(("Non-zero FourthChannel (%d)", pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.FourthChannel));248 AssertBreakpoint();249 bSupported = FALSE;250 break;251 }252 253 /* Content (D3DKMDT_VPPC_GRAPHICS, _NOTSPECIFIED, _VIDEO), does not matter for now254 pNewVidPnPresentPathInfo->Content255 */256 /* not support copy protection for now */257 if (pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionType != D3DKMDT_VPPMT_NOPROTECTION258 && pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionType != D3DKMDT_VPPMT_UNINITIALIZED)259 {260 LOG(("Copy protection not supported CopyProtectionType(%d)", pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionType));261 AssertBreakpoint();262 bSupported = FALSE;263 break;264 }265 266 if (pNewVidPnPresentPathInfo->CopyProtection.APSTriggerBits)267 {268 LOG(("Copy protection not supported APSTriggerBits(%d)", pNewVidPnPresentPathInfo->CopyProtection.APSTriggerBits));269 AssertBreakpoint();270 bSupported = FALSE;271 break;272 }273 274 D3DKMDT_VIDPN_PRESENT_PATH_COPYPROTECTION_SUPPORT tstCPSupport = {0};275 tstCPSupport.NoProtection = 1;276 if (memcmp(&tstCPSupport, &pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionSupport, sizeof(tstCPSupport)))277 {278 LOG(("Copy protection support (0x%x)", *((UINT*)&pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionSupport)));279 AssertBreakpoint();280 bSupported = FALSE;281 break;282 }283 284 if (pNewVidPnPresentPathInfo->GammaRamp.Type != D3DDDI_GAMMARAMP_DEFAULT285 && pNewVidPnPresentPathInfo->GammaRamp.Type != D3DDDI_GAMMARAMP_UNINITIALIZED)286 {287 LOG(("Unsupported GammaRamp.Type (%d)", pNewVidPnPresentPathInfo->GammaRamp.Type));288 AssertBreakpoint();289 bSupported = FALSE;290 break;291 }292 293 if (pNewVidPnPresentPathInfo->GammaRamp.DataSize != 0)294 {295 LOG(("Warning: non-zero GammaRamp.DataSize (%d), treating as supported", pNewVidPnPresentPathInfo->GammaRamp.DataSize));296 }297 298 const D3DKMDT_VIDPN_PRESENT_PATH *pNextVidPnPresentPathInfo;299 300 Status = pVidPnTopologyInterface->pfnAcquireNextPathInfo(hVidPnTopology, pNewVidPnPresentPathInfo, &pNextVidPnPresentPathInfo);301 pVidPnTopologyInterface->pfnReleasePathInfo(hVidPnTopology, pNewVidPnPresentPathInfo);302 if (Status == STATUS_SUCCESS)303 {304 pNewVidPnPresentPathInfo = pNextVidPnPresentPathInfo;305 }306 else if (Status == STATUS_GRAPHICS_NO_MORE_ELEMENTS_IN_DATASET)307 {308 Status = STATUS_SUCCESS;309 pNewVidPnPresentPathInfo = NULL;310 break;311 }312 else313 {314 AssertBreakpoint();315 LOG(("pfnAcquireNextPathInfo Failed Status(0x%x)", Status));316 pNewVidPnPresentPathInfo = NULL;317 break;318 }319 }320 321 bSupported &= bFoundPrimary;322 323 if (pNewVidPnPresentPathInfo)324 pVidPnTopologyInterface->pfnReleasePathInfo(hVidPnTopology, pNewVidPnPresentPathInfo);325 326 }327 else if (Status == STATUS_GRAPHICS_DATASET_IS_EMPTY)328 Status = STATUS_SUCCESS;329 else330 LOGREL(("pfnAcquireFirstPathInfo failed Status(0x%x)", Status));331 332 *pbSupported = bSupported;333 334 return Status;335 119 } 336 120 … … 643 427 Status = pMonitorSMSIf->pfnAddMode(hMonitorSMS, pMonitorSMI); 644 428 Assert(Status == STATUS_SUCCESS/* || Status == STATUS_GRAPHICS_MODE_ALREADY_IN_MODESET*/); 645 // if (Status == STATUS_GRAPHICS_MODE_ALREADY_IN_MODESET)646 // Status = STATUS_SUCCESS;647 429 if (Status == STATUS_SUCCESS) 648 430 break; … … 658 440 if (tmpStatus != STATUS_SUCCESS) 659 441 LOGREL(("pfnReleaseModeInfo failed tmpStatus(0x%x)", tmpStatus)); 442 443 if (Status == STATUS_GRAPHICS_MODE_ALREADY_IN_MODESET) 444 Status = STATUS_SUCCESS; 660 445 } while (0); 661 446 } … … 762 547 { 763 548 D3DKMDT_2DREGION *pRes = &pResolutions[i]; 764 VBOXVIDPNCHECKMONMODESENUM ChkInfo = {0};765 ChkInfo.Region = *pRes;766 Status = vboxVidPnEnumMonitorSourceModes(hMonitorSMS, pMonitorSMSIf,767 vboxFidPnCheckMonitorModesEnum, &ChkInfo);768 Assert(Status == STATUS_SUCCESS);769 if (Status == STATUS_SUCCESS)770 {771 if (!ChkInfo.pMonitorSMI)772 {549 // VBOXVIDPNCHECKMONMODESENUM ChkInfo = {0}; 550 // ChkInfo.Region = *pRes; 551 // Status = vboxVidPnEnumMonitorSourceModes(hMonitorSMS, pMonitorSMSIf, 552 // vboxFidPnCheckMonitorModesEnum, &ChkInfo); 553 // Assert(Status == STATUS_SUCCESS); 554 // if (Status == STATUS_SUCCESS) 555 // { 556 // if (!ChkInfo.pMonitorSMI) 557 // { 773 558 Status = vboxVidPnCreatePopulateMonitorSourceModeInfoFromLegacy(pDevExt, 774 559 hMonitorSMS, … … 784 569 break; 785 570 } 786 }787 else788 {789 pMonitorSMSIf->pfnReleaseModeInfo(hMonitorSMS, ChkInfo.pMonitorSMI);790 }791 }792 else793 {794 LOGREL(("vboxVidPnEnumMonitorSourceModes failed Status(0x%x)", Status));795 break;796 }571 // } 572 // else 573 // { 574 // pMonitorSMSIf->pfnReleaseModeInfo(hMonitorSMS, ChkInfo.pMonitorSMI); 575 // } 576 // } 577 // else 578 // { 579 // LOGREL(("vboxVidPnEnumMonitorSourceModes failed Status(0x%x)", Status)); 580 // break; 581 // } 797 582 } 798 583 NTSTATUS tmpStatus = pMonitorInterface->pfnReleaseMonitorSourceModeSet(pDevExt->u.primary.DxgkInterface.DeviceHandle, hMonitorSMS); … … 1415 1200 { 1416 1201 Assert(hNewVidPnTargetModeSet); 1417 for (uint32_t i = 0; i < pInfo->cResolutions; ++i) 1418 { 1419 D3DKMDT_2DREGION *pResolution = &pInfo->aResolutions[i]; 1420 if (pPinnedVidPnSourceModeInfo) 1202 if (pCbContext->apPathInfos[VidPnSourceId].enmState == VBOXVIDPNPATHITEM_STATE_PRESENT) 1203 { 1204 Assert(VidPnSourceId == VidPnTargetId); 1205 1206 for (uint32_t i = 0; i < pInfo->cResolutions; ++i) 1421 1207 { 1422 if (pPinnedVidPnSourceModeInfo->Format.Graphics.PrimSurfSize.cx != pResolution->cx1423 || pPinnedVidPnSourceModeInfo->Format.Graphics.PrimSurfSize.cy != pResolution->cy)1208 D3DKMDT_2DREGION *pResolution = &pInfo->aResolutions[i]; 1209 if (pPinnedVidPnSourceModeInfo) 1424 1210 { 1425 continue; 1211 if (pPinnedVidPnSourceModeInfo->Format.Graphics.PrimSurfSize.cx != pResolution->cx 1212 || pPinnedVidPnSourceModeInfo->Format.Graphics.PrimSurfSize.cy != pResolution->cy) 1213 { 1214 continue; 1215 } 1426 1216 } 1427 } 1428 1429 D3DKMDT_VIDPN_TARGET_MODE *pNewVidPnTargetModeInfo; 1430 Status = pNewVidPnTargetModeSetInterface->pfnCreateNewModeInfo(hNewVidPnTargetModeSet, &pNewVidPnTargetModeInfo); 1431 Assert(Status == STATUS_SUCCESS); 1432 if (NT_SUCCESS(Status)) 1433 { 1434 Status = vboxVidPnPopulateTargetModeInfoFromLegacy(pNewVidPnTargetModeInfo, pResolution); 1217 1218 D3DKMDT_VIDPN_TARGET_MODE *pNewVidPnTargetModeInfo; 1219 Status = pNewVidPnTargetModeSetInterface->pfnCreateNewModeInfo(hNewVidPnTargetModeSet, &pNewVidPnTargetModeInfo); 1435 1220 Assert(Status == STATUS_SUCCESS); 1436 1221 if (NT_SUCCESS(Status)) 1437 1222 { 1438 Status = pNewVidPnTargetModeSetInterface->pfnAddMode(hNewVidPnTargetModeSet, pNewVidPnTargetModeInfo);1223 Status = vboxVidPnPopulateTargetModeInfoFromLegacy(pNewVidPnTargetModeInfo, pResolution); 1439 1224 Assert(Status == STATUS_SUCCESS); 1440 1225 if (NT_SUCCESS(Status)) 1441 1226 { 1442 /* success */ 1443 continue; 1227 Status = pNewVidPnTargetModeSetInterface->pfnAddMode(hNewVidPnTargetModeSet, pNewVidPnTargetModeInfo); 1228 Assert(Status == STATUS_SUCCESS); 1229 if (NT_SUCCESS(Status)) 1230 { 1231 /* success */ 1232 continue; 1233 } 1444 1234 } 1235 1236 NTSTATUS tmpStatus = pNewVidPnTargetModeSetInterface->pfnReleaseModeInfo(hNewVidPnTargetModeSet, pNewVidPnTargetModeInfo); 1237 Assert(tmpStatus == STATUS_SUCCESS); 1445 1238 } 1446 1447 NTSTATUS tmpStatus = pNewVidPnTargetModeSetInterface->pfnReleaseModeInfo(hNewVidPnTargetModeSet, pNewVidPnTargetModeInfo);1448 Assert(tmpStatus == STATUS_SUCCESS);1239 /* we're here because of an error */ 1240 Assert(!NT_SUCCESS(Status)); 1241 break; 1449 1242 } 1450 /* we're here because of an error */1451 Assert(!NT_SUCCESS(Status));1452 break;1453 1243 } 1454 1244 } … … 1535 1325 { 1536 1326 Assert(hNewVidPnSourceModeSet); 1537 for (uint32_t i = 0; i < pInfo->cModes; ++i)1538 { 1539 VIDEO_MODE_INFORMATION *pMode = &pInfo->aModes[i];1540 if (pPinnedVidPnTargetModeInfo)1327 if (pCbContext->apPathInfos[VidPnSourceId].enmState == VBOXVIDPNPATHITEM_STATE_PRESENT) 1328 { 1329 Assert(VidPnSourceId == VidPnTargetId); 1330 for (uint32_t i = 0; i < pInfo->cModes; ++i) 1541 1331 { 1542 if (pPinnedVidPnTargetModeInfo->VideoSignalInfo.ActiveSize.cx != pMode->VisScreenWidth1543 || pPinnedVidPnTargetModeInfo->VideoSignalInfo.ActiveSize.cy != pMode->VisScreenHeight)1332 VIDEO_MODE_INFORMATION *pMode = &pInfo->aModes[i]; 1333 if (pPinnedVidPnTargetModeInfo) 1544 1334 { 1545 continue; 1335 if (pPinnedVidPnTargetModeInfo->VideoSignalInfo.ActiveSize.cx != pMode->VisScreenWidth 1336 || pPinnedVidPnTargetModeInfo->VideoSignalInfo.ActiveSize.cy != pMode->VisScreenHeight) 1337 { 1338 continue; 1339 } 1546 1340 } 1547 } 1548 1549 D3DKMDT_VIDPN_SOURCE_MODE *pNewVidPnSourceModeInfo; 1550 Status = pNewVidPnSourceModeSetInterface->pfnCreateNewModeInfo(hNewVidPnSourceModeSet, &pNewVidPnSourceModeInfo); 1551 Assert(Status == STATUS_SUCCESS); 1552 if (NT_SUCCESS(Status)) 1553 { 1554 Status = vboxVidPnPopulateSourceModeInfoFromLegacy(pNewVidPnSourceModeInfo, pMode); 1341 1342 D3DKMDT_VIDPN_SOURCE_MODE *pNewVidPnSourceModeInfo; 1343 Status = pNewVidPnSourceModeSetInterface->pfnCreateNewModeInfo(hNewVidPnSourceModeSet, &pNewVidPnSourceModeInfo); 1555 1344 Assert(Status == STATUS_SUCCESS); 1556 1345 if (NT_SUCCESS(Status)) 1557 1346 { 1558 Status = pNewVidPnSourceModeSetInterface->pfnAddMode(hNewVidPnSourceModeSet, pNewVidPnSourceModeInfo);1347 Status = vboxVidPnPopulateSourceModeInfoFromLegacy(pNewVidPnSourceModeInfo, pMode); 1559 1348 Assert(Status == STATUS_SUCCESS); 1560 1349 if (NT_SUCCESS(Status)) 1561 1350 { 1562 /* success */ 1563 continue; 1351 Status = pNewVidPnSourceModeSetInterface->pfnAddMode(hNewVidPnSourceModeSet, pNewVidPnSourceModeInfo); 1352 Assert(Status == STATUS_SUCCESS); 1353 if (NT_SUCCESS(Status)) 1354 { 1355 /* success */ 1356 continue; 1357 } 1564 1358 } 1359 1360 NTSTATUS tmpStatus = pNewVidPnSourceModeSetInterface->pfnReleaseModeInfo(hNewVidPnSourceModeSet, pNewVidPnSourceModeInfo); 1361 Assert(tmpStatus == STATUS_SUCCESS); 1565 1362 } 1566 1567 NTSTATUS tmpStatus = pNewVidPnSourceModeSetInterface->pfnReleaseModeInfo(hNewVidPnSourceModeSet, pNewVidPnSourceModeInfo);1568 Assert(tmpStatus == STATUS_SUCCESS);1363 /* we're here because of an error */ 1364 Assert(!NT_SUCCESS(Status)); 1365 break; 1569 1366 } 1570 /* we're here because of an error */1571 Assert(!NT_SUCCESS(Status));1572 break;1573 1367 } 1574 1368 } … … 1689 1483 Assert(Status == STATUS_SUCCESS); 1690 1484 return Status == STATUS_SUCCESS; 1485 } 1486 1487 static BOOLEAN vboxVidPnIsPathSupported(const D3DKMDT_VIDPN_PRESENT_PATH *pNewVidPnPresentPathInfo) 1488 { 1489 if (pNewVidPnPresentPathInfo->VidPnSourceId != pNewVidPnPresentPathInfo->VidPnTargetId) 1490 { 1491 WARN(("unsupported source(%d)->target(%d) pair", pNewVidPnPresentPathInfo->VidPnSourceId, pNewVidPnPresentPathInfo->VidPnTargetId)); 1492 return FALSE; 1493 } 1494 1495 /* 1496 ImportanceOrdinal does not matter for now 1497 pNewVidPnPresentPathInfo->ImportanceOrdinal 1498 */ 1499 1500 if (pNewVidPnPresentPathInfo->ContentTransformation.Scaling != D3DKMDT_VPPS_UNPINNED 1501 && pNewVidPnPresentPathInfo->ContentTransformation.Scaling != D3DKMDT_VPPS_IDENTITY 1502 && pNewVidPnPresentPathInfo->ContentTransformation.Scaling != D3DKMDT_VPPS_NOTSPECIFIED) 1503 { 1504 WARN(("unsupported Scaling (%d)", pNewVidPnPresentPathInfo->ContentTransformation.Scaling)); 1505 return FALSE; 1506 } 1507 1508 if ( !pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport.Identity 1509 || pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport.Centered 1510 || pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport.Stretched) 1511 { 1512 WARN(("unsupported Scaling support")); 1513 return FALSE; 1514 } 1515 1516 if (pNewVidPnPresentPathInfo->ContentTransformation.Rotation != D3DKMDT_VPPR_UNPINNED 1517 && pNewVidPnPresentPathInfo->ContentTransformation.Rotation != D3DKMDT_VPPR_IDENTITY 1518 && pNewVidPnPresentPathInfo->ContentTransformation.Rotation != D3DKMDT_VPPR_NOTSPECIFIED) 1519 { 1520 WARN(("unsupported rotation (%d)", pNewVidPnPresentPathInfo->ContentTransformation.Rotation)); 1521 return FALSE; 1522 } 1523 1524 if ( !pNewVidPnPresentPathInfo->ContentTransformation.RotationSupport.Identity 1525 || pNewVidPnPresentPathInfo->ContentTransformation.RotationSupport.Rotate90 1526 || pNewVidPnPresentPathInfo->ContentTransformation.RotationSupport.Rotate180 1527 || pNewVidPnPresentPathInfo->ContentTransformation.RotationSupport.Rotate270) 1528 { 1529 WARN(("unsupported RotationSupport")); 1530 return FALSE; 1531 } 1532 1533 if (pNewVidPnPresentPathInfo->VisibleFromActiveTLOffset.cx 1534 || pNewVidPnPresentPathInfo->VisibleFromActiveTLOffset.cy) 1535 { 1536 WARN(("Non-zero TLOffset: cx(%d), cy(%d)", 1537 pNewVidPnPresentPathInfo->VisibleFromActiveTLOffset.cx, 1538 pNewVidPnPresentPathInfo->VisibleFromActiveTLOffset.cy)); 1539 return FALSE; 1540 } 1541 1542 if (pNewVidPnPresentPathInfo->VisibleFromActiveBROffset.cx 1543 || pNewVidPnPresentPathInfo->VisibleFromActiveBROffset.cy) 1544 { 1545 WARN(("Non-zero TLOffset: cx(%d), cy(%d)", 1546 pNewVidPnPresentPathInfo->VisibleFromActiveBROffset.cx, 1547 pNewVidPnPresentPathInfo->VisibleFromActiveBROffset.cy)); 1548 return FALSE; 1549 } 1550 1551 if (pNewVidPnPresentPathInfo->VidPnTargetColorBasis != D3DKMDT_CB_SRGB 1552 && pNewVidPnPresentPathInfo->VidPnTargetColorBasis != D3DKMDT_CB_UNINITIALIZED) 1553 { 1554 WARN(("unsupported VidPnTargetColorBasis (%d)", pNewVidPnPresentPathInfo->VidPnTargetColorBasis)); 1555 return FALSE; 1556 } 1557 1558 /* channels? 1559 pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.FirstChannel; 1560 pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.SecondChannel; 1561 pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.ThirdChannel; 1562 we definitely not support fourth channel 1563 */ 1564 if (pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.FourthChannel) 1565 { 1566 WARN(("Non-zero FourthChannel (%d)", pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.FourthChannel)); 1567 return FALSE; 1568 } 1569 1570 /* Content (D3DKMDT_VPPC_GRAPHICS, _NOTSPECIFIED, _VIDEO), does not matter for now 1571 pNewVidPnPresentPathInfo->Content 1572 */ 1573 /* not support copy protection for now */ 1574 if (pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionType != D3DKMDT_VPPMT_NOPROTECTION 1575 && pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionType != D3DKMDT_VPPMT_UNINITIALIZED) 1576 { 1577 WARN(("Copy protection not supported CopyProtectionType(%d)", pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionType)); 1578 return FALSE; 1579 } 1580 1581 if (pNewVidPnPresentPathInfo->CopyProtection.APSTriggerBits) 1582 { 1583 WARN(("Copy protection not supported APSTriggerBits(%d)", pNewVidPnPresentPathInfo->CopyProtection.APSTriggerBits)); 1584 return FALSE; 1585 } 1586 1587 D3DKMDT_VIDPN_PRESENT_PATH_COPYPROTECTION_SUPPORT tstCPSupport = {0}; 1588 tstCPSupport.NoProtection = 1; 1589 if (memcmp(&tstCPSupport, &pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionSupport, sizeof(tstCPSupport))) 1590 { 1591 WARN(("Copy protection support (0x%x)", *((UINT*)&pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionSupport))); 1592 return FALSE; 1593 } 1594 1595 if (pNewVidPnPresentPathInfo->GammaRamp.Type != D3DDDI_GAMMARAMP_DEFAULT 1596 && pNewVidPnPresentPathInfo->GammaRamp.Type != D3DDDI_GAMMARAMP_UNINITIALIZED) 1597 { 1598 WARN(("Unsupported GammaRamp.Type (%d)", pNewVidPnPresentPathInfo->GammaRamp.Type)); 1599 return FALSE; 1600 } 1601 1602 if (pNewVidPnPresentPathInfo->GammaRamp.DataSize != 0) 1603 { 1604 WARN(("Warning: non-zero GammaRamp.DataSize (%d), treating as supported", pNewVidPnPresentPathInfo->GammaRamp.DataSize)); 1605 } 1606 1607 return TRUE; 1608 } 1609 1610 typedef struct VBOXVIDPNGETPATHSINFO 1611 { 1612 NTSTATUS Status; 1613 BOOLEAN fBreakOnDisabled; 1614 BOOLEAN fDisabledFound; 1615 UINT cItems; 1616 PVBOXVIDPNPATHITEM paItems; 1617 } VBOXVIDPNGETPATHSINFO, *PVBOXVIDPNGETPATHSINFO; 1618 1619 static DECLCALLBACK(BOOLEAN) vboxVidPnCheckTopologyEnum(D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface, 1620 const D3DKMDT_VIDPN_PRESENT_PATH *pNewVidPnPresentPathInfo, PVOID pContext) 1621 { 1622 PVBOXVIDPNGETPATHSINFO pCbContext = (PVBOXVIDPNGETPATHSINFO)pContext; 1623 NTSTATUS Status = STATUS_SUCCESS; 1624 CONST D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId = pNewVidPnPresentPathInfo->VidPnSourceId; 1625 CONST D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId = pNewVidPnPresentPathInfo->VidPnTargetId; 1626 BOOLEAN fDisabledFound = !vboxVidPnIsPathSupported(pNewVidPnPresentPathInfo); 1627 do 1628 { 1629 if (fDisabledFound) 1630 { 1631 if (pCbContext->cItems > VidPnSourceId) 1632 { 1633 pCbContext->paItems[VidPnSourceId].enmState = VBOXVIDPNPATHITEM_STATE_DISABLED; 1634 } 1635 else 1636 { 1637 AssertFailed(); 1638 Status = STATUS_BUFFER_OVERFLOW; 1639 break; 1640 } 1641 1642 if (pCbContext->cItems > VidPnTargetId) 1643 { 1644 pCbContext->paItems[VidPnTargetId].enmState = VBOXVIDPNPATHITEM_STATE_DISABLED; 1645 } 1646 else 1647 { 1648 AssertFailed(); 1649 Status = STATUS_BUFFER_OVERFLOW; 1650 break; 1651 } 1652 1653 break; 1654 } 1655 1656 /* VidPnSourceId == VidPnTargetId */ 1657 if (pCbContext->cItems > VidPnSourceId) 1658 { 1659 if (pCbContext->paItems[VidPnSourceId].enmState != VBOXVIDPNPATHITEM_STATE_DISABLED) 1660 { 1661 Assert(pCbContext->paItems[VidPnSourceId].enmState == VBOXVIDPNPATHITEM_STATE_NOT_EXISTS); 1662 pCbContext->paItems[VidPnSourceId].enmState = VBOXVIDPNPATHITEM_STATE_PRESENT; 1663 } 1664 } 1665 else 1666 { 1667 AssertFailed(); 1668 Status = STATUS_BUFFER_OVERFLOW; 1669 break; 1670 } 1671 } while (0); 1672 1673 pCbContext->fDisabledFound |= fDisabledFound; 1674 pCbContext->Status = Status; 1675 if (!NT_SUCCESS(Status)) 1676 return FALSE; /* do not continue on failure */ 1677 1678 return !fDisabledFound || !pCbContext->fBreakOnDisabled; 1679 } 1680 1681 /* we currently support only 0 -> 0, 1 -> 1, 2 -> 2 paths, AND 0 -> 0 must be present 1682 * this routine disables all paths unsupported */ 1683 NTSTATUS vboxVidPnCheckTopology(D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface, 1684 BOOLEAN fBreakOnDisabled, UINT cItems, PVBOXVIDPNPATHITEM paItems, BOOLEAN *pfDisabledFound) 1685 { 1686 UINT i; 1687 for (i = 0; i < cItems; ++i) 1688 { 1689 paItems[i].enmState = VBOXVIDPNPATHITEM_STATE_NOT_EXISTS; 1690 } 1691 VBOXVIDPNGETPATHSINFO CbContext = {}; 1692 CbContext.Status = STATUS_SUCCESS; 1693 CbContext.fBreakOnDisabled = fBreakOnDisabled; 1694 CbContext.fDisabledFound = FALSE; 1695 CbContext.cItems = cItems; 1696 CbContext.paItems = paItems; 1697 NTSTATUS Status = vboxVidPnEnumPaths(hVidPnTopology, pVidPnTopologyInterface, vboxVidPnCheckTopologyEnum, &CbContext); 1698 if (!NT_SUCCESS(Status)) 1699 { 1700 WARN(("vboxVidPnEnumPaths failed Status()0x%x\n", Status)); 1701 return Status; 1702 } 1703 1704 Status = CbContext.Status; 1705 if (!NT_SUCCESS(Status)) 1706 { 1707 WARN(("vboxVidPnCheckTopologyEnum returned failed Status()0x%x\n", Status)); 1708 return Status; 1709 } 1710 1711 if (pfDisabledFound) 1712 *pfDisabledFound = CbContext.fDisabledFound; 1713 1714 if (!fBreakOnDisabled) 1715 { 1716 /* now check if 0->0 path is present and enabled, and if not, disable everything */ 1717 if (cItems && paItems[0].enmState != VBOXVIDPNPATHITEM_STATE_PRESENT) 1718 { 1719 LOGREL(("path 0 not set to present\n")); 1720 for (i = 0; i < cItems; ++i) 1721 { 1722 if (paItems[i].enmState == VBOXVIDPNPATHITEM_STATE_PRESENT) 1723 paItems[i].enmState = VBOXVIDPNPATHITEM_STATE_DISABLED; 1724 } 1725 } 1726 } 1727 1728 return Status; 1691 1729 } 1692 1730 … … 1901 1939 if (!pfnCallback(hVidPnTopology, pVidPnTopologyInterface, pNewVidPnPresentPathInfo, pContext)) 1902 1940 { 1903 Assert(Status == STATUS_SUCCESS);1904 1941 if (Status == STATUS_SUCCESS) 1905 1942 pVidPnTopologyInterface->pfnReleasePathInfo(hVidPnTopology, pNextVidPnPresentPathInfo); -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVidPn.h
r37189 r37207 23 23 #define VBOXVDPN_C_DISPLAY_VBLANK_SIZE 180 24 24 25 NTSTATUS vboxVidPnCheckTopology(PVBOXMP_DEVEXT pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn,26 D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface,27 BOOLEAN *pbSupported);28 29 25 NTSTATUS vboxVidPnCheckSourceModeInfo(const D3DKMDT_HVIDPN hDesiredVidPn, 30 26 const D3DKMDT_VIDPN_SOURCE_MODE *pNewVidPnSourceModeInfo, … … 43 39 BOOLEAN *pbSupported); 44 40 41 typedef enum 42 { 43 VBOXVIDPNPATHITEM_STATE_NOT_EXISTS = 0, 44 VBOXVIDPNPATHITEM_STATE_PRESENT, 45 VBOXVIDPNPATHITEM_STATE_DISABLED 46 } VBOXVIDPNPATHITEM_STATE; 47 48 typedef struct VBOXVIDPNPATHITEM 49 { 50 VBOXVIDPNPATHITEM_STATE enmState; 51 } VBOXVIDPNPATHITEM, *PVBOXVIDPNPATHITEM; 52 45 53 typedef struct VBOXVIDPNCOFUNCMODALITY 46 54 { … … 50 58 CONST DXGKARG_ENUMVIDPNCOFUNCMODALITY* pEnumCofuncModalityArg; 51 59 PVBOXWDDM_VIDEOMODES_INFO pInfos; 60 UINT cPathInfos; 61 PVBOXVIDPNPATHITEM apPathInfos; 52 62 } VBOXVIDPNCOFUNCMODALITY, *PVBOXVIDPNCOFUNCMODALITY; 53 63 … … 133 143 NTSTATUS vboxVidPnCofuncModalityForPath(PVBOXVIDPNCOFUNCMODALITY pCbContext, D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId, D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId); 134 144 145 NTSTATUS vboxVidPnCheckTopology(D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface, 146 BOOLEAN fBreakOnDisabled, UINT cItems, PVBOXVIDPNPATHITEM paItems, BOOLEAN *pfDisabledFound); 147 135 148 void vboxVidPnDumpVidPn(const char * pPrefix, PVBOXMP_DEVEXT pDevExt, D3DKMDT_HVIDPN hVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, const char * pSuffix); 136 149 void vboxVidPnDumpCofuncModalityArg(const char *pPrefix, CONST DXGKARG_ENUMVIDPNCOFUNCMODALITY* CONST pEnumCofuncModalityArg, const char *pSuffix); -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp
r37189 r37207 1110 1110 ChildRelations[i].ChildCapabilities.Type.VideoOutput.SupportsSdtvModes = FALSE; 1111 1111 ChildRelations[i].ChildCapabilities.HpdAwareness = HpdAwarenessAlwaysConnected; //HpdAwarenessInterruptible; /* ?? HpdAwarenessAlwaysConnected; */ 1112 ChildRelations[i].AcpiUid = i; /* */1112 ChildRelations[i].AcpiUid = 0; /* */ 1113 1113 ChildRelations[i].ChildUid = i; /* should be == target id */ 1114 1114 } … … 3506 3506 NTSTATUS Status = STATUS_SUCCESS; 3507 3507 BOOLEAN bSupported = TRUE; 3508 #if 1 3509 /* always report it as supported and let DxgkDdiEnumVidPnCofuncModality deal with support info */ 3510 #else 3508 3511 3509 PVBOXMP_DEVEXT pContext = (PVBOXMP_DEVEXT)hAdapter; 3512 3510 const DXGK_VIDPN_INTERFACE* pVidPnInterface = NULL; 3513 3511 Status = pContext->u.primary.DxgkInterface.DxgkCbQueryVidPnInterface(pIsSupportedVidPnArg->hDesiredVidPn, DXGK_VIDPN_INTERFACE_VERSION_V1, &pVidPnInterface); 3514 if (Status == STATUS_SUCCESS) 3515 { 3512 if (!NT_SUCCESS(Status)) 3513 { 3514 WARN(("DxgkCbQueryVidPnInterface failed Status()0x%x\n", Status)); 3515 return Status; 3516 } 3517 3516 3518 #ifdef VBOXWDDM_DEBUG_VIDPN 3517 vboxVidPnDumpVidPn("\n>>>>IS SUPPORTED VidPN : >>>>", pContext, pIsSupportedVidPnArg->hDesiredVidPn, pVidPnInterface, "<<<<<<<<<<<<<<<<<<<<"); 3518 #endif 3519 3520 D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology; 3521 const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface; 3522 Status = pVidPnInterface->pfnGetTopology(pIsSupportedVidPnArg->hDesiredVidPn, &hVidPnTopology, &pVidPnTopologyInterface); 3523 if (Status == STATUS_SUCCESS) 3524 { 3525 Status = vboxVidPnCheckTopology(pContext, pIsSupportedVidPnArg->hDesiredVidPn, hVidPnTopology, pVidPnTopologyInterface, &bSupported); 3526 if (Status == STATUS_SUCCESS && bSupported) 3527 { 3528 #if 0 3529 for (int id = 0; id < VBoxCommonFromDeviceExt(pContext)->cDisplays; ++id) 3530 { 3531 D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet; 3532 const DXGK_VIDPNSOURCEMODESET_INTERFACE *pVidPnSourceModeSetInterface; 3533 Status = pVidPnInterface->pfnAcquireSourceModeSet(pIsSupportedVidPnArg->hDesiredVidPn, 3534 id, 3535 &hNewVidPnSourceModeSet, 3536 &pVidPnSourceModeSetInterface); 3537 if (Status == STATUS_SUCCESS) 3538 { 3539 Status = vboxVidPnCheckSourceModeSet(pIsSupportedVidPnArg->hDesiredVidPn, hNewVidPnSourceModeSet, pVidPnSourceModeSetInterface, &bSupported); 3540 3541 Assert(bSupported); 3542 3543 pVidPnInterface->pfnReleaseSourceModeSet(pIsSupportedVidPnArg->hDesiredVidPn, hNewVidPnSourceModeSet); 3544 3545 if (Status != STATUS_SUCCESS || !bSupported) 3546 break; 3547 } 3548 else if (Status == STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_SOURCE) 3549 { 3550 LOGREL(("Warning: pfnAcquireSourceModeSet returned STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_SOURCE, continuing")); 3551 Status = STATUS_SUCCESS; 3552 } 3553 else 3554 { 3555 LOGREL(("pfnAcquireSourceModeSet failed Status(0x%x)")); 3556 break; 3557 } 3558 } 3559 3560 if (Status == STATUS_SUCCESS && bSupported) 3561 { 3562 for (int id = 0; id < VBoxCommonFromDeviceExt(pContext)->cDisplays; ++id) 3563 { 3564 D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet; 3565 CONST DXGK_VIDPNTARGETMODESET_INTERFACE *pVidPnTargetModeSetInterface; 3566 Status = pVidPnInterface->pfnAcquireTargetModeSet(pIsSupportedVidPnArg->hDesiredVidPn, 3567 id, /*__in CONST D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId */ 3568 &hNewVidPnTargetModeSet, 3569 &pVidPnTargetModeSetInterface); 3570 if (Status == STATUS_SUCCESS) 3571 { 3572 Status = vboxVidPnCheckTargetModeSet(pIsSupportedVidPnArg->hDesiredVidPn, hNewVidPnTargetModeSet, pVidPnTargetModeSetInterface, &bSupported); 3573 3574 Assert(bSupported); 3575 3576 pVidPnInterface->pfnReleaseTargetModeSet(pIsSupportedVidPnArg->hDesiredVidPn, hNewVidPnTargetModeSet); 3577 3578 if (Status != STATUS_SUCCESS || !bSupported) 3579 break; 3580 } 3581 else if (Status == STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_SOURCE) 3582 { 3583 LOGREL(("Warning: pfnAcquireSourceModeSet returned STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_SOURCE, continuing")); 3584 Status = STATUS_SUCCESS; 3585 } 3586 else 3587 { 3588 LOGREL(("pfnAcquireSourceModeSet failed Status(0x%x)")); 3589 break; 3590 } 3591 } 3592 } 3593 #endif 3594 } 3595 } 3596 else 3597 { 3598 LOGREL(("pfnGetTopology failed Status(0x%x)")); 3599 } 3600 } 3601 else 3602 { 3603 LOGREL(("DxgkCbQueryVidPnInterface failed Status(0x%x)")); 3604 } 3605 #endif /* if 0 */ 3519 vboxVidPnDumpVidPn("\n>>>>IS SUPPORTED VidPN : >>>>", pContext, pIsSupportedVidPnArg->hDesiredVidPn, pVidPnInterface, "<<<<<<<<<<<<<<<<<<<<"); 3520 #endif 3521 3522 D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology; 3523 const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface; 3524 Status = pVidPnInterface->pfnGetTopology(pIsSupportedVidPnArg->hDesiredVidPn, &hVidPnTopology, &pVidPnTopologyInterface); 3525 if (!NT_SUCCESS(Status)) 3526 { 3527 WARN(("pfnGetTopology failed Status()0x%x\n", Status)); 3528 return Status; 3529 } 3530 3531 VBOXVIDPNPATHITEM aItems[VBOX_VIDEO_MAX_SCREENS]; 3532 BOOLEAN fDisabledFound = FALSE; 3533 Status = vboxVidPnCheckTopology(hVidPnTopology, pVidPnTopologyInterface, TRUE /* fBreakOnDisabled */, RT_ELEMENTS(aItems), aItems, &fDisabledFound); 3534 Assert(Status == STATUS_SUCCESS); 3535 if (!NT_SUCCESS(Status)) 3536 { 3537 WARN(("vboxVidPnCheckTopology failed Status()0x%x\n", Status)); 3538 return Status; 3539 } 3540 3541 if (fDisabledFound) 3542 { 3543 WARN(("found unsupported path")); 3544 bSupported = FALSE; 3545 } 3606 3546 3607 3547 pIsSupportedVidPnArg->IsVidPnSupported = bSupported; … … 3634 3574 PVBOXWDDM_RECOMMENDVIDPN pVidPnInfo = pRecommendFunctionalVidPnArg->PrivateDriverDataSize >= sizeof (VBOXWDDM_RECOMMENDVIDPN) ? 3635 3575 (PVBOXWDDM_RECOMMENDVIDPN)pRecommendFunctionalVidPnArg->pPrivateDriverData : NULL; 3636 PVBOXWDDM_VIDEOMODES_INFO pInfos = VBoxWddmUpdateVideoModesInfo(pDevExt, pVidPnInfo);3576 PVBOXWDDM_VIDEOMODES_INFO pInfos = VBoxWddmUpdateVideoModesInfo(pDevExt, NULL /*pVidPnInfo*/); 3637 3577 const DXGK_VIDPN_INTERFACE* pVidPnInterface = NULL; 3638 3578 Status = pDevExt->u.primary.DxgkInterface.DxgkCbQueryVidPnInterface(pRecommendFunctionalVidPnArg->hRecommendedFunctionalVidPn, DXGK_VIDPN_INTERFACE_VERSION_V1, &pVidPnInterface); … … 3742 3682 const DXGK_VIDPN_INTERFACE* pVidPnInterface = NULL; 3743 3683 NTSTATUS Status = pDevExt->u.primary.DxgkInterface.DxgkCbQueryVidPnInterface(pEnumCofuncModalityArg->hConstrainingVidPn, DXGK_VIDPN_INTERFACE_VERSION_V1, &pVidPnInterface); 3744 if (Status == STATUS_SUCCESS) 3745 { 3684 if (!NT_SUCCESS(Status)) 3685 { 3686 WARN(("DxgkCbQueryVidPnInterface failed Status()0x%x\n", Status)); 3687 return Status; 3688 } 3746 3689 #ifdef VBOXWDDM_DEBUG_VIDPN 3747 vboxVidPnDumpCofuncModalityArg(">>>>MODALITY Args: ", pEnumCofuncModalityArg, "\n"); 3748 vboxVidPnDumpVidPn(">>>>MODALITY VidPN (IN) : >>>>\n", pDevExt, pEnumCofuncModalityArg->hConstrainingVidPn, pVidPnInterface, "<<<<<<<<<<<<<<<<<<<<\n"); 3749 #endif 3750 3751 D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology; 3752 const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface; 3753 NTSTATUS Status = pVidPnInterface->pfnGetTopology(pEnumCofuncModalityArg->hConstrainingVidPn, &hVidPnTopology, &pVidPnTopologyInterface); 3754 Assert(Status == STATUS_SUCCESS); 3755 if (Status == STATUS_SUCCESS) 3756 { 3757 BOOLEAN bSupported = FALSE; 3758 Status = vboxVidPnCheckTopology(pDevExt, pEnumCofuncModalityArg->hConstrainingVidPn, hVidPnTopology, pVidPnTopologyInterface, &bSupported); 3759 Assert(Status == STATUS_SUCCESS); 3760 Assert(bSupported); 3761 3762 VBOXVIDPNCOFUNCMODALITY CbContext = {0}; 3763 CbContext.pDevExt = pDevExt; 3764 CbContext.pVidPnInterface = pVidPnInterface; 3765 CbContext.pEnumCofuncModalityArg = pEnumCofuncModalityArg; 3766 CbContext.pInfos = VBoxWddmGetAllVideoModesInfos(pDevExt); 3767 3768 #if 0 3769 for (int i = 0; i < VBoxCommonFromDeviceExt(pDevExt)->cDisplays; ++i) 3770 { 3771 vboxVidPnCofuncModalityForPath(&CbContext, i, i, TRUE); 3772 } 3773 #else 3774 Status = vboxVidPnEnumPaths(hVidPnTopology, pVidPnTopologyInterface, 3690 vboxVidPnDumpCofuncModalityArg(">>>>MODALITY Args: ", pEnumCofuncModalityArg, "\n"); 3691 vboxVidPnDumpVidPn(">>>>MODALITY VidPN (IN) : >>>>\n", pDevExt, pEnumCofuncModalityArg->hConstrainingVidPn, pVidPnInterface, "<<<<<<<<<<<<<<<<<<<<\n"); 3692 #endif 3693 3694 D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology; 3695 const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface; 3696 Status = pVidPnInterface->pfnGetTopology(pEnumCofuncModalityArg->hConstrainingVidPn, &hVidPnTopology, &pVidPnTopologyInterface); 3697 Assert(Status == STATUS_SUCCESS); 3698 if (!NT_SUCCESS(Status)) 3699 { 3700 WARN(("pfnGetTopology failed Status()0x%x\n", Status)); 3701 return Status; 3702 } 3703 3704 VBOXVIDPNPATHITEM aItems[VBOX_VIDEO_MAX_SCREENS]; 3705 Status = vboxVidPnCheckTopology(hVidPnTopology, pVidPnTopologyInterface, FALSE /* fBreakOnDisabled */, RT_ELEMENTS(aItems), aItems, NULL /* *pfDisabledFound */); 3706 Assert(Status == STATUS_SUCCESS); 3707 if (!NT_SUCCESS(Status)) 3708 { 3709 WARN(("vboxVidPnCheckTopology failed Status()0x%x\n", Status)); 3710 return Status; 3711 } 3712 3713 VBOXVIDPNCOFUNCMODALITY CbContext = {0}; 3714 CbContext.pDevExt = pDevExt; 3715 CbContext.pVidPnInterface = pVidPnInterface; 3716 CbContext.pEnumCofuncModalityArg = pEnumCofuncModalityArg; 3717 CbContext.pInfos = VBoxWddmGetAllVideoModesInfos(pDevExt); 3718 CbContext.cPathInfos = RT_ELEMENTS(aItems); 3719 CbContext.apPathInfos = aItems; 3720 3721 Status = vboxVidPnEnumPaths(hVidPnTopology, pVidPnTopologyInterface, 3775 3722 vboxVidPnCofuncModalityPathEnum, &CbContext); 3776 Assert(Status == STATUS_SUCCESS); 3777 if (Status == STATUS_SUCCESS) 3778 { 3779 Status = CbContext.Status; 3780 Assert(Status == STATUS_SUCCESS); 3781 if (Status != STATUS_SUCCESS) 3782 LOGREL(("vboxVidPnAdjustSourcesTargetsCallback failed Status(0x%x)", Status)); 3783 } 3784 else 3785 LOGREL(("vboxVidPnEnumPaths failed Status(0x%x)", Status)); 3786 #endif 3787 } 3788 else 3789 LOGREL(("pfnGetTopology failed Status(0x%x)", Status)); 3723 Assert(Status == STATUS_SUCCESS); 3724 if (!NT_SUCCESS(Status)) 3725 { 3726 WARN(("vboxVidPnEnumPaths failed Status()0x%x\n", Status)); 3727 return Status; 3728 } 3729 3730 Status = CbContext.Status; 3731 if (!NT_SUCCESS(Status)) 3732 { 3733 WARN(("vboxVidPnCofuncModalityPathEnum failed Status()0x%x\n", Status)); 3734 return Status; 3735 } 3790 3736 3791 3737 #ifdef VBOXWDDM_DEBUG_VIDPN 3792 3738 vboxVidPnDumpVidPn("\n>>>>MODALITY VidPN (OUT) : >>>>\n", pDevExt, pEnumCofuncModalityArg->hConstrainingVidPn, pVidPnInterface, "<<<<<<<<<<<<<<<<<<<<\n\n"); 3793 3739 #endif 3794 }3795 else3796 LOGREL(("DxgkCbQueryVidPnInterface failed Status(0x%x)", Status));3797 3740 3798 3741 LOGF(("LEAVE, status(0x%x), context(0x%x)", Status, hAdapter));
Note:
See TracChangeset
for help on using the changeset viewer.