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 2b70aa2406a9edf1af9eaafcf2833935a2089c03..cf420ceda62facea9c871d2754d0d86a22ed2434 100644 --- a/content/browser/gpu/gpu_data_manager_impl.cc +++ b/content/browser/gpu/gpu_data_manager_impl.cc @@ -234,6 +234,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 15ee11b33aca857edf44d799004f4424214ecf2e..2735668757843639ca30aa7e270abbdb8f4acbdf 100644 --- a/content/browser/gpu/gpu_data_manager_impl.h +++ b/content/browser/gpu/gpu_data_manager_impl.h @@ -105,6 +105,7 @@ class CONTENT_EXPORT GpuDataManagerImpl : public GpuDataManager, // BrowserMainParts override instead. void PostCreateThreads(); 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 6a117c1d092afb9f8a459faed07b7deb1cbd97ec..7bd6420444c4692053290bb520c56e1ef0c62621 100644 --- a/content/browser/gpu/gpu_data_manager_impl_private.cc +++ b/content/browser/gpu/gpu_data_manager_impl_private.cc @@ -1093,6 +1093,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 40b736989347b13e0ec0393bd02d67d2cae5ef96..90c561e1fc0d9b6ebf7c6dde6912c55505cc7c56 100644 --- a/content/browser/gpu/gpu_data_manager_impl_private.h +++ b/content/browser/gpu/gpu_data_manager_impl_private.h @@ -77,6 +77,7 @@ class CONTENT_EXPORT GpuDataManagerImplPrivate { bool VulkanRequested() const; void PostCreateThreads(); void TerminateInfoCollectionGpuProcess(); + bool DxdiagDx12VulkanRequested() const; #endif void UpdateGpuFeatureInfo(const gpu::GpuFeatureInfo& gpu_feature_info, const base::Optional&