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

Unified Diff: chrome/browser/gpu_util.cc

Issue 10389051: Change GPUInfo to handle multiple GPUs. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 7 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 | « chrome/browser/gpu_blacklist_unittest.cc ('k') | chrome/browser/metrics/metrics_log.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gpu_util.cc
===================================================================
--- chrome/browser/gpu_util.cc (revision 136164)
+++ chrome/browser/gpu_util.cc (working copy)
@@ -81,6 +81,17 @@
return value;
}
+std::string GPUDeviceToString(const content::GPUInfo::GPUDevice& gpu) {
+ std::string vendor = base::StringPrintf("0x%04x", gpu.vendor_id);
+ if (!gpu.vendor_string.empty())
+ vendor += " [" + gpu.vendor_string + "]";
+ std::string device = base::StringPrintf("0x%04x", gpu.device_id);
+ if (!gpu.device_string.empty())
+ device += " [" + gpu.device_string + "]";
+ return base::StringPrintf(
+ "VENDOR = %s, DEVICE= %s", vendor.c_str(), device.c_str());
+}
+
#if defined(OS_WIN)
enum WinSubVersion {
@@ -336,10 +347,13 @@
"Initialization time",
base::Int64ToString(gpu_info.initialization_time.InMilliseconds())));
basic_info->Append(NewDescriptionValuePair(
- "Vendor Id", base::StringPrintf("0x%04x", gpu_info.vendor_id)));
+ "GPU0", GPUDeviceToString(gpu_info.gpu)));
+ for (size_t i = 0; i < gpu_info.secondary_gpus.size(); ++i) {
+ basic_info->Append(NewDescriptionValuePair(
+ base::StringPrintf("GPU%d", static_cast<int>(i + 1)),
+ GPUDeviceToString(gpu_info.secondary_gpus[i])));
+ }
basic_info->Append(NewDescriptionValuePair(
- "Device Id", base::StringPrintf("0x%04x", gpu_info.device_id)));
- basic_info->Append(NewDescriptionValuePair(
"Optimus", Value::CreateBooleanValue(gpu_info.optimus)));
basic_info->Append(NewDescriptionValuePair(
"AMD switchable", Value::CreateBooleanValue(gpu_info.amd_switchable)));
« no previous file with comments | « chrome/browser/gpu_blacklist_unittest.cc ('k') | chrome/browser/metrics/metrics_log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698