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 b55ab1c2e4172b069ee9f0a7dbce3b8a64cfe6da..19c138929e28bd155c1c510bbd1abc2712b6a29e 100644
  14. --- a/content/browser/gpu/gpu_data_manager_impl.cc
  15. +++ b/content/browser/gpu/gpu_data_manager_impl.cc
  16. @@ -229,6 +229,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 008795fbdc8724931852399704a945563fd0b3f2..6b295d21deebf59a79a205ef2fa8579d689a7c72 100644
  29. --- a/content/browser/gpu/gpu_data_manager_impl.h
  30. +++ b/content/browser/gpu/gpu_data_manager_impl.h
  31. @@ -115,6 +115,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 b7ad87a73ce1e7da9ea2a7b2557d97ebe1f84298..cb8197061cb1424d533d17cad3e22cb8b30c0a34 100644
  40. --- a/content/browser/gpu/gpu_data_manager_impl_private.cc
  41. +++ b/content/browser/gpu/gpu_data_manager_impl_private.cc
  42. @@ -1108,6 +1108,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 b4256db01335ec312fd6be0060bc2ad4ee496ae6..b028d8feffe05ef37a8e5f16e35c2da3a5a1cc33 100644
  56. --- a/content/browser/gpu/gpu_data_manager_impl_private.h
  57. +++ b/content/browser/gpu/gpu_data_manager_impl_private.h
  58. @@ -79,6 +79,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);