update to 109.0.5414.74

This commit is contained in:
Than Ngo 2023-01-12 11:24:53 +01:00
parent 7f6eb6da0a
commit 6c69a0f2ec
14 changed files with 573 additions and 735 deletions

View File

@ -1,65 +0,0 @@
diff -up chromium-107.0.5304.110/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_extractor.cc.system-minizip chromium-107.0.5304.110/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_extractor.cc
--- chromium-107.0.5304.110/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_extractor.cc.system-minizip 2022-11-14 11:48:36.877164150 +0100
+++ chromium-107.0.5304.110/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_extractor.cc 2022-11-14 11:51:55.791949494 +0100
@@ -27,8 +27,8 @@ limitations under the License.
#include "tensorflow_lite_support/cc/port/status_macros.h"
#include "tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.h"
#include "tensorflow_lite_support/metadata/metadata_schema_generated.h"
-#include "third_party/zlib/contrib/minizip/ioapi.h"
-#include "third_party/zlib/contrib/minizip/unzip.h"
+#include <minizip/ioapi.h>
+#include <minizip/unzip.h>
namespace tflite {
namespace metadata {
diff -up chromium-107.0.5304.110/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_populator.cc.system-minizip chromium-107.0.5304.110/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_populator.cc
--- chromium-107.0.5304.110/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_populator.cc.system-minizip 2022-11-14 11:48:36.877164150 +0100
+++ chromium-107.0.5304.110/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_populator.cc 2022-11-14 11:52:36.233736347 +0100
@@ -26,8 +26,8 @@ limitations under the License.
#include "tensorflow_lite_support/cc/port/statusor.h"
#include "tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h"
#include "tensorflow_lite_support/metadata/metadata_schema_generated.h"
-#include "third_party/zlib/contrib/minizip/ioapi.h"
-#include "third_party/zlib/contrib/minizip/unzip.h"
+#include <minizip/ioapi.h>
+#include <minizip/zip.h>
namespace tflite {
namespace metadata {
diff -up chromium-107.0.5304.110/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc.system-minizip chromium-107.0.5304.110/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc
--- chromium-107.0.5304.110/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc.system-minizip 2022-11-09 01:41:13.000000000 +0100
+++ chromium-107.0.5304.110/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc 2022-11-14 11:48:36.877164150 +0100
@@ -19,7 +19,7 @@ limitations under the License.
#include <cstdio>
#include "absl/strings/string_view.h" // from @com_google_absl
-#include "contrib/minizip/ioapi.h"
+#include <minizip/ioapi.h>
namespace tflite {
namespace metadata {
diff -up chromium-107.0.5304.110/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.h.system-minizip chromium-107.0.5304.110/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.h
diff -up chromium-107.0.5304.110/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.cc.system-minizip chromium-107.0.5304.110/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.cc
--- chromium-107.0.5304.110/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.cc.system-minizip 2022-11-14 11:48:36.877164150 +0100
+++ chromium-107.0.5304.110/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.cc 2022-11-14 11:53:57.365294462 +0100
@@ -19,7 +19,7 @@ limitations under the License.
#include <cstdio>
#include "absl/strings/string_view.h" // from @com_google_absl
-#include "third_party/zlib/contrib/minizip/ioapi.h"
+#include <minizip/ioapi.h>
namespace tflite {
namespace metadata {
diff -up chromium-107.0.5304.110/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h.system-minizip chromium-107.0.5304.110/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h
--- chromium-107.0.5304.110/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h.system-minizip 2022-11-14 11:48:36.877164150 +0100
+++ chromium-107.0.5304.110/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h 2022-11-14 11:54:21.318756738 +0100
@@ -19,7 +19,7 @@ limitations under the License.
#include <cstdlib>
#include "absl/strings/string_view.h" // from @com_google_absl
-#include "third_party/zlib/contrib/minizip/ioapi.h"
+#include <minizip/ioapi.h>
namespace tflite {
namespace metadata {

View File

@ -1,11 +0,0 @@
diff -up chromium-107.0.5304.110/remoting/codec/video_encoder_active_map.cc.me chromium-107.0.5304.110/remoting/codec/video_encoder_active_map.cc
--- chromium-107.0.5304.110/remoting/codec/video_encoder_active_map.cc.me 2022-11-20 19:17:37.781264509 +0100
+++ chromium-107.0.5304.110/remoting/codec/video_encoder_active_map.cc 2022-11-20 19:18:12.040865033 +0100
@@ -6,6 +6,7 @@
#include <algorithm>
#include <utility>
+#include <cstring>
#include "base/check_op.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"

View File

@ -1,19 +0,0 @@
diff -up chromium-108.0.5359.124/build/config/compiler/BUILD.gn.me chromium-108.0.5359.124/build/config/compiler/BUILD.gn
--- chromium-108.0.5359.124/build/config/compiler/BUILD.gn.me 2023-01-03 21:02:16.602183035 +0100
+++ chromium-108.0.5359.124/build/config/compiler/BUILD.gn 2023-01-03 21:04:11.606320859 +0100
@@ -589,15 +589,6 @@ config("compiler") {
if (is_clang) {
cflags_cc += [ "-fno-trigraphs" ]
}
- } else if (is_linux) {
- # TODO(crbug.com/1284275): Switch to C++20 on all platforms.
- if (is_clang) {
- cflags_cc += [ "-std=${standard_prefix}++20" ]
- } else {
- # The gcc bots are currently using GCC 9, which is not new enough to
- # support "c++20"/"gnu++20".
- cflags_cc += [ "-std=${standard_prefix}++2a" ]
- }
} else {
cflags_cc += [ "-std=${standard_prefix}++17" ]
}

View File

@ -1,20 +0,0 @@
diff -up chromium-108.0.5359.124/chrome/browser/media/router/media_router_feature.cc.me chromium-108.0.5359.124/chrome/browser/media/router/media_router_feature.cc
--- chromium-108.0.5359.124/chrome/browser/media/router/media_router_feature.cc.me 2022-12-30 13:05:24.520593426 +0100
+++ chromium-108.0.5359.124/chrome/browser/media/router/media_router_feature.cc 2022-12-30 14:03:08.996254352 +0100
@@ -46,16 +46,9 @@ BASE_FEATURE(kDialEnforceUrlIPAddress,
BASE_FEATURE(kMediaRemotingWithoutFullscreen,
"MediaRemotingWithoutFullscreen",
base::FEATURE_DISABLED_BY_DEFAULT);
-
-#if BUILDFLAG(IS_CHROMEOS)
BASE_FEATURE(kGlobalMediaControlsCastStartStop,
"GlobalMediaControlsCastStartStop",
base::FEATURE_DISABLED_BY_DEFAULT);
-#else
-BASE_FEATURE(kGlobalMediaControlsCastStartStop,
- "GlobalMediaControlsCastStartStop",
- base::FEATURE_ENABLED_BY_DEFAULT);
-#endif // BUILDFLAG(IS_CHROMEOS)
#endif // !BUILDFLAG(IS_ANDROID)

View File

@ -1,71 +0,0 @@
commit f8f456983cf238d0429ab63466d75357d79a32da
author Ted Meyer <tmathmeyer@chromium.org> Thu Dec 08 21:24:37 2022
committer Chromium LUCI CQ <chromium-scoped@luci-project-accounts.iam.gserviceaccount.com> Thu Dec 08 21:24:37 2022
tree ebfdab985b269b73b48322db0caa594766c9bb58
parent cbf3167e80fd2dc3a87cdc7143dcdb1edfcb1f72 [diff]
Guard VaapiVideoDecoder behind more correct flags
Vulkan on linux also needs the features kVulkanFromANGLE and
kDefaultANGLEVulkan to function properly.
Additinoally, Vaapi on GL needs to be guarded behind a flag.
Bug: 1236697
Bug: 1394888
Bug: 1381114
Bug: 1383140
Change-Id: Ifb9da84b95e71fa39c1559455f25e7efcdc083f1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4088731
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Commit-Queue: Ted (Chromium) Meyer <tmathmeyer@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1081118}
diff -up chromium-108.0.5359.124/media/base/media_switches.cc.orig chromium-108.0.5359.124/media/base/media_switches.cc
--- chromium-108.0.5359.124/media/base/media_switches.cc.orig 2023-01-08 16:37:39.373874165 +0100
+++ chromium-108.0.5359.124/media/base/media_switches.cc 2023-01-10 08:16:23.492761745 +0100
@@ -577,6 +577,10 @@ BASE_FEATURE(kVaapiVideoDecodeLinux,
"VaapiVideoDecoder",
base::FEATURE_ENABLED_BY_DEFAULT);
+BASE_FEATURE(kVaapiVideoDecodeLinuxGL,
+ "VaapiVideoDecodeLinuxGL",
+ base::FEATURE_DISABLED_BY_DEFAULT);
+
BASE_FEATURE(kVaapiVideoEncodeLinux,
"VaapiVideoEncoder",
base::FEATURE_DISABLED_BY_DEFAULT);
diff -up chromium-108.0.5359.124/media/base/media_switches.h.orig chromium-108.0.5359.124/media/base/media_switches.h
--- chromium-108.0.5359.124/media/base/media_switches.h.orig 2023-01-08 16:37:39.379874227 +0100
+++ chromium-108.0.5359.124/media/base/media_switches.h 2023-01-10 08:16:23.493761763 +0100
@@ -216,6 +216,7 @@ MEDIA_EXPORT BASE_DECLARE_FEATURE(kUseMe
MEDIA_EXPORT BASE_DECLARE_FEATURE(kUseR16Texture);
#if BUILDFLAG(IS_LINUX)
MEDIA_EXPORT BASE_DECLARE_FEATURE(kVaapiVideoDecodeLinux);
+MEDIA_EXPORT BASE_DECLARE_FEATURE(kVaapiVideoDecodeLinuxGL);
MEDIA_EXPORT BASE_DECLARE_FEATURE(kVaapiVideoEncodeLinux);
MEDIA_EXPORT BASE_DECLARE_FEATURE(kVaapiIgnoreDriverChecks);
#endif // BUILDFLAG(IS_LINUX)
diff -up chromium-108.0.5359.124/media/mojo/services/gpu_mojo_media_client_cros.cc.orig chromium-108.0.5359.124/media/mojo/services/gpu_mojo_media_client_cros.cc
--- chromium-108.0.5359.124/media/mojo/services/gpu_mojo_media_client_cros.cc.orig 2023-01-10 08:16:23.493761763 +0100
+++ chromium-108.0.5359.124/media/mojo/services/gpu_mojo_media_client_cros.cc 2023-01-10 08:21:55.617909016 +0100
@@ -78,10 +78,19 @@ VideoDecoderType GetActualPlatformDecode
}
case VideoDecoderType::kVaapi: {
// Allow VaapiVideoDecoder on GL.
- if (gpu_preferences.gr_context_type == gpu::GrContextType::kGL)
- return VideoDecoderType::kVaapi;
+ if (gpu_preferences.gr_context_type == gpu::GrContextType::kGL) {
+ if (base::FeatureList::IsEnabled(kVaapiVideoDecodeLinuxGL)) {
+ return VideoDecoderType::kVaapi;
+ } else {
+ return VideoDecoderType::kUnknown;
+ }
+ }
if (gpu_preferences.gr_context_type != gpu::GrContextType::kVulkan)
return VideoDecoderType::kUnknown;
+ if (!base::FeatureList::IsEnabled(features::kVulkanFromANGLE))
+ return VideoDecoderType::kUnknown;
+ if (!base::FeatureList::IsEnabled(features::kDefaultANGLEVulkan))
+ return VideoDecoderType::kUnknown;
// If Vulkan is active, check Vulkan info if VaapiVideoDecoder is allowed.
if (!gpu_info.vulkan_info.has_value())
return VideoDecoderType::kUnknown;

View File

@ -0,0 +1,17 @@
diff -up chromium-109.0.5414.74/build/config/compiler/BUILD.gn.link-error-clang14 chromium-109.0.5414.74/build/config/compiler/BUILD.gn
--- chromium-109.0.5414.74/build/config/compiler/BUILD.gn.link-error-clang14 2023-01-11 18:00:34.692512606 +0100
+++ chromium-109.0.5414.74/build/config/compiler/BUILD.gn 2023-01-11 18:30:10.905410122 +0100
@@ -601,12 +601,7 @@ config("compiler") {
cflags_cc += [ "-fno-trigraphs" ]
}
} else if (is_clang) {
- if (is_chromeos_device) {
- # TODO(crbug.com/1392471): Support C++20 in CrOS toolchain.
- cflags_cc += [ "-std=${standard_prefix}++17" ]
- } else {
- cflags_cc += [ "-std=${standard_prefix}++20" ]
- }
+ cflags_cc += [ "-std=${standard_prefix}++17" ]
} else {
# The gcc bots are currently using GCC 9, which is not new enough to
# support "c++20"/"gnu++20".

View File

@ -0,0 +1,19 @@
diff -up chromium-109.0.5414.74/chrome/browser/media/router/media_router_feature.cc.disable-GlobalMediaControlsCastStartStop chromium-109.0.5414.74/chrome/browser/media/router/media_router_feature.cc
--- chromium-109.0.5414.74/chrome/browser/media/router/media_router_feature.cc.disable-GlobalMediaControlsCastStartStop 2023-01-11 15:27:50.587737070 +0100
+++ chromium-109.0.5414.74/chrome/browser/media/router/media_router_feature.cc 2023-01-11 15:30:35.136829951 +0100
@@ -48,15 +48,9 @@ BASE_FEATURE(kMediaRemotingWithoutFullsc
"MediaRemotingWithoutFullscreen",
base::FEATURE_DISABLED_BY_DEFAULT);
-#if BUILDFLAG(IS_CHROMEOS)
BASE_FEATURE(kGlobalMediaControlsCastStartStop,
"GlobalMediaControlsCastStartStop",
base::FEATURE_DISABLED_BY_DEFAULT);
-#else
-BASE_FEATURE(kGlobalMediaControlsCastStartStop,
- "GlobalMediaControlsCastStartStop",
- base::FEATURE_ENABLED_BY_DEFAULT);
-#endif // BUILDFLAG(IS_CHROMEOS)
#endif // BUILDFLAG(IS_ANDROID)

View File

@ -18,9 +18,9 @@ on Linux.
Test: VDA video playback on Linux X11 and Linux Wayland
Bug: 1326754,1116701
Change-Id: I6d6bf781833a7752d23dafb2b63112c2fc81b17a
diff -up chromium-108.0.5359.124/media/gpu/args.gni.wayland-vaapi chromium-108.0.5359.124/media/gpu/args.gni
--- chromium-108.0.5359.124/media/gpu/args.gni.wayland-vaapi 2022-12-14 01:39:52.000000000 +0100
+++ chromium-108.0.5359.124/media/gpu/args.gni 2023-01-05 10:13:08.291403261 +0100
diff -up chromium-109.0.5359.124/media/gpu/args.gni.wayland-vaapi chromium-109.0.5359.124/media/gpu/args.gni
--- chromium-109.0.5359.124/media/gpu/args.gni.wayland-vaapi 2022-12-14 01:39:52.000000000 +0100
+++ chromium-109.0.5359.124/media/gpu/args.gni 2023-01-05 10:13:08.291403261 +0100
@@ -6,10 +6,14 @@ import("//build/config/chromeos/ui_mode.
import("//build/config/ozone.gni")
@ -52,9 +52,9 @@ diff -up chromium-108.0.5359.124/media/gpu/args.gni.wayland-vaapi chromium-108.0
# Indicates if ChromeOS protected media support exists. This is used
# to enable the CDM daemon in Chrome OS as well as support for
diff -up chromium-108.0.5359.124/media/gpu/BUILD.gn.wayland-vaapi chromium-108.0.5359.124/media/gpu/BUILD.gn
--- chromium-108.0.5359.124/media/gpu/BUILD.gn.wayland-vaapi 2022-12-14 01:39:52.000000000 +0100
+++ chromium-108.0.5359.124/media/gpu/BUILD.gn 2023-01-05 10:13:08.291403261 +0100
diff -up chromium-109.0.5359.124/media/gpu/BUILD.gn.wayland-vaapi chromium-109.0.5359.124/media/gpu/BUILD.gn
--- chromium-109.0.5359.124/media/gpu/BUILD.gn.wayland-vaapi 2022-12-14 01:39:52.000000000 +0100
+++ chromium-109.0.5359.124/media/gpu/BUILD.gn 2023-01-05 10:13:08.291403261 +0100
@@ -20,7 +20,7 @@ buildflag_header("buildflags") {
"USE_VAAPI_IMAGE_CODECS=$use_vaapi_image_codecs",
"USE_V4L2_CODEC=$use_v4l2_codec",
@ -64,9 +64,9 @@ diff -up chromium-108.0.5359.124/media/gpu/BUILD.gn.wayland-vaapi chromium-108.0
]
}
diff -up chromium-108.0.5359.124/media/gpu/vaapi/BUILD.gn.wayland-vaapi chromium-108.0.5359.124/media/gpu/vaapi/BUILD.gn
--- chromium-108.0.5359.124/media/gpu/vaapi/BUILD.gn.wayland-vaapi 2022-12-14 01:39:52.000000000 +0100
+++ chromium-108.0.5359.124/media/gpu/vaapi/BUILD.gn 2023-01-05 10:13:08.291403261 +0100
diff -up chromium-109.0.5359.124/media/gpu/vaapi/BUILD.gn.wayland-vaapi chromium-109.0.5359.124/media/gpu/vaapi/BUILD.gn
--- chromium-109.0.5359.124/media/gpu/vaapi/BUILD.gn.wayland-vaapi 2022-12-14 01:39:52.000000000 +0100
+++ chromium-109.0.5359.124/media/gpu/vaapi/BUILD.gn 2023-01-05 10:13:08.291403261 +0100
@@ -17,7 +17,7 @@ assert(use_vaapi)
generate_stubs("libva_stubs") {
extra_header = "va_stub_header.fragment"
@ -94,128 +94,9 @@ diff -up chromium-108.0.5359.124/media/gpu/vaapi/BUILD.gn.wayland-vaapi chromium
deps += [ "//ui/gfx/x" ]
}
diff -up chromium-108.0.5359.124/media/gpu/vaapi/vaapi_picture_factory.cc.wayland-vaapi chromium-108.0.5359.124/media/gpu/vaapi/vaapi_picture_factory.cc
--- chromium-108.0.5359.124/media/gpu/vaapi/vaapi_picture_factory.cc.wayland-vaapi 2022-12-14 01:39:53.000000000 +0100
+++ chromium-108.0.5359.124/media/gpu/vaapi/vaapi_picture_factory.cc 2023-01-05 10:32:58.616517572 +0100
@@ -12,10 +12,10 @@
#if defined(USE_OZONE)
#include "media/gpu/vaapi/vaapi_picture_native_pixmap_ozone.h"
#endif // defined(USE_OZONE)
-#if BUILDFLAG(USE_VAAPI_X11)
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
#include "media/gpu/vaapi/vaapi_picture_native_pixmap_angle.h"
#include "media/gpu/vaapi/vaapi_picture_tfp.h"
-#endif // BUILDFLAG(USE_VAAPI_X11)
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
#if defined(USE_EGL)
#include "media/gpu/vaapi/vaapi_picture_native_pixmap_egl.h"
#endif
@@ -41,22 +41,32 @@ std::unique_ptr<VaapiPicture> CreateVaap
} // namespace
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+VaapiPictureFactory::VaapiPictureFactory(
+ absl::optional<bool> may_use_vaapi_over_x11)
+ : may_use_vaapi_over_x11_(may_use_vaapi_over_x11) {
+#else
VaapiPictureFactory::VaapiPictureFactory() {
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
vaapi_impl_pairs_.insert(
std::make_pair(gl::kGLImplementationEGLGLES2,
VaapiPictureFactory::kVaapiImplementationDrm));
-#if BUILDFLAG(USE_VAAPI_X11)
- vaapi_impl_pairs_.insert(
- std::make_pair(gl::kGLImplementationEGLANGLE,
- VaapiPictureFactory::kVaapiImplementationAngle));
- vaapi_impl_pairs_.insert(
- std::make_pair(gl::kGLImplementationDesktopGL,
- VaapiPictureFactory::kVaapiImplementationX11));
-#elif defined(USE_OZONE)
+
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+ CHECK(may_use_vaapi_over_x11_.has_value());
+ if (may_use_vaapi_over_x11_.value()) {
+ vaapi_impl_pairs_.insert(
+ std::make_pair(gl::kGLImplementationEGLANGLE,
+ VaapiPictureFactory::kVaapiImplementationAngle));
+ vaapi_impl_pairs_.insert(
+ std::make_pair(gl::kGLImplementationDesktopGL,
+ VaapiPictureFactory::kVaapiImplementationX11));
+ }
+#else
vaapi_impl_pairs_.insert(
std::make_pair(gl::kGLImplementationEGLANGLE,
VaapiPictureFactory::kVaapiImplementationDrm));
-#endif
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
DeterminePictureCreationAndDownloadingMechanism();
}
@@ -97,19 +107,19 @@ VaapiPictureFactory::GetVaapiImplementat
}
uint32_t VaapiPictureFactory::GetGLTextureTarget() {
-#if BUILDFLAG(USE_VAAPI_X11)
- return GL_TEXTURE_2D;
-#else
+#if BUILDFLAG(IS_CHROMEOS)
return GL_TEXTURE_EXTERNAL_OES;
-#endif
+#else
+ return GL_TEXTURE_2D;
+#endif // BUILDFLAG(IS_CHROMEOS)
}
gfx::BufferFormat VaapiPictureFactory::GetBufferFormat() {
-#if BUILDFLAG(USE_VAAPI_X11)
- return gfx::BufferFormat::RGBX_8888;
-#else
+#if BUILDFLAG(IS_CHROMEOS)
return gfx::BufferFormat::YUV_420_BIPLANAR;
-#endif
+#else
+ return gfx::BufferFormat::RGBX_8888;
+#endif // BUILDFLAG(IS_CHROMEOS)
}
void VaapiPictureFactory::DeterminePictureCreationAndDownloadingMechanism() {
@@ -117,25 +127,30 @@ void VaapiPictureFactory::DeterminePictu
#if defined(USE_OZONE)
// We can be called without GL initialized, which is valid if we use Ozone.
case kVaapiImplementationNone:
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+ DCHECK(may_use_vaapi_over_x11_.value_or(false));
+#endif
create_picture_cb_ = base::BindRepeating(
&CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapOzone>);
needs_vpp_for_downloading_ = true;
break;
#endif // defined(USE_OZONE)
-#if BUILDFLAG(USE_VAAPI_X11)
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
case kVaapiImplementationX11:
+ DCHECK(may_use_vaapi_over_x11_.value_or(false));
create_picture_cb_ =
base::BindRepeating(&CreateVaapiPictureNativeImpl<VaapiTFPPicture>);
// Neither VaapiTFPPicture or VaapiPictureNativePixmapAngle needs the VPP.
needs_vpp_for_downloading_ = false;
break;
case kVaapiImplementationAngle:
+ DCHECK(may_use_vaapi_over_x11_.value_or(false));
create_picture_cb_ = base::BindRepeating(
&CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapAngle>);
// Neither VaapiTFPPicture or VaapiPictureNativePixmapAngle needs the VPP.
needs_vpp_for_downloading_ = false;
break;
-#endif // BUILDFLAG(USE_VAAPI_X11)
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
case kVaapiImplementationDrm:
#if defined(USE_OZONE)
create_picture_cb_ = base::BindRepeating(
diff -up chromium-108.0.5359.124/media/gpu/vaapi/vaapi_picture_factory.h.wayland-vaapi chromium-108.0.5359.124/media/gpu/vaapi/vaapi_picture_factory.h
--- chromium-108.0.5359.124/media/gpu/vaapi/vaapi_picture_factory.h.wayland-vaapi 2022-12-14 01:39:53.000000000 +0100
+++ chromium-108.0.5359.124/media/gpu/vaapi/vaapi_picture_factory.h 2023-01-05 10:13:08.291403261 +0100
diff -up chromium-109.0.5359.124/media/gpu/vaapi/vaapi_picture_factory.h.wayland-vaapi chromium-109.0.5359.124/media/gpu/vaapi/vaapi_picture_factory.h
--- chromium-109.0.5359.124/media/gpu/vaapi/vaapi_picture_factory.h.wayland-vaapi 2022-12-14 01:39:53.000000000 +0100
+++ chromium-109.0.5359.124/media/gpu/vaapi/vaapi_picture_factory.h 2023-01-05 10:13:08.291403261 +0100
@@ -36,7 +36,11 @@ class MEDIA_GPU_EXPORT VaapiPictureFacto
kVaapiImplementationAngle,
};
@ -240,10 +121,9 @@ diff -up chromium-108.0.5359.124/media/gpu/vaapi/vaapi_picture_factory.h.wayland
};
} // namespace media
diff -up chromium-108.0.5359.124/media/gpu/vaapi/vaapi_picture_native_pixmap_ozone.cc.wayland-vaapi chromium-108.0.5359.124/media/gpu/vaapi/vaapi_picture_native_pixmap_ozone.cc
diff -up chromium-108.0.5359.124/media/gpu/vaapi/vaapi_video_decode_accelerator.cc.wayland-vaapi chromium-108.0.5359.124/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
--- chromium-108.0.5359.124/media/gpu/vaapi/vaapi_video_decode_accelerator.cc.wayland-vaapi 2023-01-05 10:13:08.290403251 +0100
+++ chromium-108.0.5359.124/media/gpu/vaapi/vaapi_video_decode_accelerator.cc 2023-01-05 10:13:08.292403271 +0100
diff -up chromium-109.0.5359.124/media/gpu/vaapi/vaapi_video_decode_accelerator.cc.wayland-vaapi chromium-109.0.5359.124/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
--- chromium-109.0.5359.124/media/gpu/vaapi/vaapi_video_decode_accelerator.cc.wayland-vaapi 2023-01-05 10:13:08.290403251 +0100
+++ chromium-109.0.5359.124/media/gpu/vaapi/vaapi_video_decode_accelerator.cc 2023-01-05 10:13:08.292403271 +0100
@@ -184,7 +184,12 @@ bool VaapiVideoDecodeAccelerator::Initia
Client* client) {
DCHECK(task_runner_->BelongsToCurrentThread());
@ -266,299 +146,9 @@ diff -up chromium-108.0.5359.124/media/gpu/vaapi/vaapi_video_decode_accelerator.
// The IMPORT mode is used for Android on Chrome OS, so this doesn't apply
// here.
DCHECK_NE(output_mode_, VideoDecodeAccelerator::Config::OutputMode::IMPORT);
diff -up chromium-108.0.5359.124/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc.wayland-vaapi chromium-108.0.5359.124/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc
--- chromium-108.0.5359.124/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc.wayland-vaapi 2022-12-14 01:39:53.000000000 +0100
+++ chromium-108.0.5359.124/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc 2023-01-05 10:38:15.176631507 +0100
@@ -38,6 +38,11 @@ struct TestParams {
bool decode_using_client_picture_buffers;
};
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+// TODO: Add it in TestParams to cover Ozone/Wayland.
+bool kMayUseVaapiOverX11 = true;
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+
constexpr int32_t kBitstreamId = 123;
constexpr size_t kInputSize = 256;
@@ -130,7 +135,13 @@ class MockVaapiPicture : public VaapiPic
class MockVaapiPictureFactory : public VaapiPictureFactory {
public:
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+ explicit MockVaapiPictureFactory(absl::optional<bool> may_use_vaapi_over_x11)
+ : VaapiPictureFactory(may_use_vaapi_over_x11) {}
+#else
MockVaapiPictureFactory() = default;
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+
~MockVaapiPictureFactory() override = default;
MOCK_METHOD3(MockCreateVaapiPicture,
@@ -164,7 +175,12 @@ class VaapiVideoDecodeAcceleratorTest :
bool can_bind_to_sampler) { return true; })),
decoder_thread_("VaapiVideoDecodeAcceleratorTestThread"),
mock_decoder_(new ::testing::StrictMock<MockAcceleratedVideoDecoder>),
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+ mock_vaapi_picture_factory_(
+ new MockVaapiPictureFactory(kMayUseVaapiOverX11)),
+#else
mock_vaapi_picture_factory_(new MockVaapiPictureFactory()),
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
mock_vaapi_wrapper_(new MockVaapiWrapper(VaapiWrapper::kDecode)),
mock_vpp_vaapi_wrapper_(new MockVaapiWrapper(VaapiWrapper::kDecode)),
weak_ptr_factory_(this) {
@@ -420,14 +436,16 @@ TEST_P(VaapiVideoDecodeAcceleratorTest,
mock_vaapi_picture_factory_->GetVaapiImplementation(
gl::kGLImplementationEGLGLES2));
-#if BUILDFLAG(USE_VAAPI_X11)
- EXPECT_EQ(VaapiPictureFactory::kVaapiImplementationAngle,
- mock_vaapi_picture_factory_->GetVaapiImplementation(
- gl::kGLImplementationEGLANGLE));
- EXPECT_EQ(VaapiPictureFactory::kVaapiImplementationX11,
- mock_vaapi_picture_factory_->GetVaapiImplementation(
- gl::kGLImplementationDesktopGL));
-#elif defined(USE_OZONE)
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+ if (kMayUseVaapiOverX11) {
+ EXPECT_EQ(VaapiPictureFactory::kVaapiImplementationAngle,
+ mock_vaapi_picture_factory_->GetVaapiImplementation(
+ gl::kGLImplementationEGLANGLE));
+ EXPECT_EQ(VaapiPictureFactory::kVaapiImplementationX11,
+ mock_vaapi_picture_factory_->GetVaapiImplementation(
+ gl::kGLImplementationDesktopGL));
+ }
+#else
EXPECT_EQ(VaapiPictureFactory::kVaapiImplementationDrm,
mock_vaapi_picture_factory_->GetVaapiImplementation(
gl::kGLImplementationEGLANGLE));
diff -up chromium-108.0.5359.124/media/gpu/vaapi/vaapi_wrapper.cc.wayland-vaapi chromium-108.0.5359.124/media/gpu/vaapi/vaapi_wrapper.cc
--- chromium-108.0.5359.124/media/gpu/vaapi/vaapi_wrapper.cc.wayland-vaapi 2022-12-14 01:39:53.000000000 +0100
+++ chromium-108.0.5359.124/media/gpu/vaapi/vaapi_wrapper.cc 2023-01-05 10:41:41.595648227 +0100
@@ -62,7 +62,7 @@
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_implementation.h"
-#if BUILDFLAG(USE_VAAPI_X11)
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
typedef XID Drawable;
extern "C" {
@@ -70,7 +70,7 @@ extern "C" {
}
#include "ui/gfx/x/connection.h" // nogncheck
-#endif // BUILDFLAG(USE_VAAPI_X11)
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
#if defined(USE_OZONE)
#include "ui/ozone/public/ozone_platform.h"
@@ -84,14 +84,14 @@ using media_gpu_vaapi::kModuleVa_prot;
using media_gpu_vaapi::kModuleVa;
using media_gpu_vaapi::kModuleVa_drm;
-#if BUILDFLAG(USE_VAAPI_X11)
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
using media_gpu_vaapi::kModuleVa_x11;
-#endif // BUILDFLAG(USE_VAAPI_X11)
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
using media_gpu_vaapi::InitializeStubs;
using media_gpu_vaapi::IsVaInitialized;
-#if BUILDFLAG(USE_VAAPI_X11)
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
using media_gpu_vaapi::IsVa_x11Initialized;
-#endif // BUILDFLAG(USE_VAAPI_X11)
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
using media_gpu_vaapi::IsVa_drmInitialized;
using media_gpu_vaapi::StubPathMap;
@@ -668,6 +668,12 @@ class VADisplayState {
void SetDrmFd(base::PlatformFile fd) { drm_fd_.reset(HANDLE_EINTR(dup(fd))); }
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+ absl::optional<bool> MayUseVaapiOverX11() const {
+ return may_use_vaapi_over_x11_;
+ }
+#endif
+
private:
friend class base::NoDestructor<VADisplayState>;
@@ -690,6 +696,13 @@ class VADisplayState {
// Drm fd used to obtain access to the driver interface by VA.
base::ScopedFD drm_fd_;
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+ // Whether we'll be possibly using VA-API over Ozone/X11. This should only be
+ // set (if at all) during the pre-sandbox initialization. If absl::nullopt,
+ // all calls to Initialize() will return false immediately.
+ absl::optional<bool> may_use_vaapi_over_x11_;
+#endif
+
// The VADisplay handle. Valid between Initialize() and Deinitialize().
VADisplay va_display_;
@@ -708,6 +721,15 @@ VADisplayState* VADisplayState::Get() {
// static
void VADisplayState::PreSandboxInitialization() {
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+ if (ui::OzonePlatform::IsInitialized()) {
+ VADisplayState::Get()->may_use_vaapi_over_x11_ =
+ ui::OzonePlatform::GetInstance()
+ ->GetPlatformProperties()
+ .supports_vaapi_x11;
+ }
+#endif
+
constexpr char kRenderNodeFilePattern[] = "/dev/dri/renderD%d";
// This loop ends on either the first card that does not exist or the first
// render node that is not vgem.
@@ -740,20 +762,18 @@ VADisplayState::VADisplayState()
bool VADisplayState::Initialize() {
base::AutoLock auto_lock(va_lock_);
-#if defined(USE_OZONE) && BUILDFLAG(IS_LINUX)
- // 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
- // guarded by USE_VAAPI_X11. For example, if USE_VAAPI_X11 is true, but the
- // user chooses the Wayland backend for Ozone at runtime, then many things (if
- // not all) that we do for X11 won't apply.
- if (!ui::OzonePlatform::GetInstance()->GetPlatformProperties().supports_vaapi)
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+ if (!may_use_vaapi_over_x11_.has_value())
return false;
#endif
bool libraries_initialized = IsVaInitialized() && IsVa_drmInitialized();
-#if BUILDFLAG(USE_VAAPI_X11)
- libraries_initialized = libraries_initialized && IsVa_x11Initialized();
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+ // Initialize VA-API X11 display backend for Linux Ozone/X11.
+ // See comment in OzonePlatform::PlatformProperties::supports_vaapi_x11 for
+ // more details.
+ if (may_use_vaapi_over_x11_.value())
+ libraries_initialized = libraries_initialized && IsVa_x11Initialized();
#endif
if (!libraries_initialized)
return false;
@@ -768,7 +788,7 @@ bool VADisplayState::Initialize() {
return success;
}
-#if BUILDFLAG(USE_VAAPI_X11)
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
absl::optional<VADisplay> GetVADisplayStateX11(const base::ScopedFD& drm_fd) {
switch (gl::GetGLImplementation()) {
@@ -796,13 +816,19 @@ absl::optional<VADisplay> GetVADisplaySt
}
}
-#else
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
absl::optional<VADisplay> GetVADisplayState(const base::ScopedFD& drm_fd) {
switch (gl::GetGLImplementation()) {
case gl::kGLImplementationEGLGLES2:
+#if BUILDFLAG(IS_CHROMEOS)
+ // GetVADisplayState() should not get called on Linux with Ozone/X11
+ // (GetVADisplayStateX11() should get called instead), and we haven't tried
+ // VA-API decoding on Linux with Ozone/Wayland and anything other than
+ // native EGL/GLES2.
case gl::kGLImplementationEGLANGLE:
case gl::kGLImplementationNone:
+#endif
return vaGetDisplayDRM(drm_fd.get());
default:
LOG(WARNING) << "VAAPI video acceleration not available for "
@@ -812,18 +838,23 @@ absl::optional<VADisplay> GetVADisplaySt
}
}
-#endif // BUILDFLAG(USE_VAAPI_X11)
-
bool VADisplayState::InitializeVaDisplay_Locked() {
- absl::optional<VADisplay> display =
-#if BUILDFLAG(USE_VAAPI_X11)
- GetVADisplayStateX11(drm_fd_);
-#else
- GetVADisplayState(drm_fd_);
-#endif
+ absl::optional<VADisplay> display;
- if (!display)
- return false;
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+ DCHECK(may_use_vaapi_over_x11_.has_value());
+ if (may_use_vaapi_over_x11_.value()) {
+ display = GetVADisplayStateX11(drm_fd_);
+ if (!display)
+ return false;
+ }
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+
+ if (!display) {
+ display = GetVADisplayState(drm_fd_);
+ if (!display)
+ return false;
+ }
va_display_ = *display;
if (!vaDisplayIsValid(va_display_)) {
@@ -1656,6 +1687,13 @@ scoped_refptr<VaapiWrapper> VaapiWrapper
enforce_sequence_affinity);
}
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+// static
+absl::optional<bool> VaapiWrapper::MayUseVaapiOverX11() {
+ return VADisplayState::Get()->MayUseVaapiOverX11();
+}
+#endif
+
// static
std::vector<SVCScalabilityMode> VaapiWrapper::GetSupportedScalabilityModes(
VideoCodecProfile media_profile,
@@ -2665,12 +2703,13 @@ bool VaapiWrapper::MapAndCopyAndExecute(
return Execute_Locked(va_surface_id, va_buffer_ids);
}
-#if BUILDFLAG(USE_VAAPI_X11)
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
bool VaapiWrapper::PutSurfaceIntoPixmap(VASurfaceID va_surface_id,
x11::Pixmap x_pixmap,
gfx::Size dest_size) {
CHECK(!enforce_sequence_affinity_ ||
sequence_checker_.CalledOnValidSequence());
+ CHECK(MayUseVaapiOverX11().value_or(false));
base::AutoLockMaybe auto_lock(va_lock_.get());
VAStatus va_res = vaSyncSurface(va_display_, va_surface_id);
@@ -2684,7 +2723,7 @@ bool VaapiWrapper::PutSurfaceIntoPixmap(
VA_SUCCESS_OR_RETURN(va_res, VaapiFunctions::kVAPutSurface, false);
return true;
}
-#endif // BUILDFLAG(USE_VAAPI_X11)
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
std::unique_ptr<ScopedVAImage> VaapiWrapper::CreateVaImage(
VASurfaceID va_surface_id,
@@ -3086,7 +3125,7 @@ void VaapiWrapper::PreSandboxInitializat
paths[kModuleVa].push_back(std::string("libva.so.") + va_suffix);
paths[kModuleVa_drm].push_back(std::string("libva-drm.so.") + va_suffix);
-#if BUILDFLAG(USE_VAAPI_X11)
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
paths[kModuleVa_x11].push_back(std::string("libva-x11.so.") + va_suffix);
#endif
#if BUILDFLAG(IS_CHROMEOS_ASH)
diff -up chromium-108.0.5359.124/media/gpu/vaapi/vaapi_wrapper.h.wayland-vaapi chromium-108.0.5359.124/media/gpu/vaapi/vaapi_wrapper.h
--- chromium-108.0.5359.124/media/gpu/vaapi/vaapi_wrapper.h.wayland-vaapi 2022-12-14 01:39:53.000000000 +0100
+++ chromium-108.0.5359.124/media/gpu/vaapi/vaapi_wrapper.h 2023-01-05 10:13:08.292403271 +0100
diff -up chromium-109.0.5359.124/media/gpu/vaapi/vaapi_wrapper.h.wayland-vaapi chromium-109.0.5359.124/media/gpu/vaapi/vaapi_wrapper.h
--- chromium-109.0.5359.124/media/gpu/vaapi/vaapi_wrapper.h.wayland-vaapi 2022-12-14 01:39:53.000000000 +0100
+++ chromium-109.0.5359.124/media/gpu/vaapi/vaapi_wrapper.h 2023-01-05 10:13:08.292403271 +0100
@@ -36,9 +36,9 @@
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "ui/gfx/geometry/size.h"
@ -604,9 +194,9 @@ diff -up chromium-108.0.5359.124/media/gpu/vaapi/vaapi_wrapper.h.wayland-vaapi c
// Creates a ScopedVAImage from a VASurface |va_surface_id| and map it into
// memory with the given |format| and |size|. If |format| is not equal to the
diff -up chromium-108.0.5359.124/media/gpu/vaapi/va_stub_header.fragment.wayland-vaapi chromium-108.0.5359.124/media/gpu/vaapi/va_stub_header.fragment
--- chromium-108.0.5359.124/media/gpu/vaapi/va_stub_header.fragment.wayland-vaapi 2022-12-14 01:39:52.000000000 +0100
+++ chromium-108.0.5359.124/media/gpu/vaapi/va_stub_header.fragment 2023-01-05 10:13:08.291403261 +0100
diff -up chromium-109.0.5359.124/media/gpu/vaapi/va_stub_header.fragment.wayland-vaapi chromium-109.0.5359.124/media/gpu/vaapi/va_stub_header.fragment
--- chromium-109.0.5359.124/media/gpu/vaapi/va_stub_header.fragment.wayland-vaapi 2022-12-14 01:39:52.000000000 +0100
+++ chromium-109.0.5359.124/media/gpu/vaapi/va_stub_header.fragment 2023-01-05 10:13:08.291403261 +0100
@@ -7,8 +7,8 @@ extern "C" {
#include <va/va_drm.h>
@ -618,9 +208,9 @@ diff -up chromium-108.0.5359.124/media/gpu/vaapi/va_stub_header.fragment.wayland
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
}
diff -up chromium-108.0.5359.124/ui/ozone/platform/x11/ozone_platform_x11.cc.wayland-vaapi chromium-108.0.5359.124/ui/ozone/platform/x11/ozone_platform_x11.cc
--- chromium-108.0.5359.124/ui/ozone/platform/x11/ozone_platform_x11.cc.wayland-vaapi 2022-12-14 01:40:14.000000000 +0100
+++ chromium-108.0.5359.124/ui/ozone/platform/x11/ozone_platform_x11.cc 2023-01-05 10:13:08.292403271 +0100
diff -up chromium-109.0.5359.124/ui/ozone/platform/x11/ozone_platform_x11.cc.wayland-vaapi chromium-109.0.5359.124/ui/ozone/platform/x11/ozone_platform_x11.cc
--- chromium-109.0.5359.124/ui/ozone/platform/x11/ozone_platform_x11.cc.wayland-vaapi 2022-12-14 01:40:14.000000000 +0100
+++ chromium-109.0.5359.124/ui/ozone/platform/x11/ozone_platform_x11.cc 2023-01-05 10:13:08.292403271 +0100
@@ -196,7 +196,7 @@ class OzonePlatformX11 : public OzonePla
properties->app_modal_dialogs_use_event_blocker = true;
properties->fetch_buffer_formats_for_gmb_on_gpu = true;
@ -630,9 +220,9 @@ diff -up chromium-108.0.5359.124/ui/ozone/platform/x11/ozone_platform_x11.cc.way
#endif
initialised = true;
diff -up chromium-108.0.5359.124/ui/ozone/public/ozone_platform.h.wayland-vaapi chromium-108.0.5359.124/ui/ozone/public/ozone_platform.h
--- chromium-108.0.5359.124/ui/ozone/public/ozone_platform.h.wayland-vaapi 2022-12-14 01:40:14.000000000 +0100
+++ chromium-108.0.5359.124/ui/ozone/public/ozone_platform.h 2023-01-05 10:13:08.293403281 +0100
diff -up chromium-109.0.5359.124/ui/ozone/public/ozone_platform.h.wayland-vaapi chromium-109.0.5359.124/ui/ozone/public/ozone_platform.h
--- chromium-109.0.5359.124/ui/ozone/public/ozone_platform.h.wayland-vaapi 2022-12-14 01:40:14.000000000 +0100
+++ chromium-109.0.5359.124/ui/ozone/public/ozone_platform.h 2023-01-05 10:13:08.293403281 +0100
@@ -145,12 +145,13 @@ class COMPONENT_EXPORT(OZONE) OzonePlatf
bool fetch_buffer_formats_for_gmb_on_gpu = false;
@ -653,3 +243,424 @@ diff -up chromium-108.0.5359.124/ui/ozone/public/ozone_platform.h.wayland-vaapi
#endif
// Indicates that the platform allows client applications to manipulate
diff -up chromium-109.0.5414.74/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc.orig chromium-109.0.5414.74/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc
--- chromium-109.0.5414.74/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc.orig 2023-01-04 20:20:18.000000000 +0100
+++ chromium-109.0.5414.74/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc 2023-01-11 14:31:01.033496121 +0100
@@ -39,6 +39,11 @@ struct TestParams {
bool decode_using_client_picture_buffers;
};
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+// TODO: Add it in TestParams to cover Ozone/Wayland.
+bool kMayUseVaapiOverX11 = true;
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+
constexpr int32_t kBitstreamId = 123;
constexpr size_t kInputSize = 256;
@@ -131,7 +136,13 @@ class MockVaapiPicture : public VaapiPic
class MockVaapiPictureFactory : public VaapiPictureFactory {
public:
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+ explicit MockVaapiPictureFactory(absl::optional<bool> may_use_vaapi_over_x11)
+ : VaapiPictureFactory(may_use_vaapi_over_x11) {}
+#else
MockVaapiPictureFactory() = default;
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+
~MockVaapiPictureFactory() override = default;
MOCK_METHOD3(MockCreateVaapiPicture,
@@ -165,7 +176,12 @@ class VaapiVideoDecodeAcceleratorTest :
bool can_bind_to_sampler) { return true; })),
decoder_thread_("VaapiVideoDecodeAcceleratorTestThread"),
mock_decoder_(new ::testing::StrictMock<MockAcceleratedVideoDecoder>),
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+ mock_vaapi_picture_factory_(
+ new MockVaapiPictureFactory(kMayUseVaapiOverX11)),
+#else
mock_vaapi_picture_factory_(new MockVaapiPictureFactory()),
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
mock_vaapi_wrapper_(new MockVaapiWrapper(VaapiWrapper::kDecode)),
mock_vpp_vaapi_wrapper_(new MockVaapiWrapper(VaapiWrapper::kDecode)),
weak_ptr_factory_(this) {
@@ -421,14 +437,16 @@ TEST_P(VaapiVideoDecodeAcceleratorTest,
mock_vaapi_picture_factory_->GetVaapiImplementation(
gl::kGLImplementationEGLGLES2));
-#if BUILDFLAG(USE_VAAPI_X11)
- EXPECT_EQ(VaapiPictureFactory::kVaapiImplementationAngle,
- mock_vaapi_picture_factory_->GetVaapiImplementation(
- gl::kGLImplementationEGLANGLE));
- EXPECT_EQ(VaapiPictureFactory::kVaapiImplementationX11,
- mock_vaapi_picture_factory_->GetVaapiImplementation(
- gl::kGLImplementationDesktopGL));
-#elif BUILDFLAG(IS_OZONE)
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+ if (kMayUseVaapiOverX11) {
+ EXPECT_EQ(VaapiPictureFactory::kVaapiImplementationAngle,
+ mock_vaapi_picture_factory_->GetVaapiImplementation(
+ gl::kGLImplementationEGLANGLE));
+ EXPECT_EQ(VaapiPictureFactory::kVaapiImplementationX11,
+ mock_vaapi_picture_factory_->GetVaapiImplementation(
+ gl::kGLImplementationDesktopGL));
+ }
+#else
EXPECT_EQ(VaapiPictureFactory::kVaapiImplementationDrm,
mock_vaapi_picture_factory_->GetVaapiImplementation(
gl::kGLImplementationEGLANGLE));
diff -up chromium-109.0.5414.74/media/gpu/vaapi/vaapi_picture_factory.cc.orig chromium-109.0.5414.74/media/gpu/vaapi/vaapi_picture_factory.cc
--- chromium-109.0.5414.74/media/gpu/vaapi/vaapi_picture_factory.cc.orig 2023-01-04 20:20:18.000000000 +0100
+++ chromium-109.0.5414.74/media/gpu/vaapi/vaapi_picture_factory.cc 2023-01-11 14:45:36.405506479 +0100
@@ -13,10 +13,10 @@
#if BUILDFLAG(IS_OZONE)
#include "media/gpu/vaapi/vaapi_picture_native_pixmap_ozone.h"
#endif // BUILDFLAG(IS_OZONE)
-#if BUILDFLAG(USE_VAAPI_X11)
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
#include "media/gpu/vaapi/vaapi_picture_native_pixmap_angle.h"
#include "media/gpu/vaapi/vaapi_picture_tfp.h"
-#endif // BUILDFLAG(USE_VAAPI_X11)
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
#if defined(USE_EGL)
#include "media/gpu/vaapi/vaapi_picture_native_pixmap_egl.h"
#endif
@@ -42,22 +42,32 @@
} // namespace
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+VaapiPictureFactory::VaapiPictureFactory(
+ absl::optional<bool> may_use_vaapi_over_x11)
+ : may_use_vaapi_over_x11_(may_use_vaapi_over_x11) {
+#else
VaapiPictureFactory::VaapiPictureFactory() {
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
vaapi_impl_pairs_.insert(
std::make_pair(gl::kGLImplementationEGLGLES2,
VaapiPictureFactory::kVaapiImplementationDrm));
-#if BUILDFLAG(USE_VAAPI_X11)
- vaapi_impl_pairs_.insert(
- std::make_pair(gl::kGLImplementationEGLANGLE,
- VaapiPictureFactory::kVaapiImplementationAngle));
- vaapi_impl_pairs_.insert(
- std::make_pair(gl::kGLImplementationDesktopGL,
- VaapiPictureFactory::kVaapiImplementationX11));
-#elif BUILDFLAG(IS_OZONE)
+
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+ CHECK(may_use_vaapi_over_x11_.has_value());
+ if (may_use_vaapi_over_x11_.value()) {
+ vaapi_impl_pairs_.insert(
+ std::make_pair(gl::kGLImplementationEGLANGLE,
+ VaapiPictureFactory::kVaapiImplementationAngle));
+ vaapi_impl_pairs_.insert(
+ std::make_pair(gl::kGLImplementationDesktopGL,
+ VaapiPictureFactory::kVaapiImplementationX11));
+ }
+#else
vaapi_impl_pairs_.insert(
std::make_pair(gl::kGLImplementationEGLANGLE,
VaapiPictureFactory::kVaapiImplementationDrm));
-#endif
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
DeterminePictureCreationAndDownloadingMechanism();
}
@@ -98,19 +108,19 @@
}
uint32_t VaapiPictureFactory::GetGLTextureTarget() {
-#if BUILDFLAG(USE_VAAPI_X11)
- return GL_TEXTURE_2D;
-#else
+#if BUILDFLAG(IS_CHROMEOS)
return GL_TEXTURE_EXTERNAL_OES;
-#endif
+#else
+ return GL_TEXTURE_2D;
+#endif // BUILDFLAG(IS_CHROMEOS)
}
gfx::BufferFormat VaapiPictureFactory::GetBufferFormat() {
-#if BUILDFLAG(USE_VAAPI_X11)
- return gfx::BufferFormat::RGBX_8888;
-#else
+#if BUILDFLAG(IS_CHROMEOS)
return gfx::BufferFormat::YUV_420_BIPLANAR;
-#endif
+#else
+ return gfx::BufferFormat::RGBX_8888;
+#endif // BUILDFLAG(IS_CHROMEOS)
}
void VaapiPictureFactory::DeterminePictureCreationAndDownloadingMechanism() {
@@ -118,25 +128,30 @@
#if BUILDFLAG(IS_OZONE)
// We can be called without GL initialized, which is valid if we use Ozone.
case kVaapiImplementationNone:
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+ DCHECK(may_use_vaapi_over_x11_.value_or(false));
+#endif
create_picture_cb_ = base::BindRepeating(
&CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapOzone>);
needs_vpp_for_downloading_ = true;
break;
#endif // BUILDFLAG(IS_OZONE)
-#if BUILDFLAG(USE_VAAPI_X11)
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
case kVaapiImplementationX11:
+ DCHECK(may_use_vaapi_over_x11_.value_or(false));
create_picture_cb_ =
base::BindRepeating(&CreateVaapiPictureNativeImpl<VaapiTFPPicture>);
// Neither VaapiTFPPicture or VaapiPictureNativePixmapAngle needs the VPP.
needs_vpp_for_downloading_ = false;
break;
case kVaapiImplementationAngle:
+ DCHECK(may_use_vaapi_over_x11_.value_or(false));
create_picture_cb_ = base::BindRepeating(
&CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapAngle>);
// Neither VaapiTFPPicture or VaapiPictureNativePixmapAngle needs the VPP.
needs_vpp_for_downloading_ = false;
break;
-#endif // BUILDFLAG(USE_VAAPI_X11)
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
case kVaapiImplementationDrm:
#if BUILDFLAG(IS_OZONE)
create_picture_cb_ = base::BindRepeating(
diff -up chromium-109.0.5414.74/media/gpu/vaapi/vaapi_wrapper.cc.orig chromium-109.0.5414.74/media/gpu/vaapi/vaapi_wrapper.cc
--- chromium-109.0.5414.74/media/gpu/vaapi/vaapi_wrapper.cc.orig 2023-01-04 20:20:18.000000000 +0100
+++ chromium-109.0.5414.74/media/gpu/vaapi/vaapi_wrapper.cc 2023-01-11 15:08:02.721768243 +0100
@@ -62,7 +62,7 @@
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_implementation.h"
-#if BUILDFLAG(USE_VAAPI_X11)
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
typedef XID Drawable;
extern "C" {
@@ -70,7 +70,7 @@
}
#include "ui/gfx/x/connection.h" // nogncheck
-#endif // BUILDFLAG(USE_VAAPI_X11)
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
#if BUILDFLAG(IS_OZONE)
#include "ui/ozone/public/ozone_platform.h"
@@ -84,14 +84,14 @@
using media_gpu_vaapi::kModuleVa;
using media_gpu_vaapi::kModuleVa_drm;
-#if BUILDFLAG(USE_VAAPI_X11)
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
using media_gpu_vaapi::kModuleVa_x11;
-#endif // BUILDFLAG(USE_VAAPI_X11)
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
using media_gpu_vaapi::InitializeStubs;
using media_gpu_vaapi::IsVaInitialized;
-#if BUILDFLAG(USE_VAAPI_X11)
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
using media_gpu_vaapi::IsVa_x11Initialized;
-#endif // BUILDFLAG(USE_VAAPI_X11)
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
using media_gpu_vaapi::IsVa_drmInitialized;
using media_gpu_vaapi::StubPathMap;
@@ -668,6 +668,12 @@
void SetDrmFd(base::PlatformFile fd) { drm_fd_.reset(HANDLE_EINTR(dup(fd))); }
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+ absl::optional<bool> MayUseVaapiOverX11() const {
+ return may_use_vaapi_over_x11_;
+ }
+#endif
+
private:
friend class base::NoDestructor<VADisplayState>;
@@ -690,6 +696,13 @@
// Drm fd used to obtain access to the driver interface by VA.
base::ScopedFD drm_fd_;
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+ // Whether we'll be possibly using VA-API over Ozone/X11. This should only be
+ // set (if at all) during the pre-sandbox initialization. If absl::nullopt,
+ // all calls to Initialize() will return false immediately.
+ absl::optional<bool> may_use_vaapi_over_x11_;
+#endif
+
// The VADisplay handle. Valid between Initialize() and Deinitialize().
VADisplay va_display_;
@@ -708,6 +721,15 @@
// static
void VADisplayState::PreSandboxInitialization() {
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+ if (ui::OzonePlatform::IsInitialized()) {
+ VADisplayState::Get()->may_use_vaapi_over_x11_ =
+ ui::OzonePlatform::GetInstance()
+ ->GetPlatformProperties()
+ .supports_vaapi_x11;
+ }
+#endif
+
constexpr char kRenderNodeFilePattern[] = "/dev/dri/renderD%d";
// This loop ends on either the first card that does not exist or the first
// render node that is not vgem.
@@ -740,20 +762,18 @@
bool VADisplayState::Initialize() {
base::AutoLock auto_lock(va_lock_);
-#if BUILDFLAG(IS_OZONE) && BUILDFLAG(IS_LINUX)
- // 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
- // guarded by USE_VAAPI_X11. For example, if USE_VAAPI_X11 is true, but the
- // user chooses the Wayland backend for Ozone at runtime, then many things (if
- // not all) that we do for X11 won't apply.
- if (!ui::OzonePlatform::GetInstance()->GetPlatformProperties().supports_vaapi)
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+ if (!may_use_vaapi_over_x11_.has_value())
return false;
#endif
bool libraries_initialized = IsVaInitialized() && IsVa_drmInitialized();
-#if BUILDFLAG(USE_VAAPI_X11)
- libraries_initialized = libraries_initialized && IsVa_x11Initialized();
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+ // Initialize VA-API X11 display backend for Linux Ozone/X11.
+ // See comment in OzonePlatform::PlatformProperties::supports_vaapi_x11 for
+ // more details.
+ if (may_use_vaapi_over_x11_.value())
+ libraries_initialized = libraries_initialized && IsVa_x11Initialized();
#endif
if (!libraries_initialized)
return false;
@@ -768,7 +788,7 @@
return success;
}
-#if BUILDFLAG(USE_VAAPI_X11)
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
absl::optional<VADisplay> GetVADisplayStateX11(const base::ScopedFD& drm_fd) {
switch (gl::GetGLImplementation()) {
@@ -796,13 +816,19 @@
}
}
-#else
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
absl::optional<VADisplay> GetVADisplayState(const base::ScopedFD& drm_fd) {
switch (gl::GetGLImplementation()) {
case gl::kGLImplementationEGLGLES2:
+#if BUILDFLAG(IS_CHROMEOS)
+ // GetVADisplayState() should not get called on Linux with Ozone/X11
+ // (GetVADisplayStateX11() should get called instead), and we haven't tried
+ // VA-API decoding on Linux with Ozone/Wayland and anything other than
+ // native EGL/GLES2.
case gl::kGLImplementationEGLANGLE:
case gl::kGLImplementationNone:
+#endif
return vaGetDisplayDRM(drm_fd.get());
default:
LOG(WARNING) << "VAAPI video acceleration not available for "
@@ -812,18 +838,23 @@
}
}
-#endif // BUILDFLAG(USE_VAAPI_X11)
-
bool VADisplayState::InitializeVaDisplay_Locked() {
- absl::optional<VADisplay> display =
-#if BUILDFLAG(USE_VAAPI_X11)
- GetVADisplayStateX11(drm_fd_);
-#else
- GetVADisplayState(drm_fd_);
-#endif
+ absl::optional<VADisplay> display;
- if (!display)
- return false;
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+ DCHECK(may_use_vaapi_over_x11_.has_value());
+ if (may_use_vaapi_over_x11_.value()) {
+ display = GetVADisplayStateX11(drm_fd_);
+ if (!display)
+ return false;
+ }
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+
+ if (!display) {
+ display = GetVADisplayState(drm_fd_);
+ if (!display)
+ return false;
+ }
va_display_ = *display;
if (!vaDisplayIsValid(va_display_)) {
@@ -1656,6 +1687,13 @@
enforce_sequence_affinity);
}
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
+// static
+absl::optional<bool> VaapiWrapper::MayUseVaapiOverX11() {
+ return VADisplayState::Get()->MayUseVaapiOverX11();
+}
+#endif
+
// static
std::vector<SVCScalabilityMode> VaapiWrapper::GetSupportedScalabilityModes(
VideoCodecProfile media_profile,
@@ -2665,12 +2703,13 @@
return Execute_Locked(va_surface_id, va_buffer_ids);
}
-#if BUILDFLAG(USE_VAAPI_X11)
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
bool VaapiWrapper::PutSurfaceIntoPixmap(VASurfaceID va_surface_id,
x11::Pixmap x_pixmap,
gfx::Size dest_size) {
CHECK(!enforce_sequence_affinity_ ||
sequence_checker_.CalledOnValidSequence());
+ CHECK(MayUseVaapiOverX11().value_or(false));
base::AutoLockMaybe auto_lock(va_lock_.get());
VAStatus va_res = vaSyncSurface(va_display_, va_surface_id);
@@ -2684,7 +2723,7 @@
VA_SUCCESS_OR_RETURN(va_res, VaapiFunctions::kVAPutSurface, false);
return true;
}
-#endif // BUILDFLAG(USE_VAAPI_X11)
+#endif // BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
std::unique_ptr<ScopedVAImage> VaapiWrapper::CreateVaImage(
VASurfaceID va_surface_id,
@@ -3086,7 +3125,7 @@
paths[kModuleVa].push_back(std::string("libva.so.") + va_suffix);
paths[kModuleVa_drm].push_back(std::string("libva-drm.so.") + va_suffix);
-#if BUILDFLAG(USE_VAAPI_X11)
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
paths[kModuleVa_x11].push_back(std::string("libva-x11.so.") + va_suffix);
#endif
#if BUILDFLAG(IS_CHROMEOS_ASH)
diff -up chromium-109.0.5414.74/media/gpu/vaapi/vaapi_picture_native_pixmap_ozone.cc.orig chromium-109.0.5414.74/media/gpu/vaapi/vaapi_picture_native_pixmap_ozone.cc
--- chromium-109.0.5414.74/media/gpu/vaapi/vaapi_picture_native_pixmap_ozone.cc.orig 2023-01-11 20:45:17.347940426 +0100
+++ chromium-109.0.5414.74/media/gpu/vaapi/vaapi_picture_native_pixmap_ozone.cc 2023-01-11 20:45:58.314670752 +0100
@@ -109,7 +109,7 @@
ui::OzonePlatform* platform = ui::OzonePlatform::GetInstance();
ui::SurfaceFactoryOzone* factory = platform->GetSurfaceFactoryOzone();
gfx::BufferUsage buffer_usage = gfx::BufferUsage::SCANOUT_VDA_WRITE;
-#if BUILDFLAG(USE_VAAPI_X11)
+#if BUILDFLAG(SUPPORT_VAAPI_OVER_X11)
// The 'VaapiVideoDecodeAccelerator' requires the VPP to download the decoded
// frame from the internal surface to the allocated native pixmap.
// 'SCANOUT_VDA_WRITE' is used for 'YUV_420_BIPLANAR' on ChromeOS; For Linux,

View File

@ -0,0 +1,64 @@
diff -up chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_extractor.cc.system-minizip chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_extractor.cc
--- chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_extractor.cc.system-minizip 2023-01-04 20:20:37.000000000 +0100
+++ chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_extractor.cc 2023-01-08 15:48:08.654793086 +0100
@@ -27,8 +27,8 @@ limitations under the License.
#include "tensorflow_lite_support/cc/port/status_macros.h"
#include "tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.h"
#include "tensorflow_lite_support/metadata/metadata_schema_generated.h"
-#include "third_party/zlib/contrib/minizip/ioapi.h"
-#include "third_party/zlib/contrib/minizip/unzip.h"
+#include <minizip/ioapi.h>
+#include <minizip/unzip.h>
namespace tflite {
namespace metadata {
diff -up chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_populator.cc.system-minizip chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_populator.cc
--- chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_populator.cc.system-minizip 2023-01-04 20:20:37.000000000 +0100
+++ chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_populator.cc 2023-01-08 15:48:08.655793097 +0100
@@ -26,8 +26,8 @@ limitations under the License.
#include "tensorflow_lite_support/cc/port/statusor.h"
#include "tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h"
#include "tensorflow_lite_support/metadata/metadata_schema_generated.h"
-#include "third_party/zlib/contrib/minizip/ioapi.h"
-#include "third_party/zlib/contrib/minizip/unzip.h"
+#include <minizip/ioapi.h>
+#include <minizip/zip.h>
namespace tflite {
namespace metadata {
diff -up chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc.system-minizip chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc
--- chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc.system-minizip 2023-01-08 15:48:08.655793097 +0100
+++ chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc 2023-01-08 15:53:17.498329640 +0100
@@ -19,7 +19,7 @@ limitations under the License.
#include <cstdio>
#include "absl/strings/string_view.h" // from @com_google_absl
-#include "third_party/zlib/contrib/minizip/ioapi.h"
+#include <minizip/ioapi.h>
namespace tflite {
namespace metadata {
diff -up chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.cc.system-minizip chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.cc
--- chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.cc.system-minizip 2023-01-04 20:20:37.000000000 +0100
+++ chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.cc 2023-01-08 15:48:08.655793097 +0100
@@ -19,7 +19,7 @@ limitations under the License.
#include <cstdio>
#include "absl/strings/string_view.h" // from @com_google_absl
-#include "third_party/zlib/contrib/minizip/ioapi.h"
+#include <minizip/ioapi.h>
namespace tflite {
namespace metadata {
diff -up chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h.system-minizip chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h
--- chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h.system-minizip 2023-01-04 20:20:37.000000000 +0100
+++ chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h 2023-01-08 15:48:08.655793097 +0100
@@ -19,7 +19,7 @@ limitations under the License.
#include <cstdlib>
#include "absl/strings/string_view.h" // from @com_google_absl
-#include "third_party/zlib/contrib/minizip/ioapi.h"
+#include <minizip/ioapi.h>
namespace tflite {
namespace metadata {

View File

@ -1,12 +0,0 @@
diff -up chromium-84.0.4147.125/third_party/ffmpeg/BUILD.gn.i686-textrels chromium-84.0.4147.125/third_party/ffmpeg/BUILD.gn
--- chromium-84.0.4147.125/third_party/ffmpeg/BUILD.gn.i686-textrels 2020-08-17 09:33:53.153653741 -0400
+++ chromium-84.0.4147.125/third_party/ffmpeg/BUILD.gn 2020-08-17 09:34:25.099564669 -0400
@@ -68,7 +68,7 @@ if (has_nasm_deps) {
}
# See comments on fix_textrels config.
- if (use_lld && current_cpu == "x86" && !is_win) {
+ if (current_cpu == "x86" && !is_win) {
all_dependent_configs = [ ":fix_textrels" ]
}
}

View File

@ -1,56 +0,0 @@
diff -up chromium-98.0.4758.80/remoting/base/util.cc.remoting-cstring chromium-98.0.4758.80/remoting/base/util.cc
--- chromium-98.0.4758.80/remoting/base/util.cc.remoting-cstring 2022-02-01 00:41:54.000000000 +0000
+++ chromium-98.0.4758.80/remoting/base/util.cc 2022-02-02 15:55:01.352340901 +0000
@@ -4,6 +4,7 @@
#include "remoting/base/util.h"
+#include <cstring>
#include <math.h>
#include "base/logging.h"
diff -up chromium-98.0.4758.80/remoting/client/display/gl_helpers.cc.remoting-cstring chromium-98.0.4758.80/remoting/client/display/gl_helpers.cc
--- chromium-98.0.4758.80/remoting/client/display/gl_helpers.cc.remoting-cstring 2022-02-01 00:41:54.000000000 +0000
+++ chromium-98.0.4758.80/remoting/client/display/gl_helpers.cc 2022-02-02 15:55:01.353340854 +0000
@@ -5,6 +5,7 @@
#include "remoting/client/display/gl_helpers.h"
#include "base/logging.h"
+#include <cstring>
namespace remoting {
diff -up chromium-98.0.4758.80/remoting/host/fake_mouse_cursor_monitor.cc.remoting-cstring chromium-98.0.4758.80/remoting/host/fake_mouse_cursor_monitor.cc
--- chromium-98.0.4758.80/remoting/host/fake_mouse_cursor_monitor.cc.remoting-cstring 2022-02-01 00:41:54.000000000 +0000
+++ chromium-98.0.4758.80/remoting/host/fake_mouse_cursor_monitor.cc 2022-02-02 15:55:01.353340854 +0000
@@ -4,6 +4,7 @@
#include "remoting/host/fake_mouse_cursor_monitor.h"
+#include <cstring>
#include <memory>
#include "base/check.h"
diff -up chromium-98.0.4758.80/remoting/host/host_config_unittest.cc.remoting-cstring chromium-98.0.4758.80/remoting/host/host_config_unittest.cc
--- chromium-98.0.4758.80/remoting/host/host_config_unittest.cc.remoting-cstring 2022-02-02 15:55:01.353340854 +0000
+++ chromium-98.0.4758.80/remoting/host/host_config_unittest.cc 2022-02-02 15:57:20.295794172 +0000
@@ -10,6 +10,7 @@
#include "base/values.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
+#include <cstring>
namespace remoting {
diff -up chromium-98.0.4758.80/remoting/host/host_secret.cc.remoting-cstring chromium-98.0.4758.80/remoting/host/host_secret.cc
--- chromium-98.0.4758.80/remoting/host/host_secret.cc.remoting-cstring 2022-02-01 00:41:54.000000000 +0000
+++ chromium-98.0.4758.80/remoting/host/host_secret.cc 2022-02-02 15:55:01.353340854 +0000
@@ -6,7 +6,7 @@
#include <stdint.h>
-#include <string>
+#include <cstring>
#include "base/rand_util.h"
#include "base/strings/string_number_conversions.h"

View File

@ -7,13 +7,13 @@
%endif
%global numjobs 10
%ifarch aarch64 i686
%ifarch aarch64
%global numjobs 8
%endif
# This flag is so I can build things very fast on a giant system.
# Enabling this in koji causes aarch64 builds to timeout indefinitely.
%global use_all_cpus 0
%global use_all_cpus 1
%if %{use_all_cpus}
%global numjobs %{_smp_build_ncpus}
@ -30,7 +30,7 @@
ninja -j %{numjobs} -C '%1' '%2'
# enable|disable headless client build
%global build_headless 1
%global build_headless 0
# enable|disable chrome-remote-desktop build
%global build_remoting 0
@ -111,14 +111,9 @@
# enable system brotli
%global bundlebrotli 0
%if 0
# Chromium's fork of ICU is now something we can't unbundle.
# This is left here to ease the change if that ever switches.
BuildRequires: libicu-devel >= 5.4
%global bundleicu 0
%else
%global bundleicu 1
%endif
%global bundlere2 1
@ -215,8 +210,8 @@ BuildRequires: libicu-devel >= 5.4
%endif
Name: chromium%{chromium_channel}
Version: 108.0.5359.124
Release: 5%{?dist}
Version: 109.0.5414.74
Release: 1%{?dist}
Summary: A WebKit (Blink) powered web browser that Google doesn't want you to use
Url: http://www.chromium.org/Home
License: BSD and LGPLv2+ and ASL 2.0 and IJG and MIT and GPLv2+ and ISC and OpenSSL and (MPLv1.1 or GPLv2 or LGPLv2)
@ -256,38 +251,32 @@ Patch11: chromium-93.0.4577.63-py3-bootstrap.patch
Patch12: chromium-101.0.4951.41-fedora-user-agent.patch
# Needs to be submitted..
Patch51: chromium-96.0.4664.45-gcc-remoting-constexpr.patch
Patch51: chromium-96.0.4664.45-gcc-remoting-constexpr.patch
# https://gitweb.gentoo.org/repo/gentoo.git/tree/www-client/chromium/files/chromium-unbundle-zlib.patch
Patch52: chromium-81.0.4044.92-unbundle-zlib.patch
Patch52: chromium-81.0.4044.92-unbundle-zlib.patch
# ../../third_party/perfetto/include/perfetto/base/task_runner.h:48:55: error: 'uint32_t' has not been declared
Patch56: chromium-96.0.4664.45-missing-cstdint-header.patch
Patch56: chromium-96.0.4664.45-missing-cstdint-header.patch
# Missing <cstring> (thanks c++17)
Patch57: chromium-96.0.4664.45-missing-cstring.patch
Patch57: chromium-96.0.4664.45-missing-cstring.patch
# https://github.com/stha09/chromium-patches/blob/master/chromium-103-VirtualCursor-std-layout.patch
Patch59: chromium-103-VirtualCursor-std-layout.patch
Patch59: chromium-103-VirtualCursor-std-layout.patch
# Fix headers to look for system paths when we are using system minizip
Patch61: chromium-107.0.5304.101-system-minizip-header-fix.patch
Patch61: chromium-109-system-minizip-header-fix.patch
# Update bundled copy of wayland-client-core.h
Patch62: chromium-105.0.5195.52-update-wayland-client-core.patch
Patch62: chromium-105.0.5195.52-update-wayland-client-core.patch
# Fix issue where closure_compiler thinks java is only allowed in android builds
# https://bugs.chromium.org/p/chromium/issues/detail?id=1192875
Patch65: chromium-91.0.4472.77-java-only-allowed-in-android-builds.patch
# Fix missing cstring in remoting code
Patch67: chromium-98.0.4758.80-remoting-cstring.patch
# Apply fix_textrels hack for i686 (even without lld)
Patch68: chromium-84.0.4147.125-i686-fix_textrels.patch
Patch65: chromium-91.0.4472.77-java-only-allowed-in-android-builds.patch
# Update rjsmin to 1.2.0
Patch69: chromium-103.0.5060.53-update-rjsmin-to-1.2.0.patch
Patch69: chromium-103.0.5060.53-update-rjsmin-to-1.2.0.patch
# Update six to 1.16.0
Patch70: chromium-105.0.5195.52-python-six-1.16.0.patch
@ -318,7 +307,7 @@ Patch89: chromium-108-system-brotli.patch
# disable GlobalMediaControlsCastStartStop to avoid crash
# when using the address bar media player button
Patch90: chromium-108-disable-GlobalMediaControlsCastStartStop.patch
Patch90: chromium-109-disable-GlobalMediaControlsCastStartStop.patch
# patch for using system opus
Patch91: chromium-108-system-opus.patch
@ -361,9 +350,6 @@ Patch107: chromium-99.0.4844.51-el7-extra-operator==.patch
# AARCH64 neon symbols need to be prefixed too to prevent multiple definition issue at linktime
Patch110: chromium-90.0.4430.93-epel8-aarch64-libpng16-symbol-prefixes.patch
# memset was not declared in this scope
Patch113: chromium-107.0.5304.110-cstring-memset.patch
# system ffmpeg
Patch114: chromium-107-ffmpeg-duration.patch
Patch115: chromium-107-proprietary-codecs.patch
@ -374,7 +360,7 @@ Patch117: chromium-108-ffmpeg-revert-new-channel-layout-api.patch
# clang =< 14 and C++20, linker errors std::u16string
# build failure on rhel and fedora 36
Patch120: chromium-108-clang14-c++20-link-error.patch
Patch120: chromium-109-clang14-c++20-link-error.patch
# enable Qt
Patch121: chromium-108-enable-allowqt.patch
@ -383,8 +369,7 @@ Patch121: chromium-108-enable-allowqt.patch
# Upstream turned VAAPI on in Linux in 86
Patch202: chromium-104.0.5112.101-enable-hardware-accelerated-mjpeg.patch
Patch205: chromium-86.0.4240.75-fix-vaapi-on-intel.patch
Patch206: chromium-108-ozone-wayland-vaapi-support.patch
Patch207: chromium-108-vaapi-guard-vaapivideodecoder.patch
Patch206: chromium-109-ozone-wayland-vaapi-support.patch
# Apply these patches to work around EPEL8 issues
Patch300: chromium-99.0.4844.51-rhel8-force-disable-use_gnome_keyring.patch
@ -624,6 +609,10 @@ BuildRequires: python3-devel
BuildRequires: python3-zipp
BuildRequires: python3-simplejson
%if 0%{?rhel} <= 8
BuildRequires: python3-dataclasses
%endif
%if ! 0%{?bundlepylibs}
%if 0%{?fedora} || 0%{?rhel} >= 8
BuildRequires: python3-beautifulsoup4
@ -647,10 +636,6 @@ BuildRequires: re2-devel >= 20160401
BuildRequires: brotli-devel
%endif
%if ! %{bundleopus}
BuildRequires: opus-devel
%endif
BuildRequires: speech-dispatcher-devel
BuildRequires: yasm
BuildRequires: zlib-devel
@ -975,8 +960,6 @@ udev.
%endif
%patch65 -p1 -b .java-only-allowed
%patch67 -p1 -b .remoting-cstring
%patch68 -p1 -b .i686-textrels
%patch69 -p1 -b .update-rjsmin-to-1.2.0
%patch70 -p1 -b .update-six-to-1.16.0
%patch80 -p1 -b .EnumTable-crash
@ -1009,8 +992,6 @@ udev.
%patch12 -p1 -b .fedora-user-agent
%endif
%patch113 -p1 -b .memset
%if ! 0%{?bundleffmpegfree}
%patch114 -p1 -b .system-ffmppeg
%patch115 -p1 -b .prop-codecs
@ -1044,7 +1025,6 @@ udev.
%patch202 -p1 -b .accel-mjpeg
%patch205 -p1 -b .vaapi-intel-fix
%patch206 -p1 -b .wayland-vaapi
%patch207 -p1 -b .guard-vaapiVideoDecoder
%endif
%if 0%{?use_qt}
@ -1272,7 +1252,6 @@ CHROMIUM_CORE_GN_DEFINES+=' use_custom_libcxx=false'
CHROMIUM_CORE_GN_DEFINES+=' use_kerberos=true'
CHROMIUM_CORE_GN_DEFINES+=' target_os="linux"'
CHROMIUM_CORE_GN_DEFINES+=' current_os="linux"'
CHROMIUM_CORE_GN_DEFINES+=' use_allocator="none"'
CHROMIUM_CORE_GN_DEFINES+=' enable_vr=false'
CHROMIUM_CORE_GN_DEFINES+=' build_dawn_tests=false'
CHROMIUM_CORE_GN_DEFINES+=' enable_iterator_debugging=false'
@ -1776,6 +1755,9 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt
%{chromium_path}/chromedriver
%changelog
* Wed Jan 11 2023 Than Ngo <than@redhat.com> - 109.0.5414.74-1
- update to 109.0.5414.74
* Tue Jan 10 2023 Than Ngo <than@redhat.com> - 108.0.5359.124-5
- enable qt backend for el >= 9 and fedora >= 35
- drop i686

View File

@ -122,7 +122,6 @@ header_files=" libavcodec/x86/inline_asm.h \
libavcodec/mpegutils.h \
libavcodec/mpegvideo.h \
libavcodec/mpegvideodata.h \
libavcodec/mpegvideodsp.h \
libavcodec/mpegvideoencdsp.h \
libavcodec/options_table.h \
libavcodec/opusdsp.h \

View File

@ -19,4 +19,4 @@ SHA512 (NotoSansSymbols2-Regular.ttf) = 2644b42c3fdccfe12395f9b61553aced169a0f1d
SHA512 (NotoSansTibetan-Regular.ttf) = fb5a48fcaea80eebe7d692f6fcf00d59d47658a358d0ec8e046fc559873f88bd595b2da474d2826abd9e9305f3741c69058d867b1e6048f37fe7d71b5d3af36a
SHA512 (node-v16.17.0-linux-x64.tar.xz) = aedfeeb71420a7fbcb07fbc4c5d2ba74ffe4f88c15998809346a84148132ec866dbae4e848531a2a77ca41413f442e1046f981d4f188bdf667faf88069aa28cd
SHA512 (node-v16.17.0-linux-arm64.tar.xz) = ae4aabc2389779c9e1b4a15622cae3ba50e0c313ca3d7a1dc7b2344df06ade1f303d6a75b941d37e2a0ef368cf047c862a822a893684494f55446afd6ab0610e
SHA512 (chromium-108.0.5359.124-clean.tar.xz) = a47fb046b5be2f26f65f467a20fe300a86542bebf3d7e8d8a6064458bf4cfcc0243a1f5212755d1d4121b79f79bc2d3b61d7918431daef26538f0755608e444b
SHA512 (chromium-109.0.5414.74-clean.tar.xz) = 620836f27aeffa828f3ff434aa08025979bd98699288a14783a68e7f905d117ec7d2feec82c34c05dee1659c1e2a4c7bec1e279a34ff25b66246083364a5d12e