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

Unified Diff: gpu/config/gpu_info_collector_x11.cc

Issue 283823002: Be more strict with detecting Optimus on Linux. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/config/gpu_info_collector_x11.cc
diff --git a/gpu/config/gpu_info_collector_x11.cc b/gpu/config/gpu_info_collector_x11.cc
index d4288b77938ee9fc4937500291eb834e4f1b4e64..19232c6ea1d55e1c93db91e04a7bc2d14d9c4db1 100644
--- a/gpu/config/gpu_info_collector_x11.cc
+++ b/gpu/config/gpu_info_collector_x11.cc
@@ -237,13 +237,18 @@ CollectInfoResult CollectBasicGraphicsInfo(GPUInfo* gpu_info) {
case kVendorIDIntel:
// In dual-GPU cases, sometimes PCI scan only gives us the
// integrated GPU (i.e., the Intel one).
- driver_version = CollectDriverVersionNVidia();
- if (!driver_version.empty()) {
- gpu_info->driver_vendor = "NVIDIA";
- gpu_info->driver_version = driver_version;
- // Machines with more than two GPUs are not handled.
- if (gpu_info->secondary_gpus.size() <= 1)
+ if (gpu_info->secondary_gpus.size() == 0) {
+ driver_version = CollectDriverVersionNVidia();
+ if (!driver_version.empty()) {
+ gpu_info->driver_vendor = "NVIDIA";
+ gpu_info->driver_version = driver_version;
gpu_info->optimus = true;
+ // Put Intel to the secondary GPU list.
+ gpu_info->secondary_gpus.push_back(gpu_info->gpu);
+ // Put NVIDIA as the primary GPU.
+ gpu_info->gpu.vendor_id = kVendorIDNVidia;
+ gpu_info->gpu.device_id = 0; // Unknown Device.
+ }
}
break;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698