Changeset 30169 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Miniport
- Timestamp:
- Jun 11, 2010 6:24:42 PM (15 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Miniport
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.cpp
r29883 r30169 942 942 if (DeviceExtension->CurrentMode == 0) 943 943 #else 944 if (!DeviceExtension-> cSources || !DeviceExtension->aSources[0].pPrimaryAllocation)944 if (!DeviceExtension->u.primary.cDisplays || !DeviceExtension->aSources[0].pPrimaryAllocation) 945 945 #endif 946 946 { … … 982 982 } 983 983 #else 984 if (DeviceExtension-> cSources && DeviceExtension->aSources[0].pPrimaryAllocation)984 if (DeviceExtension->u.primary.cDisplays && DeviceExtension->aSources[0].pPrimaryAllocation) 985 985 { 986 986 if (!xres) … … 1041 1041 if (DeviceExtension->CurrentMode != 0) 1042 1042 #else 1043 if (DeviceExtension-> cSources && DeviceExtension->aSources[0].pPrimaryAllocation)1043 if (DeviceExtension->u.primary.cDisplays && DeviceExtension->aSources[0].pPrimaryAllocation) 1044 1044 #endif 1045 1045 #ifndef VBOX_WITH_MULTIMONITOR_FIX … … 1147 1147 if (DeviceExtension->CurrentMode == 0) 1148 1148 #else 1149 if (!DeviceExtension-> cSources || !DeviceExtension->aSources[0].pPrimaryAllocation)1149 if (!DeviceExtension->u.primary.cDisplays || !DeviceExtension->aSources[0].pPrimaryAllocation) 1150 1150 #endif 1151 1151 { -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.h
r29922 r30169 178 178 } VBOXWDDM_SOURCE, *PVBOXWDDM_SOURCE; 179 179 180 typedef struct VBOXWDDM_TARGET 181 { 182 uint32_t ScanLineState; 183 uint32_t HeightVisible; 184 uint32_t HeightTotal; 185 } VBOXWDDM_TARGET, *PVBOXWDDM_TARGET; 186 180 187 #endif 181 188 … … 211 218 212 219 BOOLEAN bVBoxVideoSupported; /* TRUE if VBoxVideo extensions, including DualView, are supported by the host. */ 213 #ifndef VBOXWDDM 220 214 221 int cDisplays; /* Number of displays. */ 215 #endif 222 216 223 ULONG cbVRAM; /* The VRAM size. */ 217 224 … … 268 275 VBOXVIDEOPORTPROCS VideoPortProcs; 269 276 # else 277 /* committed VidPn handle */ 278 D3DKMDT_HVIDPN hCommittedVidPn; 270 279 /* Display Port handle and callbacks */ 271 280 DXGKRNL_INTERFACE DxgkInterface; … … 295 304 BOOL bNotifyDxDpc; 296 305 297 ULONG cSources;298 /* currently we define the array for the max possible size since we do not know299 * the monitor count at the DxgkDdiAddDevice,300 * i.e. we obtain the monitor count in DxgkDdiStartDevice due to implementation of the currently re-used XPDM functionality301 *302 * @todo: use the dynamic array size calculated at DxgkDdiAddDevice303 * */304 306 VBOXWDDM_SOURCE aSources[VBOX_VIDEO_MAX_SCREENS]; 307 VBOXWDDM_TARGET aTargets[VBOX_VIDEO_MAX_SCREENS]; 305 308 #endif 306 309 } DEVICE_EXTENSION, *PDEVICE_EXTENSION; -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideoHGSMI.cpp
r29883 r30169 923 923 #else 924 924 /* simply store the number of monitors, we will deal with VidPN stuff later */ 925 PrimaryExtension-> cSources = cDisplays;925 PrimaryExtension->u.primary.cDisplays = cDisplays; 926 926 #endif 927 927 } … … 984 984 ulAvailable = offset; 985 985 ulSize = ulAvailable / 2; 986 ulSize /= PrimaryExtension-> cSources;986 ulSize /= PrimaryExtension->u.primary.cDisplays; 987 987 Assert(ulSize > VBVA_MIN_BUFFER_SIZE); 988 988 if (ulSize > VBVA_MIN_BUFFER_SIZE) … … 1003 1003 Assert(ulSize); 1004 1004 1005 Assert(ulSize * PrimaryExtension-> cSources < ulAvailable);1006 1007 for (int i = PrimaryExtension-> cSources-1; i >= 0; --i)1005 Assert(ulSize * PrimaryExtension->u.primary.cDisplays < ulAvailable); 1006 1007 for (int i = PrimaryExtension->u.primary.cDisplays-1; i >= 0; --i) 1008 1008 { 1009 1009 offset -= ulSize; … … 1049 1049 { 1050 1050 int rc = VINF_SUCCESS; 1051 for (int i = PrimaryExtension-> cSources-1; i >= 0; --i)1051 for (int i = PrimaryExtension->u.primary.cDisplays-1; i >= 0; --i) 1052 1052 { 1053 1053 rc = vboxVbvaDisable(PrimaryExtension, &PrimaryExtension->aSources[i].Vbva); … … 1300 1300 uint32_t cDisplays = (uint32_t)PrimaryExtension->u.primary.cDisplays; 1301 1301 #else 1302 uint32_t cDisplays = (uint32_t)PrimaryExtension-> cSources;1302 uint32_t cDisplays = (uint32_t)PrimaryExtension->u.primary.cDisplays; 1303 1303 #endif 1304 1304 const size_t size = RT_OFFSETOF(VBVA_CHANNELCONTEXTS, aContexts[cDisplays]); -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVhwa.cpp
r29966 r30169 335 335 static void vboxVHWAInitSrc(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId) 336 336 { 337 Assert(srcId < pDevExt-> cSources);337 Assert(srcId < pDevExt->u.primary.cDisplays); 338 338 VBOXVHWA_INFO *pSettings = &pDevExt->aSources[srcId].Vhwa.Settings; 339 339 memset (pSettings, 0, sizeof (VBOXVHWA_INFO)); … … 398 398 void vboxVHWAInit(PDEVICE_EXTENSION pDevExt) 399 399 { 400 for ( uint32_t i = 0; i < pDevExt->cSources; ++i)401 { 402 vboxVHWAInitSrc(pDevExt, i);400 for (int i = 0; i < pDevExt->u.primary.cDisplays; ++i) 401 { 402 vboxVHWAInitSrc(pDevExt, (D3DDDI_VIDEO_PRESENT_SOURCE_ID)i); 403 403 } 404 404 } … … 408 408 /* we do not allocate/map anything, just issue a Disable command 409 409 * to ensure all pending commands are flushed */ 410 for (uint32_t i = 0; i < pDevExt-> cSources; ++i)410 for (uint32_t i = 0; i < pDevExt->u.primary.cDisplays; ++i) 411 411 { 412 412 vboxVHWADisable(pDevExt, i); … … 660 660 int vboxVhwaHlpGetSurfInfo(PDEVICE_EXTENSION pDevExt, PVBOXWDDM_ALLOCATION pSurf) 661 661 { 662 for (uint32_t i = 0; i < pDevExt-> cSources; ++i)662 for (uint32_t i = 0; i < pDevExt->u.primary.cDisplays; ++i) 663 663 { 664 664 PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[i]; … … 708 708 int vboxVhwaHlpCheckInit(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId) 709 709 { 710 Assert(VidPnSourceId < pDevExt-> cSources);711 if (VidPnSourceId >= pDevExt-> cSources)710 Assert(VidPnSourceId < pDevExt->u.primary.cDisplays); 711 if (VidPnSourceId >= pDevExt->u.primary.cDisplays) 712 712 return VERR_INVALID_PARAMETER; 713 713 … … 748 748 int vboxVhwaHlpCheckTerm(PDEVICE_EXTENSION pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId) 749 749 { 750 Assert(VidPnSourceId < pDevExt-> cSources);751 if (VidPnSourceId >= pDevExt-> cSources)750 Assert(VidPnSourceId < pDevExt->u.primary.cDisplays); 751 if (VidPnSourceId >= pDevExt->u.primary.cDisplays) 752 752 return VERR_INVALID_PARAMETER; 753 753 -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVidPn.cpp
r28800 r30169 1466 1466 } 1467 1467 1468 NTSTATUS vboxVidPnEnumTargetsForSource(PDEVICE_EXTENSION pDevExt, D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface, 1469 CONST D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId, 1470 PFNVBOXVIDPNENUMTARGETSFORSOURCE pfnCallback, PVOID pContext) 1471 { 1472 SIZE_T cTgtPaths; 1473 NTSTATUS Status = pVidPnTopologyInterface->pfnGetNumPathsFromSource(hVidPnTopology, VidPnSourceId, &cTgtPaths); 1474 Assert(Status == STATUS_SUCCESS); 1475 if (Status == STATUS_SUCCESS) 1476 { 1477 for (SIZE_T i = 0; i < cTgtPaths; ++i) 1478 { 1479 D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId; 1480 Status = pVidPnTopologyInterface->pfnEnumPathTargetsFromSource(hVidPnTopology, VidPnSourceId, i, &VidPnTargetId); 1481 Assert(Status == STATUS_SUCCESS); 1482 if (Status == STATUS_SUCCESS) 1483 { 1484 if (!pfnCallback(pDevExt, hVidPnTopology, pVidPnTopologyInterface, VidPnSourceId, VidPnTargetId, cTgtPaths, pContext)) 1485 break; 1486 } 1487 else 1488 { 1489 drprintf((__FUNCTION__": pfnEnumPathTargetsFromSource failed Status(0x%x)\n", Status)); 1490 break; 1491 } 1492 } 1493 } 1494 else 1495 drprintf((__FUNCTION__": pfnGetNumPathsFromSource failed Status(0x%x)\n", Status)); 1496 1497 return Status; 1498 } 1468 1499 1469 1500 NTSTATUS vboxVidPnEnumPaths(PDEVICE_EXTENSION pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, … … 1527 1558 NTSTATUS vboxVidPnCommitSourceMode(struct _DEVICE_EXTENSION* pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId, CONST D3DKMDT_VIDPN_SOURCE_MODE* pVidPnSourceModeInfo, PVBOXWDDM_ALLOCATION pAllocation) 1528 1559 { 1529 Assert(srcId < pDevExt->cSources);1530 if (srcId < pDevExt->cSources)1560 Assert(srcId < (UINT)pDevExt->u.primary.cDisplays); 1561 if (srcId < (UINT)pDevExt->u.primary.cDisplays) 1531 1562 { 1532 1563 PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[srcId]; … … 1534 1565 } 1535 1566 1536 drprintf((__FUNCTION__": invalid srcId (%d), cSources(%d)\n", srcId, pDevExt-> cSources));1567 drprintf((__FUNCTION__": invalid srcId (%d), cSources(%d)\n", srcId, pDevExt->u.primary.cDisplays)); 1537 1568 return STATUS_INVALID_PARAMETER; 1569 } 1570 1571 typedef struct VBOXVIDPNCOMMITTARGETMODE 1572 { 1573 NTSTATUS Status; 1574 D3DKMDT_HVIDPN hVidPn; 1575 const DXGK_VIDPN_INTERFACE* pVidPnInterface; 1576 } VBOXVIDPNCOMMITTARGETMODE; 1577 1578 DECLCALLBACK(BOOLEAN) vboxVidPnCommitTargetModeEnum(PDEVICE_EXTENSION pDevExt, D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface, 1579 CONST D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId, D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId, SIZE_T cTgtPaths, PVOID pContext) 1580 { 1581 VBOXVIDPNCOMMITTARGETMODE *pInfo = (VBOXVIDPNCOMMITTARGETMODE*)pContext; 1582 Assert(cTgtPaths <= (SIZE_T)pDevExt->u.primary.cDisplays); 1583 D3DKMDT_HVIDPNTARGETMODESET hVidPnTargetModeSet; 1584 CONST DXGK_VIDPNTARGETMODESET_INTERFACE* pVidPnTargetModeSetInterface; 1585 NTSTATUS Status = pInfo->pVidPnInterface->pfnAcquireTargetModeSet(pInfo->hVidPn, VidPnTargetId, &hVidPnTargetModeSet, &pVidPnTargetModeSetInterface); 1586 Assert(Status == STATUS_SUCCESS); 1587 if (Status == STATUS_SUCCESS) 1588 { 1589 CONST D3DKMDT_VIDPN_TARGET_MODE* pPinnedVidPnTargetModeInfo; 1590 Status = pVidPnTargetModeSetInterface->pfnAcquirePinnedModeInfo(hVidPnTargetModeSet, &pPinnedVidPnTargetModeInfo); 1591 Assert(Status == STATUS_SUCCESS); 1592 if (Status == STATUS_SUCCESS) 1593 { 1594 VBOXWDDM_TARGET *pTarget = &pDevExt->aTargets[VidPnTargetId]; 1595 if (pTarget->HeightVisible != pPinnedVidPnTargetModeInfo->VideoSignalInfo.ActiveSize.cy 1596 || pTarget->HeightTotal != pPinnedVidPnTargetModeInfo->VideoSignalInfo.TotalSize.cy) 1597 { 1598 pTarget->HeightVisible = pPinnedVidPnTargetModeInfo->VideoSignalInfo.ActiveSize.cy; 1599 pTarget->HeightTotal = pPinnedVidPnTargetModeInfo->VideoSignalInfo.TotalSize.cy; 1600 pTarget->ScanLineState = 0; 1601 } 1602 pVidPnTargetModeSetInterface->pfnReleaseModeInfo(hVidPnTargetModeSet, pPinnedVidPnTargetModeInfo); 1603 } 1604 1605 pInfo->pVidPnInterface->pfnReleaseTargetModeSet(pInfo->hVidPn, hVidPnTargetModeSet); 1606 } 1607 else 1608 drprintf((__FUNCTION__": pfnAcquireTargetModeSet failed Status(0x%x)\n", Status)); 1609 1610 pInfo->Status = Status; 1611 return Status == STATUS_SUCCESS; 1538 1612 } 1539 1613 … … 1558 1632 Status = vboxVidPnCommitSourceMode(pDevExt, srcId, pPinnedVidPnSourceModeInfo, pAllocation); 1559 1633 Assert(Status == STATUS_SUCCESS); 1560 if (Status != STATUS_SUCCESS) 1634 if (Status == STATUS_SUCCESS) 1635 { 1636 D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology; 1637 CONST DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface; 1638 Status = pVidPnInterface->pfnGetTopology(hDesiredVidPn, &hVidPnTopology, &pVidPnTopologyInterface); 1639 Assert(Status == STATUS_SUCCESS); 1640 if (Status == STATUS_SUCCESS) 1641 { 1642 VBOXVIDPNCOMMITTARGETMODE TgtModeInfo = {0}; 1643 TgtModeInfo.Status = STATUS_SUCCESS; /* <- to ensure we're succeeded if no targets are set */ 1644 TgtModeInfo.hVidPn = hDesiredVidPn; 1645 TgtModeInfo.pVidPnInterface = pVidPnInterface; 1646 Status = vboxVidPnEnumTargetsForSource(pDevExt, hVidPnTopology, pVidPnTopologyInterface, 1647 srcId, 1648 vboxVidPnCommitTargetModeEnum, &TgtModeInfo); 1649 Assert(Status == STATUS_SUCCESS); 1650 if (Status == STATUS_SUCCESS) 1651 { 1652 Status = TgtModeInfo.Status; 1653 Assert(Status == STATUS_SUCCESS); 1654 } 1655 else 1656 drprintf((__FUNCTION__": vboxVidPnEnumTargetsForSource failed Status(0x%x)\n", Status)); 1657 } 1658 else 1659 drprintf((__FUNCTION__": pfnGetTopology failed Status(0x%x)\n", Status)); 1660 } 1661 else 1561 1662 drprintf((__FUNCTION__": vboxVidPnCommitSourceMode failed Status(0x%x)\n", Status)); 1562 1663 /* release */ -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVidPn.h
r28800 r30169 79 79 typedef FNVBOXVIDPNENUMMONITORSOURCEMODES *PFNVBOXVIDPNENUMMONITORSOURCEMODES; 80 80 81 typedef DECLCALLBACK(BOOLEAN) FNVBOXVIDPNENUMTARGETSFORSOURCE(PDEVICE_EXTENSION pDevExt, D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface, 82 CONST D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId, D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId, SIZE_T cTgtPaths, PVOID pContext); 83 typedef FNVBOXVIDPNENUMTARGETSFORSOURCE *PFNVBOXVIDPNENUMTARGETSFORSOURCE; 81 84 82 85 DECLCALLBACK(BOOLEAN) vboxVidPnCofuncModalityPathEnum(struct _DEVICE_EXTENSION* pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, … … 113 116 PFNVBOXVIDPNENUMMONITORSOURCEMODES pfnCallback, PVOID pContext); 114 117 118 NTSTATUS vboxVidPnEnumTargetsForSource(PDEVICE_EXTENSION pDevExt, D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface, 119 CONST D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId, 120 PFNVBOXVIDPNENUMTARGETSFORSOURCE pfnCallback, PVOID pContext); 121 115 122 NTSTATUS vboxVidPnPopulateMonitorSourceModeInfoFromLegacy(struct _DEVICE_EXTENSION* pDevExt, 116 123 D3DKMDT_MONITOR_SOURCE_MODE *pMonitorSourceMode, -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp
r30057 r30169 139 139 pView->u32ViewIndex = pAllocation->SurfDesc.VidPnSourceId; 140 140 pView->u32ViewOffset = (uint32_t)offVram; /* we pretend the view is located at the start of each framebuffer */ 141 pView->u32ViewSize = vboxWddmVramCpuVisibleSegmentSize(pDevExt)/pDevExt-> cSources;141 pView->u32ViewSize = vboxWddmVramCpuVisibleSegmentSize(pDevExt)/pDevExt->u.primary.cDisplays; 142 142 143 143 pView->u32MaxScreenSize = pView->u32ViewSize; … … 645 645 { 646 646 drprintf(("VBoxVideoWddm: using HGSMI\n")); 647 *NumberOfVideoPresentSources = pContext-> cSources;648 *NumberOfChildren = pContext-> cSources;647 *NumberOfVideoPresentSources = pContext->u.primary.cDisplays; 648 *NumberOfChildren = pContext->u.primary.cDisplays; 649 649 dprintf(("VBoxVideoWddm: sources(%d), children(%d)\n", *NumberOfVideoPresentSources, *NumberOfChildren)); 650 650 #ifdef VBOX_WITH_VIDEOHWACCEL … … 1041 1041 1042 1042 dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", MiniportDeviceContext)); 1043 Assert(ChildRelationsSize == (pDevExt-> cSources + 1)*sizeof(DXGK_CHILD_DESCRIPTOR));1044 for (UINT i = 0; i < pDevExt-> cSources; ++i)1043 Assert(ChildRelationsSize == (pDevExt->u.primary.cDisplays + 1)*sizeof(DXGK_CHILD_DESCRIPTOR)); 1044 for (UINT i = 0; i < pDevExt->u.primary.cDisplays; ++i) 1045 1045 { 1046 1046 ChildRelations[i].ChildDeviceType = TypeVideoOutput; … … 1232 1232 pCaps->MaxOverlays = 0; 1233 1233 #ifdef VBOX_WITH_VIDEOHWACCEL 1234 for (uint32_t i = 0; i < pContext-> cSources; ++i)1234 for (uint32_t i = 0; i < pContext->u.primary.cDisplays; ++i) 1235 1235 { 1236 1236 if ( pContext->aSources[i].Vhwa.Settings.fFlags & VBOXVHWA_F_ENABLED) … … 1321 1321 memset (pQi, 0, sizeof (VBOXWDDM_QI)); 1322 1322 pQi->u32Version = VBOXVIDEOIF_VERSION; 1323 pQi->cInfos = pContext-> cSources;1323 pQi->cInfos = pContext->u.primary.cDisplays; 1324 1324 #ifdef VBOX_WITH_VIDEOHWACCEL 1325 for (uint32_t i = 0; i < pContext-> cSources; ++i)1325 for (uint32_t i = 0; i < pContext->u.primary.cDisplays; ++i) 1326 1326 { 1327 1327 pQi->aInfos[i] = pContext->aSources[i].Vhwa.Settings; … … 1597 1597 { 1598 1598 PVBOXWDDM_RCINFO pRcInfo = (PVBOXWDDM_RCINFO)pCreateAllocation->pPrivateDriverData; 1599 // Assert(pRcInfo->RcDesc.VidPnSourceId < pDevExt-> cSources);1599 // Assert(pRcInfo->RcDesc.VidPnSourceId < pDevExt->u.primary.cDisplays); 1600 1600 Assert(pRcInfo->cAllocInfos == pCreateAllocation->NumAllocations); 1601 1601 pResource = (PVBOXWDDM_RESOURCE)vboxWddmMemAllocZero(RT_OFFSETOF(VBOXWDDM_RESOURCE, aAllocations[pRcInfo->cAllocInfos])); … … 2644 2644 if (Status == STATUS_SUCCESS && bSupported) 2645 2645 { 2646 for (UINT id = 0; id < pContext-> cSources; ++id)2646 for (UINT id = 0; id < pContext->u.primary.cDisplays; ++id) 2647 2647 { 2648 2648 D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet; … … 2675 2675 if (Status == STATUS_SUCCESS && bSupported) 2676 2676 { 2677 for (UINT id = 0; id < pContext-> cSources; ++id)2677 for (UINT id = 0; id < pContext->u.primary.cDisplays; ++id) 2678 2678 { 2679 2679 D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet; … … 2785 2785 if (Status == STATUS_SUCCESS) 2786 2786 { 2787 for (uint32_t i = 0; i < pDevExt-> cSources; ++i)2787 for (uint32_t i = 0; i < pDevExt->u.primary.cDisplays; ++i) 2788 2788 { 2789 2789 Status = vboxVidPnCheckAddMonitorModes(pDevExt, i, D3DKMDT_MCO_DRIVER, &Resolution, 1, 0); … … 2902 2902 NTSTATUS Status = STATUS_SUCCESS; 2903 2903 PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)hAdapter; 2904 Assert(pDevExt-> cSources > pSetVidPnSourceAddress->VidPnSourceId);2905 if (pDevExt-> cSources > pSetVidPnSourceAddress->VidPnSourceId)2904 Assert(pDevExt->u.primary.cDisplays > pSetVidPnSourceAddress->VidPnSourceId); 2905 if (pDevExt->u.primary.cDisplays > pSetVidPnSourceAddress->VidPnSourceId) 2906 2906 { 2907 2907 PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[pSetVidPnSourceAddress->VidPnSourceId]; … … 2945 2945 else 2946 2946 { 2947 drprintf((__FUNCTION__": invalid VidPnSourceId (%d), should be smaller than (%d)\n", pSetVidPnSourceAddress->VidPnSourceId, pDevExt-> cSources));2947 drprintf((__FUNCTION__": invalid VidPnSourceId (%d), should be smaller than (%d)\n", pSetVidPnSourceAddress->VidPnSourceId, pDevExt->u.primary.cDisplays)); 2948 2948 Status = STATUS_INVALID_PARAMETER; 2949 2949 } … … 2970 2970 NTSTATUS Status = STATUS_SUCCESS; 2971 2971 PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)hAdapter; 2972 Assert(pDevExt-> cSources > pSetVidPnSourceVisibility->VidPnSourceId);2973 if (pDevExt-> cSources > pSetVidPnSourceVisibility->VidPnSourceId)2972 Assert(pDevExt->u.primary.cDisplays > pSetVidPnSourceVisibility->VidPnSourceId); 2973 if (pDevExt->u.primary.cDisplays > pSetVidPnSourceVisibility->VidPnSourceId) 2974 2974 { 2975 2975 PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[pSetVidPnSourceVisibility->VidPnSourceId]; … … 2997 2997 else 2998 2998 { 2999 drprintf((__FUNCTION__": invalid VidPnSourceId (%d), should be smaller than (%d)\n", pSetVidPnSourceVisibility->VidPnSourceId, pDevExt-> cSources));2999 drprintf((__FUNCTION__": invalid VidPnSourceId (%d), should be smaller than (%d)\n", pSetVidPnSourceVisibility->VidPnSourceId, pDevExt->u.primary.cDisplays)); 3000 3000 Status = STATUS_INVALID_PARAMETER; 3001 3001 } … … 3036 3036 { 3037 3037 /* clear all current primaries */ 3038 for (UINT i = 0; i < pDevExt-> cSources; ++i)3038 for (UINT i = 0; i < pDevExt->u.primary.cDisplays; ++i) 3039 3039 { 3040 3040 vboxWddmAssignPrimary(pDevExt, &pDevExt->aSources[i], NULL, i); … … 3066 3066 drprintf((__FUNCTION__ ": pfnGetTopology failed Status(0x%x)\n", Status)); 3067 3067 } 3068 3069 if (Status == STATUS_SUCCESS) 3070 { 3071 pDevExt->u.primary.hCommittedVidPn = pCommitVidPnArg->hFunctionalVidPn; 3072 } 3068 3073 } 3069 3074 else … … 3176 3181 dfprintf(("==> "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter)); 3177 3182 3178 AssertBreakpoint(); 3179 3180 pGetScanLine->InVerticalBlank = FALSE; 3181 pGetScanLine->ScanLine = 0; 3183 PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)hAdapter; 3184 3185 Assert(pDevExt->u.primary.cDisplays > pGetScanLine->VidPnTargetId); 3186 VBOXWDDM_TARGET *pTarget = &pDevExt->aTargets[pGetScanLine->VidPnTargetId]; 3187 Assert(pTarget->HeightTotal); 3188 Assert(pTarget->HeightVisible); 3189 Assert(pTarget->HeightTotal > pTarget->HeightVisible); 3190 Assert(pTarget->ScanLineState < pTarget->HeightTotal); 3191 if (pTarget->HeightTotal) 3192 { 3193 uint32_t curScanLine = pTarget->ScanLineState; 3194 BOOLEAN bVBlanck; 3195 ++pTarget->ScanLineState; 3196 if (pTarget->ScanLineState >= pTarget->HeightTotal) 3197 pTarget->ScanLineState = 0; 3198 3199 3200 BOOL bVBlank = (!curScanLine || curScanLine > pTarget->HeightVisible); 3201 pGetScanLine->ScanLine = curScanLine; 3202 pGetScanLine->InVerticalBlank = bVBlank; 3203 } 3204 else 3205 { 3206 pGetScanLine->InVerticalBlank = TRUE; 3207 pGetScanLine->ScanLine = 0; 3208 } 3182 3209 3183 3210 dfprintf(("<== "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter)); … … 3431 3458 3432 3459 D3DDDI_VIDEO_PRESENT_SOURCE_ID id = pAllocation->SurfDesc.VidPnSourceId; 3433 if (id >= pDevExt-> cSources)3460 if (id >= pDevExt->u.primary.cDisplays) 3434 3461 return false; 3435 3462
Note:
See TracChangeset
for help on using the changeset viewer.