VirtualBox

Ignore:
Timestamp:
Jul 18, 2012 8:41:29 PM (12 years ago)
Author:
vboxsync
Message:

wddm: autoresize, etc. fixes, more to follow..

File:
1 edited

Legend:

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

    r42158 r42217  
    219219    NTSTATUS Status = STATUS_SUCCESS;
    220220
    221     pVsi->VideoStandard  = D3DKMDT_VSS_VESA_DMT;
     221    pVsi->VideoStandard  = D3DKMDT_VSS_OTHER;
    222222    pVsi->ActiveSize = *pResolution;
    223223    pVsi->VSyncFreq.Numerator = VSync * 1000;
    224224    pVsi->VSyncFreq.Denominator = 1000;
    225     pVsi->TotalSize.cx = pVsi->ActiveSize.cx + VBOXVDPN_C_DISPLAY_HBLANK_SIZE;
    226     pVsi->TotalSize.cy = pVsi->ActiveSize.cy + VBOXVDPN_C_DISPLAY_VBLANK_SIZE;
     225    pVsi->TotalSize.cx = pVsi->ActiveSize.cx;// + VBOXVDPN_C_DISPLAY_HBLANK_SIZE;
     226    pVsi->TotalSize.cy = pVsi->ActiveSize.cy;// + VBOXVDPN_C_DISPLAY_VBLANK_SIZE;
    227227    pVsi->PixelRate = pVsi->TotalSize.cx * pVsi->TotalSize.cy * VSync;
    228228    pVsi->HSyncFreq.Numerator = (UINT)((pVsi->PixelRate / pVsi->TotalSize.cy) * 1000);
     
    527527    D3DKMDT_2DREGION *paResolutions;
    528528    uint32_t cResolutions;
    529     BOOLEAN fMatch;
     529    BOOLEAN fMatched;
    530530} VBOXVIDPNMATCHMONMODESENUM, *PVBOXVIDPNMATCHMONMODESENUM;
    531531
     
    535535    PVBOXVIDPNMATCHMONMODESENUM pInfo = (PVBOXVIDPNMATCHMONMODESENUM)pContext;
    536536
    537     Assert(pInfo->fMatch);
     537    Assert(pInfo->fMatched);
     538
     539    BOOLEAN fFound = FALSE;
    538540
    539541    for (UINT i = 0; i < pInfo->cResolutions; ++i)
    540542    {
    541543        D3DKMDT_2DREGION *pResolution = &pInfo->paResolutions[i];
    542         if (pMonitorSMI->VideoSignalInfo.ActiveSize.cx != pResolution->cx
    543                 || pMonitorSMI->VideoSignalInfo.ActiveSize.cy != pResolution->cy)
    544         {
    545             pInfo->fMatch = FALSE;
     544        if (pMonitorSMI->VideoSignalInfo.ActiveSize.cx == pResolution->cx
     545                && pMonitorSMI->VideoSignalInfo.ActiveSize.cy == pResolution->cy)
     546        {
     547            fFound = TRUE;
    546548            break;
    547549        }
    548550    }
    549551
     552    if (!fFound)
     553        pInfo->fMatched = FALSE;
     554
    550555    pMonitorSMSIf->pfnReleaseModeInfo(hMonitorSMS, pMonitorSMI);
    551556
    552     return pInfo->fMatch;
     557    return pInfo->fMatched;
    553558}
    554559
     
    585590    }
    586591
    587     VBOXVIDPNMATCHMONMODESENUM Info;
    588     Info.paResolutions = pResolutions;
    589     Info.cResolutions = cResolutions;
    590     Info.fMatch = TRUE;
    591 
    592     Status = vboxVidPnEnumMonitorSourceModes(hMonitorSMS, pMonitorSMSIf, vboxFidPnMatchMonitorModesEnum, &Info);
     592    /* we care only about monitor modes covering all needed resolutions,
     593     * we do NOT care if resolutions do not cover some monitor modes */
     594    SIZE_T cModes = 0;
     595    Status = pMonitorSMSIf->pfnGetNumModes(hMonitorSMS, &cModes);
    593596    if (NT_SUCCESS(Status))
    594597    {
    595         *pfMatch = Info.fMatch;
    596     }
     598        if (cModes < cResolutions)
     599            *pfMatch = FALSE;
     600        else
     601        {
     602            VBOXVIDPNMATCHMONMODESENUM Info;
     603            Info.paResolutions = pResolutions;
     604            Info.cResolutions = cResolutions;
     605            Info.fMatched = TRUE;
     606
     607            Status = vboxVidPnEnumMonitorSourceModes(hMonitorSMS, pMonitorSMSIf, vboxFidPnMatchMonitorModesEnum, &Info);
     608            if (NT_SUCCESS(Status))
     609                *pfMatch = Info.fMatched;
     610        }
     611    }
     612    else
     613        WARN(("pfnGetNumModes failed, Status 0x%x", Status));
    597614
    598615    NTSTATUS tmpStatus = pMonitorInterface->pfnReleaseMonitorSourceModeSet(pDevExt->u.primary.DxgkInterface.DeviceHandle, hMonitorSMS);
     
    12991316                    {
    13001317                        Status = vboxVidPnPopulateTargetModeInfoFromLegacy(pNewVidPnTargetModeInfo, pResolution, i == pInfo->iPreferredResolution);
    1301                         Assert(Status == STATUS_SUCCESS);
    13021318                        if (NT_SUCCESS(Status))
    13031319                        {
     
    13091325                                continue;
    13101326                            }
     1327                            else
     1328                            {
     1329                                WARN(("pfnAddMode failed, Status 0x%x", Status));
     1330                            }
     1331                        }
     1332                        else
     1333                        {
     1334                            WARN(("vboxVidPnPopulateTargetModeInfoFromLegacy failed, Status 0x%x", Status));
    13111335                        }
    13121336
     
    13141338                        Assert(tmpStatus == STATUS_SUCCESS);
    13151339                    }
     1340
    13161341                    /* we're here because of an error */
    13171342                    Assert(!NT_SUCCESS(Status));
    1318                     break;
     1343                    /* ignore mode addition failure */
     1344                    Status = STATUS_SUCCESS;
     1345                    continue;
    13191346                }
    13201347            }
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