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

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

Issue 11009011: Use the cpuid instruction to generate the CPU brand string. And (Closed) Base URL: https://src.chromium.org/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/software_rendering_list.json » ('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 160148)
+++ content/browser/gpu/gpu_blacklist.cc (working copy)
@@ -5,6 +5,7 @@
#include "content/browser/gpu/gpu_blacklist.h"
#include "base/command_line.h"
+#include "base/cpu.h"
#include "base/json/json_reader.h"
#include "base/logging.h"
@@ -578,6 +579,19 @@
dictionary_entry_count++;
}
+ const DictionaryValue* cpu_brand_value = NULL;
+ if (value->GetDictionary("cpu_info", &cpu_brand_value)) {
+ std::string cpu_op;
+ std::string cpu_value;
+ cpu_brand_value->GetString("op", &cpu_op);
+ cpu_brand_value->GetString("value", &cpu_value);
+ if (!entry->SetCpuBrand(cpu_op, cpu_value)) {
+ LOG(WARNING) << "Malformed cpu_brand entry " << entry->id();
+ return NULL;
+ }
+ dictionary_entry_count++;
+ }
+
const DictionaryValue* perf_graphics_value = NULL;
if (value->GetDictionary("perf_graphics", &perf_graphics_value)) {
std::string op;
@@ -846,6 +860,14 @@
return gl_renderer_info_->IsValid();
}
+bool GpuBlacklist::GpuBlacklistEntry::SetCpuBrand(
+ const std::string& cpu_op,
+ const std::string& cpu_value) {
+ cpu_brand_.reset(
+ new StringInfo(cpu_op, cpu_value));
+ return cpu_brand_->IsValid();
+}
+
bool GpuBlacklist::GpuBlacklistEntry::SetPerfGraphicsInfo(
const std::string& op,
const std::string& float_string,
@@ -1050,6 +1072,12 @@
if (gpu_count_info_.get() != NULL &&
!gpu_count_info_->Contains(gpu_info.secondary_gpus.size() + 1))
return false;
+ if (cpu_brand_.get() != NULL) {
+ base::CPU cpu_info;
+ if (!cpu_brand_->Contains(cpu_info.cpu_brand()))
+ return false;
+ }
+
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))
« no previous file with comments | « content/browser/gpu/gpu_blacklist.h ('k') | content/browser/gpu/software_rendering_list.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698