Commit bf03211a authored by Maggie Chen's avatar Maggie Chen Committed by Commit Bot

Add no-delay-for-dx12-vulkan-info-collection command line switch

A non-sandboxed, 15-seconds-delayed gpu process is currently running in the
browser to collect dx12/vulkan info. This switch is added for gpu integration
test where dx12 and vulkan paths will be tested. With this switch, the gpu
information will be collected immediately.

Bug:977034

Change-Id: I3609a9f4e2827862530fdc4e0d14591bd99b4013
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1761103Reviewed-by: default avatarZhenyao Mo <zmo@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Maggie Chen <magchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#688400}
parent b441cd7d
...@@ -1400,7 +1400,11 @@ int BrowserMainLoop::BrowserThreadsStarted() { ...@@ -1400,7 +1400,11 @@ int BrowserMainLoop::BrowserThreadsStarted() {
#if defined(OS_WIN) #if defined(OS_WIN)
if (!parsed_command_line_.HasSwitch( if (!parsed_command_line_.HasSwitch(
switches::kDisableGpuProcessForDX12VulkanInfoCollection)) { switches::kDisableGpuProcessForDX12VulkanInfoCollection)) {
GpuDataManagerImpl::GetInstance()->RequestGpuSupportedRuntimeVersion(); // The default is to delay the secondary GPU process for 15 seconds.
bool delayed = !parsed_command_line_.HasSwitch(
switches::kNoDelayForDX12VulkanInfoCollection);
GpuDataManagerImpl::GetInstance()->RequestGpuSupportedRuntimeVersion(
delayed);
} }
if (base::FeatureList::IsEnabled(features::kFontSrcLocalMatching)) { if (base::FeatureList::IsEnabled(features::kFontSrcLocalMatching)) {
......
...@@ -90,9 +90,9 @@ void GpuDataManagerImpl::AppendGpuCommandLine(base::CommandLine* command_line, ...@@ -90,9 +90,9 @@ void GpuDataManagerImpl::AppendGpuCommandLine(base::CommandLine* command_line,
private_->AppendGpuCommandLine(command_line, kind); private_->AppendGpuCommandLine(command_line, kind);
} }
void GpuDataManagerImpl::RequestGpuSupportedRuntimeVersion() const { void GpuDataManagerImpl::RequestGpuSupportedRuntimeVersion(bool delayed) const {
base::AutoLock auto_lock(lock_); base::AutoLock auto_lock(lock_);
private_->RequestGpuSupportedRuntimeVersion(); private_->RequestGpuSupportedRuntimeVersion(delayed);
} }
bool GpuDataManagerImpl::GpuProcessStartAllowed() const { bool GpuDataManagerImpl::GpuProcessStartAllowed() const {
......
...@@ -65,7 +65,7 @@ class CONTENT_EXPORT GpuDataManagerImpl : public GpuDataManager { ...@@ -65,7 +65,7 @@ class CONTENT_EXPORT GpuDataManagerImpl : public GpuDataManager {
void AppendGpuCommandLine(base::CommandLine* command_line, void AppendGpuCommandLine(base::CommandLine* command_line,
GpuProcessKind kind) override; GpuProcessKind kind) override;
void RequestGpuSupportedRuntimeVersion() const; void RequestGpuSupportedRuntimeVersion(bool delayed) const;
bool GpuProcessStartAllowed() const; bool GpuProcessStartAllowed() const;
bool IsGpuFeatureInfoAvailable() const; bool IsGpuFeatureInfoAvailable() const;
......
...@@ -408,7 +408,8 @@ void GpuDataManagerImplPrivate::RequestCompleteGpuInfoIfNeeded() { ...@@ -408,7 +408,8 @@ void GpuDataManagerImplPrivate::RequestCompleteGpuInfoIfNeeded() {
#endif #endif
} }
void GpuDataManagerImplPrivate::RequestGpuSupportedRuntimeVersion() { void GpuDataManagerImplPrivate::RequestGpuSupportedRuntimeVersion(
bool delayed) {
#if defined(OS_WIN) #if defined(OS_WIN)
base::OnceClosure task = base::BindOnce([]() { base::OnceClosure task = base::BindOnce([]() {
GpuProcessHost* host = GpuProcessHost::Get( GpuProcessHost* host = GpuProcessHost::Get(
...@@ -419,8 +420,12 @@ void GpuDataManagerImplPrivate::RequestGpuSupportedRuntimeVersion() { ...@@ -419,8 +420,12 @@ void GpuDataManagerImplPrivate::RequestGpuSupportedRuntimeVersion() {
base::BindOnce(&UpdateDx12VulkanInfoOnIO)); base::BindOnce(&UpdateDx12VulkanInfoOnIO));
}); });
base::PostDelayedTask(FROM_HERE, {BrowserThread::IO}, std::move(task), if (delayed) {
base::TimeDelta::FromMilliseconds(15000)); base::PostDelayedTask(FROM_HERE, {BrowserThread::IO}, std::move(task),
base::TimeDelta::FromMilliseconds(15000));
} else {
base::PostTask(FROM_HERE, {BrowserThread::IO}, std::move(task));
}
#else #else
NOTREACHED(); NOTREACHED();
#endif #endif
...@@ -531,6 +536,7 @@ void GpuDataManagerImplPrivate::UpdateDxDiagNode( ...@@ -531,6 +536,7 @@ void GpuDataManagerImplPrivate::UpdateDxDiagNode(
void GpuDataManagerImplPrivate::UpdateDx12VulkanInfo( void GpuDataManagerImplPrivate::UpdateDx12VulkanInfo(
const gpu::Dx12VulkanVersionInfo& dx12_vulkan_version_info) { const gpu::Dx12VulkanVersionInfo& dx12_vulkan_version_info) {
gpu_info_.dx12_vulkan_version_info = dx12_vulkan_version_info; gpu_info_.dx12_vulkan_version_info = dx12_vulkan_version_info;
// No need to call GetContentClient()->SetGpuInfo(). // No need to call GetContentClient()->SetGpuInfo().
NotifyGpuInfoUpdate(); NotifyGpuInfoUpdate();
} }
......
...@@ -45,7 +45,7 @@ class CONTENT_EXPORT GpuDataManagerImplPrivate { ...@@ -45,7 +45,7 @@ class CONTENT_EXPORT GpuDataManagerImplPrivate {
bool GpuAccessAllowed(std::string* reason) const; bool GpuAccessAllowed(std::string* reason) const;
bool GpuProcessStartAllowed() const; bool GpuProcessStartAllowed() const;
void RequestCompleteGpuInfoIfNeeded(); void RequestCompleteGpuInfoIfNeeded();
void RequestGpuSupportedRuntimeVersion(); void RequestGpuSupportedRuntimeVersion(bool delayed);
bool IsEssentialGpuInfoAvailable() const; bool IsEssentialGpuInfoAvailable() const;
bool IsGpuFeatureInfoAvailable() const; bool IsGpuFeatureInfoAvailable() const;
gpu::GpuFeatureStatus GetFeatureStatus(gpu::GpuFeatureType feature) const; gpu::GpuFeatureStatus GetFeatureStatus(gpu::GpuFeatureType feature) const;
......
...@@ -85,7 +85,7 @@ class GpuIntegrationTest( ...@@ -85,7 +85,7 @@ class GpuIntegrationTest(
# skip this gpu process for all gpu integration tests to prevent any # skip this gpu process for all gpu integration tests to prevent any
# interference with the test results. # interference with the test results.
browser_args.append( browser_args.append(
'--disable-gpu-process-for-dx12-vulkan-info-collection') '--no-delay-for-dx12-vulkan-info-collection')
# Append the new arguments. # Append the new arguments.
browser_options.AppendExtraBrowserArgs(browser_args) browser_options.AppendExtraBrowserArgs(browser_args)
......
...@@ -53,4 +53,9 @@ const char kEnableWebGLSwapChain[] = "enable-webgl-swap-chain"; ...@@ -53,4 +53,9 @@ const char kEnableWebGLSwapChain[] = "enable-webgl-swap-chain";
const char kUseHighGPUThreadPriorityForPerfTests[] = const char kUseHighGPUThreadPriorityForPerfTests[] =
"use-gpu-high-thread-priority-for-perf-tests"; "use-gpu-high-thread-priority-for-perf-tests";
// Start the non-sandboxed GPU process for DX12 and Vulkan info collection
// immediately after the browser starts. The default is to delay for 15 seconds.
const char kNoDelayForDX12VulkanInfoCollection[] =
"no-delay-for-dx12-vulkan-info-collection";
} // namespace switches } // namespace switches
...@@ -21,6 +21,7 @@ GPU_EXPORT extern const char kDisableGpuProcessForDX12VulkanInfoCollection[]; ...@@ -21,6 +21,7 @@ GPU_EXPORT extern const char kDisableGpuProcessForDX12VulkanInfoCollection[];
GPU_EXPORT extern const char kEnableUnsafeWebGPU[]; GPU_EXPORT extern const char kEnableUnsafeWebGPU[];
GPU_EXPORT extern const char kEnableWebGLSwapChain[]; GPU_EXPORT extern const char kEnableWebGLSwapChain[];
GPU_EXPORT extern const char kUseHighGPUThreadPriorityForPerfTests[]; GPU_EXPORT extern const char kUseHighGPUThreadPriorityForPerfTests[];
GPU_EXPORT extern const char kNoDelayForDX12VulkanInfoCollection[];
} // namespace switches } // namespace switches
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment