aboutsummaryrefslogtreecommitdiff
path: root/www/qt6-webengine/files/patch-src_3rdparty_chromium_media_gpu_vaapi_vaapi__wrapper.cc
blob: 78386389a125518117992b150072dc81a4f476e8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
--- src/3rdparty/chromium/media/gpu/vaapi/vaapi_wrapper.cc.orig	2023-10-11 18:22:24 UTC
+++ src/3rdparty/chromium/media/gpu/vaapi/vaapi_wrapper.cc
@@ -70,7 +70,7 @@
 using media_gpu_vaapi::kModuleVa_prot;
 #endif
 
-#if BUILDFLAG(IS_LINUX)
+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
 #include "base/files/file_util.h"
 #include "base/strings/string_split.h"
 #endif
@@ -1441,7 +1441,7 @@ bool IsVBREncodingSupported(VAProfile va_profile) {
   return VASupportedProfiles::Get().IsProfileSupported(mode, va_profile);
 }
 
-#if BUILDFLAG(IS_LINUX)
+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
 // Some VA-API drivers (vdpau-va-driver) will crash if used with VA/DRM on
 // NVIDIA GPUs. This function checks if such drivers are present.
 bool IsBrokenNvidiaVaapiDriverPresent() {
@@ -1502,7 +1502,7 @@ void VADisplayStateSingleton::PreSandboxInitialization
   VADisplayStateSingleton& va_display_state = GetInstance();
   base::AutoLock lock(va_display_state.lock_);
 
-#if BUILDFLAG(IS_LINUX)
+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
   std::string va_driver_name;
   auto env = base::Environment::Create();
   if (env->GetVar("LIBVA_DRIVER_NAME", &va_driver_name) &&
@@ -1539,7 +1539,7 @@ void VADisplayStateSingleton::PreSandboxInitialization
     if (base::EqualsCaseInsensitiveASCII(version_name, "vgem")) {
       continue;
     }
-#if BUILDFLAG(IS_LINUX)
+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
     // Skip NVIDIA GPUs if the VA-API driver used for them is known for crashing
     // with VA/DRM.
     if (is_nvidia_va_drm_broken &&
@@ -1572,7 +1572,7 @@ VADisplayStateHandle VADisplayStateSingleton::GetHandl
     return {};
   }
 
-#if BUILDFLAG(IS_OZONE) && BUILDFLAG(IS_LINUX)
+#if BUILDFLAG(IS_OZONE) && (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD))
   // TODO(crbug.com/1116701): add vaapi support for other Ozone platforms on
   // Linux. See comment in OzonePlatform::PlatformProperties::supports_vaapi
   // for more details. This will also require revisiting everything that's
@@ -2403,7 +2403,7 @@ scoped_refptr<VASurface> VaapiWrapper::CreateVASurface
     return nullptr;
   }
 
-#if BUILDFLAG(IS_LINUX)
+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
   // TODO(crbug.com/1326754): enable use DRIME_PRIME_2 API on Linux with the
   // iHD driver.
   const bool use_drm_prime_2 = false;