From fb6061ef0a7c8ef2ea3acdf6ffd8ee120bed7a29 Mon Sep 17 00:00:00 2001 From: "zmo@chromium.org" Date: Thu, 15 May 2014 20:44:39 +0000 Subject: Be more strict with detecting Optimus on Linux. I don't really this is the root cause of r371851, but anyway, tighten up the logic seems reasonable. BUG=371851 TEST= R=kbr@chromium.org Review URL: https://codereview.chromium.org/283823002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@270806 0039d316-1c4b-4281-b951-d872f2087c98 --- gpu/config/gpu_info_collector_x11.cc | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/gpu/config/gpu_info_collector_x11.cc b/gpu/config/gpu_info_collector_x11.cc index d4288b7..19232c6 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; } -- cgit v1.1