summaryrefslogtreecommitdiffstats
path: root/content/browser/gpu/gpu_data_manager_impl.cc
diff options
context:
space:
mode:
authorzmo@chromium.org <zmo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-17 21:10:09 +0000
committerzmo@chromium.org <zmo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-17 21:10:09 +0000
commit4df0884f895c653351d26f911696bb95ea407c34 (patch)
tree32c68e9b4c87fae3670c9809233d5cac44724390 /content/browser/gpu/gpu_data_manager_impl.cc
parentba62ab9cda8ce4a0f55464fa60e74366808e86e0 (diff)
downloadchromium_src-4df0884f895c653351d26f911696bb95ea407c34.zip
chromium_src-4df0884f895c653351d26f911696bb95ea407c34.tar.gz
chromium_src-4df0884f895c653351d26f911696bb95ea407c34.tar.bz2
Attempt to reland r173248,173259
They were reverted for two reasons. 1) GpuSideBlacklist test is broken in winbots. It turns out the test is buggy, so I fixed the test in 173505 2) It broke official win build. So I reverted part of the original CL that could cause the failure: move the AMDVideoCardType enum def back to gpu_info_collector.h, although for chromium build, it doesn't need to be in the .h file. Hope this will make all bots (including official build) happe. Original CL text: Only collect GL/D3D context specific GPUInfo in GPU process Instead of collecting full GPUInfo. Basic GPUInfo are already collected at Browser process startup time. This avoids sandbox issue with libpci on linux. Also, it makes GPU startup faster. BUG=162928, 165374 TEST=manual about:gpu TBR=kbr Review URL: https://codereview.chromium.org/11576056 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173533 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/gpu/gpu_data_manager_impl.cc')
-rw-r--r--content/browser/gpu/gpu_data_manager_impl.cc33
1 files changed, 20 insertions, 13 deletions
diff --git a/content/browser/gpu/gpu_data_manager_impl.cc b/content/browser/gpu/gpu_data_manager_impl.cc
index b015bb8..1388572 100644
--- a/content/browser/gpu/gpu_data_manager_impl.cc
+++ b/content/browser/gpu/gpu_data_manager_impl.cc
@@ -132,7 +132,7 @@ void GpuDataManagerImpl::Initialize() {
return;
GPUInfo gpu_info;
- gpu_info_collector::CollectPreliminaryGraphicsInfo(&gpu_info);
+ gpu_info_collector::CollectBasicGraphicsInfo(&gpu_info);
#if defined(ARCH_CPU_X86_FAMILY)
if (!gpu_info.gpu.vendor_id || !gpu_info.gpu.device_id)
gpu_info.finalized = true;
@@ -173,6 +173,10 @@ void GpuDataManagerImpl::InitializeImpl(
CHECK(succeed);
}
+ {
+ base::AutoLock auto_lock(gpu_info_lock_);
+ gpu_info_ = gpu_info;
+ }
UpdateGpuInfo(gpu_info);
UpdateGpuSwitchingManager(gpu_info);
UpdatePreliminaryBlacklistedFeatures();
@@ -190,7 +194,11 @@ void GpuDataManagerImpl::RequestCompleteGpuInfoIfNeeded() {
complete_gpu_info_already_requested_ = true;
GpuProcessHost::SendOnIO(
+#if defined(OS_WIN)
GpuProcessHost::GPU_PROCESS_KIND_UNSANDBOXED,
+#else
+ GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED,
+#endif
CAUSE_FOR_GPU_LAUNCH_GPUDATAMANAGER_REQUESTCOMPLETEGPUINFOIFNEEDED,
new GpuMsg_CollectGraphicsInfo());
}
@@ -204,12 +212,21 @@ void GpuDataManagerImpl::UpdateGpuInfo(const GPUInfo& gpu_info) {
if (software_rendering_)
return;
- GetContentClient()->SetGpuInfo(gpu_info);
+ GPUInfo my_gpu_info;
+ {
+ base::AutoLock auto_lock(gpu_info_lock_);
+ gpu_info_collector::MergeGPUInfo(&gpu_info_, gpu_info);
+ complete_gpu_info_already_requested_ =
+ complete_gpu_info_already_requested_ || gpu_info_.finalized;
+ my_gpu_info = gpu_info_;
+ }
+
+ GetContentClient()->SetGpuInfo(my_gpu_info);
if (gpu_blacklist_.get()) {
GpuBlacklist::Decision decision =
gpu_blacklist_->MakeBlacklistDecision(
- GpuBlacklist::kOsAny, "", gpu_info);
+ GpuBlacklist::kOsAny, "", my_gpu_info);
if (update_histograms_)
UpdateStats(gpu_blacklist_.get(), decision.blacklisted_features);
@@ -222,13 +239,6 @@ void GpuDataManagerImpl::UpdateGpuInfo(const GPUInfo& gpu_info) {
}
}
- {
- base::AutoLock auto_lock(gpu_info_lock_);
- gpu_info_ = gpu_info;
- complete_gpu_info_already_requested_ =
- complete_gpu_info_already_requested_ || gpu_info_.finalized;
- }
-
// We have to update GpuFeatureType before notify all the observers.
NotifyGpuInfoUpdate();
}
@@ -470,9 +480,6 @@ void GpuDataManagerImpl::AppendGpuCommandLine(
command_line->AppendSwitchASCII(switches::kSupportsDualGpus, "false");
}
- if (!gpu_blacklist_.get() || !gpu_blacklist_->needs_more_info())
- command_line->AppendSwitch(switches::kSkipGpuFullInfoCollection);
-
if (!swiftshader_path.empty())
command_line->AppendSwitchPath(switches::kSwiftShaderPath,
swiftshader_path);