From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Deepak Mohan Date: Fri, 28 Feb 2020 15:08:26 -0800 Subject: gpu: notify when dxdiag request for gpu info fails We rely on the signal OnGpuInfoUpdate to process gpu info. When Electron wants to collect the complete info in a single run it checks for the presence of dx_diagnostics attribute, as these are the only async calls that happens in the gpu process, but there are times when this call can fail due to crash or software rendering and there is no signal from browser process on this event to identify it. diff --git a/content/browser/gpu/gpu_data_manager_impl.cc b/content/browser/gpu/gpu_data_manager_impl.cc index 60887eabca674fb07ed02055e7cf113ce933d75e..ad9e7ae3008badc4669deac0b9cc001a8fd13dde 100644 --- a/content/browser/gpu/gpu_data_manager_impl.cc +++ b/content/browser/gpu/gpu_data_manager_impl.cc @@ -229,6 +229,11 @@ void GpuDataManagerImpl::TerminateInfoCollectionGpuProcess() { base::AutoLock auto_lock(lock_); private_->TerminateInfoCollectionGpuProcess(); } + +bool GpuDataManagerImpl::DxdiagDx12VulkanRequested() const { + base::AutoLock auto_lock(lock_); + return private_->DxdiagDx12VulkanRequested(); +} #endif void GpuDataManagerImpl::UpdateGpuFeatureInfo( diff --git a/content/browser/gpu/gpu_data_manager_impl.h b/content/browser/gpu/gpu_data_manager_impl.h index 6b3849cfbcba03406f1932c1c958f0456f9572be..dc7ad48d60de5f4a734cadea66ccd360ada09cdc 100644 --- a/content/browser/gpu/gpu_data_manager_impl.h +++ b/content/browser/gpu/gpu_data_manager_impl.h @@ -97,6 +97,7 @@ class CONTENT_EXPORT GpuDataManagerImpl : public GpuDataManager, // Called from BrowserMainLoop::BrowserThreadsStarted(). void OnBrowserThreadsStarted(); void TerminateInfoCollectionGpuProcess(); + bool DxdiagDx12VulkanRequested() const; #endif // Update the GPU feature info. This updates the blocklist and enabled status // of GPU rasterization. In the future this will be used for more features. diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc index 3323ceed7dee0dd487d2c30eea8428810c9e77ea..3ccc7f449d8d1d1f7f299df715423334f0e525c9 100644 --- a/content/browser/gpu/gpu_data_manager_impl_private.cc +++ b/content/browser/gpu/gpu_data_manager_impl_private.cc @@ -1022,6 +1022,11 @@ void GpuDataManagerImplPrivate::TerminateInfoCollectionGpuProcess() { host->ForceShutdown(); } +bool GpuDataManagerImplPrivate::DxdiagDx12VulkanRequested() const { + return !(gpu_info_vulkan_request_failed_ || + gpu_info_dx12_request_failed_ || + gpu_info_dx_diag_request_failed_); +} #endif void GpuDataManagerImplPrivate::UpdateGpuFeatureInfo( diff --git a/content/browser/gpu/gpu_data_manager_impl_private.h b/content/browser/gpu/gpu_data_manager_impl_private.h index f634ae502cb42afada67b15bc9c7fa1d5acdbf46..7b1c924021517ba16bd25419cc955774c5338cd9 100644 --- a/content/browser/gpu/gpu_data_manager_impl_private.h +++ b/content/browser/gpu/gpu_data_manager_impl_private.h @@ -75,6 +75,7 @@ class CONTENT_EXPORT GpuDataManagerImplPrivate { bool VulkanRequested() const; void OnBrowserThreadsStarted(); void TerminateInfoCollectionGpuProcess(); + bool DxdiagDx12VulkanRequested() const; #endif void UpdateGpuFeatureInfo(const gpu::GpuFeatureInfo& gpu_feature_info, const base::Optional&