diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-11-30 21:01:35 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-11-30 21:01:35 +0100 |
commit | 82d767a50629aa8e1c6fa005439c92153b22e7f6 (patch) | |
tree | ab04b44cc3be06a55a797ca91e80072dbdbe8ed1 | |
parent | 773d2bde7176130ad9ac4a28991a1441ad022faf (diff) |
whitelist some drivers
Especially the ones from our developer machines as they are better tested than anything else.
Change-Id: Id6ff6bcae314c03453d82ee4e64aaef1bd5ed84a
-rw-r--r-- | vcl/inc/opengl/win/WinDeviceInfo.hxx | 6 | ||||
-rw-r--r-- | vcl/opengl/win/WinDeviceInfo.cxx | 26 |
2 files changed, 26 insertions, 6 deletions
diff --git a/vcl/inc/opengl/win/WinDeviceInfo.hxx b/vcl/inc/opengl/win/WinDeviceInfo.hxx index 2a887c436615..6fb783473898 100644 --- a/vcl/inc/opengl/win/WinDeviceInfo.hxx +++ b/vcl/inc/opengl/win/WinDeviceInfo.hxx @@ -12,8 +12,6 @@ #include "opengl/DeviceInfo.hxx" #include <rtl/ustring.hxx> -#include <vector> -#include <stdint.h> namespace wgl { @@ -82,7 +80,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 +99,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 |