VBoxMPVidPn.cpp revision 635c83753ed04cf3637e019af0e15ba40e07f2fe
/* $Id$ */
/** @file
* VBox WDDM Miniport driver
*/
/*
* Copyright (C) 2011-2013 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#include "VBoxMPWddm.h"
#include "VBoxMPVidPn.h"
#include "common/VBoxMPCommon.h"
{
switch (pInfo->BitsPerPlane)
{
case 32:
if(!(pInfo->AttributeFlags & VIDEO_MODE_PALETTE_DRIVEN) && !(pInfo->AttributeFlags & VIDEO_MODE_MANAGED_PALETTE))
{
return D3DDDIFMT_A8R8G8B8;
WARN(("unsupported format: bpp(%d), rmask(%d), gmask(%d), bmask(%d)",
}
else
{
}
break;
case 24:
if(!(pInfo->AttributeFlags & VIDEO_MODE_PALETTE_DRIVEN) && !(pInfo->AttributeFlags & VIDEO_MODE_MANAGED_PALETTE))
{
return D3DDDIFMT_R8G8B8;
WARN(("unsupported format: bpp(%d), rmask(%d), gmask(%d), bmask(%d)",
}
else
{
}
break;
case 16:
if(!(pInfo->AttributeFlags & VIDEO_MODE_PALETTE_DRIVEN) && !(pInfo->AttributeFlags & VIDEO_MODE_MANAGED_PALETTE))
{
return D3DDDIFMT_R5G6B5;
WARN(("unsupported format: bpp(%d), rmask(%d), gmask(%d), bmask(%d)",
}
else
{
}
break;
case 8:
if((pInfo->AttributeFlags & VIDEO_MODE_PALETTE_DRIVEN) && (pInfo->AttributeFlags & VIDEO_MODE_MANAGED_PALETTE))
{
return D3DDDIFMT_P8;
}
else
{
}
break;
default:
break;
}
return D3DDDIFMT_UNKNOWN;
}
static int vboxWddmResolutionFind(const D3DKMDT_2DREGION *pResolutions, int cResolutions, const D3DKMDT_2DREGION *pRes)
{
for (int i = 0; i < cResolutions; ++i)
{
return i;
}
return -1;
}
static bool vboxWddmVideoModesMatch(const VIDEO_MODE_INFORMATION *pMode1, const VIDEO_MODE_INFORMATION *pMode2)
{
}
static int vboxWddmVideoModeFind(const VIDEO_MODE_INFORMATION *pModes, int cModes, const VIDEO_MODE_INFORMATION *pM)
{
for (int i = 0; i < cModes; ++i)
{
return i;
}
return -1;
}
const RTRECTSIZE *pResolution,
{
return Status;
}
BOOLEAN vboxVidPnMatchVideoSignal(const D3DKMDT_VIDEO_SIGNAL_INFO *pVsi1, const D3DKMDT_VIDEO_SIGNAL_INFO *pVsi2)
{
return FALSE;
return FALSE;
return FALSE;
return FALSE;
return FALSE;
return FALSE;
return FALSE;
return FALSE;
return FALSE;
return FALSE;
return FALSE;
return TRUE;
}
const RTRECTSIZE *pSize)
{
/* this is a graphics mode */
pNewVidPnSourceModeInfo->Format.Graphics.VisibleRegionSize = pNewVidPnSourceModeInfo->Format.Graphics.PrimSurfSize;
else
}
const RTRECTSIZE *pResolution)
{
vboxVidPnPopulateVideoSignalInfo(&pMonitorSourceMode->VideoSignalInfo, pResolution, 60 /* ULONG VSync */);
}
static NTSTATUS vboxVidPnPopulateTargetModeInfo(D3DKMDT_VIDPN_TARGET_MODE *pNewVidPnTargetModeInfo, const RTRECTSIZE *pResolution)
{
return vboxVidPnPopulateVideoSignalInfo(&pNewVidPnTargetModeInfo->VideoSignalInfo, pResolution, 60 /* ULONG VSync */);
}
void VBoxVidPnStTargetCleanup(PVBOXWDDM_SOURCE paSources, uint32_t cScreens, PVBOXWDDM_TARGET pTarget)
{
return;
if (!pSource)
return;
}
void VBoxVidPnStSourceTargetAdd(PVBOXWDDM_SOURCE paSources, uint32_t cScreens, PVBOXWDDM_SOURCE pSource, PVBOXWDDM_TARGET pTarget)
{
return;
}
void VBoxVidPnStTIterInit(PVBOXWDDM_SOURCE pSource, PVBOXWDDM_TARGET paTargets, uint32_t cTargets, VBOXWDDM_TARGET_ITER *pIter)
{
pIter->i = 0;
pIter->c = 0;
}
{
return NULL;
if (i < 0)
STOP_FATAL();
pIter->c++;
}
void VBoxVidPnStSourceCleanup(PVBOXWDDM_SOURCE paSources, D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId, PVBOXWDDM_TARGET paTargets, uint32_t cTargets)
{
{
/* iterator is not safe wrt target removal, reinit it */
}
}
{
{
}
}
void VBoxVidPnAllocDataInit(VBOXWDDM_ALLOC_DATA *pData, D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId)
{
}
void VBoxVidPnSourceInit(PVBOXWDDM_SOURCE pSource, const D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId)
{
}
void VBoxVidPnTargetInit(PVBOXWDDM_TARGET pTarget, const D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId)
{
}
{
VBoxVidPnSourceInit(&pSources[i], i);
}
{
VBoxVidPnTargetInit(&pTargets[i], i);
}
{
}
{
}
{
}
{
}
static D3DKMDT_ENUMCOFUNCMODALITY_PIVOT_TYPE vboxVidPnCofuncModalityCurrentPathPivot(D3DKMDT_ENUMCOFUNCMODALITY_PIVOT_TYPE enmPivot,
const DXGK_ENUM_PIVOT *pPivot,
{
switch (enmPivot)
{
case D3DKMDT_EPT_VIDPNSOURCE:
return D3DKMDT_EPT_VIDPNSOURCE;
{
#ifdef DEBUG_misha
AssertFailed();
#endif
return D3DKMDT_EPT_VIDPNSOURCE;
}
return D3DKMDT_EPT_NOPIVOT;
case D3DKMDT_EPT_VIDPNTARGET:
return D3DKMDT_EPT_VIDPNTARGET;
{
#ifdef DEBUG_misha
AssertFailed();
#endif
return D3DKMDT_EPT_VIDPNTARGET;
}
return D3DKMDT_EPT_NOPIVOT;
case D3DKMDT_EPT_SCALING:
case D3DKMDT_EPT_ROTATION:
case D3DKMDT_EPT_NOPIVOT:
return D3DKMDT_EPT_NOPIVOT;
default:
WARN(("unexpected pivot"));
return D3DKMDT_EPT_NOPIVOT;
}
}
NTSTATUS vboxVidPnQueryPinnedTargetMode(D3DKMDT_HVIDPN hVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface,
{
if (!NT_SUCCESS(Status))
{
return Status;
}
Status = pCurVidPnTargetModeSetInterface->pfnAcquirePinnedModeInfo(hCurVidPnTargetModeSet, &pPinnedVidPnTargetModeInfo);
{
}
else if (!NT_SUCCESS(Status))
{
}
else
{
NTSTATUS tmpStatus = pCurVidPnTargetModeSetInterface->pfnReleaseModeInfo(hCurVidPnTargetModeSet, pPinnedVidPnTargetModeInfo);
}
return Status;
}
NTSTATUS vboxVidPnQueryPinnedSourceMode(D3DKMDT_HVIDPN hVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface,
{
if (!NT_SUCCESS(Status))
{
return Status;
}
Status = pCurVidPnSourceModeSetInterface->pfnAcquirePinnedModeInfo(hCurVidPnSourceModeSet, &pPinnedVidPnSourceModeInfo);
{
}
else if (!NT_SUCCESS(Status))
{
}
else
{
NTSTATUS tmpStatus = pCurVidPnSourceModeSetInterface->pfnReleaseModeInfo(hCurVidPnSourceModeSet, pPinnedVidPnSourceModeInfo);
}
return Status;
}
{
{
if (RT_FAILURE(rc))
{
return STATUS_UNSUCCESSFUL;
}
}
return VBoxVidPnSourceModeIterStatus(&Iter);
}
const CR_SORTARRAY *pArray)
{
{
if (!NT_SUCCESS(Status))
{
return Status;
}
if (!NT_SUCCESS(Status))
{
return Status;
}
}
return STATUS_SUCCESS;
}
{
{
if (RT_FAILURE(rc))
{
return STATUS_UNSUCCESSFUL;
}
}
return VBoxVidPnTargetModeIterStatus(&Iter);
}
const CR_SORTARRAY *pArray)
{
{
if (!NT_SUCCESS(Status))
{
return Status;
}
if (!NT_SUCCESS(Status))
{
return Status;
}
}
return STATUS_SUCCESS;
}
{
{
if (RT_FAILURE(rc))
{
return STATUS_UNSUCCESSFUL;
}
}
return VBoxVidPnMonitorModeIterStatus(&Iter);
}
const CR_SORTARRAY *pArray)
{
{
if (!NT_SUCCESS(Status))
{
return Status;
}
if (!NT_SUCCESS(Status))
{
return Status;
}
}
return STATUS_SUCCESS;
}
const DXGK_VIDPN_INTERFACE* pVidPnInterface,
{
if (enmCurPivot == D3DKMDT_EPT_VIDPNTARGET)
{
if (!NT_SUCCESS(Status))
{
return Status;
}
/* intersect modes from target */
{
Status = vboxVidPnTargetModeSetToArray(hVidPnModeSet, pVidPnModeSetInterface, &aModes[VidPnTargetId]);
}
else
{
Status = vboxVidPnTargetModeSetToArray(hVidPnModeSet, pVidPnModeSetInterface, &aModes[VidPnTargetId]);
CrSaCleanup(&Arr);
}
if (!NT_SUCCESS(Status))
{
return Status;
}
return STATUS_SUCCESS;
}
RTRECTSIZE pinnedSize = {0};
if (!NT_SUCCESS(Status))
{
return Status;
}
if (pinnedSize.cx)
{
{
if (!RT_SUCCESS(rc))
{
return STATUS_UNSUCCESSFUL;
}
}
else
{
if (!RT_SUCCESS(rc))
{
return STATUS_UNSUCCESSFUL;
}
}
return STATUS_SUCCESS;
}
if (!NT_SUCCESS(Status))
{
return Status;
}
if (pinnedSize.cx)
{
{
{
if (!RT_SUCCESS(rc))
{
return STATUS_UNSUCCESSFUL;
}
}
}
else
{
{
if (!RT_SUCCESS(rc))
{
return STATUS_UNSUCCESSFUL;
}
}
}
return STATUS_SUCCESS;
}
/* now we are here because no pinned info is specified, we need to populate it based on the supported info
* and modes already configured,
* this is pretty simple actually */
{
if (!RT_SUCCESS(rc))
{
return STATUS_UNSUCCESSFUL;
}
}
else
{
}
/* we are done */
return STATUS_SUCCESS;
}
const DXGK_VIDPN_INTERFACE* pVidPnInterface,
const CR_SORTARRAY *aModes,
{
if (enmCurPivot == D3DKMDT_EPT_VIDPNTARGET)
return STATUS_SUCCESS;
RTRECTSIZE pinnedSize = {0};
NTSTATUS Status = vboxVidPnQueryPinnedTargetMode(hVidPn, pVidPnInterface, VidPnTargetId, &pinnedSize);
if (!NT_SUCCESS(Status))
{
return Status;
}
if (pinnedSize.cx)
return STATUS_SUCCESS;
/* now just create the new source mode set and apply it */
if (!NT_SUCCESS(Status))
{
return Status;
}
&aModes[VidPnTargetId]);
if (!NT_SUCCESS(Status))
{
return Status;
}
if (!NT_SUCCESS(Status))
{
return Status;
}
return STATUS_SUCCESS;
}
const DXGK_VIDPN_INTERFACE* pVidPnInterface,
const CR_SORTARRAY *aModes,
{
if (enmCurPivot == D3DKMDT_EPT_VIDPNSOURCE)
return STATUS_SUCCESS;
RTRECTSIZE pinnedSize = {0};
NTSTATUS Status = vboxVidPnQueryPinnedSourceMode(hVidPn, pVidPnInterface, VidPnSourceId, &pinnedSize);
if (!NT_SUCCESS(Status))
{
return Status;
}
if (pinnedSize.cx)
return STATUS_SUCCESS;
/* now just create the new source mode set and apply it */
if (!NT_SUCCESS(Status))
{
return Status;
}
if (!NT_SUCCESS(Status))
{
return Status;
}
if (!NT_SUCCESS(Status))
{
return Status;
}
return STATUS_SUCCESS;
}
const DXGK_VIDPN_INTERFACE* pVidPnInterface,
{
const CR_SORTARRAY* pSupportedModes = VBoxWddmVModesGet(pDevExt, VidPnTargetId); /* <- yes, modes are target-determined always */
if (enmCurPivot == D3DKMDT_EPT_VIDPNSOURCE)
{
if (!NT_SUCCESS(Status))
{
return Status;
}
/* intersect modes from target */
{
Status = vboxVidPnSourceModeSetToArray(hVidPnModeSet, pVidPnModeSetInterface, &aModes[VidPnTargetId]);
}
else
{
Status = vboxVidPnSourceModeSetToArray(hVidPnModeSet, pVidPnModeSetInterface, &aModes[VidPnTargetId]);
CrSaCleanup(&Arr);
}
if (!NT_SUCCESS(Status))
{
return Status;
}
/* intersect it with supported target modes, just in case */
return STATUS_SUCCESS;
}
RTRECTSIZE pinnedSize = {0};
if (!NT_SUCCESS(Status))
{
return Status;
}
if (pinnedSize.cx)
{
{
{
if (!RT_SUCCESS(rc))
{
return STATUS_UNSUCCESSFUL;
}
}
}
else
{
{
if (!RT_SUCCESS(rc))
{
return STATUS_UNSUCCESSFUL;
}
}
}
return STATUS_SUCCESS;
}
if (!NT_SUCCESS(Status))
{
return Status;
}
if (pinnedSize.cx)
{
{
if (!RT_SUCCESS(rc))
{
return STATUS_UNSUCCESSFUL;
}
}
else
{
if (!RT_SUCCESS(rc))
{
return STATUS_UNSUCCESSFUL;
}
}
return STATUS_SUCCESS;
}
/* now we are here because no pinned info is specified, we need to populate it based on the supported info
* and modes already configured,
* this is pretty simple actually */
{
if (!RT_SUCCESS(rc))
{
return STATUS_UNSUCCESSFUL;
}
}
else
{
}
/* we are done */
return STATUS_SUCCESS;
}
{
Status = pDevExt->u.primary.DxgkInterface.DxgkCbQueryMonitorInterface(pDevExt->u.primary.DxgkInterface.DeviceHandle, DXGK_MONITOR_INTERFACE_VERSION_V1, &pMonitorInterface);
if (!NT_SUCCESS(Status))
{
return Status;
}
if (!RT_SUCCESS(rc))
{
WARN(("CrSaInit failed"));
return STATUS_NO_MEMORY;
}
Status = pMonitorInterface->pfnAcquireMonitorSourceModeSet(pDevExt->u.primary.DxgkInterface.DeviceHandle,
if (!NT_SUCCESS(Status))
{
// if (Status == STATUS_GRAPHICS_MONITOR_NOT_CONNECTED)
return Status;
}
if (!RT_SUCCESS(rc))
{
WARN(("CrSaClone failed"));
goto done;
}
{
}
if (!NT_SUCCESS(Status))
{
goto done;
}
if (!NT_SUCCESS(Status))
{
goto done;
}
done:
NTSTATUS tmpStatus = pMonitorInterface->pfnReleaseMonitorSourceModeSet(pDevExt->u.primary.DxgkInterface.DeviceHandle, hVidPnModeSet);
if (!NT_SUCCESS(tmpStatus))
return Status;
}
static NTSTATUS vboxVidPnPathAdd(D3DKMDT_HVIDPN hVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface,
const D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId, const D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId,
{
NTSTATUS Status = pVidPnInterface->pfnGetTopology(hVidPn, &hVidPnTopology, &pVidPnTopologyInterface);
if (!NT_SUCCESS(Status))
{
AssertFailed();
return Status;
}
if (!NT_SUCCESS(Status))
{
AssertFailed();
return Status;
}
pNewVidPnPresentPathInfo->VidPnTargetColorBasis = D3DKMDT_CB_SRGB; /* @todo: how does it matters? */
// pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionType = D3DKMDT_VPPMT_NOPROTECTION;
memset(&pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionSupport, 0, sizeof (pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionSupport));
// pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionSupport.NoProtection = 1;
// pNewVidPnPresentPathInfo->GammaRamp.Type = D3DDDI_GAMMARAMP_DEFAULT;
// pNewVidPnPresentPathInfo->GammaRamp.DataSize = 0;
if (!NT_SUCCESS(Status))
{
AssertFailed();
NTSTATUS tmpStatus = pVidPnTopologyInterface->pfnReleasePathInfo(hVidPnTopology, pNewVidPnPresentPathInfo);
}
return Status;
}
NTSTATUS VBoxVidPnRecommendMonitorModes(PVBOXMP_DEVEXT pDevExt, D3DDDI_VIDEO_PRESENT_TARGET_ID VideoPresentTargetId,
D3DKMDT_HMONITORSOURCEMODESET hVidPnModeSet, const DXGK_MONITORSOURCEMODESET_INTERFACE *pVidPnModeSetInterface)
{
NTSTATUS Status = vboxVidPnMonitorModeSetFromArray(hVidPnModeSet, pVidPnModeSetInterface, pSupportedModes);
if (!NT_SUCCESS(Status))
{
return Status;
}
return STATUS_SUCCESS;
}
NTSTATUS VBoxVidPnUpdateModes(PVBOXMP_DEVEXT pDevExt, uint32_t u32TargetId, const RTRECTSIZE *pSize)
{
{
WARN(("invalid target id"));
return STATUS_INVALID_PARAMETER;
}
if (RT_FAILURE(rc))
{
return STATUS_UNSUCCESSFUL;
}
if (rc == VINF_ALREADY_INITIALIZED)
{
/* mode was already in list, just return */
return STATUS_SUCCESS;
}
/* modes have changed, need to replug */
if (!NT_SUCCESS(Status))
{
return Status;
}
return STATUS_SUCCESS;
}
NTSTATUS VBoxVidPnRecommendFunctional(PVBOXMP_DEVEXT pDevExt, D3DKMDT_HVIDPN hVidPn, const VBOXWDDM_RECOMMENDVIDPN *pData)
{
NTSTATUS Status = pDevExt->u.primary.DxgkInterface.DxgkCbQueryVidPnInterface(hVidPn, DXGK_VIDPN_INTERFACE_VERSION_V1, &pVidPnInterface);
if (!NT_SUCCESS(Status))
{
return Status;
}
{
if (iSource < 0)
continue;
{
WARN(("invalid iSource"));
return STATUS_INVALID_PARAMETER;
}
{
WARN(("complex topologies not supported!"));
return STATUS_INVALID_PARAMETER;
}
bool fNewSource = false;
{
if (RT_FAILURE(rc))
{
return STATUS_UNSUCCESSFUL;
}
if (!NT_SUCCESS(Status))
{
return Status;
}
fNewSource = true;
}
if (!NT_SUCCESS(Status))
{
return Status;
}
Importance++;
do {
i,
if (NT_SUCCESS(Status))
{
if (NT_SUCCESS(Status))
{
if (NT_SUCCESS(Status))
{
if (NT_SUCCESS(Status))
{
if (NT_SUCCESS(Status))
{
LOG(("Recommended Target[%d] (%dx%d)", i, pData->aSources[iSource].Size.cx, pData->aSources[iSource].Size.cy));
break;
}
else
}
else
}
else
if (pVidPnModeInfo)
{
}
}
else
}
else
return Status;
} while (0);
if (fNewSource)
{
do {
if (NT_SUCCESS(Status))
{
if (NT_SUCCESS(Status))
{
if (NT_SUCCESS(Status))
{
if (NT_SUCCESS(Status))
{
if (NT_SUCCESS(Status))
{
LOG(("Recommended Source[%d] (%dx%d)", iSource, pData->aSources[iSource].Size.cx, pData->aSources[iSource].Size.cy));
break;
}
else
}
else
}
else
if (pVidPnModeInfo)
{
}
}
else
}
else
return Status;
} while (0);
}
}
return STATUS_SUCCESS;
}
static BOOLEAN vboxVidPnIsPathSupported(PVBOXMP_DEVEXT pDevExt, const D3DKMDT_VIDPN_PRESENT_PATH *pNewVidPnPresentPathInfo)
{
if (!pDevExt->fComplexTopologiesEnabled && pNewVidPnPresentPathInfo->VidPnSourceId != pNewVidPnPresentPathInfo->VidPnTargetId)
{
LOG(("unsupported source(%d)->target(%d) pair", pNewVidPnPresentPathInfo->VidPnSourceId, pNewVidPnPresentPathInfo->VidPnTargetId));
return FALSE;
}
/*
ImportanceOrdinal does not matter for now
pNewVidPnPresentPathInfo->ImportanceOrdinal
*/
{
return FALSE;
}
{
WARN(("unsupported Scaling support"));
return FALSE;
}
{
return FALSE;
}
{
WARN(("unsupported RotationSupport"));
return FALSE;
}
{
WARN(("Non-zero TLOffset: cx(%d), cy(%d)",
return FALSE;
}
{
WARN(("Non-zero TLOffset: cx(%d), cy(%d)",
return FALSE;
}
{
return FALSE;
}
/* channels?
pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.FirstChannel;
pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.SecondChannel;
pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.ThirdChannel;
we definitely not support fourth channel
*/
{
WARN(("Non-zero FourthChannel (%d)", pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.FourthChannel));
return FALSE;
}
/* Content (D3DKMDT_VPPC_GRAPHICS, _NOTSPECIFIED, _VIDEO), does not matter for now
pNewVidPnPresentPathInfo->Content
*/
/* not support copy protection for now */
{
WARN(("Copy protection not supported CopyProtectionType(%d)", pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionType));
return FALSE;
}
{
WARN(("Copy protection not supported APSTriggerBits(%d)", pNewVidPnPresentPathInfo->CopyProtection.APSTriggerBits));
return FALSE;
}
if (memcmp(&tstCPSupport, &pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionSupport, sizeof(tstCPSupport)))
{
WARN(("Copy protection support (0x%x)", *((UINT*)&pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionSupport)));
return FALSE;
}
{
return FALSE;
}
{
WARN(("Warning: non-zero GammaRamp.DataSize (%d), treating as supported", pNewVidPnPresentPathInfo->GammaRamp.DataSize));
}
return TRUE;
}
{
*pfSupported = FALSE;
NTSTATUS Status = pDevExt->u.primary.DxgkInterface.DxgkCbQueryVidPnInterface(hVidPn, DXGK_VIDPN_INTERFACE_VERSION_V1, &pVidPnInterface);
if (!NT_SUCCESS(Status))
{
return Status;
}
#ifdef VBOXWDDM_DEBUG_VIDPN
vboxVidPnDumpVidPn(">>>>IsSupported VidPN (IN) : >>>>\n", pDevExt, hVidPn, pVidPnInterface, "<<<<<<<<<<<<<<<<<<<<\n");
#endif
if (!NT_SUCCESS(Status))
{
return Status;
}
const D3DKMDT_VIDPN_PRESENT_PATH * pPath;
CR_SORTARRAY TargetMode = {0};
/* collect info first */
{
/* actually vidpn topology should contain only one target info, right? */
{
fSupported = FALSE;
break;
}
if (!NT_SUCCESS(Status))
{
break;
}
if (!NT_SUCCESS(Status))
{
break;
}
{
if (!SourceSize.cx)
WARN(("not expected?"));
fSupported = FALSE;
break;
}
{
if (!NT_SUCCESS(Status))
{
break;
}
if (!NT_SUCCESS(Status))
{
break;
}
}
{
if (!NT_SUCCESS(Status))
{
break;
}
Status = vboxVidPnSourceModeSetToArray(hVidPnModeSet, pVidPnModeSetInterface, &aModes[VidPnSourceId]);
if (!NT_SUCCESS(Status))
{
break;
}
}
{
WARN(("not expected 2?"));
fSupported = FALSE;
break;
}
#if 0
{
WARN(("not expected 3?"));
fSupported = FALSE;
break;
}
#endif
}
if (!NT_SUCCESS(Status))
goto done;
if (!NT_SUCCESS(Status))
{
goto done;
}
done:
{
CrSaCleanup(&aModes[i]);
}
return Status;
}
NTSTATUS VBoxVidPnCofuncModality(PVBOXMP_DEVEXT pDevExt, D3DKMDT_HVIDPN hVidPn, D3DKMDT_ENUMCOFUNCMODALITY_PIVOT_TYPE enmPivot, const DXGK_ENUM_PIVOT *pPivot)
{
NTSTATUS Status = pDevExt->u.primary.DxgkInterface.DxgkCbQueryVidPnInterface(hVidPn, DXGK_VIDPN_INTERFACE_VERSION_V1, &pVidPnInterface);
if (!NT_SUCCESS(Status))
{
return Status;
}
#ifdef VBOXWDDM_DEBUG_VIDPN
vboxVidPnDumpVidPn(">>>>MODALITY VidPN (IN) : >>>>\n", pDevExt, pEnumCofuncModalityArg->hConstrainingVidPn, pVidPnInterface, "<<<<<<<<<<<<<<<<<<<<\n");
#endif
if (!NT_SUCCESS(Status))
{
return Status;
}
const D3DKMDT_VIDPN_PRESENT_PATH * pPath;
/* collect info first */
{
/* actually vidpn topology should contain only one target info, right? */
D3DKMDT_ENUMCOFUNCMODALITY_PIVOT_TYPE enmCurPivot = vboxVidPnCofuncModalityCurrentPathPivot(enmPivot, pPivot, VidPnSourceId, VidPnTargetId);
if (!NT_SUCCESS(Status))
{
break;
}
if (!NT_SUCCESS(Status))
{
break;
}
}
if (!NT_SUCCESS(Status))
goto done;
if (!NT_SUCCESS(Status))
{
goto done;
}
/* now we have collected all the necessary info,
* go ahead and apply it */
{
/* actually vidpn topology should contain only one target info, right? */
D3DKMDT_ENUMCOFUNCMODALITY_PIVOT_TYPE enmCurPivot = vboxVidPnCofuncModalityCurrentPathPivot(enmPivot, pPivot, VidPnSourceId, VidPnTargetId);
bool bUpdatePath = false;
{
bUpdatePath = true;
}
{
bUpdatePath = true;
}
if (bUpdatePath)
{
if (!NT_SUCCESS(Status))
{
goto done;
}
}
if (!NT_SUCCESS(Status))
{
break;
}
if (!NT_SUCCESS(Status))
{
break;
}
}
if (!NT_SUCCESS(Status))
goto done;
if (!NT_SUCCESS(Status))
{
goto done;
}
done:
{
CrSaCleanup(&aModes[i]);
}
return Status;
}
NTSTATUS vboxVidPnEnumMonitorSourceModes(D3DKMDT_HMONITORSOURCEMODESET hMonitorSMS, CONST DXGK_MONITORSOURCEMODESET_INTERFACE *pMonitorSMSIf,
{
if (Status == STATUS_SUCCESS)
{
while (1)
{
{
if (Status == STATUS_SUCCESS)
else if (Status == STATUS_GRAPHICS_NO_MORE_ELEMENTS_IN_DATASET)
{
break;
}
else
{
LOGREL(("pfnAcquireNextModeInfo Failed Status(0x%x), ignored since callback returned false", Status));
}
break;
}
else if (Status == STATUS_SUCCESS)
else if (Status == STATUS_GRAPHICS_NO_MORE_ELEMENTS_IN_DATASET)
{
break;
}
else
{
break;
}
}
}
else if (Status == STATUS_GRAPHICS_DATASET_IS_EMPTY)
else
return Status;
}
NTSTATUS vboxVidPnEnumSourceModes(D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet, const DXGK_VIDPNSOURCEMODESET_INTERFACE *pVidPnSourceModeSetInterface,
{
NTSTATUS Status = pVidPnSourceModeSetInterface->pfnAcquireFirstModeInfo(hNewVidPnSourceModeSet, &pNewVidPnSourceModeInfo);
if (Status == STATUS_SUCCESS)
{
while (1)
{
Status = pVidPnSourceModeSetInterface->pfnAcquireNextModeInfo(hNewVidPnSourceModeSet, pNewVidPnSourceModeInfo, &pNextVidPnSourceModeInfo);
{
if (Status == STATUS_SUCCESS)
else if (Status == STATUS_GRAPHICS_NO_MORE_ELEMENTS_IN_DATASET)
{
break;
}
else
{
LOGREL(("pfnAcquireNextModeInfo Failed Status(0x%x), ignored since callback returned false", Status));
}
break;
}
else if (Status == STATUS_SUCCESS)
else if (Status == STATUS_GRAPHICS_NO_MORE_ELEMENTS_IN_DATASET)
{
break;
}
else
{
break;
}
}
}
else if (Status == STATUS_GRAPHICS_DATASET_IS_EMPTY)
else
return Status;
}
NTSTATUS vboxVidPnEnumTargetModes(D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet, const DXGK_VIDPNTARGETMODESET_INTERFACE *pVidPnTargetModeSetInterface,
{
NTSTATUS Status = pVidPnTargetModeSetInterface->pfnAcquireFirstModeInfo(hNewVidPnTargetModeSet, &pNewVidPnTargetModeInfo);
if (Status == STATUS_SUCCESS)
{
while (1)
{
Status = pVidPnTargetModeSetInterface->pfnAcquireNextModeInfo(hNewVidPnTargetModeSet, pNewVidPnTargetModeInfo, &pNextVidPnTargetModeInfo);
{
if (Status == STATUS_SUCCESS)
else if (Status == STATUS_GRAPHICS_NO_MORE_ELEMENTS_IN_DATASET)
{
break;
}
else
{
LOGREL(("pfnAcquireNextModeInfo Failed Status(0x%x), ignored since callback returned false", Status));
}
break;
}
else if (Status == STATUS_SUCCESS)
else if (Status == STATUS_GRAPHICS_NO_MORE_ELEMENTS_IN_DATASET)
{
break;
}
else
{
break;
}
}
}
else if (Status == STATUS_GRAPHICS_DATASET_IS_EMPTY)
else
return Status;
}
NTSTATUS vboxVidPnEnumTargetsForSource(PVBOXMP_DEVEXT pDevExt, D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface,
{
NTSTATUS Status = pVidPnTopologyInterface->pfnGetNumPathsFromSource(hVidPnTopology, VidPnSourceId, &cTgtPaths);
if (Status == STATUS_SUCCESS)
{
{
Status = pVidPnTopologyInterface->pfnEnumPathTargetsFromSource(hVidPnTopology, VidPnSourceId, i, &VidPnTargetId);
if (Status == STATUS_SUCCESS)
{
if (!pfnCallback(pDevExt, hVidPnTopology, pVidPnTopologyInterface, VidPnSourceId, VidPnTargetId, cTgtPaths, pContext))
break;
}
else
{
break;
}
}
}
else if (Status != STATUS_GRAPHICS_SOURCE_NOT_IN_TOPOLOGY)
return Status;
}
NTSTATUS vboxVidPnEnumPaths(D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface,
{
NTSTATUS Status = pVidPnTopologyInterface->pfnAcquireFirstPathInfo(hVidPnTopology, &pNewVidPnPresentPathInfo);
if (Status == STATUS_SUCCESS)
{
while (1)
{
Status = pVidPnTopologyInterface->pfnAcquireNextPathInfo(hVidPnTopology, pNewVidPnPresentPathInfo, &pNextVidPnPresentPathInfo);
{
if (Status == STATUS_SUCCESS)
else
{
WARN(("pfnAcquireNextPathInfo Failed Status(0x%x), ignored since callback returned false", Status));
}
break;
}
else if (Status == STATUS_SUCCESS)
else if (Status == STATUS_GRAPHICS_NO_MORE_ELEMENTS_IN_DATASET)
{
break;
}
else
{
break;
}
}
}
else if (Status == STATUS_GRAPHICS_DATASET_IS_EMPTY)
else
return Status;
}
NTSTATUS vboxVidPnSetupSourceInfo(PVBOXMP_DEVEXT pDevExt, CONST D3DKMDT_VIDPN_SOURCE_MODE* pVidPnSourceModeInfo, PVBOXWDDM_ALLOCATION pAllocation,
{
/* pVidPnSourceModeInfo could be null if STATUS_GRAPHICS_MODE_NOT_PINNED,
* see VBoxVidPnCommitSourceModeForSrcId */
if (pVidPnSourceModeInfo)
{
{
}
{
}
{
}
if (pSource->AllocData.SurfDesc.bpp != vboxWddmCalcBitsPerPixel(pVidPnSourceModeInfo->Format.Graphics.PixelFormat))
{
pSource->AllocData.SurfDesc.bpp = vboxWddmCalcBitsPerPixel(pVidPnSourceModeInfo->Format.Graphics.PixelFormat);
}
{
}
{
}
if (pSource->AllocData.SurfDesc.cbSize != pVidPnSourceModeInfo->Format.Graphics.Stride * pVidPnSourceModeInfo->Format.Graphics.PrimSurfSize.cy)
{
pSource->AllocData.SurfDesc.cbSize = pVidPnSourceModeInfo->Format.Graphics.Stride * pVidPnSourceModeInfo->Format.Graphics.PrimSurfSize.cy;
}
#ifdef VBOX_WDDM_WIN8
if (g_VBoxDisplayOnly)
{
}
#endif
}
else
{
}
#ifdef VBOX_WDDM_WIN8
if (!g_VBoxDisplayOnly)
#endif
{
}
return STATUS_SUCCESS;
}
NTSTATUS vboxVidPnCommitSourceMode(PVBOXMP_DEVEXT pDevExt, CONST D3DKMDT_VIDPN_SOURCE_MODE* pVidPnSourceModeInfo, PVBOXWDDM_ALLOCATION pAllocation,
{
return vboxVidPnSetupSourceInfo(pDevExt, pVidPnSourceModeInfo, pAllocation, VidPnSourceId, paSources);
WARN(("invalid srcId (%d), cSources(%d)", VidPnSourceId, VBoxCommonFromDeviceExt(pDevExt)->cDisplays));
return STATUS_INVALID_PARAMETER;
}
typedef struct VBOXVIDPNCOMMITTARGETMODE
{
const DXGK_VIDPN_INTERFACE* pVidPnInterface;
DECLCALLBACK(BOOLEAN) vboxVidPnCommitTargetModeEnum(PVBOXMP_DEVEXT pDevExt, D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface,
CONST D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId, D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId, SIZE_T cTgtPaths, PVOID pContext)
{
NTSTATUS Status = pInfo->pVidPnInterface->pfnAcquireTargetModeSet(pInfo->hVidPn, VidPnTargetId, &hVidPnTargetModeSet, &pVidPnTargetModeSetInterface);
if (Status == STATUS_SUCCESS)
{
Status = pVidPnTargetModeSetInterface->pfnAcquirePinnedModeInfo(hVidPnTargetModeSet, &pPinnedVidPnTargetModeInfo);
if (Status == STATUS_SUCCESS)
{
VBoxVidPnStSourceTargetAdd(pInfo->paSources, VBoxCommonFromDeviceExt(pDevExt)->cDisplays, pSource, pTarget);
}
else
}
else
return Status == STATUS_SUCCESS;
}
NTSTATUS VBoxVidPnCommitSourceModeForSrcId(PVBOXMP_DEVEXT pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface,
D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId, VBOXWDDM_SOURCE *paSources, VBOXWDDM_TARGET *paTargets)
{
VBoxVidPnStTIterInit(pSource, paTargets, (uint32_t)VBoxCommonFromDeviceExt(pDevExt)->cDisplays, &Iter);
{
}
VBoxVidPnStSourceCleanup(paSources, VidPnSourceId, paTargets, (uint32_t)VBoxCommonFromDeviceExt(pDevExt)->cDisplays);
if (Status == STATUS_SUCCESS)
{
Status = pCurVidPnSourceModeSetInterface->pfnAcquirePinnedModeInfo(hCurVidPnSourceModeSet, &pPinnedVidPnSourceModeInfo);
if (Status == STATUS_SUCCESS)
{
Status = vboxVidPnCommitSourceMode(pDevExt, pPinnedVidPnSourceModeInfo, pAllocation, VidPnSourceId, paSources);
if (Status == STATUS_SUCCESS)
{
if (Status == STATUS_SUCCESS)
{
if (Status == STATUS_SUCCESS)
{
}
else if (Status == STATUS_GRAPHICS_SOURCE_NOT_IN_TOPOLOGY)
{
}
else
}
else
}
else
/* release */
pCurVidPnSourceModeSetInterface->pfnReleaseModeInfo(hCurVidPnSourceModeSet, pPinnedVidPnSourceModeInfo);
}
else if (Status == STATUS_GRAPHICS_MODE_NOT_PINNED)
{
}
else
}
else
{
}
return Status;
}
NTSTATUS VBoxVidPnCommitAll(PVBOXMP_DEVEXT pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface,
{
NTSTATUS Status = pVidPnInterface->pfnGetTopology(hDesiredVidPn, &hVidPnTopology, &pVidPnTopologyInterface);
if (!NT_SUCCESS(Status))
{
return Status;
}
{
continue;
Assert(pTarget->VidPnSourceId < (D3DDDI_VIDEO_PRESENT_SOURCE_ID)VBoxCommonFromDeviceExt(pDevExt)->cDisplays);
}
const D3DKMDT_VIDPN_PRESENT_PATH *pPath;
{
if (Status != STATUS_SUCCESS)
{
break;
}
}
if (!NT_SUCCESS(Status))
{
WARN((""));
return Status;
}
if (!NT_SUCCESS(Status))
{
return Status;
}
return STATUS_SUCCESS;
}
#define VBOXVIDPNDUMP_STRCASE(_t) \
#define VBOXVIDPNDUMP_STRCASE_UNKNOWN() \
default: Assert(0); return "Unknown";
{
switch (ImportanceOrdinal)
{
}
}
{
switch (Scaling)
{
}
}
{
switch (Rotation)
{
}
}
{
switch (ColorBasis)
{
}
}
{
switch (PixelValueAccessMode)
{
}
}
{
switch (Content)
{
}
}
const char* vboxVidPnDumpStrCopyProtectionType(D3DKMDT_VIDPN_PRESENT_PATH_COPYPROTECTION_TYPE CopyProtectionType)
{
switch (CopyProtectionType)
{
}
}
{
switch (Type)
{
}
}
{
switch (Type)
{
}
}
const char* vboxVidPnDumpStrScanLineOrdering(D3DDDI_VIDEO_SIGNAL_SCANLINE_ORDERING ScanLineOrdering)
{
switch (ScanLineOrdering)
{
}
}
{
switch (EnumPivotType)
{
}
}
{
switch (Preference)
{
}
}
{
switch (VideoStandard)
{
}
}
{
switch (PixelFormat)
{
}
}
void vboxVidPnDumpCopyProtectoin(const char *pPrefix, const D3DKMDT_VIDPN_PRESENT_PATH_COPYPROTECTION *pCopyProtection, const char *pSuffix)
{
}
void vboxVidPnDumpPathTransformation(const D3DKMDT_VIDPN_PRESENT_PATH_TRANSFORMATION *pContentTransformation)
{
LOGREL_EXACT((" --Transformation: Scaling(%s), ScalingSupport(%d), Rotation(%s), RotationSupport(%d)--",
vboxVidPnDumpStrRotation(pContentTransformation->Rotation), pContentTransformation->RotationSupport));
}
{
}
void vboxVidPnDumpRational(const char *pPrefix, const D3DDDI_RATIONAL *pRational, const char *pSuffix)
{
LOGREL_EXACT(("%s%d/%d=%d%s", pPrefix, pRational->Numerator, pRational->Denominator, pRational->Numerator/pRational->Denominator, pSuffix));
}
void vboxVidPnDumpRanges(const char *pPrefix, const D3DKMDT_COLOR_COEFF_DYNAMIC_RANGES *pDynamicRanges, const char *pSuffix)
{
LOGREL_EXACT(("%sFirstChannel(%d), SecondChannel(%d), ThirdChannel(%d), FourthChannel(%d)%s", pPrefix,
pSuffix));
}
void vboxVidPnDumpGammaRamp(const char *pPrefix, const D3DKMDT_GAMMA_RAMP *pGammaRamp, const char *pSuffix)
{
pSuffix));
}
void vboxVidPnDumpSourceMode(const char *pPrefix, const D3DKMDT_VIDPN_SOURCE_MODE* pVidPnSourceModeInfo, const char *pSuffix)
{
LOGREL_EXACT(("%sType(%s), ", pPrefix, vboxVidPnDumpStrSourceModeType(pVidPnSourceModeInfo->Type)));
LOGREL_EXACT(("format(%s), ", vboxVidPnDumpStrPixFormat(pVidPnSourceModeInfo->Format.Graphics.PixelFormat)));
LOGREL_EXACT(("clrBasis(%s), ", vboxVidPnDumpStrColorBasis(pVidPnSourceModeInfo->Format.Graphics.ColorBasis)));
LOGREL_EXACT(("pvam(%s)%s", vboxVidPnDumpStrPvam(pVidPnSourceModeInfo->Format.Graphics.PixelValueAccessMode), pSuffix));
}
void vboxVidPnDumpSignalInfo(const char *pPrefix, const D3DKMDT_VIDEO_SIGNAL_INFO *pVideoSignalInfo, const char *pSuffix)
{
LOGREL_EXACT(("%sVStd(%s), ", pPrefix, vboxVidPnDumpStrSignalStandard(pVideoSignalInfo->VideoStandard)));
LOGREL_EXACT(("PixelRate(%d), ScanLineOrdering(%s)%s", pVideoSignalInfo->PixelRate, vboxVidPnDumpStrScanLineOrdering(pVideoSignalInfo->ScanLineOrdering), pSuffix));
}
void vboxVidPnDumpTargetMode(const char *pPrefix, const D3DKMDT_VIDPN_TARGET_MODE* CONST pVidPnTargetModeInfo, const char *pSuffix)
{
LOGREL_EXACT(("Preference(%s)%s", vboxVidPnDumpStrModePreference(pVidPnTargetModeInfo->Preference), pSuffix));
}
void vboxVidPnDumpPinnedSourceMode(const D3DKMDT_HVIDPN hVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId)
{
if (Status == STATUS_SUCCESS)
{
Status = pCurVidPnSourceModeSetInterface->pfnAcquirePinnedModeInfo(hCurVidPnSourceModeSet, &pPinnedVidPnSourceModeInfo);
if (Status == STATUS_SUCCESS)
{
pCurVidPnSourceModeSetInterface->pfnReleaseModeInfo(hCurVidPnSourceModeSet, pPinnedVidPnSourceModeInfo);
}
else if (Status == STATUS_GRAPHICS_MODE_NOT_PINNED)
{
LOGREL_EXACT(("Source NOT Pinned\n"));
}
else
{
}
}
else
{
}
}
DECLCALLBACK(BOOLEAN) vboxVidPnDumpSourceModeSetEnum(D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet, const DXGK_VIDPNSOURCEMODESET_INTERFACE *pVidPnSourceModeSetInterface,
{
return TRUE;
}
void vboxVidPnDumpSourceModeSet(PVBOXMP_DEVEXT pDevExt, const D3DKMDT_HVIDPN hVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId)
{
if (Status == STATUS_SUCCESS)
{
if (Status != STATUS_SUCCESS)
{
}
}
else
{
LOGREL_EXACT(("ERROR getting SourceModeSet for Source(%d), Status(0x%x)\n", VidPnSourceId, Status));
}
}
DECLCALLBACK(BOOLEAN) vboxVidPnDumpTargetModeSetEnum(D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet, const DXGK_VIDPNTARGETMODESET_INTERFACE *pVidPnTargetModeSetInterface,
{
return TRUE;
}
void vboxVidPnDumpTargetModeSet(PVBOXMP_DEVEXT pDevExt, const D3DKMDT_HVIDPN hVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId)
{
if (Status == STATUS_SUCCESS)
{
if (Status != STATUS_SUCCESS)
{
}
}
else
{
LOGREL_EXACT(("ERROR getting TargetModeSet for Target(%d), Status(0x%x)\n", VidPnTargetId, Status));
}
}
void vboxVidPnDumpPinnedTargetMode(const D3DKMDT_HVIDPN hVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId)
{
if (Status == STATUS_SUCCESS)
{
Status = pCurVidPnTargetModeSetInterface->pfnAcquirePinnedModeInfo(hCurVidPnTargetModeSet, &pPinnedVidPnTargetModeInfo);
if (Status == STATUS_SUCCESS)
{
pCurVidPnTargetModeSetInterface->pfnReleaseModeInfo(hCurVidPnTargetModeSet, pPinnedVidPnTargetModeInfo);
}
else if (Status == STATUS_GRAPHICS_MODE_NOT_PINNED)
{
LOGREL_EXACT(("Target NOT Pinned\n"));
}
else
{
}
}
else
{
}
}
void vboxVidPnDumpCofuncModalityArg(const char *pPrefix, CONST DXGKARG_ENUMVIDPNCOFUNCMODALITY* CONST pEnumCofuncModalityArg, const char *pSuffix)
{
LOGREL_EXACT(("%sPivotType(%s), SourceId(0x%x), TargetId(0x%x),%s", pPrefix, vboxVidPnDumpStrCFMPivotType(pEnumCofuncModalityArg->EnumPivotType),
pEnumCofuncModalityArg->EnumPivot.VidPnSourceId, pEnumCofuncModalityArg->EnumPivot.VidPnTargetId, pSuffix));
}
void vboxVidPnDumpPath(const D3DKMDT_HVIDPN hVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, const D3DKMDT_VIDPN_PRESENT_PATH *pVidPnPresentPathInfo)
{
LOGREL_EXACT((" >>**** Start Dump VidPn Path ****>>\n"));
LOGREL_EXACT(("VidPnSourceId(%d), VidPnTargetId(%d)\n",
LOGREL_EXACT(("Importance(%s), TargetColorBasis(%s), Content(%s), ",
vboxVidPnDumpRanges("CCDynamicRanges: ", &pVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges, "| ");
LOGREL_EXACT((" <<**** Stop Dump VidPn Path ****<<"));
}
typedef struct VBOXVIDPNDUMPPATHENUM
{
const DXGK_VIDPN_INTERFACE* pVidPnInterface;
static DECLCALLBACK(BOOLEAN) vboxVidPnDumpPathEnum(D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface,
{
return TRUE;
}
void vboxVidPnDumpVidPn(const char * pPrefix, PVBOXMP_DEVEXT pDevExt, D3DKMDT_HVIDPN hVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, const char * pSuffix)
{
NTSTATUS Status = pVidPnInterface->pfnGetTopology(hVidPn, &hVidPnTopology, &pVidPnTopologyInterface);
if (Status == STATUS_SUCCESS)
{
}
{
}
}