VirtualBox

Changeset 27239 in vbox for trunk/src/VBox/Additions/WINNT


Ignore:
Timestamp:
Mar 10, 2010 10:35:04 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
58623
Message:

wddm: VidPn fixes

Location:
trunk/src/VBox/Additions/WINNT/Graphics/Miniport
Files:
5 edited

Legend:

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

    r27201 r27239  
    124124    if (RT_FAILURE(rc))
    125125    {
     126#ifndef DEBUG_misha
    126127        dprintf(("VBoxVideo::vboxLikesVideoMode: ERROR allocating request, rc = %Rrc\n", rc));
     128#else
     129        /* @todo: fixme: remove this ifdef*/
     130#endif
    127131        /* Most likely the VBoxGuest driver is not loaded.
    128132         * To get at least the video working, report the mode as supported.
     
    147151        VbglGRFree(&req->header);
    148152    }
    149 
     153#ifndef DEBUG_misha
    150154    dprintf(("VBoxVideo::vboxLikesVideoMode: width: %d, height: %d, bpp: %d -> %s\n", width, height, bpp, (bRC == 1) ? "OK" : "FALSE"));
     155#else
     156        /* @todo: fixme: remove this ifdef*/
     157#endif
     158
    151159    return bRC;
    152160}
     
    156164    ULONG retHeight = 0;
    157165
     166#ifndef DEBUG_misha
    158167    dprintf(("VBoxVideo::vboxGetHeightReduction\n"));
     168#endif
    159169
    160170    VMMDevGetHeightReductionRequest *req = NULL;
     
    163173    if (RT_FAILURE(rc))
    164174    {
     175#ifndef DEBUG_misha
    165176        dprintf(("VBoxVideo::vboxGetHeightReduction: ERROR allocating request, rc = %Rrc\n", rc));
     177#endif
    166178    }
    167179    else
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.cpp

    r27214 r27239  
    11751175                     xres, yres, bpp));
    11761176    }
    1177 #ifdef LOG_ENABLED
     1177#if defined(LOG_ENABLED) && !defined(DEBUG_misha)
    11781178    {
    11791179        int i;
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVidPn.cpp

    r27238 r27239  
    635635}
    636636
     637NTSTATUS vboxVidPnCreatePopulateSourceModeSetFromLegacy(PDEVICE_EXTENSION pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface,
     638                    D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId,
     639                    VIDEO_MODE_INFORMATION *pModes, uint32_t cModes, uint32_t iPreferredMode)
     640{
     641    D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet;
     642    const DXGK_VIDPNSOURCEMODESET_INTERFACE *pNewVidPnSourceModeSetInterface;
     643    NTSTATUS Status = pVidPnInterface->pfnCreateNewSourceModeSet(hDesiredVidPn,
     644                        srcId, /*__in CONST D3DDDI_VIDEO_PRESENT_SOURCE_ID  VidPnSourceId */
     645                        &hNewVidPnSourceModeSet,
     646                        &pNewVidPnSourceModeSetInterface);
     647    Assert(Status == STATUS_SUCCESS);
     648    if (Status == STATUS_SUCCESS)
     649    {
     650        Status = vboxVidPnPopulateSourceModeSetFromLegacy(pDevExt,
     651                    hNewVidPnSourceModeSet, pNewVidPnSourceModeSetInterface,
     652                    pModes, cModes, iPreferredMode);
     653        Assert(Status == STATUS_SUCCESS);
     654        if (Status == STATUS_SUCCESS)
     655        {
     656            Status = pVidPnInterface->pfnAssignSourceModeSet(hDesiredVidPn,
     657                        srcId,
     658                        hNewVidPnSourceModeSet);
     659            Assert(Status == STATUS_SUCCESS);
     660            if(Status != STATUS_SUCCESS)
     661            {
     662                drprintf((__FUNCTION__": pfnAssignSourceModeSet failed Status(0x%x)\n", Status));
     663                pVidPnInterface->pfnReleaseSourceModeSet(hDesiredVidPn, hNewVidPnSourceModeSet);
     664            }
     665        }
     666        else
     667        {
     668            drprintf((__FUNCTION__": vboxVidPnPopulateSourceModeSetFromLegacy failed Status(0x%x)\n", Status));
     669            pVidPnInterface->pfnReleaseSourceModeSet(hDesiredVidPn, hNewVidPnSourceModeSet);
     670        }
     671    }
     672    else
     673        drprintf((__FUNCTION__": pfnCreateNewSourceModeSet failed Status(0x%x)\n", Status));
     674    return Status;
     675}
     676
     677NTSTATUS vboxVidPnCreatePopulateTargetModeSetFromLegacy(PDEVICE_EXTENSION pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface,
     678                    D3DDDI_VIDEO_PRESENT_TARGET_ID tgtId,
     679                    D3DKMDT_2DREGION *pResolutions,
     680                    uint32_t cResolutions,
     681                    VIDEO_MODE_INFORMATION *pPreferredMode)
     682{
     683    D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet;
     684    const DXGK_VIDPNTARGETMODESET_INTERFACE *pNewVidPnTargetModeSetInterface;
     685    NTSTATUS Status = pVidPnInterface->pfnCreateNewTargetModeSet(hDesiredVidPn,
     686                        tgtId, /*__in CONST D3DDDI_VIDEO_PRESENT_TARGET_ID  VidPnTargetId */
     687                        &hNewVidPnTargetModeSet,
     688                        &pNewVidPnTargetModeSetInterface);
     689    Assert(Status == STATUS_SUCCESS);
     690    if (Status == STATUS_SUCCESS)
     691    {
     692        Status = vboxVidPnPopulateTargetModeSetFromLegacy(pDevExt,
     693                    hNewVidPnTargetModeSet, pNewVidPnTargetModeSetInterface,
     694                    pResolutions, cResolutions, pPreferredMode);
     695        Assert(Status == STATUS_SUCCESS);
     696        if (Status == STATUS_SUCCESS)
     697        {
     698            Status = pVidPnInterface->pfnAssignTargetModeSet(hDesiredVidPn,
     699                        tgtId,
     700                        hNewVidPnTargetModeSet);
     701            Assert(Status == STATUS_SUCCESS);
     702            if(Status != STATUS_SUCCESS)
     703            {
     704                drprintf((__FUNCTION__": pfnAssignTargetModeSet failed Status(0x%x)\n", Status));
     705                pVidPnInterface->pfnReleaseTargetModeSet(hDesiredVidPn, hNewVidPnTargetModeSet);
     706            }
     707        }
     708        else
     709        {
     710            drprintf((__FUNCTION__": vboxVidPnPopulateTargetModeSetFromLegacy failed Status(0x%x)\n", Status));
     711            pVidPnInterface->pfnReleaseTargetModeSet(hDesiredVidPn, hNewVidPnTargetModeSet);
     712        }
     713    }
     714    else
     715        drprintf((__FUNCTION__": pfnCreateNewTargetModeSet failed Status(0x%x)\n", Status));
     716    return Status;
     717
     718}
     719
     720NTSTATUS vboxVidPnCreatePopulateVidPnFromLegacy(PDEVICE_EXTENSION pDevExt, D3DKMDT_HVIDPN hVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface,
     721        VIDEO_MODE_INFORMATION *pModes, uint32_t cModes, uint32_t iPreferredMode,
     722        D3DKMDT_2DREGION *pResolutions, uint32_t cResolutions)
     723{
     724    NTSTATUS Status;
     725    D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology;
     726    const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface;
     727    Status = pVidPnInterface->pfnGetTopology(hVidPn, &hVidPnTopology, &pVidPnTopologyInterface);
     728    if (Status == STATUS_SUCCESS)
     729    {
     730        D3DKMDT_VIDPN_PRESENT_PATH *pNewVidPnPresentPathInfo;
     731        Status = pVidPnTopologyInterface->pfnCreateNewPathInfo(hVidPnTopology, &pNewVidPnPresentPathInfo);
     732        if (Status == STATUS_SUCCESS)
     733        {
     734            pNewVidPnPresentPathInfo->VidPnSourceId = 0;
     735            pNewVidPnPresentPathInfo->VidPnTargetId = 0;
     736            pNewVidPnPresentPathInfo->ImportanceOrdinal = D3DKMDT_VPPI_PRIMARY;
     737            pNewVidPnPresentPathInfo->ContentTransformation.Scaling = D3DKMDT_VPPS_IDENTITY;
     738            memset(&pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport,
     739                    0, sizeof (pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport));
     740            pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport.Identity = 1;
     741            pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport.Centered = 1;
     742            pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport.Stretched = 0;
     743            pNewVidPnPresentPathInfo->ContentTransformation.Rotation = D3DKMDT_VPPR_IDENTITY;
     744            pNewVidPnPresentPathInfo->ContentTransformation.RotationSupport.Identity = 1;
     745            pNewVidPnPresentPathInfo->ContentTransformation.RotationSupport.Rotate180 = 0;
     746            pNewVidPnPresentPathInfo->ContentTransformation.RotationSupport.Rotate270 = 0;
     747            pNewVidPnPresentPathInfo->ContentTransformation.RotationSupport.Rotate90 = 0;
     748            pNewVidPnPresentPathInfo->VisibleFromActiveTLOffset.cx = 0;
     749            pNewVidPnPresentPathInfo->VisibleFromActiveTLOffset.cy = 0;
     750            pNewVidPnPresentPathInfo->VisibleFromActiveBROffset.cx = 0;
     751            pNewVidPnPresentPathInfo->VisibleFromActiveBROffset.cy = 0;
     752            pNewVidPnPresentPathInfo->VidPnTargetColorBasis = D3DKMDT_CB_SRGB; /* @todo: how does it matters? */
     753            pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.FirstChannel =  8;
     754            pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.SecondChannel =  8;
     755            pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.ThirdChannel =  8;
     756            pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.FourthChannel =  0;
     757            pNewVidPnPresentPathInfo->Content = D3DKMDT_VPPC_GRAPHICS;
     758            pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionType = D3DKMDT_VPPMT_NOPROTECTION;
     759            pNewVidPnPresentPathInfo->CopyProtection.APSTriggerBits = 0;
     760            memset(&pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionSupport, 0, sizeof (pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionSupport));
     761            pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionSupport.NoProtection  = 1;
     762            pNewVidPnPresentPathInfo->GammaRamp.Type = D3DDDI_GAMMARAMP_DEFAULT;
     763            pNewVidPnPresentPathInfo->GammaRamp.DataSize = 0;
     764            Status = pVidPnTopologyInterface->pfnAddPath(hVidPnTopology, pNewVidPnPresentPathInfo);
     765            if (Status == STATUS_SUCCESS)
     766            {
     767                Status = vboxVidPnCreatePopulateSourceModeSetFromLegacy(pDevExt, hVidPn, pVidPnInterface, 0, pModes, cModes, iPreferredMode);
     768                Assert(Status == STATUS_SUCCESS);
     769                if (Status == STATUS_SUCCESS)
     770                {
     771                    Status = vboxVidPnCreatePopulateTargetModeSetFromLegacy(pDevExt, hVidPn, pVidPnInterface, 0,
     772                            pResolutions, cResolutions, &pModes[iPreferredMode]);
     773                    Assert(Status == STATUS_SUCCESS);
     774                    if (Status != STATUS_SUCCESS)
     775                        drprintf((__FUNCTION__": vboxVidPnCreatePopulateTargetModeSetFromLegacy failed Status(0x%x)\n", Status));
     776                }
     777                else
     778                    drprintf((__FUNCTION__": vboxVidPnCreatePopulateSourceModeSetFromLegacy failed Status(0x%x)\n", Status));
     779            }
     780            else
     781            {
     782                drprintf((__FUNCTION__": pfnAddPath failed Status(0x%x)\n", Status));
     783                pVidPnTopologyInterface->pfnReleasePathInfo(hVidPnTopology, pNewVidPnPresentPathInfo);
     784                pNewVidPnPresentPathInfo = NULL;
     785            }
     786        }
     787        else
     788        {
     789            drprintf((__FUNCTION__": pfnCreateNewPathInfo failed Status(0x%x)\n", Status));
     790        }
     791    }
     792    else
     793    {
     794        drprintf((__FUNCTION__": pfnGetTopology failed Status(0x%x)\n", Status));
     795    }
     796
     797    return Status;
     798}
    637799
    638800DECLCALLBACK(BOOLEAN) vboxVidPnCofuncModalityPathEnum(PDEVICE_EXTENSION pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface,
     
    699861            {
    700862                /* just create and populate the new source mode set for now */
    701                 D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet;
    702                 const DXGK_VIDPNSOURCEMODESET_INTERFACE *pNewVidPnSourceModeSetInterface;
    703                 Status = pVidPnInterface->pfnCreateNewSourceModeSet(hDesiredVidPn,
    704                                     pNewVidPnPresentPathInfo->VidPnSourceId, /*__in CONST D3DDDI_VIDEO_PRESENT_SOURCE_ID  VidPnSourceId */
    705                                     &hNewVidPnSourceModeSet,
    706                                     &pNewVidPnSourceModeSetInterface);
     863                Status = vboxVidPnCreatePopulateSourceModeSetFromLegacy(pDevExt, hDesiredVidPn, pVidPnInterface,
     864                        pNewVidPnPresentPathInfo->VidPnSourceId,
     865                        pModes, cModes, iPreferredMode);
    707866                Assert(Status == STATUS_SUCCESS);
    708                 if (Status == STATUS_SUCCESS)
    709                 {
    710                     Status = vboxVidPnPopulateSourceModeSetFromLegacy(pDevExt,
    711                                 hNewVidPnSourceModeSet, pNewVidPnSourceModeSetInterface,
    712                                 pModes, cModes, iPreferredMode);
    713                     Assert(Status == STATUS_SUCCESS);
    714                     if (Status == STATUS_SUCCESS)
    715                     {
    716                         Status = pVidPnInterface->pfnAssignSourceModeSet(hDesiredVidPn,
    717                                     pNewVidPnPresentPathInfo->VidPnSourceId,
    718                                     hNewVidPnSourceModeSet);
    719                         Assert(Status == STATUS_SUCCESS);
    720                         if(Status != STATUS_SUCCESS)
    721                         {
    722                             drprintf((__FUNCTION__": pfnAssignSourceModeSet failed Status(0x%x)\n", Status));
    723                             pVidPnInterface->pfnReleaseSourceModeSet(hDesiredVidPn, hNewVidPnSourceModeSet);
    724                         }
    725                     }
    726                     else
    727                     {
    728                         drprintf((__FUNCTION__": vboxVidPnPopulateSourceModeSetFromLegacy failed Status(0x%x)\n", Status));
    729                         pVidPnInterface->pfnReleaseSourceModeSet(hDesiredVidPn, hNewVidPnSourceModeSet);
    730                     }
    731                 }
    732                 else
    733                     drprintf((__FUNCTION__": pfnCreateNewSourceModeSet failed Status(0x%x)\n", Status));
     867                if (Status != STATUS_SUCCESS)
     868                    drprintf((__FUNCTION__": vboxVidPnCreatePopulateSourceModeSetFromLegacy failed Status(0x%x)\n", Status));
    734869            }
    735870            else
     
    771906                {
    772907                    /* just create and populate a new target mode info for now */
    773                     D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet;
    774                     const DXGK_VIDPNTARGETMODESET_INTERFACE *pNewVidPnTargetModeSetInterface;
    775                     Status = pVidPnInterface->pfnCreateNewTargetModeSet(hDesiredVidPn,
    776                                         pNewVidPnPresentPathInfo->VidPnTargetId, /*__in CONST D3DDDI_VIDEO_PRESENT_TARGET_ID  VidPnTargetId */
    777                                         &hNewVidPnTargetModeSet,
    778                                         &pNewVidPnTargetModeSetInterface);
     908                    Status = vboxVidPnCreatePopulateTargetModeSetFromLegacy(pDevExt, hDesiredVidPn, pVidPnInterface,
     909                            pNewVidPnPresentPathInfo->VidPnTargetId,
     910                            pResolutions,
     911                            cResolutions,
     912                            &pModes[iPreferredMode]);
    779913                    Assert(Status == STATUS_SUCCESS);
    780                     if (Status == STATUS_SUCCESS)
    781                     {
    782                         Status = vboxVidPnPopulateTargetModeSetFromLegacy(pDevExt,
    783                                     hNewVidPnTargetModeSet, pNewVidPnTargetModeSetInterface,
    784                                     pResolutions, cResolutions, &pModes[iPreferredMode]);
    785                         Assert(Status == STATUS_SUCCESS);
    786                         if (Status == STATUS_SUCCESS)
    787                         {
    788                             Status = pVidPnInterface->pfnAssignTargetModeSet(hDesiredVidPn,
    789                                         pNewVidPnPresentPathInfo->VidPnTargetId,
    790                                         hNewVidPnTargetModeSet);
    791                             Assert(Status == STATUS_SUCCESS);
    792                             if(Status != STATUS_SUCCESS)
    793                             {
    794                                 drprintf((__FUNCTION__": pfnAssignTargetModeSet failed Status(0x%x)\n", Status));
    795                                 pVidPnInterface->pfnReleaseTargetModeSet(hDesiredVidPn, hNewVidPnTargetModeSet);
    796                             }
    797                         }
    798                         else
    799                         {
    800                             drprintf((__FUNCTION__": vboxVidPnPopulateTargetModeSetFromLegacy failed Status(0x%x)\n", Status));
    801                             pVidPnInterface->pfnReleaseTargetModeSet(hDesiredVidPn, hNewVidPnTargetModeSet);
    802                         }
    803                     }
     914                    if (Status != STATUS_SUCCESS)
     915                        drprintf((__FUNCTION__": vboxVidPnCreatePopulateTargetModeSetFromLegacy failed Status(0x%x)\n", Status));
    804916                }
    805917                else
     
    818930    return Status == STATUS_SUCCESS;
    819931}
     932
    820933
    821934NTSTATUS vboxVidPnEnumSourceModes(PDEVICE_EXTENSION pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface,
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVidPn.h

    r27201 r27239  
    113113        BOOLEAN bPreferred);
    114114
     115NTSTATUS vboxVidPnCreatePopulateVidPnFromLegacy(struct _DEVICE_EXTENSION* pDevExt, D3DKMDT_HVIDPN hVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface,
     116        VIDEO_MODE_INFORMATION *pModes, uint32_t cModes, uint32_t iPreferredMomde,
     117        D3DKMDT_2DREGION *pResolutions, uint32_t cResolutions);
     118
    115119#endif /* #ifndef ___VBoxVideoVidPn_h___ */
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp

    r27225 r27239  
    550550
    551551    dfprintf(("==> "__FUNCTION__ ", pdo(0x%x)\n", PhysicalDeviceObject));
     552
     553    vboxVDbgBreakFv();
     554
    552555    NTSTATUS Status = STATUS_SUCCESS;
    553556
     
    583586
    584587    dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", MiniportDeviceContext));
     588
     589    vboxVDbgBreakFv();
    585590
    586591    if ( ARGUMENT_PRESENT(MiniportDeviceContext) &&
     
    677682    dfprintf(("==> "__FUNCTION__ ", context(0x%p)\n", MiniportDeviceContext));
    678683
     684    vboxVDbgBreakF();
     685
    679686    vboxWddmMemFree(MiniportDeviceContext);
    680687
     
    764771{
    765772    dfprintf(("==> "__FUNCTION__ ", context(0x%p), msg(0x%x)\n", MiniportDeviceContext, MessageNumber));
     773
     774    vboxVDbgBreakF();
    766775
    767776    PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)MiniportDeviceContext;
     
    875884{
    876885    dfprintf(("==> "__FUNCTION__ ", context(0x%p)\n", MiniportDeviceContext));
     886
     887    vboxVDbgBreakF();
    877888
    878889    PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)MiniportDeviceContext;
     
    14111422
    14121423    dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter));
     1424
     1425    vboxVDbgBreakFv();
     1426
    14131427    NTSTATUS Status = STATUS_SUCCESS;
    14141428
     
    16061620    dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter));
    16071621
     1622    vboxVDbgBreakF();
     1623
    16081624    /* Value == 2 is Present
    16091625     * Value == 4 is RedirectedPresent
     
    16451661
    16461662    dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter));
     1663
     1664    vboxVDbgBreakF();
    16471665
    16481666    PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)hAdapter;
     
    18611879    dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter));
    18621880
    1863     vboxVDbgBreakF();
     1881    vboxVDbgBreakFv();
    18641882
    18651883    PDEVICE_EXTENSION pContext = (PDEVICE_EXTENSION)hAdapter;
     
    19671985    dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter));
    19681986
    1969     PDEVICE_EXTENSION pContext = (PDEVICE_EXTENSION)hAdapter;
     1987    vboxVDbgBreakF();
     1988
     1989    PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)hAdapter;
     1990    NTSTATUS Status;
     1991    uint32_t cModes;
     1992    uint32_t iPreferredMode;
     1993    VIDEO_MODE_INFORMATION *pModes;
     1994    uint32_t cResolutions;
     1995    D3DKMDT_2DREGION *pResolutions;
     1996    VBoxWddmGetModesTable(pDevExt, /* PDEVICE_EXTENSION DeviceExtension */
     1997            true, /* bool bRebuildTable*/
     1998            &pModes, /* VIDEO_MODE_INFORMATION ** ppModes*/
     1999            &cModes, /* uint32_t * pcModes */
     2000            &iPreferredMode, /* uint32_t * pPreferrableMode*/
     2001            &pResolutions, /* D3DKMDT_2DREGION **ppResolutions */
     2002            &cResolutions /* uint32_t * pcResolutions */);
     2003
     2004
    19702005    const DXGK_VIDPN_INTERFACE* pVidPnInterface = NULL;
    1971     NTSTATUS Status = pContext->u.primary.DxgkInterface.DxgkCbQueryVidPnInterface(pRecommendFunctionalVidPnArg->hRecommendedFunctionalVidPn, DXGK_VIDPN_INTERFACE_VERSION_V1, &pVidPnInterface);
     2006    Status = pDevExt->u.primary.DxgkInterface.DxgkCbQueryVidPnInterface(pRecommendFunctionalVidPnArg->hRecommendedFunctionalVidPn, DXGK_VIDPN_INTERFACE_VERSION_V1, &pVidPnInterface);
     2007    Assert(Status == STATUS_SUCCESS);
    19722008    if (Status == STATUS_SUCCESS)
    19732009    {
    1974         D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology;
    1975         const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface;
    1976         Status = pVidPnInterface->pfnGetTopology(pRecommendFunctionalVidPnArg->hRecommendedFunctionalVidPn, &hVidPnTopology, &pVidPnTopologyInterface);
    1977         if (Status == STATUS_SUCCESS)
    1978         {
    1979             D3DKMDT_VIDPN_PRESENT_PATH *pNewVidPnPresentPathInfo;
    1980             Status = pVidPnTopologyInterface->pfnCreateNewPathInfo(hVidPnTopology, &pNewVidPnPresentPathInfo);
    1981             if (Status == STATUS_SUCCESS)
    1982             {
    1983                 pNewVidPnPresentPathInfo->VidPnSourceId = 0;
    1984                 pNewVidPnPresentPathInfo->VidPnTargetId = 0;
    1985                 pNewVidPnPresentPathInfo->ImportanceOrdinal = D3DKMDT_VPPI_PRIMARY;
    1986                 pNewVidPnPresentPathInfo->ContentTransformation.Scaling = D3DKMDT_VPPS_IDENTITY;
    1987                 memset(&pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport,
    1988                         0, sizeof (pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport));
    1989                 pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport.Identity = 1;
    1990                 pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport.Centered = 1;
    1991                 pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport.Stretched = 0;
    1992                 pNewVidPnPresentPathInfo->ContentTransformation.Rotation = D3DKMDT_VPPR_IDENTITY;
    1993                 pNewVidPnPresentPathInfo->ContentTransformation.RotationSupport.Identity = 1;
    1994                 pNewVidPnPresentPathInfo->ContentTransformation.RotationSupport.Rotate180 = 0;
    1995                 pNewVidPnPresentPathInfo->ContentTransformation.RotationSupport.Rotate270 = 0;
    1996                 pNewVidPnPresentPathInfo->ContentTransformation.RotationSupport.Rotate90 = 0;
    1997                 pNewVidPnPresentPathInfo->VisibleFromActiveTLOffset.cx = 0;
    1998                 pNewVidPnPresentPathInfo->VisibleFromActiveTLOffset.cy = 0;
    1999                 pNewVidPnPresentPathInfo->VisibleFromActiveBROffset.cx = 0;
    2000                 pNewVidPnPresentPathInfo->VisibleFromActiveBROffset.cy = 0;
    2001                 pNewVidPnPresentPathInfo->VidPnTargetColorBasis = D3DKMDT_CB_SRGB; /* @todo: how does it matters? */
    2002                 pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.FirstChannel =  8;
    2003                 pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.SecondChannel =  8;
    2004                 pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.ThirdChannel =  8;
    2005                 pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.FourthChannel =  0;
    2006                 pNewVidPnPresentPathInfo->Content = D3DKMDT_VPPC_GRAPHICS;
    2007                 pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionType = D3DKMDT_VPPMT_NOPROTECTION;
    2008                 pNewVidPnPresentPathInfo->CopyProtection.APSTriggerBits = 0;
    2009                 memset(&pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionSupport, 0, sizeof (pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionSupport));
    2010                 pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionSupport.NoProtection  = 1;
    2011                 pNewVidPnPresentPathInfo->GammaRamp.Type = D3DDDI_GAMMARAMP_DEFAULT;
    2012                 pNewVidPnPresentPathInfo->GammaRamp.DataSize = 0;
    2013                 Status = pVidPnTopologyInterface->pfnAddPath(hVidPnTopology, pNewVidPnPresentPathInfo);
    2014                 if (Status == STATUS_SUCCESS)
    2015                 {
    2016                     D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet;
    2017                     const DXGK_VIDPNSOURCEMODESET_INTERFACE *pVidPnSourceModeSetInterface;
    2018                     Status = pVidPnInterface->pfnCreateNewSourceModeSet(pRecommendFunctionalVidPnArg->hRecommendedFunctionalVidPn,
    2019                                     0, /*__in CONST D3DDDI_VIDEO_PRESENT_SOURCE_ID  VidPnSourceId */
    2020                                     &hNewVidPnSourceModeSet,
    2021                                     &pVidPnSourceModeSetInterface);
    2022                     if (Status == STATUS_SUCCESS)
    2023                     {
    2024                         D3DKMDT_VIDPN_SOURCE_MODE *pNewVidPnSourceModeInfo;
    2025                         Status = pVidPnSourceModeSetInterface->pfnCreateNewModeInfo(hNewVidPnSourceModeSet, &pNewVidPnSourceModeInfo);
    2026                         if (Status == STATUS_SUCCESS)
    2027                         {
    2028                             D3DKMDT_VIDEO_PRESENT_SOURCE_MODE_ID modeId = pNewVidPnSourceModeInfo->Id;
    2029                             pNewVidPnSourceModeInfo->Type = D3DKMDT_RMT_GRAPHICS;
    2030                             /* @todo: should we obtain the default mode from the host? */
    2031                             pNewVidPnSourceModeInfo->Format.Graphics.PrimSurfSize.cx = 1024;
    2032                             pNewVidPnSourceModeInfo->Format.Graphics.PrimSurfSize.cy = 768;
    2033                             pNewVidPnSourceModeInfo->Format.Graphics.VisibleRegionSize = pNewVidPnSourceModeInfo->Format.Graphics.PrimSurfSize;
    2034                             pNewVidPnSourceModeInfo->Format.Graphics.Stride = pNewVidPnSourceModeInfo->Format.Graphics.PrimSurfSize.cx * 4;
    2035                             pNewVidPnSourceModeInfo->Format.Graphics.PixelFormat = D3DDDIFMT_X8R8G8B8;
    2036                             pNewVidPnSourceModeInfo->Format.Graphics.ColorBasis = D3DKMDT_CB_SRGB;
    2037                             pNewVidPnSourceModeInfo->Format.Graphics.PixelValueAccessMode = D3DKMDT_PVAM_DIRECT;
    2038                             Status = pVidPnSourceModeSetInterface->pfnAddMode(hNewVidPnSourceModeSet, pNewVidPnSourceModeInfo);
    2039                             if (Status == STATUS_SUCCESS)
    2040                             {
    2041                                 Status = pVidPnSourceModeSetInterface->pfnPinMode(hNewVidPnSourceModeSet, modeId);
    2042                                 if (Status == STATUS_SUCCESS)
    2043                                 {
    2044                                     D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet;
    2045                                     CONST DXGK_VIDPNTARGETMODESET_INTERFACE *pVidPnTargetModeSetInterface;
    2046                                     Status = pVidPnInterface->pfnCreateNewTargetModeSet(pRecommendFunctionalVidPnArg->hRecommendedFunctionalVidPn,
    2047                                                 0, /* __in CONST D3DDDI_VIDEO_PRESENT_TARGET_ID  VidPnTargetId */
    2048                                                 &hNewVidPnTargetModeSet,
    2049                                                 &pVidPnTargetModeSetInterface);
    2050                                     if (Status == STATUS_SUCCESS)
    2051                                     {
    2052                                         D3DKMDT_VIDPN_TARGET_MODE *pNewVidPnTargetModeInfo;
    2053                                         Status = pVidPnTargetModeSetInterface->pfnCreateNewModeInfo(hNewVidPnTargetModeSet, &pNewVidPnTargetModeInfo);
    2054                                         if (Status == STATUS_SUCCESS)
    2055                                         {
    2056                                             D3DKMDT_VIDEO_PRESENT_TARGET_MODE_ID targetId = pNewVidPnTargetModeInfo->Id;
    2057                                             pNewVidPnTargetModeInfo->VideoSignalInfo.VideoStandard = D3DKMDT_VSS_OTHER;
    2058                                             pNewVidPnTargetModeInfo->VideoSignalInfo.TotalSize.cx = 1024;
    2059                                             pNewVidPnTargetModeInfo->VideoSignalInfo.TotalSize.cy = 768;
    2060                                             pNewVidPnTargetModeInfo->VideoSignalInfo.ActiveSize = pNewVidPnTargetModeInfo->VideoSignalInfo.TotalSize;
    2061                                             pNewVidPnTargetModeInfo->VideoSignalInfo.VSyncFreq.Numerator = 60;
    2062                                             pNewVidPnTargetModeInfo->VideoSignalInfo.VSyncFreq.Denominator = 1;
    2063                                             pNewVidPnTargetModeInfo->VideoSignalInfo.HSyncFreq.Numerator = 63 * 768; /* @todo: do we need that? */
    2064                                             pNewVidPnTargetModeInfo->VideoSignalInfo.HSyncFreq.Denominator = 1;
    2065                                             pNewVidPnTargetModeInfo->VideoSignalInfo.PixelRate = 165000; /* ?? */
    2066                                             pNewVidPnTargetModeInfo->VideoSignalInfo.ScanLineOrdering = D3DDDI_VSSLO_PROGRESSIVE;
    2067                                             pNewVidPnTargetModeInfo->Preference = D3DKMDT_MP_PREFERRED;
    2068                                             Status = pVidPnTargetModeSetInterface->pfnAddMode(hNewVidPnTargetModeSet, pNewVidPnTargetModeInfo);
    2069                                             if (Status == STATUS_SUCCESS)
    2070                                             {
    2071                                                 Status = pVidPnTargetModeSetInterface->pfnPinMode(hNewVidPnTargetModeSet, targetId);
    2072                                                 if (Status == STATUS_SUCCESS)
    2073                                                 {
    2074 
    2075                                                 }
    2076                                                 else
    2077                                                 {
    2078                                                     drprintf(("VBoxVideoWddm: pfnPinMode (target) failed Status(0x%x)\n"));
    2079                                                 }
    2080                                             }
    2081                                             else
    2082                                             {
    2083                                                 drprintf(("VBoxVideoWddm: pfnAddMode (target) failed Status(0x%x)\n"));
    2084                                                 pVidPnTargetModeSetInterface->pfnReleaseModeInfo(hNewVidPnTargetModeSet, pNewVidPnTargetModeInfo);
    2085                                                 pNewVidPnTargetModeInfo = NULL;
    2086                                             }
    2087                                         }
    2088                                         else
    2089                                         {
    2090                                             drprintf(("VBoxVideoWddm: pfnCreateNewModeInfo (target) failed Status(0x%x)\n"));
    2091                                         }
    2092                                     }
    2093                                     else
    2094                                     {
    2095                                         drprintf(("VBoxVideoWddm: pfnCreateNewTargetModeSet failed Status(0x%x)\n"));
    2096                                     }
    2097                                 }
    2098                                 else
    2099                                 {
    2100                                     drprintf(("VBoxVideoWddm: pfnPinMode failed Status(0x%x)\n"));
    2101                                 }
    2102                             }
    2103                             else
    2104                             {
    2105                                 drprintf(("VBoxVideoWddm: pfnAddMode failed Status(0x%x)\n"));
    2106                                 pVidPnSourceModeSetInterface->pfnReleaseModeInfo(hNewVidPnSourceModeSet, pNewVidPnSourceModeInfo);
    2107                                 pNewVidPnSourceModeInfo = NULL;
    2108                             }
    2109                         }
    2110                         else
    2111                         {
    2112                             drprintf(("VBoxVideoWddm: pfnCreateNewModeInfo failed Status(0x%x)\n"));
    2113                         }
    2114                     }
    2115                     else
    2116                     {
    2117                         drprintf(("VBoxVideoWddm: pfnCreateNewSourceModeSet failed Status(0x%x)\n"));
    2118                     }
    2119                 }
    2120                 else
    2121                 {
    2122                     drprintf(("VBoxVideoWddm: pfnAddPath failed Status(0x%x)\n"));
    2123                     pVidPnTopologyInterface->pfnReleasePathInfo(hVidPnTopology, pNewVidPnPresentPathInfo);
    2124                     pNewVidPnPresentPathInfo = NULL;
    2125                 }
    2126             }
    2127             else
    2128             {
    2129                 drprintf(("VBoxVideoWddm: pfnCreateNewPathInfo failed Status(0x%x)\n"));
    2130             }
    2131         }
    2132         else
    2133         {
    2134             drprintf(("VBoxVideoWddm: pfnGetTopology failed Status(0x%x)\n"));
    2135         }
     2010        D3DKMDT_2DREGION PrefRegion;
     2011        PrefRegion.cx = pModes[iPreferredMode].VisScreenHeight;
     2012        PrefRegion.cy = pModes[iPreferredMode].VisScreenWidth;
     2013        Status = vboxVidPnCreatePopulateVidPnFromLegacy(pDevExt, pRecommendFunctionalVidPnArg->hRecommendedFunctionalVidPn, pVidPnInterface,
     2014#if 0
     2015                pModes, cModes, iPreferredMode,
     2016                pResolutions, cResolutions
     2017#else
     2018                &pModes[iPreferredMode], 1, 0,
     2019                &PrefRegion, 1
     2020#endif
     2021                );
     2022        Assert(Status == STATUS_SUCCESS);
     2023        if (Status != STATUS_SUCCESS)
     2024            drprintf((__FUNCTION__": vboxVidPnCreatePopulateVidPnFromLegacy failed Status(0x%x)\n", Status));
    21362025    }
    21372026    else
    2138     {
    2139         drprintf(("VBoxVideoWddm: DxgkCbQueryVidPnInterface failed Status(0x%x)\n"));
    2140     }
     2027        drprintf((__FUNCTION__": DxgkCbQueryVidPnInterface failed Status(0x%x)\n", Status));
    21412028
    21422029    dfprintf(("<== "__FUNCTION__ ", status(0x%x), context(0x%x)\n", Status, hAdapter));
     
    21572044    dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter));
    21582045
    2159     vboxVDbgBreakF();
     2046    vboxVDbgBreakFv();
    21602047
    21612048    PDEVICE_EXTENSION pContext = (PDEVICE_EXTENSION)hAdapter;
     
    24192306    dfprintf(("==> "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter));
    24202307
    2421     vboxVDbgBreakF();
     2308    vboxVDbgBreakFv();
    24222309
    24232310    PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)hAdapter;
     
    25632450    dfprintf(("==> "__FUNCTION__ ", hDevice(0x%x)\n", hDevice));
    25642451
     2452    vboxVDbgBreakFv();
     2453
    25652454    vboxWddmMemFree(hDevice);
    25662455
     
    26112500
    26122501    dfprintf(("==> "__FUNCTION__ ", hDevice(0x%x)\n", hDevice));
     2502
     2503    vboxVDbgBreakFv();
    26132504
    26142505    for (UINT i = 0; i < pCloseAllocation->NumAllocations; ++i)
     
    29202811{
    29212812    dfprintf(("==> "__FUNCTION__ ", hContext(0x%x)\n", hContext));
     2813    vboxVDbgBreakFv();
    29222814    vboxWddmMemFree(hContext);
    29232815    dfprintf(("<== "__FUNCTION__ ", hContext(0x%x)\n", hContext));
     
    29342826{
    29352827    drprintf(("==> "__FUNCTION__ ", MiniportDeviceContext(0x%x)\n", MiniportDeviceContext));
     2828    vboxVDbgBreakFv();
    29362829    AssertBreakpoint();
    29372830    drprintf(("<== "__FUNCTION__ ", MiniportDeviceContext(0x%x)\n", MiniportDeviceContext));
     
    29472840{
    29482841    dfprintf(("==> "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter));
     2842    vboxVDbgBreakFv();
    29492843    AssertBreakpoint();
    29502844    dfprintf(("<== "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter));
     
    29552849{
    29562850    dfprintf(("==> "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter));
     2851    vboxVDbgBreakFv();
    29572852    AssertBreakpoint();
    29582853    dfprintf(("<== "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter));
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette