Commit 33cc4f2b authored by Steve Lhomme's avatar Steve Lhomme

dxva: allow blacklisting based on the driver build

Not used for now.
parent 6dd231f7
...@@ -570,7 +570,8 @@ static int DxSetupOutput(vlc_va_t *va, const GUID *input, const video_format_t * ...@@ -570,7 +570,8 @@ static int DxSetupOutput(vlc_va_t *va, const GUID *input, const video_format_t *
if (FAILED(hr)) if (FAILED(hr))
return VLC_EGENERIC; return VLC_EGENERIC;
if (!directx_va_canUseDecoder(va, adapterDesc.VendorId, adapterDesc.DeviceId, input)) if (!directx_va_canUseDecoder(va, adapterDesc.VendorId, adapterDesc.DeviceId,
input, sys->d3d_dev.WDDM.build))
{ {
msg_Warn(va, "GPU blacklisted for %s codec", directx_va_GetDecoderName(input)); msg_Warn(va, "GPU blacklisted for %s codec", directx_va_GetDecoderName(input));
return VLC_EGENERIC; return VLC_EGENERIC;
......
...@@ -82,6 +82,6 @@ int directx_va_Open(vlc_va_t *, directx_sys_t *); ...@@ -82,6 +82,6 @@ int directx_va_Open(vlc_va_t *, directx_sys_t *);
void directx_va_Close(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); 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); char *directx_va_GetDecoderName(const GUID *guid);
bool directx_va_canUseDecoder(vlc_va_t *, UINT VendorId, UINT DeviceId, const GUID *pCodec); bool directx_va_canUseDecoder(vlc_va_t *, UINT VendorId, UINT DeviceId, const GUID *pCodec, UINT driverBuild);
#endif /* AVCODEC_DIRECTX_VA_H */ #endif /* AVCODEC_DIRECTX_VA_H */
...@@ -505,7 +505,14 @@ static int DxSetupOutput(vlc_va_t *va, const GUID *input, const video_format_t * ...@@ -505,7 +505,14 @@ static int DxSetupOutput(vlc_va_t *va, const GUID *input, const video_format_t *
if (FAILED(hr)) if (FAILED(hr))
return VLC_EGENERIC; return VLC_EGENERIC;
if (!directx_va_canUseDecoder(va, identifier.VendorId, identifier.DeviceId, input)) UINT driverBuild = identifier.DriverVersion.LowPart & 0xFFFF;
if (identifier.VendorId == GPU_MANUFACTURER_INTEL && (identifier.DriverVersion.LowPart >> 16) >= 100)
{
/* new Intel driver format */
driverBuild += ((identifier.DriverVersion.LowPart >> 16) - 100) * 1000;
}
if (!directx_va_canUseDecoder(va, identifier.VendorId, identifier.DeviceId,
input, driverBuild))
{ {
msg_Warn(va, "GPU blacklisted for %s codec", directx_va_GetDecoderName(input)); msg_Warn(va, "GPU blacklisted for %s codec", directx_va_GetDecoderName(input));
return VLC_EGENERIC; return VLC_EGENERIC;
......
...@@ -43,9 +43,16 @@ typedef struct ...@@ -43,9 +43,16 @@ typedef struct
extern const GUID DXVA_ModeHEVC_VLD_Main; extern const GUID DXVA_ModeHEVC_VLD_Main;
extern const GUID DXVA_ModeHEVC_VLD_Main10; extern const GUID DXVA_ModeHEVC_VLD_Main10;
enum DriverTestCommand {
BLAnyDriver,
BLBelowBuild, /* driverBuild is the first driver version known to work */
};
struct decoders { struct decoders {
const UINT deviceID; const UINT deviceID;
const GUID **decoder_list; const GUID **decoder_list;
const enum DriverTestCommand cmd;
const UINT driverBuild;
}; };
static const GUID *NoHEVC[] = { static const GUID *NoHEVC[] = {
...@@ -56,35 +63,36 @@ static const GUID *NoHEVC[] = { ...@@ -56,35 +63,36 @@ static const GUID *NoHEVC[] = {
static struct decoders IntelDevices[] = { static struct decoders IntelDevices[] = {
/* Intel Broadwell GPUs with hybrid HEVC */ /* Intel Broadwell GPUs with hybrid HEVC */
{ 0x1606, NoHEVC }, /* HD Graphics */ { 0x1606, NoHEVC, BLAnyDriver, 0 }, /* HD Graphics */
{ 0x160E, NoHEVC }, /* HD Graphics */ { 0x160E, NoHEVC, BLAnyDriver, 0 }, /* HD Graphics */
{ 0x1612, NoHEVC }, /* HD Graphics 5600 */ { 0x1612, NoHEVC, BLAnyDriver, 0 }, /* HD Graphics 5600 */
{ 0x1616, NoHEVC }, /* HD Graphics 5500 */ { 0x1616, NoHEVC, BLAnyDriver, 0 }, /* HD Graphics 5500 */
{ 0x161A, NoHEVC }, /* HD Graphics P5700 */ { 0x161A, NoHEVC, BLAnyDriver, 0 }, /* HD Graphics P5700 */
{ 0x161E, NoHEVC }, /* HD Graphics 5300 */ { 0x161E, NoHEVC, BLAnyDriver, 0 }, /* HD Graphics 5300 */
{ 0x1622, NoHEVC }, /* Iris Pro Graphics 6200 */ { 0x1622, NoHEVC, BLAnyDriver, 0 }, /* Iris Pro Graphics 6200 */
{ 0x1626, NoHEVC }, /* HD Graphics 6000 */ { 0x1626, NoHEVC, BLAnyDriver, 0 }, /* HD Graphics 6000 */
{ 0x162A, NoHEVC }, /* Iris Pro Graphics P6300 */ { 0x162A, NoHEVC, BLAnyDriver, 0 }, /* Iris Pro Graphics P6300 */
{ 0x162B, NoHEVC }, /* Iris Graphics 6100 */ { 0x162B, NoHEVC, BLAnyDriver, 0 }, /* Iris Graphics 6100 */
{ 0x0402, NoHEVC }, /* HD Graphics */ { 0x0402, NoHEVC, BLAnyDriver, 0 }, /* HD Graphics */
{ 0x0406, NoHEVC }, /* HD Graphics */ { 0x0406, NoHEVC, BLAnyDriver, 0 }, /* HD Graphics */
{ 0x040A, NoHEVC }, /* HD Graphics */ { 0x040A, NoHEVC, BLAnyDriver, 0 }, /* HD Graphics */
{ 0x0412, NoHEVC }, /* HD Graphics 4600 */ { 0x0412, NoHEVC, BLAnyDriver, 0 }, /* HD Graphics 4600 */
{ 0x0416, NoHEVC }, /* HD Graphics 4600 */ { 0x0416, NoHEVC, BLAnyDriver, 0 }, /* HD Graphics 4600 */
{ 0x041E, NoHEVC }, /* HD Graphics 4400 */ { 0x041E, NoHEVC, BLAnyDriver, 0 }, /* HD Graphics 4400 */
{ 0x041A, NoHEVC }, /* HD Graphics P4600/P4700 */ { 0x041A, NoHEVC, BLAnyDriver, 0 }, /* HD Graphics P4600/P4700 */
{ 0x0A06, NoHEVC }, /* HD Graphics */ { 0x0A06, NoHEVC, BLAnyDriver, 0 }, /* HD Graphics */
{ 0x0A0E, NoHEVC }, /* HD Graphics */ { 0x0A0E, NoHEVC, BLAnyDriver, 0 }, /* HD Graphics */
{ 0x0A16, NoHEVC }, /* HD Graphics Family */ { 0x0A16, NoHEVC, BLAnyDriver, 0 }, /* HD Graphics Family */
{ 0x0A1E, NoHEVC }, /* HD Graphics Family */ { 0x0A1E, NoHEVC, BLAnyDriver, 0 }, /* HD Graphics Family */
{ 0x0A26, NoHEVC }, /* HD Graphics 5000 */ { 0x0A26, NoHEVC, BLAnyDriver, 0 }, /* HD Graphics 5000 */
{ 0x0A2E, NoHEVC }, /* Iris(TM) Graphics 5100 */ { 0x0A2E, NoHEVC, BLAnyDriver, 0 }, /* Iris(TM) Graphics 5100 */
{ 0x0D22, NoHEVC }, /* Iris(TM) Pro Graphics 5200 */ { 0x0D22, NoHEVC, BLAnyDriver, 0 }, /* Iris(TM) Pro Graphics 5200 */
{ 0x0D26, NoHEVC }, /* Iris(TM) Pro Graphics 5200 */ { 0x0D26, NoHEVC, BLAnyDriver, 0 }, /* Iris(TM) Pro Graphics 5200 */
{0, NULL}
{0, NULL, BLAnyDriver, 0}
}; };
static struct { static struct {
...@@ -94,7 +102,7 @@ static struct { ...@@ -94,7 +102,7 @@ static struct {
{ .vendor = GPU_MANUFACTURER_INTEL, .devices = IntelDevices }, { .vendor = GPU_MANUFACTURER_INTEL, .devices = IntelDevices },
}; };
bool directx_va_canUseDecoder(vlc_va_t *va, UINT VendorId, UINT DeviceId, const GUID *pCodec) bool directx_va_canUseDecoder(vlc_va_t *va, UINT VendorId, UINT DeviceId, const GUID *pCodec, UINT driverBuild)
{ {
if (va->obj.force) if (va->obj.force)
return true; return true;
...@@ -112,7 +120,13 @@ bool directx_va_canUseDecoder(vlc_va_t *va, UINT VendorId, UINT DeviceId, const ...@@ -112,7 +120,13 @@ bool directx_va_canUseDecoder(vlc_va_t *va, UINT VendorId, UINT DeviceId, const
while (*pGuid != NULL) while (*pGuid != NULL)
{ {
if (IsEqualGUID(pCodec, *pGuid)) if (IsEqualGUID(pCodec, *pGuid))
return false; {
if (pDevice->cmd == BLAnyDriver)
return false;
if (pDevice->cmd == BLBelowBuild && driverBuild < pDevice->driverBuild)
return false;
break;
}
pGuid++; pGuid++;
} }
return true; return true;
......
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