Changeset 95009 in vbox for trunk/src/VBox/Additions/WINNT/Graphics
- Timestamp:
- May 13, 2022 4:45:53 PM (3 years ago)
- 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 110 110 { 1024, 768 }, 111 111 { 1152, 864 }, 112 { 1280, 720 }, 112 113 { 1280, 960 }, 113 114 { 1280, 1024 }, -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVidPn.cpp
r93115 r95009 183 183 } 184 184 185 static void vboxVidPnPopulateSourceModeInfo(D3DKMDT_VIDPN_SOURCE_MODE *pNewVidPnSourceModeInfo, const RTRECTSIZE *pSize )185 static void vboxVidPnPopulateSourceModeInfo(D3DKMDT_VIDPN_SOURCE_MODE *pNewVidPnSourceModeInfo, const RTRECTSIZE *pSize, D3DDDIFORMAT PixelFormat = D3DDDIFMT_A8R8G8B8) 186 186 { 187 187 /* this is a graphics mode */ … … 191 191 pNewVidPnSourceModeInfo->Format.Graphics.VisibleRegionSize = pNewVidPnSourceModeInfo->Format.Graphics.PrimSurfSize; 192 192 pNewVidPnSourceModeInfo->Format.Graphics.Stride = pSize->cx * 4; 193 pNewVidPnSourceModeInfo->Format.Graphics.PixelFormat = D3DDDIFMT_A8R8G8B8;193 pNewVidPnSourceModeInfo->Format.Graphics.PixelFormat = PixelFormat; 194 194 Assert(pNewVidPnSourceModeInfo->Format.Graphics.PixelFormat != D3DDDIFMT_UNKNOWN); 195 195 pNewVidPnSourceModeInfo->Format.Graphics.ColorBasis = D3DKMDT_CB_SRGB; … … 542 542 RTRECTSIZE size = CR_U642RSIZE(CrSaGetVal(pArray, i)); 543 543 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 } 563 566 } 564 567 }
Note:
See TracChangeset
for help on using the changeset viewer.