summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzmo@chromium.org <zmo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-22 01:07:21 +0000
committerzmo@chromium.org <zmo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-22 01:07:21 +0000
commit8114edfb2848264105f90b14d267df2d2c35d942 (patch)
treeda0a0dbede553f81b5b321ce100dbef60daca3a1
parentc481bb685b669e1eeb83582c682ffa69d44cd21f (diff)
downloadchromium_src-8114edfb2848264105f90b14d267df2d2c35d942.zip
chromium_src-8114edfb2848264105f90b14d267df2d2c35d942.tar.gz
chromium_src-8114edfb2848264105f90b14d267df2d2c35d942.tar.bz2
Make full gpu info collection on Linux optional.
If we already have enough info to make blacklisting decisions from preliminary info collection, then we don't have to do full info collection at GPU process startup time. BUG= TEST=tree green Review URL: https://chromiumcodereview.appspot.com/10627010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143505 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--content/browser/gpu/gpu_data_manager_impl.cc5
-rw-r--r--content/gpu/gpu_main.cc14
-rw-r--r--content/public/common/content_switches.cc3
-rw-r--r--content/public/common/content_switches.h1
4 files changed, 18 insertions, 5 deletions
diff --git a/content/browser/gpu/gpu_data_manager_impl.cc b/content/browser/gpu/gpu_data_manager_impl.cc
index 94b6493..53f91e9 100644
--- a/content/browser/gpu/gpu_data_manager_impl.cc
+++ b/content/browser/gpu/gpu_data_manager_impl.cc
@@ -224,11 +224,14 @@ void GpuDataManagerImpl::AppendGpuCommandLine(
}
// Pass GPU and driver information to GPU process. We try to avoid full GPU
// info collection at GPU process startup, but we need gpu vendor_id,
- // device_id, driver_version for crash reporting purpose.
+ // device_id, driver_vendor, driver_version for deciding whether we need to
+ // collect full info (on Linux) and for crash reporting purpose.
command_line->AppendSwitchASCII(switches::kGpuVendorID,
base::StringPrintf("0x%04x", gpu_info_.gpu.vendor_id));
command_line->AppendSwitchASCII(switches::kGpuDeviceID,
base::StringPrintf("0x%04x", gpu_info_.gpu.device_id));
+ command_line->AppendSwitchASCII(switches::kGpuDriverVendor,
+ gpu_info_.driver_vendor);
command_line->AppendSwitchASCII(switches::kGpuDriverVersion,
gpu_info_.driver_version);
}
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc
index 5f50539..92afb3b 100644
--- a/content/gpu/gpu_main.cc
+++ b/content/gpu/gpu_main.cc
@@ -89,6 +89,9 @@ int GpuMain(const content::MainFunctionParams& parameters) {
success = base::HexStringToInt(
command_line.GetSwitchValueASCII(switches::kGpuDeviceID),
reinterpret_cast<int*>(&(gpu_info.gpu.device_id)));
+ DCHECK(success);
+ gpu_info.driver_vendor =
+ command_line.GetSwitchValueASCII(switches::kGpuDriverVendor);
gpu_info.driver_version =
command_line.GetSwitchValueASCII(switches::kGpuDriverVersion);
content::GetContentClient()->SetGpuInfo(gpu_info);
@@ -99,10 +102,13 @@ int GpuMain(const content::MainFunctionParams& parameters) {
// We collect full GPU info on demand in Win/Mac, i.e., when about:gpu
// page opens. This is because we can make blacklist decisions based on
// preliminary GPU info.
- // However, on Linux, blacklist decisions are based on full GPU info.
- if (!gpu_info_collector::CollectGraphicsInfo(&gpu_info))
- VLOG(1) << "gpu_info_collector::CollectGraphicsInfo failed";
- content::GetContentClient()->SetGpuInfo(gpu_info);
+ // However, on Linux, we may not have enough info for blacklisting.
+ if (!gpu_info.gpu.vendor_id || !gpu_info.gpu.device_id ||
+ gpu_info.driver_vendor.empty() || gpu_info.driver_version.empty()) {
+ if (!gpu_info_collector::CollectGraphicsInfo(&gpu_info))
+ VLOG(1) << "gpu_info_collector::CollectGraphicsInfo failed";
+ content::GetContentClient()->SetGpuInfo(gpu_info);
+ }
#if !defined(OS_CHROMEOS)
if (gpu_info.gpu.vendor_id == 0x10de && // NVIDIA
diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc
index e825afb..0cc3e59 100644
--- a/content/public/common/content_switches.cc
+++ b/content/public/common/content_switches.cc
@@ -399,6 +399,9 @@ const char kForceRendererAccessibility[] = "force-renderer-accessibility";
// Passes gpu device_id from browser process to GPU process.
const char kGpuDeviceID[] = "gpu-device-id";
+// Passes gpu driver_vendor from browser process to GPU process.
+const char kGpuDriverVendor[] = "gpu-driver-vendor";
+
// Passes gpu driver_version from browser process to GPU process.
const char kGpuDriverVersion[] = "gpu-driver-version";
diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h
index 3d2a63b..52ae02c 100644
--- a/content/public/common/content_switches.h
+++ b/content/public/common/content_switches.h
@@ -124,6 +124,7 @@ CONTENT_EXPORT extern const char kForceCompositingMode[];
extern const char kForceFieldTrials[];
CONTENT_EXPORT extern const char kForceRendererAccessibility[];
extern const char kGpuDeviceID[];
+extern const char kGpuDriverVendor[];
extern const char kGpuDriverVersion[];
extern const char kGpuLauncher[];
CONTENT_EXPORT extern const char kGpuProcess[];