summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-11-30 21:01:35 +0100
committerJan Holesovsky <kendy@collabora.com>2014-12-02 15:47:38 +0100
commit5d879e4a174054f3aa103b933e940b6bbd1c5076 (patch)
tree7b435d8848ec6562798e3c743073dc3b4ec0d996 /vcl
parenta915cfcf5c200f521fe8f8724d57c18b5eb4ca6f (diff)
whitelist some drivers
Especially the ones from our developer machines as they are better tested than anything else. Change-Id: Id6ff6bcae314c03453d82ee4e64aaef1bd5ed84a
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/opengl/win/WinDeviceInfo.hxx4
-rw-r--r--vcl/opengl/win/WinDeviceInfo.cxx26
2 files changed, 26 insertions, 4 deletions
diff --git a/vcl/inc/opengl/win/WinDeviceInfo.hxx b/vcl/inc/opengl/win/WinDeviceInfo.hxx
index 9abddd0e4c53..21f14d9272bd 100644
--- a/vcl/inc/opengl/win/WinDeviceInfo.hxx
+++ b/vcl/inc/opengl/win/WinDeviceInfo.hxx
@@ -82,7 +82,7 @@ struct DriverInfo
DriverInfo(OperatingSystem os, const OUString& vendor, DeviceFamilyVector* devices,
VersionComparisonOp op,
- uint64_t driverVersion, const char *suggestedVersion = nullptr,
+ uint64_t driverVersion, bool bWhiteListed = false, const char *suggestedVersion = nullptr,
bool ownDevices = false);
DriverInfo();
@@ -101,6 +101,8 @@ struct DriverInfo
// deallocated. False by default.
bool mbDeleteDevices;
+ bool mbWhitelisted;
+
VersionComparisonOp meComparisonOp;
/* versions are assumed to be A.B.C.D packed as 0xAAAABBBBCCCCDDDD */
diff --git a/vcl/opengl/win/WinDeviceInfo.cxx b/vcl/opengl/win/WinDeviceInfo.cxx
index c9bf1ff30961..824d0fccfa11 100644
--- a/vcl/opengl/win/WinDeviceInfo.cxx
+++ b/vcl/opengl/win/WinDeviceInfo.cxx
@@ -12,22 +12,25 @@
#include <windows.h>
#include <setupapi.h>
#include <cstdint>
-#include <rtl/ustrbuf.hxx>
OUString* WinOpenGLDeviceInfo::mpDeviceVendors[wgl::DeviceVendorMax];
std::vector<wgl::DriverInfo> WinOpenGLDeviceInfo::maDriverInfo;
#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) \
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) \
do { \
assert(driverComparator == wgl::DRIVER_BETWEEN_EXCLUSIVE || \
driverComparator == wgl::DRIVER_BETWEEN_INCLUSIVE || \
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; \
maDriverInfo.push_back(info); \
} while (false)
@@ -373,6 +376,7 @@ DriverInfo::DriverInfo()
maAdapterVendor(WinOpenGLDeviceInfo::GetDeviceVendor(VendorAll)),
mpDevices(allDevices),
mbDeleteDevices(false),
+ mbWhitelisted(false),
meComparisonOp(DRIVER_COMPARISON_IGNORED),
mnDriverVersion(0),
mnDriverVersionMax(0)
@@ -382,6 +386,7 @@ DriverInfo::DriverInfo(OperatingSystem os, const OUString& vendor,
DeviceFamilyVector* devices,
VersionComparisonOp op,
uint64_t driverVersion,
+ bool bWhitelisted,
const char *suggestedVersion /* = nullptr */,
bool ownDevices /* = false */)
: meOperatingSystem(os),
@@ -389,6 +394,7 @@ DriverInfo::DriverInfo(OperatingSystem os, const OUString& vendor,
maAdapterVendor(vendor),
mpDevices(devices),
mbDeleteDevices(ownDevices),
+ mbWhitelisted(bWhitelisted),
meComparisonOp(op),
mnDriverVersion(driverVersion),
mnDriverVersionMax(0)
@@ -401,6 +407,7 @@ DriverInfo::DriverInfo(const DriverInfo& aOrig)
: meOperatingSystem(aOrig.meOperatingSystem),
mnOperatingSystemVersion(aOrig.mnOperatingSystemVersion),
maAdapterVendor(aOrig.maAdapterVendor),
+ mbWhitelisted(aOrig.mbWhitelisted),
meComparisonOp(aOrig.meComparisonOp),
mnDriverVersion(aOrig.mnDriverVersion),
mnDriverVersionMax(aOrig.mnDriverVersionMax)
@@ -657,6 +664,13 @@ bool WinOpenGLDeviceInfo::FindBlocklistedDeviceInList()
}
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;
SAL_WARN("vcl.opengl", "use : " << maDriverInfo[i].maSuggestedVersion);
break;
@@ -980,6 +994,12 @@ OUString WinOpenGLDeviceInfo::GetDeviceVendor(wgl::DeviceVendor id)
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
* should be inserted -before- more generalized restriction. As the first
* match for feature/OS/device found in the list will be used for the final