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 bcc2798027aaf132d1bcf526357c8fc65b268c2a..6762c090034f5b29e978bfd9ac0a5677d2b779eb 100644 --- a/content/browser/gpu/gpu_data_manager_impl.cc +++ b/content/browser/gpu/gpu_data_manager_impl.cc @@ -230,6 +230,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::UpdateDawnInfo( diff --git a/content/browser/gpu/gpu_data_manager_impl.h b/content/browser/gpu/gpu_data_manager_impl.h index dec0836918007eb0d3be46e57cfc92c31af3dc62..9059320a73d27b81fb627753ce5a379470873f33 100644 --- a/content/browser/gpu/gpu_data_manager_impl.h +++ b/content/browser/gpu/gpu_data_manager_impl.h @@ -125,6 +125,7 @@ class CONTENT_EXPORT GpuDataManagerImpl : public GpuDataManager, // BrowserMainParts override instead. void PostCreateThreads(); void TerminateInfoCollectionGpuProcess(); + bool DxdiagDx12VulkanRequested() const; #endif void UpdateDawnInfo(const std::vector& dawn_info_list); diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc index a8884357f015b8205e9b25ff6ab7a5c268d4ef01..e6ffc967a38df013f767f1d5b5af830ad0ab4e95 100644 --- a/content/browser/gpu/gpu_data_manager_impl_private.cc +++ b/content/browser/gpu/gpu_data_manager_impl_private.cc @@ -1190,6 +1190,12 @@ void GpuDataManagerImplPrivate::TerminateInfoCollectionGpuProcess() { if (host) 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::UpdateDawnInfo( diff --git a/content/browser/gpu/gpu_data_manager_impl_private.h b/content/browser/gpu/gpu_data_manager_impl_private.h index ed4a3a959ba33fb893ac64b1f965dc3315e78e2c..2023620a79e7267ad5b5859ebf962b747889cdac 100644 --- a/content/browser/gpu/gpu_data_manager_impl_private.h +++ b/content/browser/gpu/gpu_data_manager_impl_private.h @@ -87,6 +87,7 @@ class CONTENT_EXPORT GpuDataManagerImplPrivate { bool VulkanRequested() const; void PostCreateThreads(); void TerminateInfoCollectionGpuProcess(); + bool DxdiagDx12VulkanRequested() const; #endif void UpdateDawnInfo(const std::vector& dawn_info_list);