VirtualBox

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


Ignore:
Timestamp:
Dec 5, 2019 1:00:09 PM (5 years ago)
Author:
vboxsync
Message:

WDDM: use DXVA

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/Makefile.kmk

    r80487 r82416  
    133133        $(VBOX_PATH_VMSVGA_INC)
    134134VBoxDispD3D_SOURCES  += \
     135        wddm/gallium/GaDxva.cpp \
    135136        wddm/gallium/GaDrvEnvWddm.cpp \
    136137        wddm/gallium/GaWddm.cpp \
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/gallium/GaDdi.cpp

    r82169 r82416  
    2121#include "../VBoxDispD3D.h"
    2222
     23#include "GaDxva.h"
    2324
    2425/* Copy surface data from D3DPOOL_DEFAULT to D3DPOOL_SYSTEMMEM */
     
    40044005    VBOXVDBG_BREAK_DDI();
    40054006
    4006     RT_NOREF(pData);
    4007 
    4008     vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
    4009 
    4010     PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
    4011     RT_NOREF(pDevice);
    4012 
    4013     /// @todo Not implemented.
    4014     AssertFailed();
    4015 
    4016     vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
    4017     return E_NOTIMPL;
     4007    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     4008
     4009    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     4010    HRESULT hr;
     4011    if (pDevice)
     4012        hr = VBoxDxvaCreateVideoProcessDevice(pDevice, pData);
     4013    else
     4014        hr = E_INVALIDARG;
     4015
     4016    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     4017    return hr;
    40184018}
    40194019
     
    40224022    VBOXVDBG_BREAK_DDI();
    40234023
    4024     RT_NOREF(hVideoProcessor);
    4025 
    4026     vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
    4027 
    4028     PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
    4029     RT_NOREF(pDevice);
    4030 
    4031     /// @todo Not implemented.
    4032     AssertFailed();
    4033 
    4034     vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
    4035     return E_NOTIMPL;
     4024    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     4025
     4026    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     4027    HRESULT hr = VBoxDxvaDestroyVideoProcessDevice(pDevice, hVideoProcessor);
     4028
     4029    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     4030    return hr;
    40364031}
    40374032
     
    40404035    VBOXVDBG_BREAK_DDI();
    40414036
    4042     RT_NOREF(hVideoProcessor);
    4043 
    4044     vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
    4045 
    4046     PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
    4047     RT_NOREF(pDevice);
    4048 
    4049     /// @todo Not implemented.
    4050     AssertFailed();
    4051 
    4052     vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
    4053     return E_NOTIMPL;
     4037    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     4038
     4039    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     4040    HRESULT hr = VBoxDxvaVideoProcessBeginFrame(pDevice, hVideoProcessor);
     4041
     4042    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     4043    return hr;
    40544044}
    40554045
     
    40584048    VBOXVDBG_BREAK_DDI();
    40594049
    4060     RT_NOREF(pData);
    4061 
    4062     vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
    4063 
    4064     PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
    4065     RT_NOREF(pDevice);
    4066 
    4067     /// @todo Not implemented.
    4068     AssertFailed();
    4069 
    4070     vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
    4071     return E_NOTIMPL;
     4050    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     4051
     4052    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     4053    HRESULT hr = VBoxDxvaVideoProcessEndFrame(pDevice, pData);
     4054
     4055    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     4056    return hr;
    40724057}
    40734058
     
    40774062    VBOXVDBG_BREAK_DDI();
    40784063
    4079     RT_NOREF(pData);
    4080 
    4081     vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
    4082 
    4083     PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
    4084     RT_NOREF(pDevice);
    4085 
    4086     /// @todo Not implemented.
    4087     AssertFailed();
    4088 
    4089     vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
    4090     return E_NOTIMPL;
     4064    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     4065
     4066    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     4067    HRESULT hr = VBoxDxvaSetVideoProcessRenderTarget(pDevice, pData);
     4068
     4069    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     4070    return hr;
    40914071}
    40924072
     
    40954075    VBOXVDBG_BREAK_DDI();
    40964076
    4097     RT_NOREF(pData);
    4098 
    4099     vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
    4100 
    4101     PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
    4102     RT_NOREF(pDevice);
    4103 
    4104     /// @todo Not implemented.
    4105     AssertFailed();
    4106 
    4107     vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
    4108     return E_NOTIMPL;
     4077    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     4078
     4079    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     4080    HRESULT hr = VBoxDxvaVideoProcessBlt(pDevice, pData);
     4081
     4082    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     4083    return hr;
    41094084}
    41104085
     
    45134488    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
    45144489    return S_OK;
     4490}
     4491
     4492HRESULT APIENTRY GaDdiDXVAHDCreateVideoProcessor(HANDLE hDevice,
     4493    D3DDDIARG_DXVAHD_CREATEVIDEOPROCESSOR *pData)
     4494{
     4495    VBOXVDBG_BREAK_DDI();
     4496
     4497    RT_NOREF(pData);
     4498
     4499    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     4500
     4501    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     4502    RT_NOREF(pDevice);
     4503
     4504    /// @todo Not implemented.
     4505    AssertFailed();
     4506
     4507    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     4508    return E_NOTIMPL;
     4509}
     4510
     4511HRESULT APIENTRY GaDdiDXVAHDSetVideoProcessBltState(HANDLE hDevice,
     4512    CONST D3DDDIARG_DXVAHD_SETVIDEOPROCESSBLTSTATE *pData)
     4513{
     4514    VBOXVDBG_BREAK_DDI();
     4515
     4516    RT_NOREF(pData);
     4517
     4518    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     4519
     4520    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     4521    RT_NOREF(pDevice);
     4522
     4523    /// @todo Not implemented.
     4524    AssertFailed();
     4525
     4526    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     4527    return E_NOTIMPL;
     4528}
     4529
     4530HRESULT APIENTRY GaDdiDXVAHDGetVideoProcessBltStatePrivate(HANDLE hDevice,
     4531    D3DDDIARG_DXVAHD_GETVIDEOPROCESSBLTSTATEPRIVATE *pData)
     4532{
     4533    VBOXVDBG_BREAK_DDI();
     4534
     4535    RT_NOREF(pData);
     4536
     4537    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     4538
     4539    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     4540    RT_NOREF(pDevice);
     4541
     4542    /// @todo Not implemented.
     4543    AssertFailed();
     4544
     4545    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     4546    return E_NOTIMPL;
     4547}
     4548
     4549HRESULT APIENTRY GaDdiDXVAHDSetVideoProcessStreamState(HANDLE hDevice,
     4550    CONST D3DDDIARG_DXVAHD_SETVIDEOPROCESSSTREAMSTATE *pData)
     4551{
     4552    VBOXVDBG_BREAK_DDI();
     4553
     4554    RT_NOREF(pData);
     4555
     4556    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     4557
     4558    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     4559    RT_NOREF(pDevice);
     4560
     4561    /// @todo Not implemented.
     4562    AssertFailed();
     4563
     4564    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     4565    return E_NOTIMPL;
     4566}
     4567
     4568HRESULT APIENTRY GaDdiDXVAHDGetVideoProcessStreamStatePrivate(HANDLE hDevice,
     4569    D3DDDIARG_DXVAHD_GETVIDEOPROCESSSTREAMSTATEPRIVATE *pData)
     4570{
     4571    VBOXVDBG_BREAK_DDI();
     4572
     4573    RT_NOREF(pData);
     4574
     4575    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     4576
     4577    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     4578    RT_NOREF(pDevice);
     4579
     4580    /// @todo Not implemented.
     4581    AssertFailed();
     4582
     4583    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     4584    return E_NOTIMPL;
     4585}
     4586
     4587HRESULT APIENTRY GaDdiDXVAHDVideoProcessBltHD(HANDLE hDevice,
     4588    CONST D3DDDIARG_DXVAHD_VIDEOPROCESSBLTHD *pData)
     4589{
     4590    VBOXVDBG_BREAK_DDI();
     4591
     4592    RT_NOREF(pData);
     4593
     4594    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     4595
     4596    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     4597    RT_NOREF(pDevice);
     4598
     4599    /// @todo Not implemented.
     4600    AssertFailed();
     4601
     4602    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     4603    return E_NOTIMPL;
     4604}
     4605
     4606HRESULT APIENTRY GaDdiDXVAHDDestroyVideoProcessor(HANDLE hDevice,
     4607    HANDLE hProcessor)
     4608{
     4609    VBOXVDBG_BREAK_DDI();
     4610
     4611    RT_NOREF(hProcessor);
     4612
     4613    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     4614
     4615    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
     4616    RT_NOREF(pDevice);
     4617
     4618    /// @todo Not implemented.
     4619    AssertFailed();
     4620
     4621    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
     4622    return E_NOTIMPL;
    45154623}
    45164624
     
    46604768        // pCreateData->pDeviceFuncs->pfnRename                    = NULL; /* Optional. */
    46614769
     4770        // pCreateData->pDeviceFuncs->pfnCreateVideoProcessor              = GaDdiDXVAHDCreateVideoProcessor;
     4771        // pCreateData->pDeviceFuncs->pfnSetVideoProcessBltState           = GaDdiDXVAHDSetVideoProcessBltState;
     4772        // pCreateData->pDeviceFuncs->pfnGetVideoProcessBltStatePrivate    = GaDdiDXVAHDGetVideoProcessBltStatePrivate;
     4773        // pCreateData->pDeviceFuncs->pfnSetVideoProcessStreamState        = GaDdiDXVAHDSetVideoProcessStreamState;
     4774        // pCreateData->pDeviceFuncs->pfnGetVideoProcessStreamStatePrivate = GaDdiDXVAHDGetVideoProcessStreamStatePrivate;
     4775        // pCreateData->pDeviceFuncs->pfnVideoProcessBltHD                 = GaDdiDXVAHDVideoProcessBltHD;
     4776        // pCreateData->pDeviceFuncs->pfnDestroyVideoProcessor             = GaDdiDXVAHDDestroyVideoProcessor;
    46624777    }
    46634778    else
     
    49685083            break;
    49695084
     5085        case D3DDDICAPS_GETVIDEOPROCESSORDEVICEGUIDCOUNT:
     5086        {
     5087            if (pData->DataSize >= sizeof(UINT))
     5088            {
     5089                if (pAdapter->AdapterInfo.u32AdapterCaps & VBOXWDDM_QAI_CAP_DXVA)
     5090                    hr = VBoxDxvaGetDeviceGuidCount((UINT *)pData->pData);
     5091                else
     5092                    *(UINT *)pData->pData = 0;
     5093            }
     5094            else
     5095                hr = E_INVALIDARG;
     5096            break;
     5097        }
     5098
     5099        case D3DDDICAPS_GETVIDEOPROCESSORDEVICEGUIDS:
     5100        {
     5101            hr = VBoxDxvaGetDeviceGuids((GUID *)pData->pData, pData->DataSize);
     5102            break;
     5103        }
     5104
     5105        case D3DDDICAPS_GETVIDEOPROCESSORRTSUBSTREAMFORMATCOUNT:
     5106        case D3DDDICAPS_GETVIDEOPROCESSORRTFORMATCOUNT:
     5107        {
     5108            if (pData->DataSize >= sizeof(UINT))
     5109                if (pAdapter->AdapterInfo.u32AdapterCaps & VBOXWDDM_QAI_CAP_DXVA)
     5110                    hr = VBoxDxvaGetOutputFormatCount((UINT *)pData->pData, (DXVADDI_VIDEOPROCESSORINPUT *)pData->pInfo,
     5111                                                      pData->Type == D3DDDICAPS_GETVIDEOPROCESSORRTSUBSTREAMFORMATCOUNT);
     5112                else
     5113                    *(UINT *)pData->pData = 0;
     5114            else
     5115                hr = E_INVALIDARG;
     5116            break;
     5117        }
     5118
     5119        case D3DDDICAPS_GETVIDEOPROCESSORRTSUBSTREAMFORMATS:
     5120        case D3DDDICAPS_GETVIDEOPROCESSORRTFORMATS:
     5121        {
     5122            hr = VBoxDxvaGetOutputFormats((D3DDDIFORMAT *)pData->pData, pData->DataSize,
     5123                                          (DXVADDI_VIDEOPROCESSORINPUT *)pData->pInfo,
     5124                                          pData->Type == D3DDDICAPS_GETVIDEOPROCESSORRTSUBSTREAMFORMATS);
     5125            break;
     5126        }
     5127
    49705128        case D3DDDICAPS_GETVIDEOPROCESSORCAPS:
     5129        {
     5130            if (pData->DataSize >= sizeof(DXVADDI_VIDEOPROCESSORCAPS))
     5131                hr = VBoxDxvaGetCaps((DXVADDI_VIDEOPROCESSORCAPS *)pData->pData,
     5132                                     (DXVADDI_VIDEOPROCESSORINPUT *)pData->pInfo);
     5133            else
     5134                hr = E_INVALIDARG;
     5135            break;
     5136        }
     5137
    49715138        case D3DDDICAPS_GETEXTENSIONGUIDCOUNT:
    49725139        case D3DDDICAPS_GETDECODEGUIDCOUNT:
    4973         case D3DDDICAPS_GETVIDEOPROCESSORDEVICEGUIDCOUNT:
    4974         case D3DDDICAPS_GETVIDEOPROCESSORRTFORMATCOUNT:
    49755140        case D3DDDICAPS_GETCONTENTPROTECTIONCAPS:
    49765141            if (pData->pData && pData->DataSize)
     
    49885153        case D3DDDICAPS_GETDECODECONFIGURATIONCOUNT:
    49895154        case D3DDDICAPS_GETDECODECONFIGURATIONS:
    4990         case D3DDDICAPS_GETVIDEOPROCESSORDEVICEGUIDS:
    4991         case D3DDDICAPS_GETVIDEOPROCESSORRTFORMATS:
    4992         case D3DDDICAPS_GETVIDEOPROCESSORRTSUBSTREAMFORMATCOUNT:
    4993         case D3DDDICAPS_GETVIDEOPROCESSORRTSUBSTREAMFORMATS:
    49945155        case D3DDDICAPS_GETPROCAMPRANGE:
    49955156        case D3DDDICAPS_FILTERPROPERTYRANGE:
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/gallium/GaWddm.cpp

    r81082 r82416  
    398398    const BOOL d3dLockable                   = !pRc->RcDesc.fFlags.NotLockable;
    399399
    400     if (VBOXWDDMDISP_IS_TEXTURE(pRc->RcDesc.fFlags))
     400    if (   VBOXWDDMDISP_IS_TEXTURE(pRc->RcDesc.fFlags)
     401        || pRc->RcDesc.fFlags.VideoProcessRenderTarget
     402        || pRc->RcDesc.fFlags.DecodeRenderTarget)
    401403    {
    402404        PVBOXWDDMDISP_ALLOCATION pAllocation = &pRc->aAllocations[0];
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