VirtualBox

Ignore:
Timestamp:
Jul 12, 2012 4:31:42 PM (12 years ago)
Author:
vboxsync
Message:

wddm/d-o: multiscreen working

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  
    492492#ifdef VBOX_XPDM_MINIPORT
    493493    return (pExt->CurrentMode == 0);
    494 #else
     494#elif defined(VBOX_WDDM_WIN8)
     495    return FALSE;
     496#else /* VBOX_WDDM_MINIPORT && !VBOX_WDDM_MINIPORT */
    495497    return (!VBoxCommonFromDeviceExt(pExt)->cDisplays
    496 # ifndef VBOX_WDDM_MINIPORT
    497             || !pExt->aSources[iDisplay].pPrimaryAllocation
    498 # endif
    499                     );
     498            || !pExt->aSources[iDisplay].pPrimaryAllocation);
    500499#endif
    501500}
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPMisc.cpp

    r42124 r42128  
    26272627    return STATUS_SUCCESS;
    26282628}
     2629
     2630#ifdef VBOX_WDDM_WIN8
     2631void 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
     2642void 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
     2661void 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  
    210210NTSTATUS VBoxWddmSlTerm(PVBOXMP_DEVEXT pDevExt);
    211211
     212#ifdef VBOX_WDDM_WIN8
     213void vboxWddmDiInitDefault(DXGK_DISPLAY_INFORMATION *pInfo, PHYSICAL_ADDRESS PhAddr, D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId);
     214void vboxWddmDiToAllocData(PVBOXMP_DEVEXT pDevExt, const DXGK_DISPLAY_INFORMATION *pInfo, struct VBOXWDDM_ALLOC_DATA *pAllocData);
     215void vboxWddmDmAdjustDefaultVramLocations(PVBOXMP_DEVEXT pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID ModifiedVidPnSourceId);
     216#endif
     217
    212218#endif /* #ifndef ___VBoxMPMisc_h__ */
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVidPn.cpp

    r42124 r42128  
    20722072        pSource->AllocData.SurfDesc.slicePitch = pVidPnSourceModeInfo->Format.Graphics.Stride;
    20732073        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);
    20742084    }
    20752085    Assert(pSource->AllocData.SurfDesc.VidPnSourceId == srcId);
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp

    r42124 r42128  
    179179NTSTATUS vboxWddmGhDisplayHideScreen(PVBOXMP_DEVEXT pDevExt, D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId)
    180180{
     181    Assert(0);
    181182    VBOXWDDM_SURFACE_DESC SurfDesc = {0};
    182183    POINT VScreenPos = {0};
     
    11281129                    {
    11291130                        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                        }
    11451156                    }
    11461157                    else
     
    66046615        }
    66056616
    6606 #if 0 //defined(DEBUG_misha) && defined(VBOX_WDDM_WIN8)
     6617#if defined(DEBUG_misha) && defined(VBOX_WDDM_WIN8)
    66076618        /* force g_VBoxDisplayOnly for debugging purposes */
    66086619        LOGREL(("Current win8 video driver only supports display-only mode no matter whether or not host 3D is enabled!"));
     
    66606671    return Status;
    66616672}
     6673
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette