gpu_notify_when_dxdiag_request_fails.patch 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
  2. From: Deepak Mohan <[email protected]>
  3. Date: Fri, 28 Feb 2020 15:08:26 -0800
  4. Subject: gpu: notify when dxdiag request for gpu info fails
  5. We rely on the signal OnGpuInfoUpdate to process gpu info.
  6. When Electron wants to collect the complete info in a single run
  7. it checks for the presence of dx_diagnostics attribute, as these
  8. are the only async calls that happens in the gpu process, but
  9. there are times when this call can fail due to crash or software
  10. rendering and there is no signal from browser process on this event
  11. to identify it.
  12. diff --git a/content/browser/gpu/gpu_data_manager_impl.cc b/content/browser/gpu/gpu_data_manager_impl.cc
  13. index 0582075df870162a97b463f6b3035a30bcfe36ae..d94c18d16f5ad80f14120c249e83e795c50c5106 100644
  14. --- a/content/browser/gpu/gpu_data_manager_impl.cc
  15. +++ b/content/browser/gpu/gpu_data_manager_impl.cc
  16. @@ -225,6 +225,11 @@ void GpuDataManagerImpl::TerminateInfoCollectionGpuProcess() {
  17. base::AutoLock auto_lock(lock_);
  18. private_->TerminateInfoCollectionGpuProcess();
  19. }
  20. +
  21. +bool GpuDataManagerImpl::DxdiagDx12VulkanRequested() const {
  22. + base::AutoLock auto_lock(lock_);
  23. + return private_->DxdiagDx12VulkanRequested();
  24. +}
  25. #endif // BUILDFLAG(IS_WIN)
  26. void GpuDataManagerImpl::PostCreateThreads() {
  27. diff --git a/content/browser/gpu/gpu_data_manager_impl.h b/content/browser/gpu/gpu_data_manager_impl.h
  28. index 25896ab0f3ca233ae17bf509f2a6ae5a6cc3c54b..5a8e6d184e276833034c604be8c48e01122207e2 100644
  29. --- a/content/browser/gpu/gpu_data_manager_impl.h
  30. +++ b/content/browser/gpu/gpu_data_manager_impl.h
  31. @@ -121,6 +121,7 @@ class CONTENT_EXPORT GpuDataManagerImpl : public GpuDataManager,
  32. bool Dx12Requested() const;
  33. bool VulkanRequested() const;
  34. void TerminateInfoCollectionGpuProcess();
  35. + bool DxdiagDx12VulkanRequested() const;
  36. #endif
  37. // Called from BrowserMainLoop::PostCreateThreads().
  38. // TODO(content/browser/gpu/OWNERS): This should probably use a
  39. diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc
  40. index 9cb4a7755a7073d76cfce2eb396c4fdb5bdad691..5ee4ee107bcfa135de3f182286f1e277d10e867b 100644
  41. --- a/content/browser/gpu/gpu_data_manager_impl_private.cc
  42. +++ b/content/browser/gpu/gpu_data_manager_impl_private.cc
  43. @@ -1232,6 +1232,12 @@ void GpuDataManagerImplPrivate::TerminateInfoCollectionGpuProcess() {
  44. if (host)
  45. host->ForceShutdown();
  46. }
  47. +
  48. +bool GpuDataManagerImplPrivate::DxdiagDx12VulkanRequested() const {
  49. + return !(gpu_info_vulkan_request_failed_ ||
  50. + gpu_info_dx12_request_failed_ ||
  51. + gpu_info_dx_diag_request_failed_);
  52. +}
  53. #endif
  54. void GpuDataManagerImplPrivate::PostCreateThreads() {
  55. diff --git a/content/browser/gpu/gpu_data_manager_impl_private.h b/content/browser/gpu/gpu_data_manager_impl_private.h
  56. index 20e883daaa07133f977c5fe0c822f324d2642793..28306624ec6f7f9a7848e65787d4dc5aa738a76c 100644
  57. --- a/content/browser/gpu/gpu_data_manager_impl_private.h
  58. +++ b/content/browser/gpu/gpu_data_manager_impl_private.h
  59. @@ -86,6 +86,7 @@ class CONTENT_EXPORT GpuDataManagerImplPrivate {
  60. bool Dx12Requested() const;
  61. bool VulkanRequested() const;
  62. void TerminateInfoCollectionGpuProcess();
  63. + bool DxdiagDx12VulkanRequested() const;
  64. #endif
  65. void PostCreateThreads();
  66. void UpdateDawnInfo(const std::vector<std::string>& dawn_info_list);