VirtualBox

Changeset 63823 in vbox for trunk


Ignore:
Timestamp:
Sep 14, 2016 6:35:39 AM (8 years ago)
Author:
vboxsync
Message:

WDDM: bugref:8387: blank monitors using VBVA_SCREEN_F_BLANK2 when the guest powers them off

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPDevExt.h

    r63039 r63823  
    6666
    6767    BOOLEAN fAnyX;                      /* Unrestricted horizontal resolution flag. */
     68    uint16_t u16SupportedScreenFlags;   /* VBVA_SCREEN_F_* flags supported by the host. */
    6869} VBOXMP_COMMON, *PVBOXMP_COMMON;
    6970
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPHGSMI.cpp

    r63046 r63823  
    127127                                        /* Query the configured number of displays. */
    128128                                        pCommon->cDisplays = VBoxHGSMIGetMonitorCount(&pCommon->guestCtx);
     129                                        /* Query supported VBVA_SCREEN_F_* flags. */
     130                                        pCommon->u16SupportedScreenFlags = VBoxHGSMIGetScreenFlags(&pCommon->guestCtx);
    129131                                        LOGF_LEAVE();
    130132                                        return;
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPTypes.h

    r63646 r63823  
    129129    BOOLEAN fTargetsReported;
    130130    BOOLEAN bVisible;
     131    BOOLEAN bBlankedByPowerOff;
    131132#ifdef VBOX_WITH_CROGL
    132133    /* specifies whether the source has 3D overlay data visible */
     
    160161    bool fConnected;
    161162    bool fConfigured;
     163    bool fBlankedByPowerOff;
    162164} VBOXWDDM_TARGET, *PVBOXWDDM_TARGET;
    163165
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVidPn.cpp

    r63646 r63823  
    23272327NTSTATUS VBoxVidPnCommitSourceModeForSrcId(PVBOXMP_DEVEXT pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface,
    23282328        PVBOXWDDM_ALLOCATION pAllocation,
    2329         D3DDDI_VIDEO_PRESENT_SOURCE_ID  VidPnSourceId, VBOXWDDM_SOURCE *paSources, VBOXWDDM_TARGET *paTargets)
     2329        D3DDDI_VIDEO_PRESENT_SOURCE_ID  VidPnSourceId, VBOXWDDM_SOURCE *paSources, VBOXWDDM_TARGET *paTargets, BOOLEAN bPathPowerTransition)
    23302330{
    23312331    D3DKMDT_HVIDPNSOURCEMODESET hCurVidPnSourceModeSet;
     
    23332333
    23342334    PVBOXWDDM_SOURCE pSource = &paSources[VidPnSourceId];
     2335    pSource->bBlankedByPowerOff = bPathPowerTransition ? pAllocation == NULL : 0;
     2336
    23352337    VBOXWDDM_TARGET_ITER Iter;
    23362338    VBoxVidPnStTIterInit(pSource, paTargets, (uint32_t)VBoxCommonFromDeviceExt(pDevExt)->cDisplays, &Iter);
     
    23422344        pTarget->Size.cx = 0;
    23432345        pTarget->Size.cy = 0;
     2346        pTarget->fBlankedByPowerOff = RT_BOOL(pSource->bBlankedByPowerOff);
    23442347        pTarget->u8SyncState &= ~VBOXWDDM_HGSYNC_F_SYNCED_ALL;
    23452348    }
     
    24562459    {
    24572460        Status = VBoxVidPnCommitSourceModeForSrcId(pDevExt, hDesiredVidPn, pVidPnInterface, pAllocation,
    2458                     pPath->VidPnSourceId, paSources, paTargets);
     2461                    pPath->VidPnSourceId, paSources, paTargets, FALSE);
    24592462        if (Status != STATUS_SUCCESS)
    24602463        {
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVidPn.h

    r63646 r63823  
    7474NTSTATUS VBoxVidPnCommitSourceModeForSrcId(PVBOXMP_DEVEXT pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface,
    7575        PVBOXWDDM_ALLOCATION pAllocation,
    76         D3DDDI_VIDEO_PRESENT_SOURCE_ID  VidPnSourceId, VBOXWDDM_SOURCE *paSources, VBOXWDDM_TARGET *paTargets);
     76        D3DDDI_VIDEO_PRESENT_SOURCE_ID  VidPnSourceId, VBOXWDDM_SOURCE *paSources, VBOXWDDM_TARGET *paTargets, BOOLEAN bPathPowerTransition);
    7777
    7878NTSTATUS VBoxVidPnCommitAll(PVBOXMP_DEVEXT pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface,
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp

    r63815 r63823  
    280280    int rc;
    281281
    282     if (!(fFlags & VBVA_SCREEN_F_DISABLED))
     282    if (!(fFlags & (VBVA_SCREEN_F_DISABLED | VBVA_SCREEN_F_BLANK2)))
    283283    {
    284284        rc = vboxWddmGhDisplayPostInfoView(pDevExt, pAllocData);
     
    345345}
    346346
    347 NTSTATUS vboxWddmGhDisplaySetInfoLegacy(PVBOXMP_DEVEXT pDevExt, const VBOXWDDM_ALLOC_DATA *pAllocData, const POINT * pVScreenPos, uint8_t u8CurCyncState)
     347static uint16_t vboxWddmCalcScreenFlags(PVBOXMP_DEVEXT pDevExt, bool fValidAlloc, bool fPowerOff)
     348{
     349    uint16_t u16Flags;
     350
     351    if (fValidAlloc)
     352    {
     353        u16Flags = VBVA_SCREEN_F_ACTIVE;
     354    }
     355    else
     356    {
     357        if (   fPowerOff
     358            && RT_BOOL(VBoxCommonFromDeviceExt(pDevExt)->u16SupportedScreenFlags & VBVA_SCREEN_F_BLANK2))
     359        {
     360            u16Flags = VBVA_SCREEN_F_ACTIVE | VBVA_SCREEN_F_BLANK2;
     361        }
     362        else
     363        {
     364            u16Flags = VBVA_SCREEN_F_DISABLED;
     365        }
     366    }
     367
     368    return u16Flags;
     369}
     370
     371NTSTATUS vboxWddmGhDisplaySetInfoLegacy(PVBOXMP_DEVEXT pDevExt, const VBOXWDDM_ALLOC_DATA *pAllocData, const POINT * pVScreenPos, uint8_t u8CurCyncState, bool fPowerOff)
    348372{
    349373    NTSTATUS Status = STATUS_SUCCESS;
    350     bool fEnabled = !!pAllocData->SurfDesc.width;
    351     uint16_t fu16Flags = fEnabled ? VBVA_SCREEN_F_ACTIVE : VBVA_SCREEN_F_DISABLED;
    352     if (fEnabled)
     374    bool fValidAlloc = pAllocData->SurfDesc.width > 0 && pAllocData->SurfDesc.height > 0;
     375    uint16_t fu16Flags = vboxWddmCalcScreenFlags(pDevExt, fValidAlloc, fPowerOff);
     376
     377    if (fValidAlloc)
    353378    {
    354379#ifdef VBOX_WITH_CROGL
     
    374399        {
    375400#ifdef VBOX_WITH_CROGL
    376             if (fEnabled && pDevExt->f3DEnabled)
     401            if (fValidAlloc && pDevExt->f3DEnabled)
    377402            {
    378403                Status = vboxVdmaTexPresentSetAlloc(pDevExt, pAllocData);
     
    395420}
    396421
    397 NTSTATUS vboxWddmGhDisplaySetInfoNew(PVBOXMP_DEVEXT pDevExt, const VBOXWDDM_ALLOC_DATA *pAllocData, const uint32_t *pTargetMap, const POINT * pVScreenPos, uint8_t u8CurCyncState)
     422NTSTATUS vboxWddmGhDisplaySetInfoNew(PVBOXMP_DEVEXT pDevExt, const VBOXWDDM_ALLOC_DATA *pAllocData, const uint32_t *pTargetMap, const POINT * pVScreenPos, uint8_t u8CurCyncState, bool fPowerOff)
    398423{
    399424    NTSTATUS Status = STATUS_SUCCESS;
    400     bool fEnabled = !!pAllocData->SurfDesc.width;
    401     uint16_t fu16Flags = fEnabled ? VBVA_SCREEN_F_ACTIVE : VBVA_SCREEN_F_DISABLED;
    402     if (fEnabled)
     425    bool fValidAlloc = pAllocData->SurfDesc.width > 0 && pAllocData->SurfDesc.height > 0;
     426    uint16_t fu16Flags = vboxWddmCalcScreenFlags(pDevExt, fValidAlloc, fPowerOff);
     427
     428    if (fValidAlloc)
    403429    {
    404430#ifdef VBOX_WITH_CROGL
     
    423449        {
    424450#ifdef VBOX_WITH_CROGL
    425             if (fEnabled && pDevExt->f3DEnabled)
     451            if (fValidAlloc && pDevExt->f3DEnabled)
    426452            {
    427453                Status = vboxVdmaTexPresentSetAlloc(pDevExt, pAllocData);
     
    467493    }
    468494
    469     NTSTATUS Status = vboxWddmGhDisplaySetInfoNew(pDevExt, &pSource->AllocData, pTargetMap, &pSource->VScreenPos, pSource->u8SyncState);
     495    NTSTATUS Status = vboxWddmGhDisplaySetInfoNew(pDevExt, &pSource->AllocData, pTargetMap, &pSource->VScreenPos, pSource->u8SyncState, RT_BOOL(pSource->bBlankedByPowerOff));
    470496    if (NT_SUCCESS(Status))
    471497    {
     
    513539    {
    514540        AllocData.SurfDesc.VidPnSourceId = pTarget->u32Id;
    515         NTSTATUS Status = vboxWddmGhDisplaySetInfoLegacy(pDevExt, &AllocData, &pSource->VScreenPos, pSource->u8SyncState | pTarget->u8SyncState);
     541        NTSTATUS Status = vboxWddmGhDisplaySetInfoLegacy(pDevExt, &AllocData, &pSource->VScreenPos, pSource->u8SyncState | pTarget->u8SyncState, pTarget->fBlankedByPowerOff);
    516542        if (NT_SUCCESS(Status))
    517543            pTarget->u8SyncState = VBOXWDDM_HGSYNC_F_SYNCED_ALL;
     
    548574
    549575    bool fFound = false;
     576    bool fPowerOff = false;
    550577    for (int i = 0; i < VBoxCommonFromDeviceExt(pDevExt)->cDisplays; ++i)
    551578    {
     
    559586
    560587        if (pTarget->u8SyncState != VBOXWDDM_HGSYNC_F_SYNCED_ALL)
     588        {
    561589            fFound = true;
     590            /* Assume that either all targets are powered off or all are disabled (usually true). */
     591            fPowerOff = pTarget->fBlankedByPowerOff;
     592        }
    562593
    563594        ASMBitSet(aTargetMap, i);
     
    570601    VBOXWDDM_ALLOC_DATA AllocData;
    571602    VBoxVidPnAllocDataInit(&AllocData, D3DDDI_ID_UNINITIALIZED);
    572     NTSTATUS Status = vboxWddmGhDisplaySetInfoNew(pDevExt, &AllocData, aTargetMap, &VScreenPos, 0);
     603    NTSTATUS Status = vboxWddmGhDisplaySetInfoNew(pDevExt, &AllocData, aTargetMap, &VScreenPos, 0, fPowerOff);
    573604    if (!NT_SUCCESS(Status))
    574605    {
     
    614645        fFound = true;
    615646        AllocData.SurfDesc.VidPnSourceId = i;
    616         NTSTATUS Status = vboxWddmGhDisplaySetInfoLegacy(pDevExt, &AllocData, &VScreenPos, 0);
     647        NTSTATUS Status = vboxWddmGhDisplaySetInfoLegacy(pDevExt, &AllocData, &VScreenPos, 0, pTarget->fBlankedByPowerOff);
    617648        if (NT_SUCCESS(Status))
    618649            pTarget->u8SyncState = VBOXWDDM_HGSYNC_F_SYNCED_ALL;
     
    53595390                    pCommitVidPnArg->hFunctionalVidPn, pVidPnInterface,
    53605391                    (PVBOXWDDM_ALLOCATION)pCommitVidPnArg->hPrimaryAllocation,
    5361                     pCommitVidPnArg->AffectedVidPnSourceId, paSources, paTargets);
     5392                    pCommitVidPnArg->AffectedVidPnSourceId, paSources, paTargets, pCommitVidPnArg->Flags.PathPowerTransition);
    53625393            if (!NT_SUCCESS(Status))
    53635394            {
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.h

    r63646 r63823  
    171171{
    172172    VBOXVIDEOOFFSET offVram = vboxWddmAddrFramOffset(&pAllocData->Addr);
    173     if (offVram == VBOXVIDEOOFFSET_VOID && !(fFlags & VBVA_SCREEN_F_DISABLED))
     173    if (offVram == VBOXVIDEOOFFSET_VOID && !(fFlags & (VBVA_SCREEN_F_DISABLED | VBVA_SCREEN_F_BLANK2)))
    174174    {
    175175        WARN(("offVram == VBOXVIDEOOFFSET_VOID"));
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