Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1007)

Unified Diff: content/browser/gpu/gpu_blacklist.cc

Issue 11047011: Figure out whether we have enough information to make the final GPU blacklisting decision. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/gpu/gpu_blacklist.h ('k') | content/browser/gpu/gpu_blacklist_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/gpu/gpu_blacklist.cc
===================================================================
--- content/browser/gpu/gpu_blacklist.cc (revision 160744)
+++ content/browser/gpu/gpu_blacklist.cc (working copy)
@@ -1013,7 +1013,7 @@
if (is_not_primary_gpu && is_not_secondary_gpu)
return false;
break;
- default:
+ case kMultiGpuCategoryNone:
break;
}
switch (multi_gpu_style_) {
@@ -1025,13 +1025,13 @@
if (!gpu_info.amd_switchable)
return false;
break;
- default:
+ case kMultiGpuStyleNone:
break;
}
- if (driver_vendor_info_.get() != NULL &&
+ if (driver_vendor_info_.get() != NULL && !gpu_info.driver_vendor.empty() &&
!driver_vendor_info_->Contains(gpu_info.driver_vendor))
return false;
- if (driver_version_info_.get() != NULL) {
+ if (driver_version_info_.get() != NULL && !gpu_info.driver_version.empty()) {
std::string processed_driver_version;
if (driver_version_info_->IsLexical())
processed_driver_version = NumericalToLexical(gpu_info.driver_version);
@@ -1042,16 +1042,16 @@
!driver_version_info_->Contains(driver_version))
return false;
}
- if (driver_date_info_.get() != NULL) {
+ if (driver_date_info_.get() != NULL && !gpu_info.driver_date.empty()) {
Version driver_date;
GetDateFromString(gpu_info.driver_date, &driver_date);
if (!driver_date.IsValid() || !driver_date_info_->Contains(driver_date))
return false;
}
- if (gl_vendor_info_.get() != NULL &&
+ if (gl_vendor_info_.get() != NULL && !gpu_info.gl_vendor.empty() &&
!gl_vendor_info_->Contains(gpu_info.gl_vendor))
return false;
- if (gl_renderer_info_.get() != NULL &&
+ if (gl_renderer_info_.get() != NULL && !gpu_info.gl_renderer.empty() &&
!gl_renderer_info_->Contains(gpu_info.gl_renderer))
return false;
if (perf_graphics_info_.get() != NULL &&
@@ -1080,12 +1080,34 @@
for (size_t i = 0; i < exceptions_.size(); ++i) {
if (exceptions_[i]->Contains(os_type, os_version, machine_model_name,
- machine_model_version, gpu_info))
+ machine_model_version, gpu_info) &&
+ !exceptions_[i]->NeedsMoreInfo(gpu_info))
return false;
}
return true;
}
+bool GpuBlacklist::GpuBlacklistEntry::NeedsMoreInfo(
+ const content::GPUInfo& gpu_info) const {
+ // We only check for missing info that might be collected with a gl context.
+ // If certain info is missing due to some error, say, we fail to collect
+ // vendor_id/device_id, then even if we launch GPU process and create a gl
+ // context, we won't gather such missing info, so we still return false.
+ if (driver_vendor_info_.get() && gpu_info.driver_vendor.empty())
+ return true;
+ if (driver_version_info_.get() && gpu_info.driver_version.empty())
+ return true;
+ if (gl_vendor_info_.get() && gpu_info.gl_vendor.empty())
+ return true;
+ if (gl_renderer_info_.get() && gpu_info.gl_renderer.empty())
+ return true;
+ for (size_t i = 0; i < exceptions_.size(); ++i) {
+ if (exceptions_[i]->NeedsMoreInfo(gpu_info))
+ return true;
+ }
+ return false;
+}
+
GpuBlacklist::OsType GpuBlacklist::GpuBlacklistEntry::GetOsType() const {
if (os_info_.get() == NULL)
return kOsAny;
@@ -1111,7 +1133,8 @@
GpuBlacklist::GpuBlacklist()
: max_entry_id_(0),
- contains_unknown_fields_(false) {
+ contains_unknown_fields_(false),
+ needs_more_info_(false) {
}
GpuBlacklist::~GpuBlacklist() {
@@ -1209,6 +1232,10 @@
int type = 0;
GpuSwitchingOption switching = content::GPU_SWITCHING_OPTION_UNKNOWN;
+ needs_more_info_ = false;
+ int possible_type = 0;
+ GpuSwitchingOption possible_switching = content::GPU_SWITCHING_OPTION_UNKNOWN;
+
if (os == kOsAny)
os = GetOsType();
scoped_ptr<Version> my_os_version;
@@ -1227,14 +1254,28 @@
if (blacklist_[i]->Contains(os, *os_version, current_machine_model_name_,
*current_machine_model_version_, gpu_info)) {
if (!blacklist_[i]->disabled()) {
- type |= blacklist_[i]->GetGpuFeatureType();
+ bool not_final = blacklist_[i]->NeedsMoreInfo(gpu_info);
+ if (not_final)
+ possible_type |= blacklist_[i]->GetGpuFeatureType();
+ else
+ type |= blacklist_[i]->GetGpuFeatureType();
if (blacklist_[i]->GetGpuSwitchingOption() !=
- content::GPU_SWITCHING_OPTION_UNKNOWN)
- switching = blacklist_[i]->GetGpuSwitchingOption();
+ content::GPU_SWITCHING_OPTION_UNKNOWN) {
+ if (not_final)
+ possible_switching = blacklist_[i]->GetGpuSwitchingOption();
+ else
+ switching = blacklist_[i]->GetGpuSwitchingOption();
+ }
}
active_entries_.push_back(blacklist_[i]);
}
}
+
+ if ((possible_type != 0 && (possible_type | type) != type) ||
+ (possible_switching != content::GPU_SWITCHING_OPTION_UNKNOWN &&
+ switching == content::GPU_SWITCHING_OPTION_UNKNOWN))
+ needs_more_info_ = true;
+
Decision decision;
decision.blacklisted_features = static_cast<GpuFeatureType>(type);
decision.gpu_switching = switching;
« no previous file with comments | « content/browser/gpu/gpu_blacklist.h ('k') | content/browser/gpu/gpu_blacklist_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698