VirtualBox

Ignore:
Timestamp:
May 13, 2022 4:45:53 PM (3 years ago)
Author:
vboxsync
Message:

WDDM: report both RGB and BGR graphics modes. bugref:9845

Location:
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVModes.cpp

    r93115 r95009  
    110110    { 1024,  768 },
    111111    { 1152,  864 },
     112    { 1280,  720 },
    112113    { 1280,  960 },
    113114    { 1280, 1024 },
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVidPn.cpp

    r93115 r95009  
    183183}
    184184
    185 static void vboxVidPnPopulateSourceModeInfo(D3DKMDT_VIDPN_SOURCE_MODE *pNewVidPnSourceModeInfo, const RTRECTSIZE *pSize)
     185static void vboxVidPnPopulateSourceModeInfo(D3DKMDT_VIDPN_SOURCE_MODE *pNewVidPnSourceModeInfo, const RTRECTSIZE *pSize, D3DDDIFORMAT PixelFormat = D3DDDIFMT_A8R8G8B8)
    186186{
    187187    /* this is a graphics mode */
     
    191191    pNewVidPnSourceModeInfo->Format.Graphics.VisibleRegionSize = pNewVidPnSourceModeInfo->Format.Graphics.PrimSurfSize;
    192192    pNewVidPnSourceModeInfo->Format.Graphics.Stride = pSize->cx * 4;
    193     pNewVidPnSourceModeInfo->Format.Graphics.PixelFormat = D3DDDIFMT_A8R8G8B8;
     193    pNewVidPnSourceModeInfo->Format.Graphics.PixelFormat = PixelFormat;
    194194    Assert(pNewVidPnSourceModeInfo->Format.Graphics.PixelFormat != D3DDDIFMT_UNKNOWN);
    195195    pNewVidPnSourceModeInfo->Format.Graphics.ColorBasis = D3DKMDT_CB_SRGB;
     
    542542        RTRECTSIZE size = CR_U642RSIZE(CrSaGetVal(pArray, i));
    543543
    544         D3DKMDT_VIDPN_SOURCE_MODE *pVidPnModeInfo;
    545         NTSTATUS Status = pVidPnModeSetInterface->pfnCreateNewModeInfo(hVidPnModeSet, &pVidPnModeInfo);
    546         if (!NT_SUCCESS(Status))
    547         {
    548             WARN(("pfnCreateNewModeInfo failed, Status 0x%x", Status));
    549             return Status;
    550         }
    551 
    552         vboxVidPnPopulateSourceModeInfo(pVidPnModeInfo, &size);
    553 
    554         Status = pVidPnModeSetInterface->pfnAddMode(hVidPnModeSet, pVidPnModeInfo);
    555         if (!NT_SUCCESS(Status))
    556         {
    557             WARN(("pfnAddMode (%d x %d) failed, Status 0x%x", size.cx, size.cy, Status));
    558             VBoxVidPnDumpSourceMode("SourceMode: ", pVidPnModeInfo, "\n");
    559             NTSTATUS rcNt2 = pVidPnModeSetInterface->pfnReleaseModeInfo(hVidPnModeSet, pVidPnModeInfo);
    560             AssertNtStatusSuccess(rcNt2);
    561             // Continue adding modes into modeset even if a mode was rejected
    562             continue;
     544        for (uint32_t m = 0; m < 2; ++m)
     545        {
     546            D3DKMDT_VIDPN_SOURCE_MODE *pVidPnModeInfo;
     547            NTSTATUS Status = pVidPnModeSetInterface->pfnCreateNewModeInfo(hVidPnModeSet, &pVidPnModeInfo);
     548            if (!NT_SUCCESS(Status))
     549            {
     550                WARN(("pfnCreateNewModeInfo failed, Status 0x%x", Status));
     551                return Status;
     552            }
     553
     554            vboxVidPnPopulateSourceModeInfo(pVidPnModeInfo, &size, m == 0 ? D3DDDIFMT_A8R8G8B8 : D3DDDIFMT_A8B8G8R8);
     555
     556            Status = pVidPnModeSetInterface->pfnAddMode(hVidPnModeSet, pVidPnModeInfo);
     557            if (!NT_SUCCESS(Status))
     558            {
     559                WARN(("pfnAddMode (%d x %d) failed, Status 0x%x", size.cx, size.cy, Status));
     560                VBoxVidPnDumpSourceMode("SourceMode: ", pVidPnModeInfo, "\n");
     561                NTSTATUS rcNt2 = pVidPnModeSetInterface->pfnReleaseModeInfo(hVidPnModeSet, pVidPnModeInfo);
     562                AssertNtStatusSuccess(rcNt2);
     563                // Continue adding modes into modeset even if a mode was rejected
     564                continue;
     565            }
    563566        }
    564567    }
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