VirtualBox

Changeset 27230 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
Mar 9, 2010 6:22:04 PM (15 years ago)
Author:
vboxsync
Message:

wddm: VidPn bugfix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVidPn.cpp

    r27228 r27230  
    4242            {
    4343                dprintf(("unsupported Scaling (%d)\n", pNewVidPnPresentPathInfo->ContentTransformation.Scaling));
     44                AssertBreakpoint();
    4445                bSupported = FALSE;
    4546                break;
     
    4950            {
    5051                dprintf(("unsupported Scaling support (Stretched)\n"));
     52                AssertBreakpoint();
    5153                bSupported = FALSE;
    5254                break;
     
    5759            {
    5860                dprintf(("\"Identity\" or \"Centered\" Scaling support not set\n"));
     61                AssertBreakpoint();
    5962                bSupported = FALSE;
    6063                break;
     
    6568            {
    6669                dprintf(("unsupported rotation (%d)\n", pNewVidPnPresentPathInfo->ContentTransformation.Rotation));
     70                AssertBreakpoint();
    6771                bSupported = FALSE;
    6872                break;
     
    7478            {
    7579                dprintf(("unsupported RotationSupport\n"));
     80                AssertBreakpoint();
    7681                bSupported = FALSE;
    7782                break;
     
    8186            {
    8287                dprintf(("\"Identity\" RotationSupport not set\n"));
     88                AssertBreakpoint();
    8389                bSupported = FALSE;
    8490                break;
     
    9197                        pNewVidPnPresentPathInfo->VisibleFromActiveTLOffset.cx,
    9298                        pNewVidPnPresentPathInfo->VisibleFromActiveTLOffset.cy));
     99                AssertBreakpoint();
    93100                bSupported = FALSE;
    94101                break;
     
    101108                        pNewVidPnPresentPathInfo->VisibleFromActiveBROffset.cx,
    102109                        pNewVidPnPresentPathInfo->VisibleFromActiveBROffset.cy));
     110                AssertBreakpoint();
    103111                bSupported = FALSE;
    104112                break;
     
    109117            {
    110118                dprintf(("unsupported VidPnTargetColorBasis (%d)\n", pNewVidPnPresentPathInfo->VidPnTargetColorBasis));
     119                AssertBreakpoint();
    111120                bSupported = FALSE;
    112121                break;
     
    122131            {
    123132                dprintf(("Non-zero FourthChannel (%d)\n", pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.FourthChannel));
     133                AssertBreakpoint();
    124134                bSupported = FALSE;
    125135                break;
     
    133143            {
    134144                dprintf(("Copy protection not supported CopyProtectionType(%d)\n", pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionType));
     145                AssertBreakpoint();
    135146                bSupported = FALSE;
    136147                break;
     
    140151            {
    141152                dprintf(("Copy protection not supported APSTriggerBits(%d)\n", pNewVidPnPresentPathInfo->CopyProtection.APSTriggerBits));
     153                AssertBreakpoint();
    142154                bSupported = FALSE;
    143155                break;
     
    149161            {
    150162                dprintf(("Copy protection support (0x%x)\n", *((UINT*)&pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionSupport)));
     163                AssertBreakpoint();
    151164                bSupported = FALSE;
    152165                break;
     
    156169            {
    157170                dprintf(("Unsupported GammaRamp.Type (%d)\n", pNewVidPnPresentPathInfo->GammaRamp.Type));
     171                AssertBreakpoint();
    158172                bSupported = FALSE;
    159173                break;
     
    223237                        pNewVidPnSourceModeInfo->Format.Graphics.PrimSurfSize.cx,
    224238                        pNewVidPnSourceModeInfo->Format.Graphics.PrimSurfSize.cy));
     239                AssertBreakpoint();
    225240                bSupported = FALSE;
    226241                break;
     
    295310}
    296311
     312NTSTATUS vboxVidPnPopulateVideoSignalInfo(D3DKMDT_VIDEO_SIGNAL_INFO *pVsi,
     313        D3DKMDT_2DREGION *pResolution,
     314        ULONG VSync)
     315{
     316    NTSTATUS Status = STATUS_SUCCESS;
     317
     318    pVsi->VideoStandard  = D3DKMDT_VSS_VESA_DMT;
     319    pVsi->ActiveSize = *pResolution;
     320    pVsi->VSyncFreq.Numerator = VSync * 1000;
     321    pVsi->VSyncFreq.Denominator = 1000;
     322    pVsi->TotalSize.cx = pVsi->ActiveSize.cx + VBOXVDPN_C_DISPLAY_HBLANK_SIZE;
     323    pVsi->TotalSize.cy = pVsi->ActiveSize.cy + VBOXVDPN_C_DISPLAY_VBLANK_SIZE;
     324    pVsi->PixelRate = pVsi->TotalSize.cx * pVsi->TotalSize.cy * VSync;
     325    pVsi->HSyncFreq.Numerator = (UINT)((pVsi->PixelRate / pVsi->TotalSize.cy) * 1000);
     326    pVsi->HSyncFreq.Denominator = 1000;
     327    pVsi->ScanLineOrdering = D3DDDI_VSSLO_PROGRESSIVE;
     328
     329    return Status;
     330}
     331
    297332NTSTATUS vboxVidPnCheckTargetModeInfo(const D3DKMDT_HVIDPN hDesiredVidPn,
    298333        const D3DKMDT_VIDPN_TARGET_MODE *pNewVidPnTargetModeInfo,
     
    300335{
    301336    BOOLEAN bSupported = TRUE;
    302     do
    303     {
    304         /* video standatd does not matter ??
    305         pNewVidPnTargetModeInfo->VideoSignalInfo.VideoStandard
    306 
    307         we support any total size??
    308         pNewVidPnTargetModeInfo->VideoSignalInfo.TotalSize.cx
    309         pNewVidPnTargetModeInfo->VideoSignalInfo.TotalSize.cy
    310         */
    311         /* ActualSize should be same as total size??*/
    312         if (pNewVidPnTargetModeInfo->VideoSignalInfo.ActiveSize.cx != pNewVidPnTargetModeInfo->VideoSignalInfo.TotalSize.cx
    313                 || pNewVidPnTargetModeInfo->VideoSignalInfo.ActiveSize.cy != pNewVidPnTargetModeInfo->VideoSignalInfo.TotalSize.cy)
    314         {
    315             dprintf(("ActiveSize(%d, %d) !=  TotalSize(%d, %d)\n",
    316                     pNewVidPnTargetModeInfo->VideoSignalInfo.ActiveSize.cx,
    317                     pNewVidPnTargetModeInfo->VideoSignalInfo.ActiveSize.cy,
    318                     pNewVidPnTargetModeInfo->VideoSignalInfo.TotalSize.cx,
    319                     pNewVidPnTargetModeInfo->VideoSignalInfo.TotalSize.cy));
    320             bSupported = FALSE;
    321             break;
    322         }
    323 
    324         /* we do not care about those
    325         pNewVidPnTargetModeInfo->VideoSignalInfo.VSyncFreq.Numerator
    326         pNewVidPnTargetModeInfo->VideoSignalInfo.VSyncFreq.Denominator
    327         pNewVidPnTargetModeInfo->VideoSignalInfo.HSyncFreq.Numerator
    328         pNewVidPnTargetModeInfo->VideoSignalInfo.HSyncFreq.Denominator
    329         pNewVidPnTargetModeInfo->VideoSignalInfo.PixelRate
    330         pNewVidPnTargetModeInfo->VideoSignalInfo.ScanLineOrdering
    331         pNewVidPnTargetModeInfo->Preference
    332         */
    333     } while (1);
     337    D3DKMDT_VIDEO_SIGNAL_INFO CmpVsi;
     338    D3DKMDT_2DREGION CmpRes;
     339    CmpRes.cx = pNewVidPnTargetModeInfo->VideoSignalInfo.ActiveSize.cx;
     340    CmpRes.cy = pNewVidPnTargetModeInfo->VideoSignalInfo.ActiveSize.cy;
     341    NTSTATUS Status = vboxVidPnPopulateVideoSignalInfo(&CmpVsi,
     342                &CmpRes,
     343                pNewVidPnTargetModeInfo->VideoSignalInfo.VSyncFreq.Numerator/pNewVidPnTargetModeInfo->VideoSignalInfo.VSyncFreq.Denominator);
     344    Assert(Status == STATUS_SUCCESS);
     345    if (Status != STATUS_SUCCESS)
     346    {
     347        drprintf((__FUNCTION__": vboxVidPnPopulateVideoSignalInfo error Status (0x%x)\n", Status));
     348        return Status;
     349    }
     350
     351    if (memcmp(&CmpRes, &pNewVidPnTargetModeInfo->VideoSignalInfo, sizeof (D3DKMDT_VIDEO_SIGNAL_INFO)))
     352    {
     353        dfprintf((__FUNCTION__": VideoSignalInfos do not match!!!\n"));
     354        AssertBreakpoint();
     355        bSupported = FALSE;
     356    }
    334357
    335358    *pbSupported = bSupported;
     
    524547}
    525548
    526 NTSTATUS vboxVidPnPopulateVideoSignalInfo(PDEVICE_EXTENSION pDevExt,
    527         D3DKMDT_VIDEO_SIGNAL_INFO *pVsi,
    528         D3DKMDT_2DREGION *pResolution,
    529         ULONG VSync)
    530 {
    531     NTSTATUS Status = STATUS_SUCCESS;
    532 
    533     pVsi->VideoStandard  = D3DKMDT_VSS_VESA_DMT;
    534     pVsi->ActiveSize = *pResolution;
    535     pVsi->VSyncFreq.Numerator = VSync * 1000;
    536     pVsi->VSyncFreq.Denominator = 1000;
    537     pVsi->TotalSize.cx = pVsi->ActiveSize.cx + VBOXVDPN_C_DISPLAY_HBLANK_SIZE;
    538     pVsi->TotalSize.cy = pVsi->ActiveSize.cy + VBOXVDPN_C_DISPLAY_VBLANK_SIZE;
    539     pVsi->PixelRate = pVsi->TotalSize.cx * pVsi->TotalSize.cy * VSync;
    540     pVsi->HSyncFreq.Numerator = (UINT)((pVsi->PixelRate / pVsi->TotalSize.cy) * 1000);
    541     pVsi->HSyncFreq.Denominator = 1000;
    542     pVsi->ScanLineOrdering = D3DDDI_VSSLO_PROGRESSIVE;
    543 
    544     return Status;
    545 }
    546 
    547549NTSTATUS vboxVidPnPopulateMonitorSourceModeInfoFromLegacy(PDEVICE_EXTENSION pDevExt,
    548550        D3DKMDT_MONITOR_SOURCE_MODE *pMonitorSourceMode,
     
    551553        BOOLEAN bPreferred)
    552554{
    553     NTSTATUS Status = vboxVidPnPopulateVideoSignalInfo(pDevExt, &pMonitorSourceMode->VideoSignalInfo, pResolution, 60 /* ULONG VSync */);
     555    NTSTATUS Status = vboxVidPnPopulateVideoSignalInfo(&pMonitorSourceMode->VideoSignalInfo, pResolution, 60 /* ULONG VSync */);
    554556    Assert(Status == STATUS_SUCCESS);
    555557    if (Status == STATUS_SUCCESS)
     
    574576    pNewVidPnTargetModeInfo->Preference = bPreferred ? D3DKMDT_MP_PREFERRED : D3DKMDT_MP_NOTPREFERRED;
    575577
    576     return vboxVidPnPopulateVideoSignalInfo(pDevExt, &pNewVidPnTargetModeInfo->VideoSignalInfo, pResolution, 60 /* ULONG VSync */);
     578    return vboxVidPnPopulateVideoSignalInfo(&pNewVidPnTargetModeInfo->VideoSignalInfo, pResolution, 60 /* ULONG VSync */);
    577579}
    578580
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