diff options
author | zmo@chromium.org <zmo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-10 23:02:42 +0000 |
---|---|---|
committer | zmo@chromium.org <zmo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-10 23:02:42 +0000 |
commit | a094e2cb67f9c134163a4418315d8d245e406fbe (patch) | |
tree | 47f0ee5de8d8216bcb12c2dbd5c65569b13fe200 /content/public/common | |
parent | e9165b203749b1b3b37a93d3e640781384191cb9 (diff) | |
download | chromium_src-a094e2cb67f9c134163a4418315d8d245e406fbe.zip chromium_src-a094e2cb67f9c134163a4418315d8d245e406fbe.tar.gz chromium_src-a094e2cb67f9c134163a4418315d8d245e406fbe.tar.bz2 |
Change GPUInfo to handle multiple GPUs.
At the moment we always select one GPU as primary and the others as secondary. In preliminary GPU info collection (without creating a GL context and collect GL VENDOR/RENDERER strings), we actually don't know which GPU is in use. The current logic is that if one GPU is Intel, we assume the other is primary.
I agree a better logic is needed. However, at the moment, logging/crash reports all requires ONE GPU vendor_id/device_id, so even though we don't know which GPU is active, we still need to randomly select one.
This needs more thinking and design, so I think it's reasonable to leave it to a possible future CL.
Also, the logic on collecting GPU info through libpci is changed to collect multiple GPUs. If one is Intel and one is NVIDIA, we assume it's optimus and we disable GPU features. This logic is hardwired in Chrome in this CL. The plan is to push the logic to blacklist, but I'll leave it to a seperate CL.
BUG=126307,75220
TEST=about:gpu page on a Linux system with optimus GPU
R=kbr
TBR=jam
Review URL: https://chromiumcodereview.appspot.com/10389051
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@136429 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/public/common')
-rw-r--r-- | content/public/common/gpu_info.cc | 9 | ||||
-rw-r--r-- | content/public/common/gpu_info.h | 28 |
2 files changed, 30 insertions, 7 deletions
diff --git a/content/public/common/gpu_info.cc b/content/public/common/gpu_info.cc index 03e33a5..af3ea48 100644 --- a/content/public/common/gpu_info.cc +++ b/content/public/common/gpu_info.cc @@ -6,12 +6,17 @@ namespace content { +GPUInfo::GPUDevice::GPUDevice() + : vendor_id(0), + device_id(0) { +} + +GPUInfo::GPUDevice::~GPUDevice() { } + GPUInfo::GPUInfo() : finalized(false), optimus(false), amd_switchable(false), - vendor_id(0), - device_id(0), can_lose_context(false), gpu_accessible(true), software_rendering(false) { diff --git a/content/public/common/gpu_info.h b/content/public/common/gpu_info.h index 820ce23..dad0477 100644 --- a/content/public/common/gpu_info.h +++ b/content/public/common/gpu_info.h @@ -10,6 +10,7 @@ // on which chrome is currently running. #include <string> +#include <vector> #include "base/basictypes.h" #include "base/time.h" @@ -21,6 +22,24 @@ namespace content { struct CONTENT_EXPORT GPUInfo { + struct CONTENT_EXPORT GPUDevice { + GPUDevice(); + ~GPUDevice(); + + // The DWORD (uint32) representing the graphics card vendor id. + uint32 vendor_id; + + // The DWORD (uint32) representing the graphics card device id. + // Device ids are unique to vendor, not to one another. + uint32 device_id; + + // The strings that describe the GPU. + // In Linux these strings are obtained through libpci. + // In Win/MacOSX, these two strings are not filled at the moment. + std::string vendor_string; + std::string device_string; + }; + GPUInfo(); ~GPUInfo(); @@ -37,12 +56,11 @@ struct CONTENT_EXPORT GPUInfo { // Computer has AMD Dynamic Switchable Graphics bool amd_switchable; - // The DWORD (uint32) representing the graphics card vendor id. - uint32 vendor_id; + // Primary GPU, for exmaple, the discrete GPU in a dual GPU machine. + GPUDevice gpu; - // The DWORD (uint32) representing the graphics card device id. Device ids - // are unique to vendor, not to one another. - uint32 device_id; + // Secondary GPUs, for example, the integrated GPU in a dual GPU machine. + std::vector<GPUDevice> secondary_gpus; // The vendor of the graphics driver currently installed. std::string driver_vendor; |