Browse Source

fix: Avoid loading DRI via GBM when GpuMemoryBuffers are disabled (#25221)

Robo 4 years ago
parent
commit
56cde790e1

+ 1 - 0
patches/chromium/.patches

@@ -121,3 +121,4 @@ worker_feat_add_hook_to_notify_script_ready.patch
 reconnect_p2p_socket_dispatcher_if_network_service_dies.patch
 allow_focus_to_move_into_an_editable_combobox_s_listbox.patch
 cherry-pick-70579363ce7b.patch
+avoid_loading_dri_via_gbm_when_gpumemorybuffers_are_disabled.patch

+ 41 - 0
patches/chromium/avoid_loading_dri_via_gbm_when_gpumemorybuffers_are_disabled.patch

@@ -0,0 +1,41 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Tom Anderson <[email protected]>
+Date: Thu, 21 May 2020 01:20:33 +0000
+Subject: Avoid loading DRI via GBM when GpuMemoryBuffers are disabled
+
+We haven't yet whitelisted the necessary dri files in the GPU sandbox,
+which is leading to issues like 1077609 and 1077626.  Since GMBs are
+not yet supported, avoid loading GBM unless
+--enable-native-gpu-memory-buffers is passed.
+
+Bug: 1077609, 1077626, 1031269
+Change-Id: Ic052d2e89330c6558da86a91b77637229808102f
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2211120
+Auto-Submit: Thomas Anderson <[email protected]>
+Reviewed-by: Kenneth Russell <[email protected]>
+Commit-Queue: Thomas Anderson <[email protected]>
+Cr-Commit-Position: refs/heads/master@{#770878}
+
+diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc
+index 9b22493abbd81c2f592e75fe32f7ab7efbb281d9..d650cef5e081da9cd00896db7d59f00635f13279 100644
+--- a/content/gpu/gpu_main.cc
++++ b/content/gpu/gpu_main.cc
+@@ -366,11 +366,13 @@ int GpuMain(const MainFunctionParams& parameters) {
+ #if defined(USE_X11)
+   // ui::GbmDevice() takes >50ms with amdgpu, so kick off
+   // GpuMemoryBufferSupportX11 creation on another thread now.
+-  base::PostTask(
+-      FROM_HERE, base::BindOnce([]() {
+-        SCOPED_UMA_HISTOGRAM_TIMER("Linux.X11.GbmSupportX11CreationTime");
+-        ui::GpuMemoryBufferSupportX11::GetInstance();
+-      }));
++  if (gpu_preferences.enable_native_gpu_memory_buffers) {
++    base::PostTask(
++        FROM_HERE, base::BindOnce([]() {
++          SCOPED_UMA_HISTOGRAM_TIMER("Linux.X11.GbmSupportX11CreationTime");
++          ui::GpuMemoryBufferSupportX11::GetInstance();
++        }));
++  }
+ #endif
+ 
+   if (client)