gpu_notify_when_dxdiag_request_fails.patch 3.2 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 b26a3c72aa63b81f8f4558b28b404faf138a897b..335dc385eb03bc9634387af44dfd1aa3bfa71cb6 100644
  14. --- a/content/browser/gpu/gpu_data_manager_impl.cc
  15. +++ b/content/browser/gpu/gpu_data_manager_impl.cc
  16. @@ -230,6 +230,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
  26. void GpuDataManagerImpl::UpdateDawnInfo(
  27. diff --git a/content/browser/gpu/gpu_data_manager_impl.h b/content/browser/gpu/gpu_data_manager_impl.h
  28. index 4364da656ac02f2f717e713f37d29ce44c14242b..ba044aee23db495e1da69c5bc0a807e96783faa9 100644
  29. --- a/content/browser/gpu/gpu_data_manager_impl.h
  30. +++ b/content/browser/gpu/gpu_data_manager_impl.h
  31. @@ -124,6 +124,7 @@ class CONTENT_EXPORT GpuDataManagerImpl : public GpuDataManager,
  32. // BrowserMainParts override instead.
  33. void PostCreateThreads();
  34. void TerminateInfoCollectionGpuProcess();
  35. + bool DxdiagDx12VulkanRequested() const;
  36. #endif
  37. void UpdateDawnInfo(const std::vector<std::string>& dawn_info_list);
  38. diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc
  39. index 972bb4e8ba2d1470ed5f24c125551e3e627d79e4..d3b15d35eb458c00e470569904924c28c7a3957d 100644
  40. --- a/content/browser/gpu/gpu_data_manager_impl_private.cc
  41. +++ b/content/browser/gpu/gpu_data_manager_impl_private.cc
  42. @@ -1211,6 +1211,12 @@ void GpuDataManagerImplPrivate::TerminateInfoCollectionGpuProcess() {
  43. if (host)
  44. host->ForceShutdown();
  45. }
  46. +
  47. +bool GpuDataManagerImplPrivate::DxdiagDx12VulkanRequested() const {
  48. + return !(gpu_info_vulkan_request_failed_ ||
  49. + gpu_info_dx12_request_failed_ ||
  50. + gpu_info_dx_diag_request_failed_);
  51. +}
  52. #endif
  53. void GpuDataManagerImplPrivate::UpdateDawnInfo(
  54. diff --git a/content/browser/gpu/gpu_data_manager_impl_private.h b/content/browser/gpu/gpu_data_manager_impl_private.h
  55. index 81f6abb91a3fdefc1b0128f3224c7b82bfcbd0d2..99980e3528f4660bf1205e44326645d97e762cb9 100644
  56. --- a/content/browser/gpu/gpu_data_manager_impl_private.h
  57. +++ b/content/browser/gpu/gpu_data_manager_impl_private.h
  58. @@ -89,6 +89,7 @@ class CONTENT_EXPORT GpuDataManagerImplPrivate {
  59. bool VulkanRequested() const;
  60. void PostCreateThreads();
  61. void TerminateInfoCollectionGpuProcess();
  62. + bool DxdiagDx12VulkanRequested() const;
  63. #endif
  64. void UpdateDawnInfo(const std::vector<std::string>& dawn_info_list);