Commit 9daba7a1 authored by Steve Lhomme's avatar Steve Lhomme

dxva: allow per-vendor HEVC black listing

parent ec1313ce
......@@ -558,10 +558,7 @@ static bool CanUseIntelHEVC(vlc_va_t *va)
if (FAILED(hr))
return false;
if (adapterDesc.VendorId != GPU_MANUFACTURER_INTEL)
return true;
return directx_va_canUseHevc( va, adapterDesc.DeviceId );
return directx_va_canUseHevc( va, adapterDesc.VendorId, adapterDesc.DeviceId );
}
static int DxSetupOutput(vlc_va_t *va, const GUID *input, const video_format_t *fmt)
......
......@@ -82,6 +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);
bool directx_va_canUseHevc(vlc_va_t *, UINT VendorId, UINT DeviceId);
#endif /* AVCODEC_DIRECTX_VA_H */
......@@ -506,10 +506,7 @@ static bool CanUseIntelHEVC(vlc_va_t *va)
if (FAILED(hr))
return false;
if (identifier.VendorId != GPU_MANUFACTURER_INTEL)
return true;
return directx_va_canUseHevc( va, identifier.DeviceId );
return directx_va_canUseHevc( va, identifier.VendorId, identifier.DeviceId );
}
static int DxSetupOutput(vlc_va_t *va, const GUID *input, const video_format_t *fmt)
......
......@@ -27,6 +27,8 @@
#include <vlc_codecs.h>
#include <vlc_codec.h>
#include "../../video_chroma/dxgi_fmt.h"
#define D3D_DecoderType IUnknown
#define D3D_DecoderDevice IUnknown
#define D3D_DecoderSurface IUnknown
......@@ -38,7 +40,7 @@ typedef struct
#include "directx_va.h"
static UINT hevc_blacklist[] = {
static UINT IntelDevices[] = {
/* Intel Broadwell GPUs with hybrid HEVC */
0x1606, /* HD Graphics */
0x160E, /* HD Graphics */
......@@ -68,19 +70,36 @@ static UINT hevc_blacklist[] = {
0x0D22, /* Iris(TM) Pro Graphics 5200 */
0x0D26, /* Iris(TM) Pro Graphics 5200 */
0
};
static struct {
UINT vendor;
const UINT *devices;
} hevc_blacklist[] = {
{ .vendor = GPU_MANUFACTURER_INTEL, .devices = IntelDevices },
};
bool directx_va_canUseHevc(vlc_va_t *va, UINT DeviceId)
bool directx_va_canUseHevc(vlc_va_t *va, UINT VendorId, UINT DeviceId)
{
if (va->obj.force)
return true;
for (size_t i=0; i<ARRAY_SIZE(hevc_blacklist); i++)
{
if (hevc_blacklist[i] == DeviceId)
if (hevc_blacklist[i].vendor == VendorId)
{
msg_Warn(va, "Intel Hybrid HEVC detected, disabling hardware decoding");
return false;
const UINT *pDevice = hevc_blacklist[i].devices;
while (*pDevice != 0)
{
if (*pDevice == DeviceId)
{
msg_Warn(va, "Intel Hybrid HEVC detected, disabling hardware decoding");
return false;
}
pDevice++;
}
break;
}
}
......
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