summaryrefslogtreecommitdiff
path: root/www/iridium/files/patch-gpu_ipc_service_gpu__init.cc
diff options
context:
space:
mode:
authorRene Ladan <rene@FreeBSD.org>2020-07-23 16:31:18 +0000
committerRene Ladan <rene@FreeBSD.org>2020-07-23 16:31:18 +0000
commit651302b592fe54c5197641402df87ff216c27903 (patch)
tree784a10fc6050d3be8786fd6f4f954d7802bd9204 /www/iridium/files/patch-gpu_ipc_service_gpu__init.cc
parentAdd compiler:c++14-lang to USES to atttempt to fix on GCC-based systems: (diff)
www/iridium: update to 2020.04.81
PR: 245959 Submitted by: Matthias Wolf MFH: 2020Q3 Security: any Chromium vulnerability between 73 and 81
Diffstat (limited to 'www/iridium/files/patch-gpu_ipc_service_gpu__init.cc')
-rw-r--r--www/iridium/files/patch-gpu_ipc_service_gpu__init.cc129
1 files changed, 118 insertions, 11 deletions
diff --git a/www/iridium/files/patch-gpu_ipc_service_gpu__init.cc b/www/iridium/files/patch-gpu_ipc_service_gpu__init.cc
index a3ae793cbba2..2dff9b7c455a 100644
--- a/www/iridium/files/patch-gpu_ipc_service_gpu__init.cc
+++ b/www/iridium/files/patch-gpu_ipc_service_gpu__init.cc
@@ -1,25 +1,43 @@
---- gpu/ipc/service/gpu_init.cc.orig 2019-03-11 22:00:59 UTC
+--- gpu/ipc/service/gpu_init.cc.orig 2020-03-16 18:40:32 UTC
+++ gpu/ipc/service/gpu_init.cc
-@@ -87,7 +87,7 @@ void InitializeDirectCompositionOverlaySupport(GPUInfo
+@@ -109,7 +109,7 @@ void InitializePlatformOverlaySettings(GPUInfo* gpu_in
+ #endif
}
- #endif // defined(OS_WIN)
--#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(IS_CHROMECAST)
-+#if (defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(IS_CHROMECAST)) || defined(OS_BSD)
+-#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !BUILDFLAG(IS_CHROMECAST)
++#if (defined(OS_LINUX) && !defined(OS_CHROMEOS) && !BUILDFLAG(IS_CHROMECAST)) || defined(OS_BSD)
bool CanAccessNvidiaDeviceFile() {
bool res = true;
- base::ScopedBlockingCall scoped_blocking_call(base::BlockingType::WILL_BLOCK);
-@@ -129,7 +129,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL
- // crash during feature collection.
- gpu::SetKeysForCrashLogging(gpu_info_);
+ base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
+@@ -120,7 +120,7 @@ bool CanAccessNvidiaDeviceFile() {
+ }
+ return res;
+ }
+-#endif // OS_LINUX && !OS_CHROMEOS && !BUILDFLAG(IS_CHROMECAST)
++#endif // (OS_LINUX && !OS_CHROMEOS && !BUILDFLAG(IS_CHROMECAST)) || defined(OS_BSD)
+
+ class GpuWatchdogInit {
+ public:
+@@ -170,7 +170,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL
+ gpu_info_.subpixel_font_rendering = true;
+ #endif
-#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
+#if (defined(OS_LINUX) && !defined(OS_CHROMEOS)) || defined(OS_BSD)
if (gpu_info_.gpu.vendor_id == 0x10de && // NVIDIA
gpu_info_.gpu.driver_vendor == "NVIDIA" && !CanAccessNvidiaDeviceFile())
return false;
-@@ -199,7 +199,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL
- sandbox_helper_->PreSandboxStartup();
+@@ -221,7 +221,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL
+ delayed_watchdog_enable = true;
+ #endif
+
+-#if defined(OS_LINUX)
++#if defined(OS_LINUX) || defined(OS_BSD)
+ // PreSandbox is mainly for resource handling and not related to the GPU
+ // driver, it doesn't need the GPU watchdog. The loadLibrary may take long
+ // time that killing and restarting the GPU process will not help.
+@@ -266,7 +266,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL
+ }
bool attempted_startsandbox = false;
-#if defined(OS_LINUX)
@@ -27,3 +45,92 @@
// On Chrome OS ARM Mali, GPU driver userspace creates threads when
// initializing a GL context, so start the sandbox early.
// TODO(zmo): Need to collect OS version before this.
+@@ -275,7 +275,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL
+ watchdog_thread_.get(), &gpu_info_, gpu_preferences_);
+ attempted_startsandbox = true;
+ }
+-#endif // defined(OS_LINUX)
++#endif // defined(OS_LINUX) && !defined(OS_BSD)
+
+ base::TimeTicks before_initialize_one_off = base::TimeTicks::Now();
+
+@@ -299,14 +299,14 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL
+ }
+ if (gl_initialized && use_swiftshader &&
+ gl::GetGLImplementation() != gl::kGLImplementationSwiftShaderGL) {
+-#if defined(OS_LINUX)
++#if defined(OS_LINUX) || defined(OS_BSD)
+ VLOG(1) << "Quit GPU process launch to fallback to SwiftShader cleanly "
+ << "on Linux";
+ return false;
+ #else
+ gl::init::ShutdownGL(true);
+ gl_initialized = false;
+-#endif // OS_LINUX
++#endif // OS_LINUX || OS_BSD
+ }
+
+ if (!gl_initialized) {
+@@ -332,7 +332,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL
+ }
+ }
+
+-#if defined(OS_LINUX)
++#if defined(OS_LINUX) && !defined(OS_BSD)
+ // The ContentSandboxHelper is currently the only one implementation of
+ // gpu::GpuSandboxHelper and it has no dependency. Except on Linux where
+ // VaapiWrapper checks the GL implementation to determine which display
+@@ -370,7 +370,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL
+ command_line, gpu_feature_info_,
+ gpu_preferences_.disable_software_rasterizer, false);
+ if (use_swiftshader) {
+-#if defined(OS_LINUX)
++#if defined(OS_LINUX) || defined(OS_BSD)
+ VLOG(1) << "Quit GPU process launch to fallback to SwiftShader cleanly "
+ << "on Linux";
+ return false;
+@@ -384,7 +384,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL
+ << "failed";
+ return false;
+ }
+-#endif // OS_LINUX
++#endif // OS_LINUX || OS_BSD
+ }
+ } else { // use_swiftshader == true
+ switch (gpu_preferences_.use_vulkan) {
+@@ -440,7 +440,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL
+
+ InitializePlatformOverlaySettings(&gpu_info_);
+
+-#if defined(OS_LINUX)
++#if defined(OS_LINUX) || defined(OS_BSD)
+ // Driver may create a compatibility profile context when collect graphics
+ // information on Linux platform. Try to collect graphics information
+ // based on core profile context after disabling platform extensions.
+@@ -459,7 +459,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL
+ return false;
+ }
+ }
+-#endif // defined(OS_LINUX)
++#endif // defined(OS_LINUX) || defined(OS_BSD)
+
+ if (use_swiftshader) {
+ AdjustInfoToSwiftShader();
+@@ -637,7 +637,7 @@ void GpuInit::InitializeInProcess(base::CommandLine* c
+
+ InitializePlatformOverlaySettings(&gpu_info_);
+
+-#if defined(OS_LINUX)
++#if defined(OS_LINUX) || defined(OS_BSD)
+ // Driver may create a compatibility profile context when collect graphics
+ // information on Linux platform. Try to collect graphics information
+ // based on core profile context after disabling platform extensions.
+@@ -657,7 +657,7 @@ void GpuInit::InitializeInProcess(base::CommandLine* c
+ }
+ }
+ }
+-#endif // defined(OS_LINUX)
++#endif // defined(OS_LINUX) || defined(OS_BSD)
+
+ if (use_swiftshader) {
+ AdjustInfoToSwiftShader();