Kaydet (Commit) 82d767a5 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

whitelist some drivers

Especially the ones from our developer machines as they are better tested than anything else.

Change-Id: Id6ff6bcae314c03453d82ee4e64aaef1bd5ed84a
üst 773d2bde
...@@ -12,8 +12,6 @@ ...@@ -12,8 +12,6 @@
#include "opengl/DeviceInfo.hxx" #include "opengl/DeviceInfo.hxx"
#include <rtl/ustring.hxx> #include <rtl/ustring.hxx>
#include <vector>
#include <stdint.h>
namespace wgl { namespace wgl {
...@@ -82,7 +80,7 @@ struct DriverInfo ...@@ -82,7 +80,7 @@ struct DriverInfo
DriverInfo(OperatingSystem os, const OUString& vendor, DeviceFamilyVector* devices, DriverInfo(OperatingSystem os, const OUString& vendor, DeviceFamilyVector* devices,
VersionComparisonOp op, VersionComparisonOp op,
uint64_t driverVersion, const char *suggestedVersion = nullptr, uint64_t driverVersion, bool bWhiteListed = false, const char *suggestedVersion = nullptr,
bool ownDevices = false); bool ownDevices = false);
DriverInfo(); DriverInfo();
...@@ -101,6 +99,8 @@ struct DriverInfo ...@@ -101,6 +99,8 @@ struct DriverInfo
// deallocated. False by default. // deallocated. False by default.
bool mbDeleteDevices; bool mbDeleteDevices;
bool mbWhitelisted;
VersionComparisonOp meComparisonOp; VersionComparisonOp meComparisonOp;
/* versions are assumed to be A.B.C.D packed as 0xAAAABBBBCCCCDDDD */ /* versions are assumed to be A.B.C.D packed as 0xAAAABBBBCCCCDDDD */
......
...@@ -12,22 +12,25 @@ ...@@ -12,22 +12,25 @@
#include <windows.h> #include <windows.h>
#include <setupapi.h> #include <setupapi.h>
#include <cstdint> #include <cstdint>
#include <rtl/ustrbuf.hxx>
OUString* WinOpenGLDeviceInfo::mpDeviceVendors[wgl::DeviceVendorMax]; OUString* WinOpenGLDeviceInfo::mpDeviceVendors[wgl::DeviceVendorMax];
std::vector<wgl::DriverInfo> WinOpenGLDeviceInfo::maDriverInfo; std::vector<wgl::DriverInfo> WinOpenGLDeviceInfo::maDriverInfo;
#define APPEND_TO_DRIVER_BLOCKLIST(os, vendor, devices, driverComparator, driverVersion, suggestedVersion) \ #define APPEND_TO_DRIVER_BLOCKLIST(os, vendor, devices, driverComparator, driverVersion, suggestedVersion) \
maDriverInfo.push_back(wgl::DriverInfo(os, vendor, devices, driverComparator, driverVersion, suggestedVersion)) maDriverInfo.push_back(wgl::DriverInfo(os, vendor, devices, driverComparator, driverVersion, false, suggestedVersion))
#define APPEND_TO_DRIVER_BLOCKLIST2(os, vendor, devices, driverComparator, driverVersion) \ #define APPEND_TO_DRIVER_BLOCKLIST2(os, vendor, devices, driverComparator, driverVersion) \
maDriverInfo.push_back(wgl::DriverInfo(os, vendor, devices, driverComparator, driverVersion)) maDriverInfo.push_back(wgl::DriverInfo(os, vendor, devices, driverComparator, driverVersion))
#define APPEND_TO_DRIVER_WHITELIST(os, vendor, devices, driverComparator, driverVersion) \
maDriverInfo.push_back(wgl::DriverInfo(os, vendor, devices, driverComparator, driverVersion, true))
#define APPEND_TO_DRIVER_BLOCKLIST_RANGE(os, vendor, devices, driverComparator, driverVersion, driverVersionMax, suggestedVersion) \ #define APPEND_TO_DRIVER_BLOCKLIST_RANGE(os, vendor, devices, driverComparator, driverVersion, driverVersionMax, suggestedVersion) \
do { \ do { \
assert(driverComparator == wgl::DRIVER_BETWEEN_EXCLUSIVE || \ assert(driverComparator == wgl::DRIVER_BETWEEN_EXCLUSIVE || \
driverComparator == wgl::DRIVER_BETWEEN_INCLUSIVE || \ driverComparator == wgl::DRIVER_BETWEEN_INCLUSIVE || \
driverComparator == wgl::DRIVER_BETWEEN_INCLUSIVE_START); \ driverComparator == wgl::DRIVER_BETWEEN_INCLUSIVE_START); \
wgl::DriverInfo info(os, vendor, devices, driverComparator, driverVersion, suggestedVersion); \ wgl::DriverInfo info(os, vendor, devices, driverComparator, driverVersion, false, suggestedVersion); \
info.mnDriverVersionMax = driverVersionMax; \ info.mnDriverVersionMax = driverVersionMax; \
maDriverInfo.push_back(info); \ maDriverInfo.push_back(info); \
} while (false) } while (false)
...@@ -373,6 +376,7 @@ DriverInfo::DriverInfo() ...@@ -373,6 +376,7 @@ DriverInfo::DriverInfo()
maAdapterVendor(WinOpenGLDeviceInfo::GetDeviceVendor(VendorAll)), maAdapterVendor(WinOpenGLDeviceInfo::GetDeviceVendor(VendorAll)),
mpDevices(allDevices), mpDevices(allDevices),
mbDeleteDevices(false), mbDeleteDevices(false),
mbWhitelisted(false),
meComparisonOp(DRIVER_COMPARISON_IGNORED), meComparisonOp(DRIVER_COMPARISON_IGNORED),
mnDriverVersion(0), mnDriverVersion(0),
mnDriverVersionMax(0) mnDriverVersionMax(0)
...@@ -382,6 +386,7 @@ DriverInfo::DriverInfo(OperatingSystem os, const OUString& vendor, ...@@ -382,6 +386,7 @@ DriverInfo::DriverInfo(OperatingSystem os, const OUString& vendor,
DeviceFamilyVector* devices, DeviceFamilyVector* devices,
VersionComparisonOp op, VersionComparisonOp op,
uint64_t driverVersion, uint64_t driverVersion,
bool bWhitelisted,
const char *suggestedVersion /* = nullptr */, const char *suggestedVersion /* = nullptr */,
bool ownDevices /* = false */) bool ownDevices /* = false */)
: meOperatingSystem(os), : meOperatingSystem(os),
...@@ -389,6 +394,7 @@ DriverInfo::DriverInfo(OperatingSystem os, const OUString& vendor, ...@@ -389,6 +394,7 @@ DriverInfo::DriverInfo(OperatingSystem os, const OUString& vendor,
maAdapterVendor(vendor), maAdapterVendor(vendor),
mpDevices(devices), mpDevices(devices),
mbDeleteDevices(ownDevices), mbDeleteDevices(ownDevices),
mbWhitelisted(bWhitelisted),
meComparisonOp(op), meComparisonOp(op),
mnDriverVersion(driverVersion), mnDriverVersion(driverVersion),
mnDriverVersionMax(0) mnDriverVersionMax(0)
...@@ -401,6 +407,7 @@ DriverInfo::DriverInfo(const DriverInfo& aOrig) ...@@ -401,6 +407,7 @@ DriverInfo::DriverInfo(const DriverInfo& aOrig)
: meOperatingSystem(aOrig.meOperatingSystem), : meOperatingSystem(aOrig.meOperatingSystem),
mnOperatingSystemVersion(aOrig.mnOperatingSystemVersion), mnOperatingSystemVersion(aOrig.mnOperatingSystemVersion),
maAdapterVendor(aOrig.maAdapterVendor), maAdapterVendor(aOrig.maAdapterVendor),
mbWhitelisted(aOrig.mbWhitelisted),
meComparisonOp(aOrig.meComparisonOp), meComparisonOp(aOrig.meComparisonOp),
mnDriverVersion(aOrig.mnDriverVersion), mnDriverVersion(aOrig.mnDriverVersion),
mnDriverVersionMax(aOrig.mnDriverVersionMax) mnDriverVersionMax(aOrig.mnDriverVersionMax)
...@@ -657,6 +664,13 @@ bool WinOpenGLDeviceInfo::FindBlocklistedDeviceInList() ...@@ -657,6 +664,13 @@ bool WinOpenGLDeviceInfo::FindBlocklistedDeviceInList()
} }
if (match || maDriverInfo[i].mnDriverVersion == wgl::DriverInfo::allDriverVersions) { if (match || maDriverInfo[i].mnDriverVersion == wgl::DriverInfo::allDriverVersions) {
// white listed drivers
if (maDriverInfo[i].mbWhitelisted)
{
SAL_WARN("vcl.opengl", "whitelisted driver");
return false;
}
match = true; match = true;
SAL_WARN("vcl.opengl", "use : " << maDriverInfo[i].maSuggestedVersion); SAL_WARN("vcl.opengl", "use : " << maDriverInfo[i].maSuggestedVersion);
break; break;
...@@ -979,6 +993,12 @@ OUString WinOpenGLDeviceInfo::GetDeviceVendor(wgl::DeviceVendor id) ...@@ -979,6 +993,12 @@ OUString WinOpenGLDeviceInfo::GetDeviceVendor(wgl::DeviceVendor id)
void WinOpenGLDeviceInfo::FillBlacklist() void WinOpenGLDeviceInfo::FillBlacklist()
{ {
/*
* Implement whitelist entries first as they will be used first to stop early;
*/
APPEND_TO_DRIVER_WHITELIST( wgl::DRIVER_OS_WINDOWS_7, GetDeviceVendor(wgl::VendorIntel),
wgl::DriverInfo::allDevices, wgl::DRIVER_EQUAL, wgl::V(10,18,10,3412));
/* /*
* It should be noted here that more specialized rules on certain features * It should be noted here that more specialized rules on certain features
* should be inserted -before- more generalized restriction. As the first * should be inserted -before- more generalized restriction. As the first
......
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