Index: trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/Makefile.kmk
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/Makefile.kmk	(revision 82415)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/Makefile.kmk	(revision 82416)
@@ -133,4 +133,5 @@
 	$(VBOX_PATH_VMSVGA_INC)
 VBoxDispD3D_SOURCES  += \
+	wddm/gallium/GaDxva.cpp \
 	wddm/gallium/GaDrvEnvWddm.cpp \
 	wddm/gallium/GaWddm.cpp \
Index: trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/gallium/GaDdi.cpp
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/gallium/GaDdi.cpp	(revision 82415)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/gallium/GaDdi.cpp	(revision 82416)
@@ -21,4 +21,5 @@
 #include "../VBoxDispD3D.h"
 
+#include "GaDxva.h"
 
 /* Copy surface data from D3DPOOL_DEFAULT to D3DPOOL_SYSTEMMEM */
@@ -4004,16 +4005,15 @@
     VBOXVDBG_BREAK_DDI();
 
-    RT_NOREF(pData);
-
-    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
-
-    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
-    RT_NOREF(pDevice);
-
-    /// @todo Not implemented.
-    AssertFailed();
-
-    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
-    return E_NOTIMPL;
+    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
+
+    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
+    HRESULT hr;
+    if (pDevice)
+        hr = VBoxDxvaCreateVideoProcessDevice(pDevice, pData);
+    else
+        hr = E_INVALIDARG;
+
+    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
+    return hr;
 }
 
@@ -4022,16 +4022,11 @@
     VBOXVDBG_BREAK_DDI();
 
-    RT_NOREF(hVideoProcessor);
-
-    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
-
-    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
-    RT_NOREF(pDevice);
-
-    /// @todo Not implemented.
-    AssertFailed();
-
-    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
-    return E_NOTIMPL;
+    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
+
+    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
+    HRESULT hr = VBoxDxvaDestroyVideoProcessDevice(pDevice, hVideoProcessor);
+
+    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
+    return hr;
 }
 
@@ -4040,16 +4035,11 @@
     VBOXVDBG_BREAK_DDI();
 
-    RT_NOREF(hVideoProcessor);
-
-    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
-
-    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
-    RT_NOREF(pDevice);
-
-    /// @todo Not implemented.
-    AssertFailed();
-
-    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
-    return E_NOTIMPL;
+    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
+
+    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
+    HRESULT hr = VBoxDxvaVideoProcessBeginFrame(pDevice, hVideoProcessor);
+
+    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
+    return hr;
 }
 
@@ -4058,16 +4048,11 @@
     VBOXVDBG_BREAK_DDI();
 
-    RT_NOREF(pData);
-
-    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
-
-    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
-    RT_NOREF(pDevice);
-
-    /// @todo Not implemented.
-    AssertFailed();
-
-    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
-    return E_NOTIMPL;
+    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
+
+    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
+    HRESULT hr = VBoxDxvaVideoProcessEndFrame(pDevice, pData);
+
+    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
+    return hr;
 }
 
@@ -4077,16 +4062,11 @@
     VBOXVDBG_BREAK_DDI();
 
-    RT_NOREF(pData);
-
-    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
-
-    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
-    RT_NOREF(pDevice);
-
-    /// @todo Not implemented.
-    AssertFailed();
-
-    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
-    return E_NOTIMPL;
+    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
+
+    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
+    HRESULT hr = VBoxDxvaSetVideoProcessRenderTarget(pDevice, pData);
+
+    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
+    return hr;
 }
 
@@ -4095,16 +4075,11 @@
     VBOXVDBG_BREAK_DDI();
 
-    RT_NOREF(pData);
-
-    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
-
-    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
-    RT_NOREF(pDevice);
-
-    /// @todo Not implemented.
-    AssertFailed();
-
-    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
-    return E_NOTIMPL;
+    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
+
+    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
+    HRESULT hr = VBoxDxvaVideoProcessBlt(pDevice, pData);
+
+    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
+    return hr;
 }
 
@@ -4513,4 +4488,137 @@
     vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     return S_OK;
+}
+
+HRESULT APIENTRY GaDdiDXVAHDCreateVideoProcessor(HANDLE hDevice,
+    D3DDDIARG_DXVAHD_CREATEVIDEOPROCESSOR *pData)
+{
+    VBOXVDBG_BREAK_DDI();
+
+    RT_NOREF(pData);
+
+    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
+
+    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
+    RT_NOREF(pDevice);
+
+    /// @todo Not implemented.
+    AssertFailed();
+
+    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
+    return E_NOTIMPL;
+}
+
+HRESULT APIENTRY GaDdiDXVAHDSetVideoProcessBltState(HANDLE hDevice,
+    CONST D3DDDIARG_DXVAHD_SETVIDEOPROCESSBLTSTATE *pData)
+{
+    VBOXVDBG_BREAK_DDI();
+
+    RT_NOREF(pData);
+
+    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
+
+    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
+    RT_NOREF(pDevice);
+
+    /// @todo Not implemented.
+    AssertFailed();
+
+    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
+    return E_NOTIMPL;
+}
+
+HRESULT APIENTRY GaDdiDXVAHDGetVideoProcessBltStatePrivate(HANDLE hDevice,
+    D3DDDIARG_DXVAHD_GETVIDEOPROCESSBLTSTATEPRIVATE *pData)
+{
+    VBOXVDBG_BREAK_DDI();
+
+    RT_NOREF(pData);
+
+    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
+
+    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
+    RT_NOREF(pDevice);
+
+    /// @todo Not implemented.
+    AssertFailed();
+
+    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
+    return E_NOTIMPL;
+}
+
+HRESULT APIENTRY GaDdiDXVAHDSetVideoProcessStreamState(HANDLE hDevice,
+    CONST D3DDDIARG_DXVAHD_SETVIDEOPROCESSSTREAMSTATE *pData)
+{
+    VBOXVDBG_BREAK_DDI();
+
+    RT_NOREF(pData);
+
+    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
+
+    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
+    RT_NOREF(pDevice);
+
+    /// @todo Not implemented.
+    AssertFailed();
+
+    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
+    return E_NOTIMPL;
+}
+
+HRESULT APIENTRY GaDdiDXVAHDGetVideoProcessStreamStatePrivate(HANDLE hDevice,
+    D3DDDIARG_DXVAHD_GETVIDEOPROCESSSTREAMSTATEPRIVATE *pData)
+{
+    VBOXVDBG_BREAK_DDI();
+
+    RT_NOREF(pData);
+
+    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
+
+    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
+    RT_NOREF(pDevice);
+
+    /// @todo Not implemented.
+    AssertFailed();
+
+    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
+    return E_NOTIMPL;
+}
+
+HRESULT APIENTRY GaDdiDXVAHDVideoProcessBltHD(HANDLE hDevice,
+    CONST D3DDDIARG_DXVAHD_VIDEOPROCESSBLTHD *pData)
+{
+    VBOXVDBG_BREAK_DDI();
+
+    RT_NOREF(pData);
+
+    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
+
+    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
+    RT_NOREF(pDevice);
+
+    /// @todo Not implemented.
+    AssertFailed();
+
+    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
+    return E_NOTIMPL;
+}
+
+HRESULT APIENTRY GaDdiDXVAHDDestroyVideoProcessor(HANDLE hDevice,
+    HANDLE hProcessor)
+{
+    VBOXVDBG_BREAK_DDI();
+
+    RT_NOREF(hProcessor);
+
+    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
+
+    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
+    RT_NOREF(pDevice);
+
+    /// @todo Not implemented.
+    AssertFailed();
+
+    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
+    return E_NOTIMPL;
 }
 
@@ -4660,4 +4768,11 @@
         // pCreateData->pDeviceFuncs->pfnRename                    = NULL; /* Optional. */
 
+        // pCreateData->pDeviceFuncs->pfnCreateVideoProcessor              = GaDdiDXVAHDCreateVideoProcessor;
+        // pCreateData->pDeviceFuncs->pfnSetVideoProcessBltState           = GaDdiDXVAHDSetVideoProcessBltState;
+        // pCreateData->pDeviceFuncs->pfnGetVideoProcessBltStatePrivate    = GaDdiDXVAHDGetVideoProcessBltStatePrivate;
+        // pCreateData->pDeviceFuncs->pfnSetVideoProcessStreamState        = GaDdiDXVAHDSetVideoProcessStreamState;
+        // pCreateData->pDeviceFuncs->pfnGetVideoProcessStreamStatePrivate = GaDdiDXVAHDGetVideoProcessStreamStatePrivate;
+        // pCreateData->pDeviceFuncs->pfnVideoProcessBltHD                 = GaDdiDXVAHDVideoProcessBltHD;
+        // pCreateData->pDeviceFuncs->pfnDestroyVideoProcessor             = GaDdiDXVAHDDestroyVideoProcessor;
     }
     else
@@ -4968,9 +5083,59 @@
             break;
 
+        case D3DDDICAPS_GETVIDEOPROCESSORDEVICEGUIDCOUNT:
+        {
+            if (pData->DataSize >= sizeof(UINT))
+            {
+                if (pAdapter->AdapterInfo.u32AdapterCaps & VBOXWDDM_QAI_CAP_DXVA)
+                    hr = VBoxDxvaGetDeviceGuidCount((UINT *)pData->pData);
+                else
+                    *(UINT *)pData->pData = 0;
+            }
+            else
+                hr = E_INVALIDARG;
+            break;
+        }
+
+        case D3DDDICAPS_GETVIDEOPROCESSORDEVICEGUIDS:
+        {
+            hr = VBoxDxvaGetDeviceGuids((GUID *)pData->pData, pData->DataSize);
+            break;
+        }
+
+        case D3DDDICAPS_GETVIDEOPROCESSORRTSUBSTREAMFORMATCOUNT:
+        case D3DDDICAPS_GETVIDEOPROCESSORRTFORMATCOUNT:
+        {
+            if (pData->DataSize >= sizeof(UINT))
+                if (pAdapter->AdapterInfo.u32AdapterCaps & VBOXWDDM_QAI_CAP_DXVA)
+                    hr = VBoxDxvaGetOutputFormatCount((UINT *)pData->pData, (DXVADDI_VIDEOPROCESSORINPUT *)pData->pInfo,
+                                                      pData->Type == D3DDDICAPS_GETVIDEOPROCESSORRTSUBSTREAMFORMATCOUNT);
+                else
+                    *(UINT *)pData->pData = 0;
+            else
+                hr = E_INVALIDARG;
+            break;
+        }
+
+        case D3DDDICAPS_GETVIDEOPROCESSORRTSUBSTREAMFORMATS:
+        case D3DDDICAPS_GETVIDEOPROCESSORRTFORMATS:
+        {
+            hr = VBoxDxvaGetOutputFormats((D3DDDIFORMAT *)pData->pData, pData->DataSize,
+                                          (DXVADDI_VIDEOPROCESSORINPUT *)pData->pInfo,
+                                          pData->Type == D3DDDICAPS_GETVIDEOPROCESSORRTSUBSTREAMFORMATS);
+            break;
+        }
+
         case D3DDDICAPS_GETVIDEOPROCESSORCAPS:
+        {
+            if (pData->DataSize >= sizeof(DXVADDI_VIDEOPROCESSORCAPS))
+                hr = VBoxDxvaGetCaps((DXVADDI_VIDEOPROCESSORCAPS *)pData->pData,
+                                     (DXVADDI_VIDEOPROCESSORINPUT *)pData->pInfo);
+            else
+                hr = E_INVALIDARG;
+            break;
+        }
+
         case D3DDDICAPS_GETEXTENSIONGUIDCOUNT:
         case D3DDDICAPS_GETDECODEGUIDCOUNT:
-        case D3DDDICAPS_GETVIDEOPROCESSORDEVICEGUIDCOUNT:
-        case D3DDDICAPS_GETVIDEOPROCESSORRTFORMATCOUNT:
         case D3DDDICAPS_GETCONTENTPROTECTIONCAPS:
             if (pData->pData && pData->DataSize)
@@ -4988,8 +5153,4 @@
         case D3DDDICAPS_GETDECODECONFIGURATIONCOUNT:
         case D3DDDICAPS_GETDECODECONFIGURATIONS:
-        case D3DDDICAPS_GETVIDEOPROCESSORDEVICEGUIDS:
-        case D3DDDICAPS_GETVIDEOPROCESSORRTFORMATS:
-        case D3DDDICAPS_GETVIDEOPROCESSORRTSUBSTREAMFORMATCOUNT:
-        case D3DDDICAPS_GETVIDEOPROCESSORRTSUBSTREAMFORMATS:
         case D3DDDICAPS_GETPROCAMPRANGE:
         case D3DDDICAPS_FILTERPROPERTYRANGE:
Index: trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/gallium/GaWddm.cpp
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/gallium/GaWddm.cpp	(revision 82415)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/gallium/GaWddm.cpp	(revision 82416)
@@ -398,5 +398,7 @@
     const BOOL d3dLockable                   = !pRc->RcDesc.fFlags.NotLockable;
 
-    if (VBOXWDDMDISP_IS_TEXTURE(pRc->RcDesc.fFlags))
+    if (   VBOXWDDMDISP_IS_TEXTURE(pRc->RcDesc.fFlags)
+        || pRc->RcDesc.fFlags.VideoProcessRenderTarget
+        || pRc->RcDesc.fFlags.DecodeRenderTarget)
     {
         PVBOXWDDMDISP_ALLOCATION pAllocation = &pRc->aAllocations[0];
