mirror of
https://git.freebsd.org/ports.git
synced 2025-07-08 12:59:17 -04:00
Approved by: rene (mentor) Security: https://vuxml.freebsd.org/freebsd/310ca30e-a951-11ed-8314-a8a1599412c6.html
83 lines
4.1 KiB
C++
83 lines
4.1 KiB
C++
--- gpu/ipc/service/gpu_init.cc.orig 2023-02-08 09:03:45 UTC
|
|
+++ gpu/ipc/service/gpu_init.cc
|
|
@@ -351,7 +351,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL
|
|
enable_watchdog = false;
|
|
#endif
|
|
|
|
-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
|
|
+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
|
|
bool gpu_sandbox_start_early = gpu_preferences_.gpu_sandbox_start_early;
|
|
#else // !(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS))
|
|
// For some reasons MacOSX's VideoToolbox might crash when called after
|
|
@@ -387,7 +387,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL
|
|
}
|
|
|
|
bool attempted_startsandbox = false;
|
|
-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
|
|
+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
|
|
// 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.
|
|
@@ -436,7 +436,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL
|
|
|
|
if (gl_initialized && gl_use_swiftshader_ &&
|
|
!gl::IsSoftwareGLImplementation(gl::GetGLImplementationParts())) {
|
|
-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
|
|
+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
|
|
VLOG(1) << "Quit GPU process launch to fallback to SwiftShader cleanly "
|
|
<< "on Linux";
|
|
return false;
|
|
@@ -487,7 +487,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL
|
|
}
|
|
}
|
|
|
|
-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
|
|
+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
|
|
// The ContentSandboxHelper is currently the only one implementation of
|
|
// GpuSandboxHelper and it has no dependency. Except on Linux where
|
|
// VaapiWrapper checks the GL implementation to determine which display
|
|
@@ -547,7 +547,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL
|
|
command_line, gpu_feature_info_,
|
|
gpu_preferences_.disable_software_rasterizer, false);
|
|
if (gl_use_swiftshader_) {
|
|
-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
|
|
+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
|
|
VLOG(1) << "Quit GPU process launch to fallback to SwiftShader cleanly "
|
|
<< "on Linux";
|
|
return false;
|
|
@@ -675,7 +675,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL
|
|
|
|
InitializePlatformOverlaySettings(&gpu_info_, gpu_feature_info_);
|
|
|
|
-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
|
|
+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_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.
|
|
@@ -727,7 +727,7 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandL
|
|
gl_use_swiftshader_ = true;
|
|
}
|
|
}
|
|
-#if BUILDFLAG(IS_LINUX) || \
|
|
+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) || \
|
|
(BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_CHROMEOS_DEVICE))
|
|
if (!gl_disabled && !gl_use_swiftshader_ && std::getenv("RUNNING_UNDER_RR")) {
|
|
// https://rr-project.org/ is a Linux-only record-and-replay debugger that
|
|
@@ -870,7 +870,7 @@ void GpuInit::InitializeInProcess(base::CommandLine* c
|
|
}
|
|
bool gl_disabled = gl::GetGLImplementation() == gl::kGLImplementationDisabled;
|
|
|
|
-#if BUILDFLAG(IS_LINUX) || \
|
|
+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD) || \
|
|
(BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_CHROMEOS_DEVICE))
|
|
if (!gl_disabled && !gl_use_swiftshader_ && std::getenv("RUNNING_UNDER_RR")) {
|
|
// https://rr-project.org/ is a Linux-only record-and-replay debugger that
|
|
@@ -933,7 +933,7 @@ void GpuInit::InitializeInProcess(base::CommandLine* c
|
|
|
|
InitializePlatformOverlaySettings(&gpu_info_, gpu_feature_info_);
|
|
|
|
-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
|
|
+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_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.
|