VirtualBox

Ignore:
Timestamp:
Jan 26, 2010 4:45:43 PM (15 years ago)
Author:
vboxsync
Message:

wddm: more impl

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.h

    r26050 r26052  
    505505        D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet, const DXGK_VIDPNTARGETMODESET_INTERFACE *pVidPnTargetModeSetInterface,
    506506        BOOLEAN *pbSupported);
     507
     508/* !!!NOTE: The callback is responsible for releasing the path */
     509typedef DECLCALLBACK(BOOLEAN) FNVBOXVIDPNENUMPATHS(PDEVICE_EXTENSION pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn,
     510        D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface,
     511        const D3DKMDT_VIDPN_PRESENT_PATH *pNewVidPnPresentPathInfo, PVOID pContext);
     512typedef FNVBOXVIDPNENUMPATHS *PFNVBOXVIDPNENUMPATHS;
     513
     514DECLCALLBACK(BOOLEAN) vboxVidPnAdjustSourcesTargetsCallback(PDEVICE_EXTENSION pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn,
     515        D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface,
     516        const D3DKMDT_VIDPN_PRESENT_PATH *pNewVidPnPresentPathInfo, PVOID pContext);
     517
     518NTSTATUS vboxVidPnEnumPaths(PDEVICE_EXTENSION pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn,
     519        D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface,
     520        PFNVBOXVIDPNENUMPATHS pfnCallback, PVOID pContext);
    507521#endif
    508522
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVidPn.cpp

    r26050 r26052  
    357357    return Status;
    358358}
     359
     360DECLCALLBACK(BOOLEAN) vboxVidPnAdjustSourcesTargetsCallback(PDEVICE_EXTENSION pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn,
     361        D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface,
     362        const D3DKMDT_VIDPN_PRESENT_PATH *pNewVidPnPresentPathInfo, PVOID pContext)
     363{
     364
     365    pVidPnTopologyInterface->pfnReleasePathInfo(hVidPnTopology, pNewVidPnPresentPathInfo);
     366    return TRUE;
     367}
     368
     369NTSTATUS vboxVidPnEnumPaths(PDEVICE_EXTENSION pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn,
     370        D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface,
     371        PFNVBOXVIDPNENUMPATHS pfnCallback, PVOID pContext)
     372{
     373    const D3DKMDT_VIDPN_PRESENT_PATH *pNewVidPnPresentPathInfo = NULL;
     374    NTSTATUS Status = pVidPnTopologyInterface->pfnAcquireFirstPathInfo(hVidPnTopology, &pNewVidPnPresentPathInfo);
     375    if (Status == STATUS_SUCCESS)
     376    {
     377        while (pNewVidPnPresentPathInfo)
     378        {
     379            const D3DKMDT_VIDPN_PRESENT_PATH *pNextVidPnPresentPathInfo;
     380            Status = pVidPnTopologyInterface->pfnAcquireNextPathInfo(hVidPnTopology, pNewVidPnPresentPathInfo, &pNextVidPnPresentPathInfo);
     381
     382            if (!pfnCallback(pDevExt, hDesiredVidPn, hVidPnTopology, pVidPnTopologyInterface, pNewVidPnPresentPathInfo, pContext))
     383            {
     384                Assert(Status == STATUS_SUCCESS);
     385                if (Status == STATUS_SUCCESS)
     386                {
     387                    pVidPnTopologyInterface->pfnReleasePathInfo(hVidPnTopology, pNextVidPnPresentPathInfo);
     388                }
     389                else
     390                {
     391                    drprintf((__FUNCTION__": pfnAcquireNextPathInfo Failed Status(0x%x), ignored since callback returned false\n", Status));
     392                }
     393
     394                break;
     395            }
     396            else if (Status == STATUS_SUCCESS)
     397            {
     398                pNewVidPnPresentPathInfo = pNextVidPnPresentPathInfo;
     399            }
     400            else
     401            {
     402                AssertBreakpoint();
     403                drprintf((__FUNCTION__": pfnAcquireNextPathInfo Failed Status(0x%x)\n", Status));
     404                pNewVidPnPresentPathInfo = NULL;
     405                break;
     406            }
     407        }
     408    }
     409
     410    return Status;
     411}
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp

    r26050 r26052  
    874874    )
    875875{
     876    /* The DxgkDdiEnumVidPnCofuncModality function should be made pageable. */
     877    PAGED_CODE();
     878
     879    dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter));
     880
     881    PDEVICE_EXTENSION pContext = (PDEVICE_EXTENSION)hAdapter;
     882
     883    const DXGK_VIDPN_INTERFACE* pVidPnInterface = NULL;
     884    NTSTATUS Status = pContext->u.primary.DxgkInterface.DxgkCbQueryVidPnInterface(pEnumCofuncModalityArg->hConstrainingVidPn, DXGK_VIDPN_INTERFACE_VERSION_V1, &pVidPnInterface);
     885    if (Status == STATUS_SUCCESS)
     886    {
     887        D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology;
     888        const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface;
     889        NTSTATUS Status = pVidPnInterface->pfnGetTopology(pEnumCofuncModalityArg->hConstrainingVidPn, &hVidPnTopology, &pVidPnTopologyInterface);
     890        Assert(Status == STATUS_SUCCESS);
     891        if (Status == STATUS_SUCCESS)
     892        {
     893            Status = vboxVidPnEnumPaths(pContext, pEnumCofuncModalityArg->hConstrainingVidPn,
     894                    hVidPnTopology, pVidPnTopologyInterface,
     895                    vboxVidPnAdjustSourcesTargetsCallback, (PVOID)pEnumCofuncModalityArg);
     896            Assert(Status == STATUS_SUCCESS);
     897            if (Status != STATUS_SUCCESS)
     898                drprintf((__FUNCTION__ ": vboxVidPnEnumPaths failed Status(0x%x)\n"));
     899        }
     900        else
     901            drprintf((__FUNCTION__ ": pfnGetTopology failed Status(0x%x)\n"));
     902    }
     903    else
     904        drprintf((__FUNCTION__ ": DxgkCbQueryVidPnInterface failed Status(0x%x)\n"));
     905
     906    dfprintf(("<== "__FUNCTION__ ", status(0x%x), context(0x%x)\n", Status, hAdapter));
     907
    876908    return STATUS_NOT_IMPLEMENTED;
    877909}
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