Changeset 27201 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Mar 9, 2010 10:16:07 AM (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/Helper.cpp
r27164 r27201 52 52 #include "Helper.h" 53 53 54 #ifdef DEBUG_misha 55 bool g_bVBoxVDbgBreakF = true; 56 bool g_bVBoxVDbgBreakFv = false; 57 #endif 58 54 59 /** 55 60 * Globals -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/Helper.h
r27164 r27201 81 81 #endif 82 82 83 #ifdef DEBUG_misha 84 /* specifies whether the vboxVDbgBreakF should break in the debugger 85 * windbg seems to have some issues when there is a lot ( >~50) of sw breakpoints defined 86 * to simplify things we just insert breaks for the case of intensive debugging WDDM driver*/ 87 extern bool g_bVBoxVDbgBreakF; 88 extern bool g_bVBoxVDbgBreakFv; 89 #define vboxVDbgBreakF() do { if (g_bVBoxVDbgBreakF) AssertBreakpoint(); } while (0) 90 #define vboxVDbgBreakFv() do { if (g_bVBoxVDbgBreakF) AssertBreakpoint(); } while (0) 91 #else 92 #define vboxVDbgBreakF() do { } while (0) 93 #define vboxVDbgBreakFv() do { } while (0) 94 #endif 83 95 84 96 #endif // __HELPER_h__ -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.cpp
r27165 r27201 346 346 ULONG vramSize = DeviceExtension->pPrimary->u.primary.ulMaxFrameBufferSize; 347 347 #else 348 ULONG vramSize = vboxWddmVramReportedS ize(DeviceExtension);348 ULONG vramSize = vboxWddmVramReportedSegmentSize(DeviceExtension); 349 349 350 350 gPreferredVideoMode = 0; -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.h
r26794 r27201 581 581 } 582 582 583 DECLINLINE(ULONG) vboxWddmVramReportedSegmentSize(PDEVICE_EXTENSION pDevExt) 584 { 585 ULONG size = vboxWddmVramReportedSize(pDevExt); 586 size /= 2; 587 size &= ~0xfffUL; 588 return size; 589 } 590 583 591 DECLINLINE(VOID) vboxWddmAssignPrimary(PDEVICE_EXTENSION pDevExt, PVBOXWDDM_SOURCE pSource, PVBOXWDDM_ALLOCATION pAllocation, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId) 584 592 { -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVidPn.cpp
r26794 r27201 496 496 } 497 497 498 NTSTATUS vboxVidPnPopulateVideoSignalInfo(PDEVICE_EXTENSION pDevExt, 499 D3DKMDT_VIDEO_SIGNAL_INFO *pVsi, 500 D3DKMDT_2DREGION *pResolution, 501 ULONG VSync) 502 { 503 NTSTATUS Status = STATUS_SUCCESS; 504 505 pVsi->VideoStandard = D3DKMDT_VSS_VESA_DMT; 506 pVsi->ActiveSize = *pResolution; 507 pVsi->VSyncFreq.Numerator = VSync * 1000; 508 pVsi->VSyncFreq.Denominator = 1000; 509 pVsi->TotalSize.cx = pVsi->ActiveSize.cx + VBOXVDPN_C_DISPLAY_HBLANK_SIZE; 510 pVsi->TotalSize.cy = pVsi->ActiveSize.cy + VBOXVDPN_C_DISPLAY_VBLANK_SIZE; 511 pVsi->PixelRate = pVsi->TotalSize.cx * pVsi->TotalSize.cy * VSync; 512 pVsi->HSyncFreq.Numerator = (UINT)((pVsi->PixelRate / pVsi->TotalSize.cy) * 1000); 513 pVsi->HSyncFreq.Denominator = 1000; 514 pVsi->ScanLineOrdering = D3DDDI_VSSLO_PROGRESSIVE; 515 516 return Status; 517 } 518 519 NTSTATUS vboxVidPnPopulateMonitorSourceModeInfoFromLegacy(PDEVICE_EXTENSION pDevExt, 520 D3DKMDT_MONITOR_SOURCE_MODE *pMonitorSourceMode, 521 D3DKMDT_2DREGION *pResolution, 522 D3DKMDT_MONITOR_CAPABILITIES_ORIGIN enmOrigin, 523 BOOLEAN bPreferred) 524 { 525 NTSTATUS Status = vboxVidPnPopulateVideoSignalInfo(pDevExt, &pMonitorSourceMode->VideoSignalInfo, pResolution, 60 /* ULONG VSync */); 526 Assert(Status == STATUS_SUCCESS); 527 if (Status == STATUS_SUCCESS) 528 { 529 pMonitorSourceMode->ColorBasis = D3DKMDT_CB_SRGB; 530 pMonitorSourceMode->ColorCoeffDynamicRanges.FirstChannel = 8; 531 pMonitorSourceMode->ColorCoeffDynamicRanges.SecondChannel = 8; 532 pMonitorSourceMode->ColorCoeffDynamicRanges.ThirdChannel = 8; 533 pMonitorSourceMode->ColorCoeffDynamicRanges.FourthChannel = 0; 534 pMonitorSourceMode->Origin = enmOrigin; 535 pMonitorSourceMode->Preference = bPreferred ? D3DKMDT_MP_PREFERRED : D3DKMDT_MP_NOTPREFERRED; 536 } 537 538 return Status; 539 } 540 498 541 NTSTATUS vboxVidPnPopulateTargetModeInfoFromLegacy(PDEVICE_EXTENSION pDevExt, 499 542 D3DKMDT_VIDPN_TARGET_MODE *pNewVidPnTargetModeInfo, … … 501 544 BOOLEAN bPreferred) 502 545 { 503 NTSTATUS Status = STATUS_SUCCESS;504 505 pNewVidPnTargetModeInfo->VideoSignalInfo.VideoStandard = D3DKMDT_VSS_VESA_DMT;506 pNewVidPnTargetModeInfo->VideoSignalInfo.TotalSize = *pResolution;507 pNewVidPnTargetModeInfo->VideoSignalInfo.ActiveSize = pNewVidPnTargetModeInfo->VideoSignalInfo.TotalSize;508 pNewVidPnTargetModeInfo->VideoSignalInfo.VSyncFreq.Numerator = 60000;509 pNewVidPnTargetModeInfo->VideoSignalInfo.VSyncFreq.Denominator = 1000;510 pNewVidPnTargetModeInfo->VideoSignalInfo.HSyncFreq.Numerator = pNewVidPnTargetModeInfo->VideoSignalInfo.ActiveSize.cy * 63; /* 63 is (60 * 1.05)*/511 pNewVidPnTargetModeInfo->VideoSignalInfo.HSyncFreq.Denominator = 1;512 pNewVidPnTargetModeInfo->VideoSignalInfo.PixelRate = 165000; /* @todo: ? */513 pNewVidPnTargetModeInfo->VideoSignalInfo.ScanLineOrdering = D3DDDI_VSSLO_PROGRESSIVE;514 546 pNewVidPnTargetModeInfo->Preference = bPreferred ? D3DKMDT_MP_PREFERRED : D3DKMDT_MP_NOTPREFERRED; 515 547 516 return Status;548 return vboxVidPnPopulateVideoSignalInfo(pDevExt, &pNewVidPnTargetModeInfo->VideoSignalInfo, pResolution, 60 /* ULONG VSync */); 517 549 } 518 550 -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVidPn.h
r26794 r27201 16 16 #ifndef ___VBoxVideoVidPn_h___ 17 17 #define ___VBoxVideoVidPn_h___ 18 19 #define VBOXVDPN_C_DISPLAY_HBLANK_SIZE 200 20 #define VBOXVDPN_C_DISPLAY_VBLANK_SIZE 180 18 21 19 22 NTSTATUS vboxVidPnCheckTopology(const D3DKMDT_HVIDPN hDesiredVidPn, … … 104 107 PFNVBOXVIDPNENUMTARGETMODES pfnCallback, PVOID pContext); 105 108 109 NTSTATUS vboxVidPnPopulateMonitorSourceModeInfoFromLegacy(struct _DEVICE_EXTENSION* pDevExt, 110 D3DKMDT_MONITOR_SOURCE_MODE *pMonitorSourceMode, 111 D3DKMDT_2DREGION *pResolution, 112 D3DKMDT_MONITOR_CAPABILITIES_ORIGIN enmOrigin, 113 BOOLEAN bPreferred); 114 106 115 #endif /* #ifndef ___VBoxVideoVidPn_h___ */ -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp
r27055 r27201 141 141 pView->u32ViewIndex = pPrimaryInfo->VidPnSourceId; 142 142 pView->u32ViewOffset = offVram; 143 pView->u32ViewSize = vboxWddmVramReportedS ize(pDevExt)/pDevExt->cSources;143 pView->u32ViewSize = vboxWddmVramReportedSegmentSize(pDevExt)/pDevExt->cSources; 144 144 145 145 pView->u32MaxScreenSize = pView->u32ViewSize; … … 917 917 PAGED_CODE(); 918 918 919 vboxVDbgBreakFv(); 920 919 921 PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)MiniportDeviceContext; 920 922 … … 943 945 /* The DxgkDdiQueryChildStatus should be made pageable. */ 944 946 PAGED_CODE(); 947 948 vboxVDbgBreakFv(); 945 949 946 950 dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", MiniportDeviceContext)); … … 959 963 default: 960 964 drprintf(("VBoxVideoWddm: ERROR: status type: %d\n", ChildStatus->Type)); 965 AssertBreakpoint(); 961 966 Status = STATUS_INVALID_PARAMETER; 962 967 break; … … 976 981 /* The DxgkDdiQueryDeviceDescriptor should be made pageable. */ 977 982 PAGED_CODE(); 983 984 vboxVDbgBreakFv(); 978 985 979 986 dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", MiniportDeviceContext)); … … 998 1005 999 1006 /* @todo: */ 1007 vboxVDbgBreakF(); 1000 1008 1001 1009 dfprintf(("<== "__FUNCTION__ ", context(0x%x)\n", MiniportDeviceContext)); … … 1014 1022 dfprintf(("==> "__FUNCTION__ ", MiniportDeviceContext(0x%x)\n", MiniportDeviceContext)); 1015 1023 1016 AssertBreakpoint();1024 vboxVDbgBreakF(); 1017 1025 1018 1026 dfprintf(("<== "__FUNCTION__ ", MiniportDeviceContext(0x%x)\n", MiniportDeviceContext)); … … 1026 1034 { 1027 1035 /* DxgkDdiResetDevice can be called at any IRQL, so it must be in nonpageable memory. */ 1036 vboxVDbgBreakF(); 1037 1028 1038 dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", MiniportDeviceContext)); 1029 1039 dfprintf(("<== "__FUNCTION__ ", context(0x%x)\n", MiniportDeviceContext)); … … 1050 1060 dfprintf(("==> "__FUNCTION__ ", MiniportDeviceContext(0x%x)\n", MiniportDeviceContext)); 1051 1061 1052 AssertBreakpoint();1062 vboxVDbgBreakF(); 1053 1063 1054 1064 dfprintf(("<== "__FUNCTION__ ", MiniportDeviceContext(0x%x)\n", MiniportDeviceContext)); … … 1065 1075 dfprintf(("==> "__FUNCTION__ "\n")); 1066 1076 1067 AssertBreakpoint();1077 vboxVDbgBreakF(); 1068 1078 1069 1079 dfprintf(("<== "__FUNCTION__ "\n")); … … 1084 1094 PDEVICE_EXTENSION pContext = (PDEVICE_EXTENSION)hAdapter; 1085 1095 1086 AssertBreakpoint();1096 vboxVDbgBreakF(); 1087 1097 1088 1098 switch (pQueryAdapterInfo->Type) … … 1142 1152 else 1143 1153 { 1154 DXGK_SEGMENTDESCRIPTOR* pDr = pQsOut->pSegmentDescriptor; 1144 1155 /* we are requested to provide segment information */ 1145 p QsOut->pSegmentDescriptor->BaseAddress.QuadPart = 0; /* VBE_DISPI_LFB_PHYSICAL_ADDRESS; */1146 p QsOut->pSegmentDescriptor->CpuTranslatedAddress.QuadPart = VBE_DISPI_LFB_PHYSICAL_ADDRESS;1156 pDr->BaseAddress.QuadPart = 0; /* VBE_DISPI_LFB_PHYSICAL_ADDRESS; */ 1157 pDr->CpuTranslatedAddress.QuadPart = VBE_DISPI_LFB_PHYSICAL_ADDRESS; 1147 1158 /* make sure the size is page aligned */ 1148 1159 /* @todo: need to setup VBVA buffers and adjust the mem size here */ 1149 pQsOut->pSegmentDescriptor->Size = vboxWddmVramReportedSize(pContext); 1150 pQsOut->pSegmentDescriptor->NbOfBanks = 0; 1151 pQsOut->pSegmentDescriptor->pBankRangeTable = 0; 1152 pQsOut->pSegmentDescriptor->CommitLimit = pQsOut->pSegmentDescriptor->Size; 1153 pQsOut->pSegmentDescriptor->Flags.Value = 0; 1154 pQsOut->pSegmentDescriptor->Flags.CpuVisible = 1; 1155 } 1156 pQsOut->PagingBufferSegmentId = 0; 1157 pQsOut->PagingBufferSize = 1024; 1158 pQsOut->PagingBufferPrivateDataSize = 0; /* @todo: do we need a private buffer ? */ 1160 pDr->Size = vboxWddmVramReportedSegmentSize(pContext); 1161 pDr->NbOfBanks = 0; 1162 pDr->pBankRangeTable = 0; 1163 pDr->CommitLimit = pDr->Size; 1164 pDr->Flags.Value = 0; 1165 pDr->Flags.CpuVisible = 1; 1166 1167 ++pDr; 1168 /* create cpu-invisible segment of the same size */ 1169 pDr->BaseAddress.QuadPart = 0; 1170 pDr->CpuTranslatedAddress.QuadPart = 0; 1171 /* make sure the size is page aligned */ 1172 /* @todo: need to setup VBVA buffers and adjust the mem size here */ 1173 pDr->Size = vboxWddmVramReportedSegmentSize(pContext); 1174 pDr->NbOfBanks = 0; 1175 pDr->pBankRangeTable = 0; 1176 pDr->CommitLimit = pDr->Size; 1177 pDr->Flags.Value = 0; 1178 1179 pQsOut->PagingBufferSegmentId = 0; 1180 pQsOut->PagingBufferSize = 1024; 1181 pQsOut->PagingBufferPrivateDataSize = 0; /* @todo: do we need a private buffer ? */ 1182 } 1159 1183 break; 1160 1184 } … … 1188 1212 PDEVICE_EXTENSION pContext = (PDEVICE_EXTENSION)hAdapter; 1189 1213 1190 AssertBreakpoint();1214 vboxVDbgBreakFv(); 1191 1215 1192 1216 PVBOXWDDM_DEVICE pDevice = (PVBOXWDDM_DEVICE)vboxWddmMemAllocZero(sizeof (VBOXWDDM_DEVICE)); … … 2383 2407 dfprintf(("==> "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter)); 2384 2408 2385 AssertBreakpoint(); 2409 vboxVDbgBreakF(); 2410 2411 PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)hAdapter; 2412 NTSTATUS Status; 2413 uint32_t cModes; 2414 uint32_t iPreferredMode; 2415 VIDEO_MODE_INFORMATION *pModes; 2416 uint32_t cResolutions; 2417 D3DKMDT_2DREGION *pResolutions; 2418 VBoxWddmGetModesTable(pDevExt, /* PDEVICE_EXTENSION DeviceExtension */ 2419 true, /* bool bRebuildTable*/ 2420 &pModes, /* VIDEO_MODE_INFORMATION ** ppModes*/ 2421 &cModes, /* uint32_t * pcModes */ 2422 &iPreferredMode, /* uint32_t * pPreferrableMode*/ 2423 &pResolutions, /* D3DKMDT_2DREGION **ppResolutions */ 2424 &cResolutions /* uint32_t * pcResolutions */); 2425 2426 for (uint32_t i = 0; i < cResolutions; i++) 2427 { 2428 D3DKMDT_MONITOR_SOURCE_MODE * pNewMonitorSourceModeInfo; 2429 Status = pRecommendMonitorModesArg->pMonitorSourceModeSetInterface->pfnCreateNewModeInfo( 2430 pRecommendMonitorModesArg->hMonitorSourceModeSet, &pNewMonitorSourceModeInfo); 2431 Assert(Status == STATUS_SUCCESS); 2432 if (Status == STATUS_SUCCESS) 2433 { 2434 Status = vboxVidPnPopulateMonitorSourceModeInfoFromLegacy(pDevExt, 2435 pNewMonitorSourceModeInfo, 2436 &pResolutions[i], 2437 D3DKMDT_MCO_DRIVER, 2438 true); 2439 Assert(Status == STATUS_SUCCESS); 2440 if (Status == STATUS_SUCCESS) 2441 { 2442 Status = pRecommendMonitorModesArg->pMonitorSourceModeSetInterface->pfnAddMode( 2443 pRecommendMonitorModesArg->hMonitorSourceModeSet, pNewMonitorSourceModeInfo); 2444 Assert(Status == STATUS_SUCCESS); 2445 if (Status == STATUS_SUCCESS) 2446 continue; 2447 } 2448 2449 /* error has occured, release & break */ 2450 pRecommendMonitorModesArg->pMonitorSourceModeSetInterface->pfnReleaseModeInfo( 2451 pRecommendMonitorModesArg->hMonitorSourceModeSet, pNewMonitorSourceModeInfo); 2452 break; 2453 } 2454 } 2386 2455 2387 2456 dfprintf(("<== "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter)); 2388 2457 2389 return S TATUS_SUCCESS;2458 return Status; 2390 2459 } 2391 2460 … … 2399 2468 dfprintf(("==> "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter)); 2400 2469 2401 AssertBreakpoint();2470 vboxVDbgBreakF(); 2402 2471 2403 2472 dfprintf(("<== "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter));
Note:
See TracChangeset
for help on using the changeset viewer.