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 54cc8dc51d400a5738c7e3d63e6f368bead2a021..182ef4fde23a6afe2e9d8a8f02d8ccf6161c633e 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 1fc56c055d423ab074f8f4f90415e34593a04a18..c637247f003e1c6bfe073a43a09851682cd242cc 100644
  29. --- a/content/browser/gpu/gpu_data_manager_impl.h
  30. +++ b/content/browser/gpu/gpu_data_manager_impl.h
  31. @@ -125,6 +125,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 91d8c7cc2b8105a4f7ef9aa314b3b4e92b94d6dd..45ba80fc280499ae48921f428eb2c6915d1cf528 100644
  40. --- a/content/browser/gpu/gpu_data_manager_impl_private.cc
  41. +++ b/content/browser/gpu/gpu_data_manager_impl_private.cc
  42. @@ -1198,6 +1198,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 af6dd8d8af99c5bd1e854c8cfbeb89e04476fefd..758adb66dff5aefad9f3c9f8c23de6fa9df33ef7 100644
  56. --- a/content/browser/gpu/gpu_data_manager_impl_private.h
  57. +++ b/content/browser/gpu/gpu_data_manager_impl_private.h
  58. @@ -87,6 +87,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);