gpu_notify_when_dxdiag_request_fails.patch 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 919ccd3f86aaecc841182de67ed94cab1008ae3d..cd9a0c9d1842daf1536b88e9d10c447ceb463d3c 100644
  14. --- a/content/browser/gpu/gpu_data_manager_impl.cc
  15. +++ b/content/browser/gpu/gpu_data_manager_impl.cc
  16. @@ -188,6 +188,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::UpdateGpuFeatureInfo(
  27. diff --git a/content/browser/gpu/gpu_data_manager_impl.h b/content/browser/gpu/gpu_data_manager_impl.h
  28. index 8af48d23b020779c1714fc7ca70966e8d33f7252..5dfa29db15467f8fc55f86a2a225380c70d4aaab 100644
  29. --- a/content/browser/gpu/gpu_data_manager_impl.h
  30. +++ b/content/browser/gpu/gpu_data_manager_impl.h
  31. @@ -95,6 +95,7 @@ class CONTENT_EXPORT GpuDataManagerImpl : public GpuDataManager,
  32. // Called from BrowserMainLoop::BrowserThreadsStarted().
  33. void OnBrowserThreadsStarted();
  34. void TerminateInfoCollectionGpuProcess();
  35. + bool DxdiagDx12VulkanRequested() const;
  36. #endif
  37. // Update the GPU feature info. This updates the blacklist and enabled status
  38. // of GPU rasterization. In the future this will be used for more features.
  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 169f1722764a49d31e06f39f7275ba80bd56df79..343561e72ad5c0f07c08a790707b51c6e2e1067a 100644
  41. --- a/content/browser/gpu/gpu_data_manager_impl_private.cc
  42. +++ b/content/browser/gpu/gpu_data_manager_impl_private.cc
  43. @@ -1063,6 +1063,11 @@ void GpuDataManagerImplPrivate::TerminateInfoCollectionGpuProcess() {
  44. host->ForceShutdown();
  45. }
  46. +bool GpuDataManagerImplPrivate::DxdiagDx12VulkanRequested() const {
  47. + return !(gpu_info_vulkan_request_failed_ ||
  48. + gpu_info_dx12_request_failed_ ||
  49. + gpu_info_dx_diag_request_failed_);
  50. +}
  51. #endif
  52. void GpuDataManagerImplPrivate::UpdateGpuFeatureInfo(
  53. diff --git a/content/browser/gpu/gpu_data_manager_impl_private.h b/content/browser/gpu/gpu_data_manager_impl_private.h
  54. index 7afb818da963271751f6ff7d876505c739ec3fae..7453817e192e01b06b8680a2209bc5c8794bb959 100644
  55. --- a/content/browser/gpu/gpu_data_manager_impl_private.h
  56. +++ b/content/browser/gpu/gpu_data_manager_impl_private.h
  57. @@ -75,6 +75,7 @@ class CONTENT_EXPORT GpuDataManagerImplPrivate {
  58. bool VulkanRequested() const;
  59. void OnBrowserThreadsStarted();
  60. void TerminateInfoCollectionGpuProcess();
  61. + bool DxdiagDx12VulkanRequested() const;
  62. #endif
  63. void UpdateGpuFeatureInfo(const gpu::GpuFeatureInfo& gpu_feature_info,
  64. const base::Optional<gpu::GpuFeatureInfo>&