Changeset 42128 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Video
- Timestamp:
- Jul 12, 2012 4:31:42 PM (12 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Video/mp
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPVidModes.cpp
r42098 r42128 492 492 #ifdef VBOX_XPDM_MINIPORT 493 493 return (pExt->CurrentMode == 0); 494 #else 494 #elif defined(VBOX_WDDM_WIN8) 495 return FALSE; 496 #else /* VBOX_WDDM_MINIPORT && !VBOX_WDDM_MINIPORT */ 495 497 return (!VBoxCommonFromDeviceExt(pExt)->cDisplays 496 # ifndef VBOX_WDDM_MINIPORT 497 || !pExt->aSources[iDisplay].pPrimaryAllocation 498 # endif 499 ); 498 || !pExt->aSources[iDisplay].pPrimaryAllocation); 500 499 #endif 501 500 } -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPMisc.cpp
r42124 r42128 2627 2627 return STATUS_SUCCESS; 2628 2628 } 2629 2630 #ifdef VBOX_WDDM_WIN8 2631 void vboxWddmDiInitDefault(DXGK_DISPLAY_INFORMATION *pInfo, PHYSICAL_ADDRESS PhAddr, D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId) 2632 { 2633 pInfo->Width = 1024; 2634 pInfo->Height = 768; 2635 pInfo->Pitch = pInfo->Width * 4; 2636 pInfo->ColorFormat = D3DDDIFMT_A8R8G8B8; 2637 pInfo->PhysicAddress = PhAddr; 2638 pInfo->TargetId = VidPnSourceId; 2639 pInfo->AcpiId = 0; 2640 } 2641 2642 void vboxWddmDiToAllocData(PVBOXMP_DEVEXT pDevExt, const DXGK_DISPLAY_INFORMATION *pInfo, PVBOXWDDM_ALLOC_DATA pAllocData) 2643 { 2644 pAllocData->SurfDesc.width = pInfo->Width; 2645 pAllocData->SurfDesc.height = pInfo->Height; 2646 pAllocData->SurfDesc.format = pInfo->ColorFormat; 2647 pAllocData->SurfDesc.bpp = vboxWddmCalcBitsPerPixel(pInfo->ColorFormat); 2648 pAllocData->SurfDesc.pitch = pInfo->Pitch; 2649 pAllocData->SurfDesc.depth = 1; 2650 pAllocData->SurfDesc.slicePitch = pInfo->Pitch; 2651 pAllocData->SurfDesc.cbSize = pInfo->Pitch * pInfo->Height; 2652 pAllocData->SurfDesc.VidPnSourceId = pInfo->TargetId; 2653 pAllocData->SurfDesc.RefreshRate.Numerator = 60000; 2654 pAllocData->SurfDesc.RefreshRate.Denominator = 1000; 2655 2656 /* the address here is not a VRAM offset! so convert it to offset */ 2657 vboxWddmAddrSetVram(&pAllocData->Addr, 1, 2658 vboxWddmVramAddrToOffset(pDevExt, pInfo->PhysicAddress)); 2659 } 2660 2661 void vboxWddmDmAdjustDefaultVramLocations(PVBOXMP_DEVEXT pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID ModifiedVidPnSourceId) 2662 { 2663 PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[ModifiedVidPnSourceId]; 2664 PHYSICAL_ADDRESS PhAddr; 2665 AssertRelease(pSource->AllocData.Addr.SegmentId); 2666 AssertRelease(pSource->AllocData.Addr.offVram != VBOXVIDEOOFFSET_VOID); 2667 PhAddr.QuadPart = pSource->AllocData.Addr.offVram; 2668 2669 for (UINT i = ModifiedVidPnSourceId + 1; i < (UINT)VBoxCommonFromDeviceExt(pDevExt)->cDisplays; ++i) 2670 { 2671 /* increaze the phaddr based on the previous source size info */ 2672 PhAddr.QuadPart += pSource->AllocData.SurfDesc.cbSize; 2673 PhAddr.QuadPart = ROUND_TO_PAGES(PhAddr.QuadPart); 2674 pSource = &pDevExt->aSources[i]; 2675 pSource->AllocData.Addr.SegmentId = 1; 2676 pSource->AllocData.Addr.offVram = PhAddr.QuadPart; 2677 } 2678 } 2679 #endif -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPMisc.h
r41636 r42128 210 210 NTSTATUS VBoxWddmSlTerm(PVBOXMP_DEVEXT pDevExt); 211 211 212 #ifdef VBOX_WDDM_WIN8 213 void vboxWddmDiInitDefault(DXGK_DISPLAY_INFORMATION *pInfo, PHYSICAL_ADDRESS PhAddr, D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId); 214 void vboxWddmDiToAllocData(PVBOXMP_DEVEXT pDevExt, const DXGK_DISPLAY_INFORMATION *pInfo, struct VBOXWDDM_ALLOC_DATA *pAllocData); 215 void vboxWddmDmAdjustDefaultVramLocations(PVBOXMP_DEVEXT pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID ModifiedVidPnSourceId); 216 #endif 217 212 218 #endif /* #ifndef ___VBoxMPMisc_h__ */ -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVidPn.cpp
r42124 r42128 2072 2072 pSource->AllocData.SurfDesc.slicePitch = pVidPnSourceModeInfo->Format.Graphics.Stride; 2073 2073 pSource->AllocData.SurfDesc.cbSize = pVidPnSourceModeInfo->Format.Graphics.Stride * pVidPnSourceModeInfo->Format.Graphics.PrimSurfSize.cy; 2074 #ifdef VBOX_WDDM_WIN8 2075 if (g_VBoxDisplayOnly) 2076 { 2077 vboxWddmDmAdjustDefaultVramLocations(pDevExt, srcId); 2078 } 2079 #endif 2080 } 2081 else 2082 { 2083 Assert(!pAllocation); 2074 2084 } 2075 2085 Assert(pSource->AllocData.SurfDesc.VidPnSourceId == srcId); -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp
r42124 r42128 179 179 NTSTATUS vboxWddmGhDisplayHideScreen(PVBOXMP_DEVEXT pDevExt, D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId) 180 180 { 181 Assert(0); 181 182 VBOXWDDM_SURFACE_DESC SurfDesc = {0}; 182 183 POINT VScreenPos = {0}; … … 1128 1129 { 1129 1130 PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[0]; 1130 pSource->AllocData.SurfDesc.width = DisplayInfo.Width; 1131 pSource->AllocData.SurfDesc.height = DisplayInfo.Height; 1132 pSource->AllocData.SurfDesc.format = DisplayInfo.ColorFormat; 1133 pSource->AllocData.SurfDesc.bpp = vboxWddmCalcBitsPerPixel(DisplayInfo.ColorFormat); 1134 pSource->AllocData.SurfDesc.pitch = DisplayInfo.Pitch; 1135 pSource->AllocData.SurfDesc.depth = 1; 1136 pSource->AllocData.SurfDesc.slicePitch = DisplayInfo.Pitch; 1137 pSource->AllocData.SurfDesc.cbSize = DisplayInfo.Pitch * DisplayInfo.Height; 1138 pSource->AllocData.SurfDesc.VidPnSourceId = 0; 1139 pSource->AllocData.SurfDesc.RefreshRate.Numerator = 60000; 1140 pSource->AllocData.SurfDesc.RefreshRate.Denominator = 1000; 1141 1142 /* the address here is not a VRAM offset! so convert it to offset */ 1143 vboxWddmAddrSetVram(&pSource->AllocData.Addr, 1, 1144 vboxWddmVramAddrToOffset(pDevExt, DisplayInfo.PhysicAddress)); 1131 PHYSICAL_ADDRESS PhAddr; 1132 /* display info may sometimes not be valid, e.g. on from-full-graphics wddm driver update 1133 * ensure we have something meaningful here */ 1134 if (!DisplayInfo.Width) 1135 { 1136 PhAddr = VBoxCommonFromDeviceExt(pDevExt)->phVRAM; 1137 vboxWddmDiInitDefault(&DisplayInfo, PhAddr, 0); 1138 } 1139 else 1140 { 1141 PhAddr = DisplayInfo.PhysicAddress; 1142 DisplayInfo.TargetId = 0; 1143 } 1144 1145 vboxWddmDiToAllocData(pDevExt, &DisplayInfo, &pSource->AllocData); 1146 1147 /* init the rest source infos with some default values */ 1148 for (UINT i = 1; i < (UINT)VBoxCommonFromDeviceExt(pDevExt)->cDisplays; ++i) 1149 { 1150 PhAddr.QuadPart += pSource->AllocData.SurfDesc.cbSize; 1151 PhAddr.QuadPart = ROUND_TO_PAGES(PhAddr.QuadPart); 1152 vboxWddmDiInitDefault(&DisplayInfo, PhAddr, i); 1153 pSource = &pDevExt->aSources[i]; 1154 vboxWddmDiToAllocData(pDevExt, &DisplayInfo, &pSource->AllocData); 1155 } 1145 1156 } 1146 1157 else … … 6604 6615 } 6605 6616 6606 #if 0 //defined(DEBUG_misha) && defined(VBOX_WDDM_WIN8)6617 #if defined(DEBUG_misha) && defined(VBOX_WDDM_WIN8) 6607 6618 /* force g_VBoxDisplayOnly for debugging purposes */ 6608 6619 LOGREL(("Current win8 video driver only supports display-only mode no matter whether or not host 3D is enabled!")); … … 6660 6671 return Status; 6661 6672 } 6673
Note:
See TracChangeset
for help on using the changeset viewer.