Commit 1bbc8377 authored by Steve Lhomme's avatar Steve Lhomme

directx_va: disable Intel hybrid HEVC decoding by default

GPUs with Intel Hybrid HEVC are the ones from the BroadWell family and is
causing decoding issues in 10 bits and 8 bits decoding.

If the HW decoder is forced it will be used anyway.

When blacklisted there is msg_Warn so that it's more visible to the user.
parent 31c9df25
......@@ -549,18 +549,20 @@ extern const GUID DXVA_ModeVP9_VLD_10bit_Profile2;
static bool CanUseIntelHEVC(vlc_va_t *va)
{
vlc_va_sys_t *sys = va->sys;
/* it should be OK starting after driver 20.19.15.4835 */
struct wddm_version WDMM = {
.wddm = 0,
.d3d_features = 0,
.revision = 0,
.build = 4836,
};
if (D3D11CheckDriverVersion(&sys->d3d_dev, GPU_MANUFACTURER_INTEL, &WDMM) == VLC_SUCCESS)
IDXGIAdapter *pAdapter = D3D11DeviceAdapter(sys->d3d_dev.d3ddevice);
if (!pAdapter)
return false;
DXGI_ADAPTER_DESC adapterDesc;
HRESULT hr = IDXGIAdapter_GetDesc(pAdapter, &adapterDesc);
IDXGIAdapter_Release(pAdapter);
if (FAILED(hr))
return false;
if (adapterDesc.VendorId != GPU_MANUFACTURER_INTEL)
return true;
msg_Dbg(va, "HEVC not supported with these drivers");
return false;
return directx_va_canUseHevc( va, adapterDesc.DeviceId );
}
static int DxSetupOutput(vlc_va_t *va, const GUID *input, const video_format_t *fmt)
......
......@@ -451,3 +451,34 @@ static int FindVideoServiceConversion(vlc_va_t *va, directx_sys_t *dx_sys,
p_list.pf_release(&p_list);
return err;
}
static UINT hevc_blacklist[] = {
/* Intel Broadwell GPUs with hybrid HEVC */
0x1606, /* HD Graphics */
0x160E, /* HD Graphics */
0x1612, /* HD Graphics 5600 */
0x1616, /* HD Graphics 5500 */
0x161A, /* HD Graphics P5700 */
0x161E, /* HD Graphics 5300 */
0x1622, /* Iris Pro Graphics 6200 */
0x1626, /* HD Graphics 6000 */
0x162A, /* Iris Pro Graphics P6300 */
0x162B, /* Iris Graphics 6100 */
};
bool directx_va_canUseHevc(vlc_va_t *va, UINT DeviceId)
{
if (va->obj.force)
return true;
for (size_t i=0; i<ARRAY_SIZE(hevc_blacklist); i++)
{
if (hevc_blacklist[i] == DeviceId)
{
msg_Warn(va, "Intel Hybrid HEVC detected, disabling hardware decoding");
return false;
}
}
return true;
}
......@@ -82,5 +82,6 @@ int directx_va_Open(vlc_va_t *, directx_sys_t *);
void directx_va_Close(vlc_va_t *, directx_sys_t *);
int directx_va_Setup(vlc_va_t *, directx_sys_t *, const AVCodecContext *avctx, const es_format_t *, int flag_xbox);
char *directx_va_GetDecoderName(const GUID *guid);
bool directx_va_canUseHevc(vlc_va_t *, UINT DeviceId);
#endif /* AVCODEC_DIRECTX_VA_H */
......@@ -500,18 +500,16 @@ extern const GUID DXVA_ModeHEVC_VLD_Main10;
static bool CanUseIntelHEVC(vlc_va_t *va)
{
vlc_va_sys_t *sys = va->sys;
/* it should be OK starting after driver 20.19.15.4835 */
struct wddm_version WDMM = {
.wddm = 0,
.d3d_features = 0,
.revision = 0,
.build = 4836,
};
if (D3D9CheckDriverVersion(&sys->hd3d, &sys->d3d_dev, GPU_MANUFACTURER_INTEL, &WDMM) == VLC_SUCCESS)
D3DADAPTER_IDENTIFIER9 identifier;
HRESULT hr = IDirect3D9_GetAdapterIdentifier(sys->hd3d.obj, sys->d3d_dev.adapterId, 0, &identifier);
if (FAILED(hr))
return false;
if (identifier.VendorId != GPU_MANUFACTURER_INTEL)
return true;
msg_Dbg(va, "HEVC not supported with these drivers");
return false;
return directx_va_canUseHevc( va, identifier.DeviceId );
}
static int DxSetupOutput(vlc_va_t *va, const GUID *input, const video_format_t *fmt)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment