Files
electron/patches/chromium/gpu_notify_when_dxdiag_request_fails.patch
Electron Bot f193d9a34f chore: bump chromium to 83.0.4103.14 (9-x-y) (#23095)
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
2020-04-14 17:14:59 -07:00

70 lines
3.5 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Deepak Mohan <hop2deep@gmail.com>
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 db9780a6c0b679354a5f74b1f89e32a8ff9dd2e3..cc51d41f88a60ccb936b0608973b76ba84c2a47b 100644
--- a/content/browser/gpu/gpu_data_manager_impl.cc
+++ b/content/browser/gpu/gpu_data_manager_impl.cc
@@ -161,6 +161,11 @@ bool GpuDataManagerImpl::Dx12VulkanRequested() const {
return private_->Dx12VulkanRequested();
}
+bool GpuDataManagerImpl::DxdiagDx12VulkanRequested() const {
+ base::AutoLock auto_lock(lock_);
+ return private_->DxdiagDx12VulkanRequested();
+}
+
void GpuDataManagerImpl::OnBrowserThreadsStarted() {
base::AutoLock auto_lock(lock_);
private_->OnBrowserThreadsStarted();
diff --git a/content/browser/gpu/gpu_data_manager_impl.h b/content/browser/gpu/gpu_data_manager_impl.h
index d5595c91f4d63362e575ad31070335ee344261fa..19c012313550cf9d9bf591a54e739fc34239e4dd 100644
--- a/content/browser/gpu/gpu_data_manager_impl.h
+++ b/content/browser/gpu/gpu_data_manager_impl.h
@@ -90,6 +90,7 @@ class CONTENT_EXPORT GpuDataManagerImpl : public GpuDataManager,
void UpdateDxDiagNodeRequestStatus(bool request_continues);
void UpdateDx12VulkanRequestStatus(bool request_continues);
bool Dx12VulkanRequested() const;
+ bool DxdiagDx12VulkanRequested() const;
// Called from BrowserMainLoop::BrowserThreadsStarted().
void OnBrowserThreadsStarted();
#endif
diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc
index aae01a85f5d37d4c8e809815540662dee1550dbc..c70dbbc6ec1fc460f8a1f95613dbf1a65482f4f4 100644
--- a/content/browser/gpu/gpu_data_manager_impl_private.cc
+++ b/content/browser/gpu/gpu_data_manager_impl_private.cc
@@ -885,6 +885,11 @@ bool GpuDataManagerImplPrivate::Dx12VulkanRequested() const {
return gpu_info_dx12_vulkan_requested_;
}
+bool GpuDataManagerImplPrivate::DxdiagDx12VulkanRequested() const {
+ return !(gpu_info_dx12_vulkan_request_failed_ ||
+ gpu_info_dx_diag_request_failed_);
+}
+
void GpuDataManagerImplPrivate::OnBrowserThreadsStarted() {
// Launch the info collection GPU process to collect DX12 and Vulkan support
// information. Not to affect Chrome startup, this is done in a delayed mode,
diff --git a/content/browser/gpu/gpu_data_manager_impl_private.h b/content/browser/gpu/gpu_data_manager_impl_private.h
index 6a082f73e77d9f5e7630cc4dbc18188c7e565c0b..1468b5a9a469e9fa9f9911dc4ca9eb91a20b5cad 100644
--- a/content/browser/gpu/gpu_data_manager_impl_private.h
+++ b/content/browser/gpu/gpu_data_manager_impl_private.h
@@ -70,6 +70,7 @@ class CONTENT_EXPORT GpuDataManagerImplPrivate {
void UpdateDx12VulkanRequestStatus(bool request_continues);
void UpdateDxDiagNodeRequestStatus(bool request_continues);
bool Dx12VulkanRequested() const;
+ bool DxdiagDx12VulkanRequested() const;
void OnBrowserThreadsStarted();
#endif
void UpdateGpuFeatureInfo(const gpu::GpuFeatureInfo& gpu_feature_info,