Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] chromium: update to 95.0.4638.54.
@ 2021-10-20 22:14 Duncaen
  2021-10-20 22:45 ` [PR PATCH] [Updated] " Duncaen
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Duncaen @ 2021-10-20 22:14 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 386 bytes --]

There is a new pull request by Duncaen against master on the void-packages repository

https://github.com/Duncaen/void-packages chromium-95
https://github.com/void-linux/void-packages/pull/33657

chromium: update to 95.0.4638.54.
[ci skip]

* [x] x86_64-glibc
* [ ] x86_64-musl
* [ ] i686


A patch file from https://github.com/void-linux/void-packages/pull/33657.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-chromium-95-33657.patch --]
[-- Type: text/x-diff, Size: 31846 bytes --]

From 0619fe885a87f65b12fa035ac6fc981cd0b8b03e Mon Sep 17 00:00:00 2001
From: Duncaen <duncaen@voidlinux.org>
Date: Thu, 21 Oct 2021 00:13:28 +0200
Subject: [PATCH] chromium: update to 95.0.4638.54.

---
 .../chromium-94-CustomSpaces-include.patch    |  24 -
 .../patches/chromium-95-harfbuzz-3.patch      |  31 +
 .../patches/chromium-95-quiche-include.patch  |  25 +
 .../patches/ozone-x11-fix-VA-API.patch        | 671 ++++++++++++++++++
 srcpkgs/chromium/template                     |   4 +-
 5 files changed, 729 insertions(+), 26 deletions(-)
 delete mode 100644 srcpkgs/chromium/patches/chromium-94-CustomSpaces-include.patch
 create mode 100644 srcpkgs/chromium/patches/chromium-95-harfbuzz-3.patch
 create mode 100644 srcpkgs/chromium/patches/chromium-95-quiche-include.patch
 create mode 100644 srcpkgs/chromium/patches/ozone-x11-fix-VA-API.patch

diff --git a/srcpkgs/chromium/patches/chromium-94-CustomSpaces-include.patch b/srcpkgs/chromium/patches/chromium-94-CustomSpaces-include.patch
deleted file mode 100644
index 01757758c1e2..000000000000
--- a/srcpkgs/chromium/patches/chromium-94-CustomSpaces-include.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From 4eeacdaa57b29a079fe09315eb22557c06aa522e Mon Sep 17 00:00:00 2001
-From: Stephan Hartmann <stha09@googlemail.com>
-Date: Fri, 13 Aug 2021 12:57:42 +0000
-Subject: [PATCH] IWYU: add memory for std::unique_ptr in blink::CustomSpaces
-
----
- .../blink/renderer/platform/heap/v8_wrapper/custom_spaces.h      | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/third_party/blink/renderer/platform/heap/v8_wrapper/custom_spaces.h b/third_party/blink/renderer/platform/heap/v8_wrapper/custom_spaces.h
-index df0465a..640cb33 100644
---- a/third_party/blink/renderer/platform/heap/v8_wrapper/custom_spaces.h
-+++ b/third_party/blink/renderer/platform/heap/v8_wrapper/custom_spaces.h
-@@ -5,6 +5,7 @@
- #ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_V8_WRAPPER_CUSTOM_SPACES_H_
- #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_V8_WRAPPER_CUSTOM_SPACES_H_
- 
-+#include <memory>
- #include <vector>
- 
- #include "third_party/blink/renderer/platform/platform_export.h"
--- 
-2.31.1
-
diff --git a/srcpkgs/chromium/patches/chromium-95-harfbuzz-3.patch b/srcpkgs/chromium/patches/chromium-95-harfbuzz-3.patch
new file mode 100644
index 000000000000..33fe9556aaf3
--- /dev/null
+++ b/srcpkgs/chromium/patches/chromium-95-harfbuzz-3.patch
@@ -0,0 +1,31 @@
+From 9e00e702633c47c590a869bc66b5c2ceec09da50 Mon Sep 17 00:00:00 2001
+From: Dominik Röttsches <drott@chromium.org>
+Date: Tue, 28 Sep 2021 15:31:50 +0000
+Subject: [PATCH] Roll src/third_party/harfbuzz-ng/src/ 6602cbb70..a52c6df38 (80 commits)
+
+Fixed: 1252284
+Change-Id: Ie2ff99da5e41ca97b8881e1bd3e158881f4d5a8e
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3190252
+Commit-Queue: Dominik Röttsches <drott@chromium.org>
+Commit-Queue: Calder Kitagawa <ckitagawa@chromium.org>
+Auto-Submit: Dominik Röttsches <drott@chromium.org>
+Reviewed-by: Calder Kitagawa <ckitagawa@chromium.org>
+Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org>
+Cr-Commit-Position: refs/heads/main@{#925776}
+
+(only components/paint_preview/common/subset_font.cc)
+---
+
+diff --git a/components/paint_preview/common/subset_font.cc b/components/paint_preview/common/subset_font.cc
+index 45daea7b1..43a448e 100644
+--- a/components/paint_preview/common/subset_font.cc
++++ b/components/paint_preview/common/subset_font.cc
+@@ -79,7 +79,7 @@
+   // Retain all variation information for OpenType variation fonts. See:
+   // https://docs.microsoft.com/en-us/typography/opentype/spec/otvaroverview
+   hb_set_t* skip_subset =
+-      hb_subset_input_no_subset_tables_set(input.get());  // Owned by |input|.
++      hb_subset_input_set(input.get(), HB_SUBSET_SETS_NO_SUBSET_TABLE_TAG);
+   hb_set_add(skip_subset, HB_TAG('a', 'v', 'a', 'r'));
+   hb_set_add(skip_subset, HB_TAG('c', 'v', 'a', 'r'));
+   hb_set_add(skip_subset, HB_TAG('f', 'v', 'a', 'r'));
diff --git a/srcpkgs/chromium/patches/chromium-95-quiche-include.patch b/srcpkgs/chromium/patches/chromium-95-quiche-include.patch
new file mode 100644
index 000000000000..4bbd45cfc094
--- /dev/null
+++ b/srcpkgs/chromium/patches/chromium-95-quiche-include.patch
@@ -0,0 +1,25 @@
+From a9d986203bcfbaab84f270c1dc6c3abb4c450ee1 Mon Sep 17 00:00:00 2001
+From: Stephan Hartmann <stha09@googlemail.com>
+Date: Fri, 17 Sep 2021 14:57:33 +0000
+Subject: [PATCH] IWYU: add stddef.h for size_t in WindowManager
+
+---
+ net/third_party/quiche/src/http2/adapter/window_manager.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/net/third_party/quiche/src/http2/adapter/window_manager.h b/net/third_party/quiche/src/http2/adapter/window_manager.h
+index f15982d..5a7701e 100644
+--- a/net/third_party/quiche/src/http2/adapter/window_manager.h
++++ b/net/third_party/quiche/src/http2/adapter/window_manager.h
+@@ -1,6 +1,8 @@
+ #ifndef QUICHE_HTTP2_ADAPTER_WINDOW_MANAGER_H_
+ #define QUICHE_HTTP2_ADAPTER_WINDOW_MANAGER_H_
+ 
++#include <stddef.h>
++
+ #include <functional>
+ 
+ #include "common/platform/api/quiche_export.h"
+-- 
+2.32.0
+
diff --git a/srcpkgs/chromium/patches/ozone-x11-fix-VA-API.patch b/srcpkgs/chromium/patches/ozone-x11-fix-VA-API.patch
new file mode 100644
index 000000000000..61d72bfb0137
--- /dev/null
+++ b/srcpkgs/chromium/patches/ozone-x11-fix-VA-API.patch
@@ -0,0 +1,671 @@
+From a4de986102a45e29c3ef596f22704bdca244c26c Mon Sep 17 00:00:00 2001
+From: Maksim Sisov <msisov@igalia.com>
+Date: Fri, 17 Sep 2021 08:45:55 +0000
+Subject: [PATCH] ozone/x11: fix VA-API.
+
+This patch fixes VA-API usage with Ozone/X11 backend (which
+is our default backend now as X11 has been deprecated -
+crrev.com/c/3114071)).
+
+non-Ozone X11 is disabled now and Ozone is always used
+on Linux. However, VA-API implementation is not Ozone friendly
+yet and requires major refactoring. But given that VA-API
+implementation on Linux worked only with X11, it's fine for
+now to change USE_X11 and !IsUsingOzonePlatform to
+BUILDFLAG(OZONE_PLATFORM_X11) and fail VA-API initialization
+in VADisplayState::Initialize for Ozone/Linux other than
+non-X11 backends.
+
+Bug: 1121948
+Change-Id: If85d289235e6d358103d9fa2bbe0f741fb599a26
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3141878
+Commit-Queue: Maksim Sisov <msisov@igalia.com>
+Reviewed-by: Andres Calderon Jaramillo <andrescj@chromium.org>
+Reviewed-by: Robert Kroeger <rjkroege@chromium.org>
+Reviewed-by: Xiaohan Wang <xhwang@chromium.org>
+Reviewed-by: Alexander Dunaev <adunaev@igalia.com>
+Cr-Commit-Position: refs/heads/main@{#922466}
+---
+ media/BUILD.gn                                |  3 -
+ media/gpu/BUILD.gn                            |  5 +-
+ media/gpu/args.gni                            | 13 +++-
+ media/gpu/vaapi/BUILD.gn                      |  8 +-
+ media/gpu/vaapi/va_stub_header.fragment       |  6 +-
+ media/gpu/vaapi/vaapi_picture_factory.cc      | 72 ++++++++----------
+ .../vaapi_picture_native_pixmap_angle.cc      |  2 -
+ media/gpu/vaapi/vaapi_picture_tfp.cc          |  2 -
+ .../vaapi/vaapi_video_decode_accelerator.cc   |  9 +--
+ ...vaapi_video_decode_accelerator_unittest.cc | 11 +--
+ media/gpu/vaapi/vaapi_wrapper.cc              | 76 +++++++++----------
+ media/gpu/vaapi/vaapi_wrapper.h               |  8 +-
+ ui/ozone/platform/x11/ozone_platform_x11.cc   |  3 +
+ ui/ozone/public/ozone_platform.h              | 10 +++
+ 14 files changed, 108 insertions(+), 120 deletions(-)
+
+diff --git a/media/BUILD.gn b/media/BUILD.gn
+index dbee1d4338..d5c158c08f 100644
+--- a/media/BUILD.gn
++++ b/media/BUILD.gn
+@@ -130,9 +130,6 @@ component("media") {
+     public_deps += [ "//media/base/mac" ]
+   }
+ 
+-  if (use_x11) {
+-    deps += [ "//ui/base/x" ]
+-  }
+   if (use_ozone) {
+     deps += [ "//ui/ozone" ]
+   }
+diff --git a/media/gpu/BUILD.gn b/media/gpu/BUILD.gn
+index c7499485ac..3fedc78948 100644
+--- a/media/gpu/BUILD.gn
++++ b/media/gpu/BUILD.gn
+@@ -20,6 +20,7 @@ buildflag_header("buildflags") {
+     "USE_VAAPI_IMAGE_CODECS=$use_vaapi_image_codecs",
+     "USE_V4L2_CODEC=$use_v4l2_codec",
+     "USE_LIBV4L2=$use_v4lplugin",
++    "USE_VAAPI_X11=$use_vaapi_x11",
+   ]
+ }
+ 
+@@ -215,9 +216,7 @@ component("gpu") {
+       "windows/supported_profile_helpers.cc",
+       "windows/supported_profile_helpers.h",
+     ]
+-    configs += [
+-      "//third_party/khronos:khronos_headers",
+-    ]
++    configs += [ "//third_party/khronos:khronos_headers" ]
+     public_deps += [ "//media/base/win:media_foundation_util" ]
+     deps += [
+       "//gpu/ipc/common:common",
+diff --git a/media/gpu/args.gni b/media/gpu/args.gni
+index 4004937949..2f53843918 100644
+--- a/media/gpu/args.gni
++++ b/media/gpu/args.gni
+@@ -3,7 +3,15 @@
+ # found in the LICENSE file.
+ 
+ import("//build/config/chromeos/ui_mode.gni")
+-import("//build/config/ui.gni")
++import("//build/config/ozone.gni")
++
++declare_args() {
++  # Indicates if X11 VA-API-based hardware acceleration is to be used.
++  # See also the comment near the |use_vaapi| arg.
++  use_vaapi_x11 =
++      is_linux && ozone_platform_x11 && !is_chromecast && !is_chromeos_lacros &&
++      (target_cpu == "x86" || target_cpu == "x64")
++}
+ 
+ declare_args() {
+   # Indicates if V4L plugin is used.
+@@ -21,8 +29,7 @@ declare_args() {
+   # is typically the case on x86-based ChromeOS devices.
+   # VA-API should also be compiled by default on x11-using linux devices
+   # using x86/x64.
+-  use_vaapi =
+-      is_linux && use_x11 && (target_cpu == "x86" || target_cpu == "x64")
++  use_vaapi = use_vaapi_x11
+ 
+   # Indicates if ChromeOS protected media support exists. This is used
+   # to enable the CDM daemon in Chrome OS as well as support for
+diff --git a/media/gpu/vaapi/BUILD.gn b/media/gpu/vaapi/BUILD.gn
+index b11d2c60fa..0c2520dd6b 100644
+--- a/media/gpu/vaapi/BUILD.gn
++++ b/media/gpu/vaapi/BUILD.gn
+@@ -17,7 +17,7 @@ assert(use_vaapi)
+ generate_stubs("libva_stubs") {
+   extra_header = "va_stub_header.fragment"
+   sigs = [ "va.sigs" ]
+-  if (use_x11) {
++  if (use_vaapi_x11) {
+     sigs += [ "va_x11.sigs" ]
+   }
+   if (is_chromeos_ash) {
+@@ -131,14 +131,14 @@ source_set("vaapi") {
+     ]
+   }
+ 
+-  if (use_x11 || use_ozone || use_egl) {
++  if (use_ozone || use_egl) {
+     sources += [
+       "vaapi_picture_native_pixmap.cc",
+       "vaapi_picture_native_pixmap.h",
+     ]
+   }
+ 
+-  if (use_x11) {
++  if (use_vaapi_x11) {
+     deps += [ "//ui/gfx/x" ]
+     sources += [
+       "vaapi_picture_native_pixmap_angle.cc",
+@@ -197,7 +197,7 @@ source_set("common") {
+     deps += [ "//ui/ozone" ]
+   }
+ 
+-  if (use_x11) {
++  if (use_vaapi_x11) {
+     deps += [ "//ui/gfx/x" ]
+   }
+ 
+diff --git a/media/gpu/vaapi/va_stub_header.fragment b/media/gpu/vaapi/va_stub_header.fragment
+index bed198484d..e8c46c5e81 100644
+--- a/media/gpu/vaapi/va_stub_header.fragment
++++ b/media/gpu/vaapi/va_stub_header.fragment
+@@ -1,12 +1,14 @@
+ // The extra include header needed in the generated stub file for defining
+ // various libva types.
+ 
++#include "media/gpu/buildflags.h"
++
+ extern "C" {
+ 
+ #include <va/va_drm.h>
+ #include <va/va.h>
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+ #include <va/va_x11.h>
+-#endif
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ 
+ }
+diff --git a/media/gpu/vaapi/vaapi_picture_factory.cc b/media/gpu/vaapi/vaapi_picture_factory.cc
+index 719035b87c..9c7d7387d2 100644
+--- a/media/gpu/vaapi/vaapi_picture_factory.cc
++++ b/media/gpu/vaapi/vaapi_picture_factory.cc
+@@ -10,13 +10,13 @@
+ #include "ui/base/ui_base_features.h"
+ #include "ui/gl/gl_bindings.h"
+ 
+-#if defined(USE_X11)
+-#include "media/gpu/vaapi/vaapi_picture_native_pixmap_angle.h"
+-#include "media/gpu/vaapi/vaapi_picture_tfp.h"
+-#endif
+ #if defined(USE_OZONE)
+ #include "media/gpu/vaapi/vaapi_picture_native_pixmap_ozone.h"
+-#endif
++#endif  // defined(USE_OZONE)
++#if BUILDFLAG(USE_VAAPI_X11)
++#include "media/gpu/vaapi/vaapi_picture_native_pixmap_angle.h"
++#include "media/gpu/vaapi/vaapi_picture_tfp.h"
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ #if defined(USE_EGL)
+ #include "media/gpu/vaapi/vaapi_picture_native_pixmap_egl.h"
+ #endif
+@@ -46,15 +46,13 @@ VaapiPictureFactory::VaapiPictureFactory() {
+   vaapi_impl_pairs_.insert(
+       std::make_pair(gl::kGLImplementationEGLGLES2,
+                      VaapiPictureFactory::kVaapiImplementationDrm));
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+   vaapi_impl_pairs_.insert(
+       std::make_pair(gl::kGLImplementationEGLANGLE,
+                      VaapiPictureFactory::kVaapiImplementationAngle));
+-  if (!features::IsUsingOzonePlatform()) {
+-    vaapi_impl_pairs_.insert(
+-        std::make_pair(gl::kGLImplementationDesktopGL,
+-                       VaapiPictureFactory::kVaapiImplementationX11));
+-  }
++  vaapi_impl_pairs_.insert(
++      std::make_pair(gl::kGLImplementationDesktopGL,
++                     VaapiPictureFactory::kVaapiImplementationX11));
+ #endif
+ 
+   DeterminePictureCreationAndDownloadingMechanism();
+@@ -96,19 +94,19 @@ VaapiPictureFactory::GetVaapiImplementation(gl::GLImplementation gl_impl) {
+ }
+ 
+ uint32_t VaapiPictureFactory::GetGLTextureTarget() {
+-#if defined(USE_OZONE)
+-  if (features::IsUsingOzonePlatform())
+-    return GL_TEXTURE_EXTERNAL_OES;
+-#endif
++#if BUILDFLAG(USE_VAAPI_X11)
+   return GL_TEXTURE_2D;
++#else
++  return GL_TEXTURE_EXTERNAL_OES;
++#endif
+ }
+ 
+ gfx::BufferFormat VaapiPictureFactory::GetBufferFormat() {
+-#if defined(USE_OZONE)
+-  if (features::IsUsingOzonePlatform())
+-    return gfx::BufferFormat::YUV_420_BIPLANAR;
+-#endif
++#if BUILDFLAG(USE_VAAPI_X11)
+   return gfx::BufferFormat::RGBX_8888;
++#else
++  return gfx::BufferFormat::YUV_420_BIPLANAR;
++#endif
+ }
+ 
+ void VaapiPictureFactory::DeterminePictureCreationAndDownloadingMechanism() {
+@@ -116,51 +114,43 @@ void VaapiPictureFactory::DeterminePictureCreationAndDownloadingMechanism() {
+ #if defined(USE_OZONE)
+     // We can be called without GL initialized, which is valid if we use Ozone.
+     case kVaapiImplementationNone:
+-      if (features::IsUsingOzonePlatform()) {
+-        create_picture_cb_ = base::BindRepeating(
+-            &CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapOzone>);
+-        needs_vpp_for_downloading_ = true;
+-      }
+-
+-      // This is reached by unit tests which don't require create_picture_cb_
+-      // to be initialized or called.
++      create_picture_cb_ = base::BindRepeating(
++          &CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapOzone>);
++      needs_vpp_for_downloading_ = true;
+       break;
+ #endif  // defined(USE_OZONE)
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+     case kVaapiImplementationX11:
+-      DCHECK(!features::IsUsingOzonePlatform());
+       create_picture_cb_ =
+           base::BindRepeating(&CreateVaapiPictureNativeImpl<VaapiTFPPicture>);
+       // Neither VaapiTFPPicture or VaapiPictureNativePixmapAngle needs the VPP.
+       needs_vpp_for_downloading_ = false;
+       break;
+     case kVaapiImplementationAngle:
+-      DCHECK(!features::IsUsingOzonePlatform());
+       create_picture_cb_ = base::BindRepeating(
+           &CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapAngle>);
+       // Neither VaapiTFPPicture or VaapiPictureNativePixmapAngle needs the VPP.
+       needs_vpp_for_downloading_ = false;
+       break;
+-#endif  // defined(USE_X11)
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+     case kVaapiImplementationDrm:
+ #if defined(USE_OZONE)
+-      if (features::IsUsingOzonePlatform()) {
+-        create_picture_cb_ = base::BindRepeating(
+-            &CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapOzone>);
+-        needs_vpp_for_downloading_ = true;
+-        break;
+-      }
+-#endif  // defined(USE_OZONE)
+-#if defined(USE_EGL)
++      create_picture_cb_ = base::BindRepeating(
++          &CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapOzone>);
++      needs_vpp_for_downloading_ = true;
++      break;
++#elif defined(USE_EGL)
+       create_picture_cb_ = base::BindRepeating(
+           &CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapEgl>);
+       needs_vpp_for_downloading_ = true;
+       break;
+-#endif  // defined(USE_EGL)
++#else
+       // ozone or egl must be used to use the DRM implementation.
+-      NOTREACHED();
++      FALLTHROUGH;
++#endif
+     default:
+       NOTREACHED();
++      break;
+   }
+ }
+ 
+diff --git a/media/gpu/vaapi/vaapi_picture_native_pixmap_angle.cc b/media/gpu/vaapi/vaapi_picture_native_pixmap_angle.cc
+index 9de0c93b44..e5b9908490 100644
+--- a/media/gpu/vaapi/vaapi_picture_native_pixmap_angle.cc
++++ b/media/gpu/vaapi/vaapi_picture_native_pixmap_angle.cc
+@@ -6,7 +6,6 @@
+ 
+ #include "media/gpu/vaapi/va_surface.h"
+ #include "media/gpu/vaapi/vaapi_wrapper.h"
+-#include "ui/base/ui_base_features.h"
+ #include "ui/gfx/x/connection.h"
+ #include "ui/gfx/x/future.h"
+ #include "ui/gfx/x/xproto.h"
+@@ -92,7 +91,6 @@ Status VaapiPictureNativePixmapAngle::Allocate(gfx::BufferFormat format) {
+   if (!make_context_current_cb_ || !make_context_current_cb_.Run())
+     return StatusCode::kVaapiBadContext;
+ 
+-  DCHECK(!features::IsUsingOzonePlatform());
+   auto image =
+       base::MakeRefCounted<gl::GLImageEGLPixmap>(visible_size_, format);
+   if (!image)
+diff --git a/media/gpu/vaapi/vaapi_picture_tfp.cc b/media/gpu/vaapi/vaapi_picture_tfp.cc
+index 3f7e221d8a..11914e3640 100644
+--- a/media/gpu/vaapi/vaapi_picture_tfp.cc
++++ b/media/gpu/vaapi/vaapi_picture_tfp.cc
+@@ -6,7 +6,6 @@
+ 
+ #include "media/gpu/vaapi/va_surface.h"
+ #include "media/gpu/vaapi/vaapi_wrapper.h"
+-#include "ui/base/ui_base_features.h"
+ #include "ui/gfx/x/connection.h"
+ #include "ui/gfx/x/future.h"
+ #include "ui/gl/gl_bindings.h"
+@@ -37,7 +36,6 @@ VaapiTFPPicture::VaapiTFPPicture(
+       connection_(x11::Connection::Get()),
+       x_pixmap_(x11::Pixmap::None) {
+   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+-  DCHECK(!features::IsUsingOzonePlatform());
+   DCHECK(texture_id);
+   DCHECK(client_texture_id);
+ }
+diff --git a/media/gpu/vaapi/vaapi_video_decode_accelerator.cc b/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
+index 7514fe4fdd..e4cd7c8d89 100644
+--- a/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
++++ b/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
+@@ -184,12 +184,6 @@ bool VaapiVideoDecodeAccelerator::Initialize(const Config& config,
+                                              Client* client) {
+   DCHECK(task_runner_->BelongsToCurrentThread());
+ 
+-#if defined(USE_X11)
+-  // TODO(crbug/1116701): implement decode acceleration when running with Ozone.
+-  if (features::IsUsingOzonePlatform())
+-    return false;
+-#endif
+-
+   vaapi_picture_factory_ = std::make_unique<VaapiPictureFactory>();
+ 
+   if (config.is_encrypted()) {
+@@ -1213,12 +1207,11 @@ VaapiVideoDecodeAccelerator::GetSupportedProfiles() {
+ 
+ VaapiVideoDecodeAccelerator::BufferAllocationMode
+ VaapiVideoDecodeAccelerator::DecideBufferAllocationMode() {
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+   // The IMPORT mode is used for Android on Chrome OS, so this doesn't apply
+   // here.
+   DCHECK_NE(output_mode_, VideoDecodeAccelerator::Config::OutputMode::IMPORT);
+   // TODO(crbug/1116701): get video decode acceleration working with ozone.
+-  DCHECK(!features::IsUsingOzonePlatform());
+   // For H.264 on older devices, another +1 is experimentally needed for
+   // high-to-high resolution changes.
+   // TODO(mcasas): Figure out why and why only H264, see crbug.com/912295 and
+diff --git a/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc b/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc
+index 5b9a543386..826bb103b1 100644
+--- a/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc
++++ b/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc
+@@ -17,7 +17,6 @@
+ #include "media/gpu/vaapi/vaapi_wrapper.h"
+ #include "testing/gmock/include/gmock/gmock.h"
+ #include "testing/gtest/include/gtest/gtest.h"
+-#include "ui/base/ui_base_features.h"
+ 
+ using base::test::RunClosure;
+ using ::testing::_;
+@@ -416,12 +415,10 @@ TEST_P(VaapiVideoDecodeAcceleratorTest, SupportedPlatforms) {
+             mock_vaapi_picture_factory_->GetVaapiImplementation(
+                 gl::kGLImplementationEGLGLES2));
+ 
+-#if defined(USE_X11)
+-  if (!features::IsUsingOzonePlatform()) {
+-    EXPECT_EQ(VaapiPictureFactory::kVaapiImplementationX11,
+-              mock_vaapi_picture_factory_->GetVaapiImplementation(
+-                  gl::kGLImplementationDesktopGL));
+-  }
++#if BUILDFLAG(USE_VAAPI_X11)
++  EXPECT_EQ(VaapiPictureFactory::kVaapiImplementationX11,
++            mock_vaapi_picture_factory_->GetVaapiImplementation(
++                gl::kGLImplementationDesktopGL));
+ #endif
+ }
+ 
+diff --git a/media/gpu/vaapi/vaapi_wrapper.cc b/media/gpu/vaapi/vaapi_wrapper.cc
+index 754d258848..e528b0f84d 100644
+--- a/media/gpu/vaapi/vaapi_wrapper.cc
++++ b/media/gpu/vaapi/vaapi_wrapper.cc
+@@ -65,7 +65,7 @@
+ #include "ui/gl/gl_bindings.h"
+ #include "ui/gl/gl_implementation.h"
+ 
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+ typedef XID Drawable;
+ 
+ extern "C" {
+@@ -73,7 +73,7 @@ extern "C" {
+ }
+ 
+ #include "ui/gfx/x/connection.h"  // nogncheck
+-#endif
++#endif                            // BUILDFLAG(USE_VAAPI_X11)
+ 
+ #if defined(USE_OZONE)
+ #include "ui/ozone/public/ozone_platform.h"
+@@ -87,14 +87,14 @@ using media_gpu_vaapi::kModuleVa_prot;
+ 
+ using media_gpu_vaapi::kModuleVa;
+ using media_gpu_vaapi::kModuleVa_drm;
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+ using media_gpu_vaapi::kModuleVa_x11;
+-#endif
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ using media_gpu_vaapi::InitializeStubs;
+ using media_gpu_vaapi::IsVaInitialized;
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+ using media_gpu_vaapi::IsVa_x11Initialized;
+-#endif
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ using media_gpu_vaapi::IsVa_drmInitialized;
+ using media_gpu_vaapi::StubPathMap;
+ 
+@@ -559,10 +559,20 @@ VADisplayState::VADisplayState()
+ bool VADisplayState::Initialize() {
+   base::AutoLock auto_lock(va_lock_);
+ 
++#if defined(USE_OZONE) && defined(OS_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)
++    return false;
++#endif
++
+   bool libraries_initialized = IsVaInitialized() && IsVa_drmInitialized();
+-#if defined(USE_X11)
+-  if (!features::IsUsingOzonePlatform())
+-    libraries_initialized = libraries_initialized && IsVa_x11Initialized();
++#if BUILDFLAG(USE_VAAPI_X11)
++  libraries_initialized = libraries_initialized && IsVa_x11Initialized();
+ #endif
+   if (!libraries_initialized)
+     return false;
+@@ -577,34 +587,25 @@ bool VADisplayState::Initialize() {
+   return success;
+ }
+ 
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+ 
+ absl::optional<VADisplay> GetVADisplayStateX11(const base::ScopedFD& drm_fd) {
+-  bool use_drm_as_fallback = false;
+   switch (gl::GetGLImplementation()) {
+     case gl::kGLImplementationEGLGLES2:
+       return vaGetDisplayDRM(drm_fd.get());
+ 
+     case gl::kGLImplementationNone:
+-      use_drm_as_fallback = true;
+-      FALLTHROUGH;
+ 
+     case gl::kGLImplementationDesktopGL: {
+-      if (!features::IsUsingOzonePlatform()) {
+-        VADisplay display =
+-            vaGetDisplay(x11::Connection::Get()->GetXlibDisplay());
+-        if (vaDisplayIsValid(display))
+-          return display;
+-        return vaGetDisplayDRM(drm_fd.get());
+-      }
+-      break;
++      VADisplay display =
++          vaGetDisplay(x11::Connection::Get()->GetXlibDisplay());
++      if (vaDisplayIsValid(display))
++        return display;
++      return vaGetDisplayDRM(drm_fd.get());
+     }
+ 
+-    case gl::kGLImplementationEGLANGLE: {
+-      if (!features::IsUsingOzonePlatform())
+-        return vaGetDisplay(x11::Connection::Get()->GetXlibDisplay());
+-      break;
+-    }
++    case gl::kGLImplementationEGLANGLE:
++      return vaGetDisplay(x11::Connection::Get()->GetXlibDisplay());
+ 
+     default:
+       LOG(WARNING) << "VAAPI video acceleration not available for "
+@@ -612,10 +613,6 @@ absl::optional<VADisplay> GetVADisplayStateX11(const base::ScopedFD& drm_fd) {
+                           gl::GetGLImplementationParts());
+       return absl::nullopt;
+   }
+-
+-  if (use_drm_as_fallback)
+-    return vaGetDisplayDRM(drm_fd.get());
+-  return absl::nullopt;
+ }
+ 
+ #else
+@@ -633,11 +630,11 @@ absl::optional<VADisplay> GetVADisplayState(const base::ScopedFD& drm_fd) {
+   }
+ }
+ 
+-#endif  // defined(USE_X11)
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ 
+ bool VADisplayState::InitializeVaDisplay_Locked() {
+   absl::optional<VADisplay> display =
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+       GetVADisplayStateX11(drm_fd_);
+ #else
+       GetVADisplayState(drm_fd_);
+@@ -702,10 +699,9 @@ bool VADisplayState::InitializeOnce() {
+   if (!InitializeVaDisplay_Locked() || !InitializeVaDriver_Locked())
+     return false;
+ 
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+   if (gl::GetGLImplementation() == gl::kGLImplementationEGLANGLE &&
+       implementation_type_ == VAImplementation::kIntelIHD) {
+-    DCHECK(!features::IsUsingOzonePlatform());
+     constexpr char libva_driver_impl_env[] = "LIBVA_DRIVER_NAME";
+     // TODO(crbug/1116703) The libva intel-media driver has a known segfault in
+     // vaPutSurface, so until this is fixed, fall back to the i965 driver. There
+@@ -722,7 +718,7 @@ bool VADisplayState::InitializeOnce() {
+     if (!InitializeVaDisplay_Locked() || !InitializeVaDriver_Locked())
+       return false;
+   }
+-#endif  // USE_X11
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ 
+   return true;
+ }
+@@ -2452,11 +2448,10 @@ bool VaapiWrapper::MapAndCopyAndExecute(
+   return Execute_Locked(va_surface_id, va_buffer_ids);
+ }
+ 
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+ bool VaapiWrapper::PutSurfaceIntoPixmap(VASurfaceID va_surface_id,
+                                         x11::Pixmap x_pixmap,
+                                         gfx::Size dest_size) {
+-  DCHECK(!features::IsUsingOzonePlatform());
+   base::AutoLock auto_lock(*va_lock_);
+ 
+   VAStatus va_res = vaSyncSurface(va_display_, va_surface_id);
+@@ -2470,7 +2465,7 @@ bool VaapiWrapper::PutSurfaceIntoPixmap(VASurfaceID va_surface_id,
+   VA_SUCCESS_OR_RETURN(va_res, VaapiFunctions::kVAPutSurface, false);
+   return true;
+ }
+-#endif  // USE_X11
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ 
+ std::unique_ptr<ScopedVAImage> VaapiWrapper::CreateVaImage(
+     VASurfaceID va_surface_id,
+@@ -2844,9 +2839,8 @@ void VaapiWrapper::PreSandboxInitialization() {
+ 
+   paths[kModuleVa].push_back(std::string("libva.so.") + va_suffix);
+   paths[kModuleVa_drm].push_back(std::string("libva-drm.so.") + va_suffix);
+-#if defined(USE_X11)
+-  if (!features::IsUsingOzonePlatform())
+-    paths[kModuleVa_x11].push_back(std::string("libva-x11.so.") + va_suffix);
++#if BUILDFLAG(USE_VAAPI_X11)
++  paths[kModuleVa_x11].push_back(std::string("libva-x11.so.") + va_suffix);
+ #endif
+ #if BUILDFLAG(IS_CHROMEOS_ASH)
+   paths[kModuleVa_prot].push_back(std::string("libva.so.") + va_suffix);
+diff --git a/media/gpu/vaapi/vaapi_wrapper.h b/media/gpu/vaapi/vaapi_wrapper.h
+index 0e3da53624..88ffcd0799 100644
+--- a/media/gpu/vaapi/vaapi_wrapper.h
++++ b/media/gpu/vaapi/vaapi_wrapper.h
+@@ -36,9 +36,9 @@
+ #include "third_party/abseil-cpp/absl/types/optional.h"
+ #include "ui/gfx/geometry/size.h"
+ 
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+ #include "ui/gfx/x/xproto.h"  // nogncheck
+-#endif  // USE_X11
++#endif                        // BUILDFLAG(USE_VAAPI_X11)
+ 
+ namespace gfx {
+ enum class BufferFormat;
+@@ -426,13 +426,13 @@ class MEDIA_GPU_EXPORT VaapiWrapper
+       const std::vector<std::pair<VABufferID, VABufferDescriptor>>& va_buffers)
+       WARN_UNUSED_RESULT;
+ 
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+   // Put data from |va_surface_id| into |x_pixmap| of size
+   // |dest_size|, converting/scaling to it.
+   bool PutSurfaceIntoPixmap(VASurfaceID va_surface_id,
+                             x11::Pixmap x_pixmap,
+                             gfx::Size dest_size) WARN_UNUSED_RESULT;
+-#endif  // USE_X11
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ 
+   // 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 --git a/ui/ozone/platform/x11/ozone_platform_x11.cc b/ui/ozone/platform/x11/ozone_platform_x11.cc
+index 8889828e0f..963dc7a0cd 100644
+--- a/ui/ozone/platform/x11/ozone_platform_x11.cc
++++ b/ui/ozone/platform/x11/ozone_platform_x11.cc
+@@ -208,6 +208,9 @@ class OzonePlatformX11 : public OzonePlatform,
+       properties->supports_global_application_menus = true;
+       properties->app_modal_dialogs_use_event_blocker = true;
+       properties->fetch_buffer_formats_for_gmb_on_gpu = true;
++#if defined(OS_LINUX)
++      properties->supports_vaapi = true;
++#endif
+ 
+       initialised = true;
+     }
+diff --git a/ui/ozone/public/ozone_platform.h b/ui/ozone/public/ozone_platform.h
+index df95f07486..2d7f44bbfa 100644
+--- a/ui/ozone/public/ozone_platform.h
++++ b/ui/ozone/public/ozone_platform.h
+@@ -15,6 +15,7 @@
+ #include "base/macros.h"
+ #include "base/message_loop/message_pump_type.h"
+ #include "base/single_thread_task_runner.h"
++#include "build/build_config.h"
+ #include "mojo/public/cpp/bindings/binder_map.h"
+ #include "ui/gfx/buffer_types.h"
+ #include "ui/gfx/native_widget_types.h"
+@@ -154,6 +155,15 @@ class COMPONENT_EXPORT(OZONE) OzonePlatform {
+     // Determines whether buffer formats should be fetched on GPU and passed
+     // back via gpu extra info.
+     bool fetch_buffer_formats_for_gmb_on_gpu = false;
++
++#if defined(OS_LINUX)
++    // TODO(crbug.com/1116701): add vaapi support for other Ozone platforms on
++    // Linux. At the moment, VA-API Linux implementation supports only X11
++    // backend. This implementation must be refactored to support Ozone
++    // properly. As a temporary solution, VA-API on Linux checks if vaapi is
++    // supported (which implicitly means that it is Ozone/X11).
++    bool supports_vaapi = false;
++#endif
+   };
+ 
+   // Groups platform properties that can only be known at run time.
diff --git a/srcpkgs/chromium/template b/srcpkgs/chromium/template
index c57c29508dfc..eb588385f128 100644
--- a/srcpkgs/chromium/template
+++ b/srcpkgs/chromium/template
@@ -1,7 +1,7 @@
 # Template file for 'chromium'
 pkgname=chromium
 # See https://chromiumdash.appspot.com/releases?platform=Linux for the latest version
-version=94.0.4606.81
+version=95.0.4638.54
 revision=1
 archs="i686* x86_64* aarch64* armv7l* ppc64le*"
 short_desc="Google's attempt at creating a safer, faster, and more stable browser"
@@ -9,7 +9,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://www.chromium.org/"
 distfiles="https://commondatastorage.googleapis.com/chromium-browser-official/${pkgname}-${version}.tar.xz"
-checksum=7071aa2b2caf48094c2ae816395948b4daec940606f4982ad5bbf68e5d2de598
+checksum=3eef88d745e6ddaeaf507358f1510482d6f399cf335061bb1226a5f7120061fd
 nocross=yes
 
 lib32disabled=yes

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PR PATCH] [Updated] chromium: update to 95.0.4638.54.
  2021-10-20 22:14 [PR PATCH] chromium: update to 95.0.4638.54 Duncaen
@ 2021-10-20 22:45 ` Duncaen
  2021-10-21  0:06 ` Duncaen
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Duncaen @ 2021-10-20 22:45 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 391 bytes --]

There is an updated pull request by Duncaen against master on the void-packages repository

https://github.com/Duncaen/void-packages chromium-95
https://github.com/void-linux/void-packages/pull/33657

chromium: update to 95.0.4638.54.
[ci skip]

* [x] x86_64-glibc
* [ ] x86_64-musl
* [ ] i686


A patch file from https://github.com/void-linux/void-packages/pull/33657.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-chromium-95-33657.patch --]
[-- Type: text/x-diff, Size: 34436 bytes --]

From 586474ada6a392d9903ad86cd215012fab10f620 Mon Sep 17 00:00:00 2001
From: Duncaen <duncaen@voidlinux.org>
Date: Thu, 21 Oct 2021 00:13:28 +0200
Subject: [PATCH] chromium: update to 95.0.4638.54.

---
 .../files/musl-patches/resolver.patch         |  13 +-
 .../musl-patches/xxx-ppc64le-support.patch    |  16 +-
 .../chromium-94-CustomSpaces-include.patch    |  24 -
 .../patches/chromium-95-harfbuzz-3.patch      |  31 +
 .../patches/chromium-95-quiche-include.patch  |  25 +
 .../patches/ozone-x11-fix-VA-API.patch        | 671 ++++++++++++++++++
 srcpkgs/chromium/template                     |   4 +-
 7 files changed, 744 insertions(+), 40 deletions(-)
 delete mode 100644 srcpkgs/chromium/patches/chromium-94-CustomSpaces-include.patch
 create mode 100644 srcpkgs/chromium/patches/chromium-95-harfbuzz-3.patch
 create mode 100644 srcpkgs/chromium/patches/chromium-95-quiche-include.patch
 create mode 100644 srcpkgs/chromium/patches/ozone-x11-fix-VA-API.patch

diff --git a/srcpkgs/chromium/files/musl-patches/resolver.patch b/srcpkgs/chromium/files/musl-patches/resolver.patch
index fb8b0ddccda6..091d3f3e88ef 100644
--- a/srcpkgs/chromium/files/musl-patches/resolver.patch
+++ b/srcpkgs/chromium/files/musl-patches/resolver.patch
@@ -51,10 +51,12 @@
      UMA_HISTOGRAM_BOOLEAN("Net.DNS.DnsConfig.Resolv.Read",
                            dns_config_.has_value());
      if (!dns_config_.has_value())
-@@ -486,20 +480,11 @@
+--- net/dns/public/resolv_reader.cc.orig
++++ net/dns/public/resolv_reader.cc
+@@ -20,19 +20,10 @@
+ namespace net {
  
- std::unique_ptr<struct __res_state>
- DnsConfigServiceLinux::ResolvReader::GetResState() {
+ std::unique_ptr<struct __res_state> ResolvReader::GetResState() {
 -  auto res = std::make_unique<struct __res_state>();
 -  memset(res.get(), 0, sizeof(struct __res_state));
 -
@@ -67,9 +69,8 @@
 +  return nullptr;
  }
  
- void DnsConfigServiceLinux::ResolvReader::CloseResState(
-     struct __res_state* res) {
+ void ResolvReader::CloseResState(struct __res_state* res) {
 -  res_nclose(res);
  }
  
- DnsConfigServiceLinux::DnsConfigServiceLinux()
+ absl::optional<std::vector<IPEndPoint>> GetNameservers(
diff --git a/srcpkgs/chromium/files/musl-patches/xxx-ppc64le-support.patch b/srcpkgs/chromium/files/musl-patches/xxx-ppc64le-support.patch
index 9ea233ba6256..681b1f011c31 100644
--- a/srcpkgs/chromium/files/musl-patches/xxx-ppc64le-support.patch
+++ b/srcpkgs/chromium/files/musl-patches/xxx-ppc64le-support.patch
@@ -1,11 +1,11 @@
---- base/allocator/partition_allocator/partition_alloc_config.h	2021-05-25 00:05:31.000000000 +0200
-+++ -	2021-05-26 22:23:47.172940826 +0200
-@@ -88,7 +88,8 @@
- // PUT_REF_COUNT_IN_PREVIOUS_SLOT does. In this case the refcount overlaps with
- // the next pointer shadow for the smallest bucket.
- #if !(defined(OS_MAC) && defined(ARCH_CPU_ARM64)) && \
--    !BUILDFLAG(PUT_REF_COUNT_IN_PREVIOUS_SLOT)
-+    !BUILDFLAG(PUT_REF_COUNT_IN_PREVIOUS_SLOT) && \
+--- base/allocator/partition_allocator/partition_alloc_config.h.orig
++++ base/allocator/partition_allocator/partition_alloc_config.h
+@@ -114,7 +114,8 @@
+ // platforms complicates things. Note that Chromium is not officially supported
+ // on any big endian architecture as well.
+ #if !BUILDFLAG(PUT_REF_COUNT_IN_PREVIOUS_SLOT) && \
+-    defined(ARCH_CPU_LITTLE_ENDIAN)
++    defined(ARCH_CPU_LITTLE_ENDIAN) && \
 +    !defined(__powerpc64__)
  #define PA_HAS_FREELIST_HARDENING
  #endif
diff --git a/srcpkgs/chromium/patches/chromium-94-CustomSpaces-include.patch b/srcpkgs/chromium/patches/chromium-94-CustomSpaces-include.patch
deleted file mode 100644
index 01757758c1e2..000000000000
--- a/srcpkgs/chromium/patches/chromium-94-CustomSpaces-include.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From 4eeacdaa57b29a079fe09315eb22557c06aa522e Mon Sep 17 00:00:00 2001
-From: Stephan Hartmann <stha09@googlemail.com>
-Date: Fri, 13 Aug 2021 12:57:42 +0000
-Subject: [PATCH] IWYU: add memory for std::unique_ptr in blink::CustomSpaces
-
----
- .../blink/renderer/platform/heap/v8_wrapper/custom_spaces.h      | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/third_party/blink/renderer/platform/heap/v8_wrapper/custom_spaces.h b/third_party/blink/renderer/platform/heap/v8_wrapper/custom_spaces.h
-index df0465a..640cb33 100644
---- a/third_party/blink/renderer/platform/heap/v8_wrapper/custom_spaces.h
-+++ b/third_party/blink/renderer/platform/heap/v8_wrapper/custom_spaces.h
-@@ -5,6 +5,7 @@
- #ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_V8_WRAPPER_CUSTOM_SPACES_H_
- #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_V8_WRAPPER_CUSTOM_SPACES_H_
- 
-+#include <memory>
- #include <vector>
- 
- #include "third_party/blink/renderer/platform/platform_export.h"
--- 
-2.31.1
-
diff --git a/srcpkgs/chromium/patches/chromium-95-harfbuzz-3.patch b/srcpkgs/chromium/patches/chromium-95-harfbuzz-3.patch
new file mode 100644
index 000000000000..33fe9556aaf3
--- /dev/null
+++ b/srcpkgs/chromium/patches/chromium-95-harfbuzz-3.patch
@@ -0,0 +1,31 @@
+From 9e00e702633c47c590a869bc66b5c2ceec09da50 Mon Sep 17 00:00:00 2001
+From: Dominik Röttsches <drott@chromium.org>
+Date: Tue, 28 Sep 2021 15:31:50 +0000
+Subject: [PATCH] Roll src/third_party/harfbuzz-ng/src/ 6602cbb70..a52c6df38 (80 commits)
+
+Fixed: 1252284
+Change-Id: Ie2ff99da5e41ca97b8881e1bd3e158881f4d5a8e
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3190252
+Commit-Queue: Dominik Röttsches <drott@chromium.org>
+Commit-Queue: Calder Kitagawa <ckitagawa@chromium.org>
+Auto-Submit: Dominik Röttsches <drott@chromium.org>
+Reviewed-by: Calder Kitagawa <ckitagawa@chromium.org>
+Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org>
+Cr-Commit-Position: refs/heads/main@{#925776}
+
+(only components/paint_preview/common/subset_font.cc)
+---
+
+diff --git a/components/paint_preview/common/subset_font.cc b/components/paint_preview/common/subset_font.cc
+index 45daea7b1..43a448e 100644
+--- a/components/paint_preview/common/subset_font.cc
++++ b/components/paint_preview/common/subset_font.cc
+@@ -79,7 +79,7 @@
+   // Retain all variation information for OpenType variation fonts. See:
+   // https://docs.microsoft.com/en-us/typography/opentype/spec/otvaroverview
+   hb_set_t* skip_subset =
+-      hb_subset_input_no_subset_tables_set(input.get());  // Owned by |input|.
++      hb_subset_input_set(input.get(), HB_SUBSET_SETS_NO_SUBSET_TABLE_TAG);
+   hb_set_add(skip_subset, HB_TAG('a', 'v', 'a', 'r'));
+   hb_set_add(skip_subset, HB_TAG('c', 'v', 'a', 'r'));
+   hb_set_add(skip_subset, HB_TAG('f', 'v', 'a', 'r'));
diff --git a/srcpkgs/chromium/patches/chromium-95-quiche-include.patch b/srcpkgs/chromium/patches/chromium-95-quiche-include.patch
new file mode 100644
index 000000000000..4bbd45cfc094
--- /dev/null
+++ b/srcpkgs/chromium/patches/chromium-95-quiche-include.patch
@@ -0,0 +1,25 @@
+From a9d986203bcfbaab84f270c1dc6c3abb4c450ee1 Mon Sep 17 00:00:00 2001
+From: Stephan Hartmann <stha09@googlemail.com>
+Date: Fri, 17 Sep 2021 14:57:33 +0000
+Subject: [PATCH] IWYU: add stddef.h for size_t in WindowManager
+
+---
+ net/third_party/quiche/src/http2/adapter/window_manager.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/net/third_party/quiche/src/http2/adapter/window_manager.h b/net/third_party/quiche/src/http2/adapter/window_manager.h
+index f15982d..5a7701e 100644
+--- a/net/third_party/quiche/src/http2/adapter/window_manager.h
++++ b/net/third_party/quiche/src/http2/adapter/window_manager.h
+@@ -1,6 +1,8 @@
+ #ifndef QUICHE_HTTP2_ADAPTER_WINDOW_MANAGER_H_
+ #define QUICHE_HTTP2_ADAPTER_WINDOW_MANAGER_H_
+ 
++#include <stddef.h>
++
+ #include <functional>
+ 
+ #include "common/platform/api/quiche_export.h"
+-- 
+2.32.0
+
diff --git a/srcpkgs/chromium/patches/ozone-x11-fix-VA-API.patch b/srcpkgs/chromium/patches/ozone-x11-fix-VA-API.patch
new file mode 100644
index 000000000000..61d72bfb0137
--- /dev/null
+++ b/srcpkgs/chromium/patches/ozone-x11-fix-VA-API.patch
@@ -0,0 +1,671 @@
+From a4de986102a45e29c3ef596f22704bdca244c26c Mon Sep 17 00:00:00 2001
+From: Maksim Sisov <msisov@igalia.com>
+Date: Fri, 17 Sep 2021 08:45:55 +0000
+Subject: [PATCH] ozone/x11: fix VA-API.
+
+This patch fixes VA-API usage with Ozone/X11 backend (which
+is our default backend now as X11 has been deprecated -
+crrev.com/c/3114071)).
+
+non-Ozone X11 is disabled now and Ozone is always used
+on Linux. However, VA-API implementation is not Ozone friendly
+yet and requires major refactoring. But given that VA-API
+implementation on Linux worked only with X11, it's fine for
+now to change USE_X11 and !IsUsingOzonePlatform to
+BUILDFLAG(OZONE_PLATFORM_X11) and fail VA-API initialization
+in VADisplayState::Initialize for Ozone/Linux other than
+non-X11 backends.
+
+Bug: 1121948
+Change-Id: If85d289235e6d358103d9fa2bbe0f741fb599a26
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3141878
+Commit-Queue: Maksim Sisov <msisov@igalia.com>
+Reviewed-by: Andres Calderon Jaramillo <andrescj@chromium.org>
+Reviewed-by: Robert Kroeger <rjkroege@chromium.org>
+Reviewed-by: Xiaohan Wang <xhwang@chromium.org>
+Reviewed-by: Alexander Dunaev <adunaev@igalia.com>
+Cr-Commit-Position: refs/heads/main@{#922466}
+---
+ media/BUILD.gn                                |  3 -
+ media/gpu/BUILD.gn                            |  5 +-
+ media/gpu/args.gni                            | 13 +++-
+ media/gpu/vaapi/BUILD.gn                      |  8 +-
+ media/gpu/vaapi/va_stub_header.fragment       |  6 +-
+ media/gpu/vaapi/vaapi_picture_factory.cc      | 72 ++++++++----------
+ .../vaapi_picture_native_pixmap_angle.cc      |  2 -
+ media/gpu/vaapi/vaapi_picture_tfp.cc          |  2 -
+ .../vaapi/vaapi_video_decode_accelerator.cc   |  9 +--
+ ...vaapi_video_decode_accelerator_unittest.cc | 11 +--
+ media/gpu/vaapi/vaapi_wrapper.cc              | 76 +++++++++----------
+ media/gpu/vaapi/vaapi_wrapper.h               |  8 +-
+ ui/ozone/platform/x11/ozone_platform_x11.cc   |  3 +
+ ui/ozone/public/ozone_platform.h              | 10 +++
+ 14 files changed, 108 insertions(+), 120 deletions(-)
+
+diff --git a/media/BUILD.gn b/media/BUILD.gn
+index dbee1d4338..d5c158c08f 100644
+--- a/media/BUILD.gn
++++ b/media/BUILD.gn
+@@ -130,9 +130,6 @@ component("media") {
+     public_deps += [ "//media/base/mac" ]
+   }
+ 
+-  if (use_x11) {
+-    deps += [ "//ui/base/x" ]
+-  }
+   if (use_ozone) {
+     deps += [ "//ui/ozone" ]
+   }
+diff --git a/media/gpu/BUILD.gn b/media/gpu/BUILD.gn
+index c7499485ac..3fedc78948 100644
+--- a/media/gpu/BUILD.gn
++++ b/media/gpu/BUILD.gn
+@@ -20,6 +20,7 @@ buildflag_header("buildflags") {
+     "USE_VAAPI_IMAGE_CODECS=$use_vaapi_image_codecs",
+     "USE_V4L2_CODEC=$use_v4l2_codec",
+     "USE_LIBV4L2=$use_v4lplugin",
++    "USE_VAAPI_X11=$use_vaapi_x11",
+   ]
+ }
+ 
+@@ -215,9 +216,7 @@ component("gpu") {
+       "windows/supported_profile_helpers.cc",
+       "windows/supported_profile_helpers.h",
+     ]
+-    configs += [
+-      "//third_party/khronos:khronos_headers",
+-    ]
++    configs += [ "//third_party/khronos:khronos_headers" ]
+     public_deps += [ "//media/base/win:media_foundation_util" ]
+     deps += [
+       "//gpu/ipc/common:common",
+diff --git a/media/gpu/args.gni b/media/gpu/args.gni
+index 4004937949..2f53843918 100644
+--- a/media/gpu/args.gni
++++ b/media/gpu/args.gni
+@@ -3,7 +3,15 @@
+ # found in the LICENSE file.
+ 
+ import("//build/config/chromeos/ui_mode.gni")
+-import("//build/config/ui.gni")
++import("//build/config/ozone.gni")
++
++declare_args() {
++  # Indicates if X11 VA-API-based hardware acceleration is to be used.
++  # See also the comment near the |use_vaapi| arg.
++  use_vaapi_x11 =
++      is_linux && ozone_platform_x11 && !is_chromecast && !is_chromeos_lacros &&
++      (target_cpu == "x86" || target_cpu == "x64")
++}
+ 
+ declare_args() {
+   # Indicates if V4L plugin is used.
+@@ -21,8 +29,7 @@ declare_args() {
+   # is typically the case on x86-based ChromeOS devices.
+   # VA-API should also be compiled by default on x11-using linux devices
+   # using x86/x64.
+-  use_vaapi =
+-      is_linux && use_x11 && (target_cpu == "x86" || target_cpu == "x64")
++  use_vaapi = use_vaapi_x11
+ 
+   # Indicates if ChromeOS protected media support exists. This is used
+   # to enable the CDM daemon in Chrome OS as well as support for
+diff --git a/media/gpu/vaapi/BUILD.gn b/media/gpu/vaapi/BUILD.gn
+index b11d2c60fa..0c2520dd6b 100644
+--- a/media/gpu/vaapi/BUILD.gn
++++ b/media/gpu/vaapi/BUILD.gn
+@@ -17,7 +17,7 @@ assert(use_vaapi)
+ generate_stubs("libva_stubs") {
+   extra_header = "va_stub_header.fragment"
+   sigs = [ "va.sigs" ]
+-  if (use_x11) {
++  if (use_vaapi_x11) {
+     sigs += [ "va_x11.sigs" ]
+   }
+   if (is_chromeos_ash) {
+@@ -131,14 +131,14 @@ source_set("vaapi") {
+     ]
+   }
+ 
+-  if (use_x11 || use_ozone || use_egl) {
++  if (use_ozone || use_egl) {
+     sources += [
+       "vaapi_picture_native_pixmap.cc",
+       "vaapi_picture_native_pixmap.h",
+     ]
+   }
+ 
+-  if (use_x11) {
++  if (use_vaapi_x11) {
+     deps += [ "//ui/gfx/x" ]
+     sources += [
+       "vaapi_picture_native_pixmap_angle.cc",
+@@ -197,7 +197,7 @@ source_set("common") {
+     deps += [ "//ui/ozone" ]
+   }
+ 
+-  if (use_x11) {
++  if (use_vaapi_x11) {
+     deps += [ "//ui/gfx/x" ]
+   }
+ 
+diff --git a/media/gpu/vaapi/va_stub_header.fragment b/media/gpu/vaapi/va_stub_header.fragment
+index bed198484d..e8c46c5e81 100644
+--- a/media/gpu/vaapi/va_stub_header.fragment
++++ b/media/gpu/vaapi/va_stub_header.fragment
+@@ -1,12 +1,14 @@
+ // The extra include header needed in the generated stub file for defining
+ // various libva types.
+ 
++#include "media/gpu/buildflags.h"
++
+ extern "C" {
+ 
+ #include <va/va_drm.h>
+ #include <va/va.h>
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+ #include <va/va_x11.h>
+-#endif
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ 
+ }
+diff --git a/media/gpu/vaapi/vaapi_picture_factory.cc b/media/gpu/vaapi/vaapi_picture_factory.cc
+index 719035b87c..9c7d7387d2 100644
+--- a/media/gpu/vaapi/vaapi_picture_factory.cc
++++ b/media/gpu/vaapi/vaapi_picture_factory.cc
+@@ -10,13 +10,13 @@
+ #include "ui/base/ui_base_features.h"
+ #include "ui/gl/gl_bindings.h"
+ 
+-#if defined(USE_X11)
+-#include "media/gpu/vaapi/vaapi_picture_native_pixmap_angle.h"
+-#include "media/gpu/vaapi/vaapi_picture_tfp.h"
+-#endif
+ #if defined(USE_OZONE)
+ #include "media/gpu/vaapi/vaapi_picture_native_pixmap_ozone.h"
+-#endif
++#endif  // defined(USE_OZONE)
++#if BUILDFLAG(USE_VAAPI_X11)
++#include "media/gpu/vaapi/vaapi_picture_native_pixmap_angle.h"
++#include "media/gpu/vaapi/vaapi_picture_tfp.h"
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ #if defined(USE_EGL)
+ #include "media/gpu/vaapi/vaapi_picture_native_pixmap_egl.h"
+ #endif
+@@ -46,15 +46,13 @@ VaapiPictureFactory::VaapiPictureFactory() {
+   vaapi_impl_pairs_.insert(
+       std::make_pair(gl::kGLImplementationEGLGLES2,
+                      VaapiPictureFactory::kVaapiImplementationDrm));
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+   vaapi_impl_pairs_.insert(
+       std::make_pair(gl::kGLImplementationEGLANGLE,
+                      VaapiPictureFactory::kVaapiImplementationAngle));
+-  if (!features::IsUsingOzonePlatform()) {
+-    vaapi_impl_pairs_.insert(
+-        std::make_pair(gl::kGLImplementationDesktopGL,
+-                       VaapiPictureFactory::kVaapiImplementationX11));
+-  }
++  vaapi_impl_pairs_.insert(
++      std::make_pair(gl::kGLImplementationDesktopGL,
++                     VaapiPictureFactory::kVaapiImplementationX11));
+ #endif
+ 
+   DeterminePictureCreationAndDownloadingMechanism();
+@@ -96,19 +94,19 @@ VaapiPictureFactory::GetVaapiImplementation(gl::GLImplementation gl_impl) {
+ }
+ 
+ uint32_t VaapiPictureFactory::GetGLTextureTarget() {
+-#if defined(USE_OZONE)
+-  if (features::IsUsingOzonePlatform())
+-    return GL_TEXTURE_EXTERNAL_OES;
+-#endif
++#if BUILDFLAG(USE_VAAPI_X11)
+   return GL_TEXTURE_2D;
++#else
++  return GL_TEXTURE_EXTERNAL_OES;
++#endif
+ }
+ 
+ gfx::BufferFormat VaapiPictureFactory::GetBufferFormat() {
+-#if defined(USE_OZONE)
+-  if (features::IsUsingOzonePlatform())
+-    return gfx::BufferFormat::YUV_420_BIPLANAR;
+-#endif
++#if BUILDFLAG(USE_VAAPI_X11)
+   return gfx::BufferFormat::RGBX_8888;
++#else
++  return gfx::BufferFormat::YUV_420_BIPLANAR;
++#endif
+ }
+ 
+ void VaapiPictureFactory::DeterminePictureCreationAndDownloadingMechanism() {
+@@ -116,51 +114,43 @@ void VaapiPictureFactory::DeterminePictureCreationAndDownloadingMechanism() {
+ #if defined(USE_OZONE)
+     // We can be called without GL initialized, which is valid if we use Ozone.
+     case kVaapiImplementationNone:
+-      if (features::IsUsingOzonePlatform()) {
+-        create_picture_cb_ = base::BindRepeating(
+-            &CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapOzone>);
+-        needs_vpp_for_downloading_ = true;
+-      }
+-
+-      // This is reached by unit tests which don't require create_picture_cb_
+-      // to be initialized or called.
++      create_picture_cb_ = base::BindRepeating(
++          &CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapOzone>);
++      needs_vpp_for_downloading_ = true;
+       break;
+ #endif  // defined(USE_OZONE)
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+     case kVaapiImplementationX11:
+-      DCHECK(!features::IsUsingOzonePlatform());
+       create_picture_cb_ =
+           base::BindRepeating(&CreateVaapiPictureNativeImpl<VaapiTFPPicture>);
+       // Neither VaapiTFPPicture or VaapiPictureNativePixmapAngle needs the VPP.
+       needs_vpp_for_downloading_ = false;
+       break;
+     case kVaapiImplementationAngle:
+-      DCHECK(!features::IsUsingOzonePlatform());
+       create_picture_cb_ = base::BindRepeating(
+           &CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapAngle>);
+       // Neither VaapiTFPPicture or VaapiPictureNativePixmapAngle needs the VPP.
+       needs_vpp_for_downloading_ = false;
+       break;
+-#endif  // defined(USE_X11)
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+     case kVaapiImplementationDrm:
+ #if defined(USE_OZONE)
+-      if (features::IsUsingOzonePlatform()) {
+-        create_picture_cb_ = base::BindRepeating(
+-            &CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapOzone>);
+-        needs_vpp_for_downloading_ = true;
+-        break;
+-      }
+-#endif  // defined(USE_OZONE)
+-#if defined(USE_EGL)
++      create_picture_cb_ = base::BindRepeating(
++          &CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapOzone>);
++      needs_vpp_for_downloading_ = true;
++      break;
++#elif defined(USE_EGL)
+       create_picture_cb_ = base::BindRepeating(
+           &CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapEgl>);
+       needs_vpp_for_downloading_ = true;
+       break;
+-#endif  // defined(USE_EGL)
++#else
+       // ozone or egl must be used to use the DRM implementation.
+-      NOTREACHED();
++      FALLTHROUGH;
++#endif
+     default:
+       NOTREACHED();
++      break;
+   }
+ }
+ 
+diff --git a/media/gpu/vaapi/vaapi_picture_native_pixmap_angle.cc b/media/gpu/vaapi/vaapi_picture_native_pixmap_angle.cc
+index 9de0c93b44..e5b9908490 100644
+--- a/media/gpu/vaapi/vaapi_picture_native_pixmap_angle.cc
++++ b/media/gpu/vaapi/vaapi_picture_native_pixmap_angle.cc
+@@ -6,7 +6,6 @@
+ 
+ #include "media/gpu/vaapi/va_surface.h"
+ #include "media/gpu/vaapi/vaapi_wrapper.h"
+-#include "ui/base/ui_base_features.h"
+ #include "ui/gfx/x/connection.h"
+ #include "ui/gfx/x/future.h"
+ #include "ui/gfx/x/xproto.h"
+@@ -92,7 +91,6 @@ Status VaapiPictureNativePixmapAngle::Allocate(gfx::BufferFormat format) {
+   if (!make_context_current_cb_ || !make_context_current_cb_.Run())
+     return StatusCode::kVaapiBadContext;
+ 
+-  DCHECK(!features::IsUsingOzonePlatform());
+   auto image =
+       base::MakeRefCounted<gl::GLImageEGLPixmap>(visible_size_, format);
+   if (!image)
+diff --git a/media/gpu/vaapi/vaapi_picture_tfp.cc b/media/gpu/vaapi/vaapi_picture_tfp.cc
+index 3f7e221d8a..11914e3640 100644
+--- a/media/gpu/vaapi/vaapi_picture_tfp.cc
++++ b/media/gpu/vaapi/vaapi_picture_tfp.cc
+@@ -6,7 +6,6 @@
+ 
+ #include "media/gpu/vaapi/va_surface.h"
+ #include "media/gpu/vaapi/vaapi_wrapper.h"
+-#include "ui/base/ui_base_features.h"
+ #include "ui/gfx/x/connection.h"
+ #include "ui/gfx/x/future.h"
+ #include "ui/gl/gl_bindings.h"
+@@ -37,7 +36,6 @@ VaapiTFPPicture::VaapiTFPPicture(
+       connection_(x11::Connection::Get()),
+       x_pixmap_(x11::Pixmap::None) {
+   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+-  DCHECK(!features::IsUsingOzonePlatform());
+   DCHECK(texture_id);
+   DCHECK(client_texture_id);
+ }
+diff --git a/media/gpu/vaapi/vaapi_video_decode_accelerator.cc b/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
+index 7514fe4fdd..e4cd7c8d89 100644
+--- a/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
++++ b/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
+@@ -184,12 +184,6 @@ bool VaapiVideoDecodeAccelerator::Initialize(const Config& config,
+                                              Client* client) {
+   DCHECK(task_runner_->BelongsToCurrentThread());
+ 
+-#if defined(USE_X11)
+-  // TODO(crbug/1116701): implement decode acceleration when running with Ozone.
+-  if (features::IsUsingOzonePlatform())
+-    return false;
+-#endif
+-
+   vaapi_picture_factory_ = std::make_unique<VaapiPictureFactory>();
+ 
+   if (config.is_encrypted()) {
+@@ -1213,12 +1207,11 @@ VaapiVideoDecodeAccelerator::GetSupportedProfiles() {
+ 
+ VaapiVideoDecodeAccelerator::BufferAllocationMode
+ VaapiVideoDecodeAccelerator::DecideBufferAllocationMode() {
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+   // The IMPORT mode is used for Android on Chrome OS, so this doesn't apply
+   // here.
+   DCHECK_NE(output_mode_, VideoDecodeAccelerator::Config::OutputMode::IMPORT);
+   // TODO(crbug/1116701): get video decode acceleration working with ozone.
+-  DCHECK(!features::IsUsingOzonePlatform());
+   // For H.264 on older devices, another +1 is experimentally needed for
+   // high-to-high resolution changes.
+   // TODO(mcasas): Figure out why and why only H264, see crbug.com/912295 and
+diff --git a/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc b/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc
+index 5b9a543386..826bb103b1 100644
+--- a/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc
++++ b/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc
+@@ -17,7 +17,6 @@
+ #include "media/gpu/vaapi/vaapi_wrapper.h"
+ #include "testing/gmock/include/gmock/gmock.h"
+ #include "testing/gtest/include/gtest/gtest.h"
+-#include "ui/base/ui_base_features.h"
+ 
+ using base::test::RunClosure;
+ using ::testing::_;
+@@ -416,12 +415,10 @@ TEST_P(VaapiVideoDecodeAcceleratorTest, SupportedPlatforms) {
+             mock_vaapi_picture_factory_->GetVaapiImplementation(
+                 gl::kGLImplementationEGLGLES2));
+ 
+-#if defined(USE_X11)
+-  if (!features::IsUsingOzonePlatform()) {
+-    EXPECT_EQ(VaapiPictureFactory::kVaapiImplementationX11,
+-              mock_vaapi_picture_factory_->GetVaapiImplementation(
+-                  gl::kGLImplementationDesktopGL));
+-  }
++#if BUILDFLAG(USE_VAAPI_X11)
++  EXPECT_EQ(VaapiPictureFactory::kVaapiImplementationX11,
++            mock_vaapi_picture_factory_->GetVaapiImplementation(
++                gl::kGLImplementationDesktopGL));
+ #endif
+ }
+ 
+diff --git a/media/gpu/vaapi/vaapi_wrapper.cc b/media/gpu/vaapi/vaapi_wrapper.cc
+index 754d258848..e528b0f84d 100644
+--- a/media/gpu/vaapi/vaapi_wrapper.cc
++++ b/media/gpu/vaapi/vaapi_wrapper.cc
+@@ -65,7 +65,7 @@
+ #include "ui/gl/gl_bindings.h"
+ #include "ui/gl/gl_implementation.h"
+ 
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+ typedef XID Drawable;
+ 
+ extern "C" {
+@@ -73,7 +73,7 @@ extern "C" {
+ }
+ 
+ #include "ui/gfx/x/connection.h"  // nogncheck
+-#endif
++#endif                            // BUILDFLAG(USE_VAAPI_X11)
+ 
+ #if defined(USE_OZONE)
+ #include "ui/ozone/public/ozone_platform.h"
+@@ -87,14 +87,14 @@ using media_gpu_vaapi::kModuleVa_prot;
+ 
+ using media_gpu_vaapi::kModuleVa;
+ using media_gpu_vaapi::kModuleVa_drm;
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+ using media_gpu_vaapi::kModuleVa_x11;
+-#endif
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ using media_gpu_vaapi::InitializeStubs;
+ using media_gpu_vaapi::IsVaInitialized;
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+ using media_gpu_vaapi::IsVa_x11Initialized;
+-#endif
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ using media_gpu_vaapi::IsVa_drmInitialized;
+ using media_gpu_vaapi::StubPathMap;
+ 
+@@ -559,10 +559,20 @@ VADisplayState::VADisplayState()
+ bool VADisplayState::Initialize() {
+   base::AutoLock auto_lock(va_lock_);
+ 
++#if defined(USE_OZONE) && defined(OS_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)
++    return false;
++#endif
++
+   bool libraries_initialized = IsVaInitialized() && IsVa_drmInitialized();
+-#if defined(USE_X11)
+-  if (!features::IsUsingOzonePlatform())
+-    libraries_initialized = libraries_initialized && IsVa_x11Initialized();
++#if BUILDFLAG(USE_VAAPI_X11)
++  libraries_initialized = libraries_initialized && IsVa_x11Initialized();
+ #endif
+   if (!libraries_initialized)
+     return false;
+@@ -577,34 +587,25 @@ bool VADisplayState::Initialize() {
+   return success;
+ }
+ 
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+ 
+ absl::optional<VADisplay> GetVADisplayStateX11(const base::ScopedFD& drm_fd) {
+-  bool use_drm_as_fallback = false;
+   switch (gl::GetGLImplementation()) {
+     case gl::kGLImplementationEGLGLES2:
+       return vaGetDisplayDRM(drm_fd.get());
+ 
+     case gl::kGLImplementationNone:
+-      use_drm_as_fallback = true;
+-      FALLTHROUGH;
+ 
+     case gl::kGLImplementationDesktopGL: {
+-      if (!features::IsUsingOzonePlatform()) {
+-        VADisplay display =
+-            vaGetDisplay(x11::Connection::Get()->GetXlibDisplay());
+-        if (vaDisplayIsValid(display))
+-          return display;
+-        return vaGetDisplayDRM(drm_fd.get());
+-      }
+-      break;
++      VADisplay display =
++          vaGetDisplay(x11::Connection::Get()->GetXlibDisplay());
++      if (vaDisplayIsValid(display))
++        return display;
++      return vaGetDisplayDRM(drm_fd.get());
+     }
+ 
+-    case gl::kGLImplementationEGLANGLE: {
+-      if (!features::IsUsingOzonePlatform())
+-        return vaGetDisplay(x11::Connection::Get()->GetXlibDisplay());
+-      break;
+-    }
++    case gl::kGLImplementationEGLANGLE:
++      return vaGetDisplay(x11::Connection::Get()->GetXlibDisplay());
+ 
+     default:
+       LOG(WARNING) << "VAAPI video acceleration not available for "
+@@ -612,10 +613,6 @@ absl::optional<VADisplay> GetVADisplayStateX11(const base::ScopedFD& drm_fd) {
+                           gl::GetGLImplementationParts());
+       return absl::nullopt;
+   }
+-
+-  if (use_drm_as_fallback)
+-    return vaGetDisplayDRM(drm_fd.get());
+-  return absl::nullopt;
+ }
+ 
+ #else
+@@ -633,11 +630,11 @@ absl::optional<VADisplay> GetVADisplayState(const base::ScopedFD& drm_fd) {
+   }
+ }
+ 
+-#endif  // defined(USE_X11)
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ 
+ bool VADisplayState::InitializeVaDisplay_Locked() {
+   absl::optional<VADisplay> display =
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+       GetVADisplayStateX11(drm_fd_);
+ #else
+       GetVADisplayState(drm_fd_);
+@@ -702,10 +699,9 @@ bool VADisplayState::InitializeOnce() {
+   if (!InitializeVaDisplay_Locked() || !InitializeVaDriver_Locked())
+     return false;
+ 
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+   if (gl::GetGLImplementation() == gl::kGLImplementationEGLANGLE &&
+       implementation_type_ == VAImplementation::kIntelIHD) {
+-    DCHECK(!features::IsUsingOzonePlatform());
+     constexpr char libva_driver_impl_env[] = "LIBVA_DRIVER_NAME";
+     // TODO(crbug/1116703) The libva intel-media driver has a known segfault in
+     // vaPutSurface, so until this is fixed, fall back to the i965 driver. There
+@@ -722,7 +718,7 @@ bool VADisplayState::InitializeOnce() {
+     if (!InitializeVaDisplay_Locked() || !InitializeVaDriver_Locked())
+       return false;
+   }
+-#endif  // USE_X11
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ 
+   return true;
+ }
+@@ -2452,11 +2448,10 @@ bool VaapiWrapper::MapAndCopyAndExecute(
+   return Execute_Locked(va_surface_id, va_buffer_ids);
+ }
+ 
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+ bool VaapiWrapper::PutSurfaceIntoPixmap(VASurfaceID va_surface_id,
+                                         x11::Pixmap x_pixmap,
+                                         gfx::Size dest_size) {
+-  DCHECK(!features::IsUsingOzonePlatform());
+   base::AutoLock auto_lock(*va_lock_);
+ 
+   VAStatus va_res = vaSyncSurface(va_display_, va_surface_id);
+@@ -2470,7 +2465,7 @@ bool VaapiWrapper::PutSurfaceIntoPixmap(VASurfaceID va_surface_id,
+   VA_SUCCESS_OR_RETURN(va_res, VaapiFunctions::kVAPutSurface, false);
+   return true;
+ }
+-#endif  // USE_X11
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ 
+ std::unique_ptr<ScopedVAImage> VaapiWrapper::CreateVaImage(
+     VASurfaceID va_surface_id,
+@@ -2844,9 +2839,8 @@ void VaapiWrapper::PreSandboxInitialization() {
+ 
+   paths[kModuleVa].push_back(std::string("libva.so.") + va_suffix);
+   paths[kModuleVa_drm].push_back(std::string("libva-drm.so.") + va_suffix);
+-#if defined(USE_X11)
+-  if (!features::IsUsingOzonePlatform())
+-    paths[kModuleVa_x11].push_back(std::string("libva-x11.so.") + va_suffix);
++#if BUILDFLAG(USE_VAAPI_X11)
++  paths[kModuleVa_x11].push_back(std::string("libva-x11.so.") + va_suffix);
+ #endif
+ #if BUILDFLAG(IS_CHROMEOS_ASH)
+   paths[kModuleVa_prot].push_back(std::string("libva.so.") + va_suffix);
+diff --git a/media/gpu/vaapi/vaapi_wrapper.h b/media/gpu/vaapi/vaapi_wrapper.h
+index 0e3da53624..88ffcd0799 100644
+--- a/media/gpu/vaapi/vaapi_wrapper.h
++++ b/media/gpu/vaapi/vaapi_wrapper.h
+@@ -36,9 +36,9 @@
+ #include "third_party/abseil-cpp/absl/types/optional.h"
+ #include "ui/gfx/geometry/size.h"
+ 
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+ #include "ui/gfx/x/xproto.h"  // nogncheck
+-#endif  // USE_X11
++#endif                        // BUILDFLAG(USE_VAAPI_X11)
+ 
+ namespace gfx {
+ enum class BufferFormat;
+@@ -426,13 +426,13 @@ class MEDIA_GPU_EXPORT VaapiWrapper
+       const std::vector<std::pair<VABufferID, VABufferDescriptor>>& va_buffers)
+       WARN_UNUSED_RESULT;
+ 
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+   // Put data from |va_surface_id| into |x_pixmap| of size
+   // |dest_size|, converting/scaling to it.
+   bool PutSurfaceIntoPixmap(VASurfaceID va_surface_id,
+                             x11::Pixmap x_pixmap,
+                             gfx::Size dest_size) WARN_UNUSED_RESULT;
+-#endif  // USE_X11
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ 
+   // 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 --git a/ui/ozone/platform/x11/ozone_platform_x11.cc b/ui/ozone/platform/x11/ozone_platform_x11.cc
+index 8889828e0f..963dc7a0cd 100644
+--- a/ui/ozone/platform/x11/ozone_platform_x11.cc
++++ b/ui/ozone/platform/x11/ozone_platform_x11.cc
+@@ -208,6 +208,9 @@ class OzonePlatformX11 : public OzonePlatform,
+       properties->supports_global_application_menus = true;
+       properties->app_modal_dialogs_use_event_blocker = true;
+       properties->fetch_buffer_formats_for_gmb_on_gpu = true;
++#if defined(OS_LINUX)
++      properties->supports_vaapi = true;
++#endif
+ 
+       initialised = true;
+     }
+diff --git a/ui/ozone/public/ozone_platform.h b/ui/ozone/public/ozone_platform.h
+index df95f07486..2d7f44bbfa 100644
+--- a/ui/ozone/public/ozone_platform.h
++++ b/ui/ozone/public/ozone_platform.h
+@@ -15,6 +15,7 @@
+ #include "base/macros.h"
+ #include "base/message_loop/message_pump_type.h"
+ #include "base/single_thread_task_runner.h"
++#include "build/build_config.h"
+ #include "mojo/public/cpp/bindings/binder_map.h"
+ #include "ui/gfx/buffer_types.h"
+ #include "ui/gfx/native_widget_types.h"
+@@ -154,6 +155,15 @@ class COMPONENT_EXPORT(OZONE) OzonePlatform {
+     // Determines whether buffer formats should be fetched on GPU and passed
+     // back via gpu extra info.
+     bool fetch_buffer_formats_for_gmb_on_gpu = false;
++
++#if defined(OS_LINUX)
++    // TODO(crbug.com/1116701): add vaapi support for other Ozone platforms on
++    // Linux. At the moment, VA-API Linux implementation supports only X11
++    // backend. This implementation must be refactored to support Ozone
++    // properly. As a temporary solution, VA-API on Linux checks if vaapi is
++    // supported (which implicitly means that it is Ozone/X11).
++    bool supports_vaapi = false;
++#endif
+   };
+ 
+   // Groups platform properties that can only be known at run time.
diff --git a/srcpkgs/chromium/template b/srcpkgs/chromium/template
index c57c29508dfc..eb588385f128 100644
--- a/srcpkgs/chromium/template
+++ b/srcpkgs/chromium/template
@@ -1,7 +1,7 @@
 # Template file for 'chromium'
 pkgname=chromium
 # See https://chromiumdash.appspot.com/releases?platform=Linux for the latest version
-version=94.0.4606.81
+version=95.0.4638.54
 revision=1
 archs="i686* x86_64* aarch64* armv7l* ppc64le*"
 short_desc="Google's attempt at creating a safer, faster, and more stable browser"
@@ -9,7 +9,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://www.chromium.org/"
 distfiles="https://commondatastorage.googleapis.com/chromium-browser-official/${pkgname}-${version}.tar.xz"
-checksum=7071aa2b2caf48094c2ae816395948b4daec940606f4982ad5bbf68e5d2de598
+checksum=3eef88d745e6ddaeaf507358f1510482d6f399cf335061bb1226a5f7120061fd
 nocross=yes
 
 lib32disabled=yes

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PR PATCH] [Updated] chromium: update to 95.0.4638.54.
  2021-10-20 22:14 [PR PATCH] chromium: update to 95.0.4638.54 Duncaen
  2021-10-20 22:45 ` [PR PATCH] [Updated] " Duncaen
@ 2021-10-21  0:06 ` Duncaen
  2021-10-21 12:34 ` Duncaen
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Duncaen @ 2021-10-21  0:06 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 391 bytes --]

There is an updated pull request by Duncaen against master on the void-packages repository

https://github.com/Duncaen/void-packages chromium-95
https://github.com/void-linux/void-packages/pull/33657

chromium: update to 95.0.4638.54.
[ci skip]

* [x] x86_64-glibc
* [ ] x86_64-musl
* [ ] i686


A patch file from https://github.com/void-linux/void-packages/pull/33657.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-chromium-95-33657.patch --]
[-- Type: text/x-diff, Size: 35185 bytes --]

From d73452438978c72ac9fc72f8762581316705aa7e Mon Sep 17 00:00:00 2001
From: Duncaen <duncaen@voidlinux.org>
Date: Thu, 21 Oct 2021 00:13:28 +0200
Subject: [PATCH] chromium: update to 95.0.4638.54.

---
 .../files/musl-patches/resolver.patch         |  13 +-
 .../musl-patches/xxx-ppc64le-support.patch    |  16 +-
 .../chromium-94-CustomSpaces-include.patch    |  24 -
 .../patches/chromium-95-harfbuzz-3.patch      |  31 +
 .../patches/chromium-95-quiche-include.patch  |  25 +
 .../fix-bits-stdint-intn-include.patch        |  11 +
 .../patches/ozone-x11-fix-VA-API.patch        | 671 ++++++++++++++++++
 srcpkgs/chromium/template                     |   4 +-
 8 files changed, 755 insertions(+), 40 deletions(-)
 delete mode 100644 srcpkgs/chromium/patches/chromium-94-CustomSpaces-include.patch
 create mode 100644 srcpkgs/chromium/patches/chromium-95-harfbuzz-3.patch
 create mode 100644 srcpkgs/chromium/patches/chromium-95-quiche-include.patch
 create mode 100644 srcpkgs/chromium/patches/fix-bits-stdint-intn-include.patch
 create mode 100644 srcpkgs/chromium/patches/ozone-x11-fix-VA-API.patch

diff --git a/srcpkgs/chromium/files/musl-patches/resolver.patch b/srcpkgs/chromium/files/musl-patches/resolver.patch
index fb8b0ddccda6..091d3f3e88ef 100644
--- a/srcpkgs/chromium/files/musl-patches/resolver.patch
+++ b/srcpkgs/chromium/files/musl-patches/resolver.patch
@@ -51,10 +51,12 @@
      UMA_HISTOGRAM_BOOLEAN("Net.DNS.DnsConfig.Resolv.Read",
                            dns_config_.has_value());
      if (!dns_config_.has_value())
-@@ -486,20 +480,11 @@
+--- net/dns/public/resolv_reader.cc.orig
++++ net/dns/public/resolv_reader.cc
+@@ -20,19 +20,10 @@
+ namespace net {
  
- std::unique_ptr<struct __res_state>
- DnsConfigServiceLinux::ResolvReader::GetResState() {
+ std::unique_ptr<struct __res_state> ResolvReader::GetResState() {
 -  auto res = std::make_unique<struct __res_state>();
 -  memset(res.get(), 0, sizeof(struct __res_state));
 -
@@ -67,9 +69,8 @@
 +  return nullptr;
  }
  
- void DnsConfigServiceLinux::ResolvReader::CloseResState(
-     struct __res_state* res) {
+ void ResolvReader::CloseResState(struct __res_state* res) {
 -  res_nclose(res);
  }
  
- DnsConfigServiceLinux::DnsConfigServiceLinux()
+ absl::optional<std::vector<IPEndPoint>> GetNameservers(
diff --git a/srcpkgs/chromium/files/musl-patches/xxx-ppc64le-support.patch b/srcpkgs/chromium/files/musl-patches/xxx-ppc64le-support.patch
index 9ea233ba6256..681b1f011c31 100644
--- a/srcpkgs/chromium/files/musl-patches/xxx-ppc64le-support.patch
+++ b/srcpkgs/chromium/files/musl-patches/xxx-ppc64le-support.patch
@@ -1,11 +1,11 @@
---- base/allocator/partition_allocator/partition_alloc_config.h	2021-05-25 00:05:31.000000000 +0200
-+++ -	2021-05-26 22:23:47.172940826 +0200
-@@ -88,7 +88,8 @@
- // PUT_REF_COUNT_IN_PREVIOUS_SLOT does. In this case the refcount overlaps with
- // the next pointer shadow for the smallest bucket.
- #if !(defined(OS_MAC) && defined(ARCH_CPU_ARM64)) && \
--    !BUILDFLAG(PUT_REF_COUNT_IN_PREVIOUS_SLOT)
-+    !BUILDFLAG(PUT_REF_COUNT_IN_PREVIOUS_SLOT) && \
+--- base/allocator/partition_allocator/partition_alloc_config.h.orig
++++ base/allocator/partition_allocator/partition_alloc_config.h
+@@ -114,7 +114,8 @@
+ // platforms complicates things. Note that Chromium is not officially supported
+ // on any big endian architecture as well.
+ #if !BUILDFLAG(PUT_REF_COUNT_IN_PREVIOUS_SLOT) && \
+-    defined(ARCH_CPU_LITTLE_ENDIAN)
++    defined(ARCH_CPU_LITTLE_ENDIAN) && \
 +    !defined(__powerpc64__)
  #define PA_HAS_FREELIST_HARDENING
  #endif
diff --git a/srcpkgs/chromium/patches/chromium-94-CustomSpaces-include.patch b/srcpkgs/chromium/patches/chromium-94-CustomSpaces-include.patch
deleted file mode 100644
index 01757758c1e2..000000000000
--- a/srcpkgs/chromium/patches/chromium-94-CustomSpaces-include.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From 4eeacdaa57b29a079fe09315eb22557c06aa522e Mon Sep 17 00:00:00 2001
-From: Stephan Hartmann <stha09@googlemail.com>
-Date: Fri, 13 Aug 2021 12:57:42 +0000
-Subject: [PATCH] IWYU: add memory for std::unique_ptr in blink::CustomSpaces
-
----
- .../blink/renderer/platform/heap/v8_wrapper/custom_spaces.h      | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/third_party/blink/renderer/platform/heap/v8_wrapper/custom_spaces.h b/third_party/blink/renderer/platform/heap/v8_wrapper/custom_spaces.h
-index df0465a..640cb33 100644
---- a/third_party/blink/renderer/platform/heap/v8_wrapper/custom_spaces.h
-+++ b/third_party/blink/renderer/platform/heap/v8_wrapper/custom_spaces.h
-@@ -5,6 +5,7 @@
- #ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_V8_WRAPPER_CUSTOM_SPACES_H_
- #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_V8_WRAPPER_CUSTOM_SPACES_H_
- 
-+#include <memory>
- #include <vector>
- 
- #include "third_party/blink/renderer/platform/platform_export.h"
--- 
-2.31.1
-
diff --git a/srcpkgs/chromium/patches/chromium-95-harfbuzz-3.patch b/srcpkgs/chromium/patches/chromium-95-harfbuzz-3.patch
new file mode 100644
index 000000000000..33fe9556aaf3
--- /dev/null
+++ b/srcpkgs/chromium/patches/chromium-95-harfbuzz-3.patch
@@ -0,0 +1,31 @@
+From 9e00e702633c47c590a869bc66b5c2ceec09da50 Mon Sep 17 00:00:00 2001
+From: Dominik Röttsches <drott@chromium.org>
+Date: Tue, 28 Sep 2021 15:31:50 +0000
+Subject: [PATCH] Roll src/third_party/harfbuzz-ng/src/ 6602cbb70..a52c6df38 (80 commits)
+
+Fixed: 1252284
+Change-Id: Ie2ff99da5e41ca97b8881e1bd3e158881f4d5a8e
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3190252
+Commit-Queue: Dominik Röttsches <drott@chromium.org>
+Commit-Queue: Calder Kitagawa <ckitagawa@chromium.org>
+Auto-Submit: Dominik Röttsches <drott@chromium.org>
+Reviewed-by: Calder Kitagawa <ckitagawa@chromium.org>
+Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org>
+Cr-Commit-Position: refs/heads/main@{#925776}
+
+(only components/paint_preview/common/subset_font.cc)
+---
+
+diff --git a/components/paint_preview/common/subset_font.cc b/components/paint_preview/common/subset_font.cc
+index 45daea7b1..43a448e 100644
+--- a/components/paint_preview/common/subset_font.cc
++++ b/components/paint_preview/common/subset_font.cc
+@@ -79,7 +79,7 @@
+   // Retain all variation information for OpenType variation fonts. See:
+   // https://docs.microsoft.com/en-us/typography/opentype/spec/otvaroverview
+   hb_set_t* skip_subset =
+-      hb_subset_input_no_subset_tables_set(input.get());  // Owned by |input|.
++      hb_subset_input_set(input.get(), HB_SUBSET_SETS_NO_SUBSET_TABLE_TAG);
+   hb_set_add(skip_subset, HB_TAG('a', 'v', 'a', 'r'));
+   hb_set_add(skip_subset, HB_TAG('c', 'v', 'a', 'r'));
+   hb_set_add(skip_subset, HB_TAG('f', 'v', 'a', 'r'));
diff --git a/srcpkgs/chromium/patches/chromium-95-quiche-include.patch b/srcpkgs/chromium/patches/chromium-95-quiche-include.patch
new file mode 100644
index 000000000000..4bbd45cfc094
--- /dev/null
+++ b/srcpkgs/chromium/patches/chromium-95-quiche-include.patch
@@ -0,0 +1,25 @@
+From a9d986203bcfbaab84f270c1dc6c3abb4c450ee1 Mon Sep 17 00:00:00 2001
+From: Stephan Hartmann <stha09@googlemail.com>
+Date: Fri, 17 Sep 2021 14:57:33 +0000
+Subject: [PATCH] IWYU: add stddef.h for size_t in WindowManager
+
+---
+ net/third_party/quiche/src/http2/adapter/window_manager.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/net/third_party/quiche/src/http2/adapter/window_manager.h b/net/third_party/quiche/src/http2/adapter/window_manager.h
+index f15982d..5a7701e 100644
+--- a/net/third_party/quiche/src/http2/adapter/window_manager.h
++++ b/net/third_party/quiche/src/http2/adapter/window_manager.h
+@@ -1,6 +1,8 @@
+ #ifndef QUICHE_HTTP2_ADAPTER_WINDOW_MANAGER_H_
+ #define QUICHE_HTTP2_ADAPTER_WINDOW_MANAGER_H_
+ 
++#include <stddef.h>
++
+ #include <functional>
+ 
+ #include "common/platform/api/quiche_export.h"
+-- 
+2.32.0
+
diff --git a/srcpkgs/chromium/patches/fix-bits-stdint-intn-include.patch b/srcpkgs/chromium/patches/fix-bits-stdint-intn-include.patch
new file mode 100644
index 000000000000..978cd6a493d6
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-bits-stdint-intn-include.patch
@@ -0,0 +1,11 @@
+--- a/ui/ozone/platform/wayland/host/wayland_window.cc.orig
++++ b/ui/ozone/platform/wayland/host/wayland_window.cc
+@@ -4,7 +4,7 @@
+ 
+ #include "ui/ozone/platform/wayland/host/wayland_window.h"
+ 
+-#include <bits/stdint-intn.h>
++#include <stdint.h>
+ #include <wayland-cursor.h>
+ #include <algorithm>
+ #include <memory>
diff --git a/srcpkgs/chromium/patches/ozone-x11-fix-VA-API.patch b/srcpkgs/chromium/patches/ozone-x11-fix-VA-API.patch
new file mode 100644
index 000000000000..61d72bfb0137
--- /dev/null
+++ b/srcpkgs/chromium/patches/ozone-x11-fix-VA-API.patch
@@ -0,0 +1,671 @@
+From a4de986102a45e29c3ef596f22704bdca244c26c Mon Sep 17 00:00:00 2001
+From: Maksim Sisov <msisov@igalia.com>
+Date: Fri, 17 Sep 2021 08:45:55 +0000
+Subject: [PATCH] ozone/x11: fix VA-API.
+
+This patch fixes VA-API usage with Ozone/X11 backend (which
+is our default backend now as X11 has been deprecated -
+crrev.com/c/3114071)).
+
+non-Ozone X11 is disabled now and Ozone is always used
+on Linux. However, VA-API implementation is not Ozone friendly
+yet and requires major refactoring. But given that VA-API
+implementation on Linux worked only with X11, it's fine for
+now to change USE_X11 and !IsUsingOzonePlatform to
+BUILDFLAG(OZONE_PLATFORM_X11) and fail VA-API initialization
+in VADisplayState::Initialize for Ozone/Linux other than
+non-X11 backends.
+
+Bug: 1121948
+Change-Id: If85d289235e6d358103d9fa2bbe0f741fb599a26
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3141878
+Commit-Queue: Maksim Sisov <msisov@igalia.com>
+Reviewed-by: Andres Calderon Jaramillo <andrescj@chromium.org>
+Reviewed-by: Robert Kroeger <rjkroege@chromium.org>
+Reviewed-by: Xiaohan Wang <xhwang@chromium.org>
+Reviewed-by: Alexander Dunaev <adunaev@igalia.com>
+Cr-Commit-Position: refs/heads/main@{#922466}
+---
+ media/BUILD.gn                                |  3 -
+ media/gpu/BUILD.gn                            |  5 +-
+ media/gpu/args.gni                            | 13 +++-
+ media/gpu/vaapi/BUILD.gn                      |  8 +-
+ media/gpu/vaapi/va_stub_header.fragment       |  6 +-
+ media/gpu/vaapi/vaapi_picture_factory.cc      | 72 ++++++++----------
+ .../vaapi_picture_native_pixmap_angle.cc      |  2 -
+ media/gpu/vaapi/vaapi_picture_tfp.cc          |  2 -
+ .../vaapi/vaapi_video_decode_accelerator.cc   |  9 +--
+ ...vaapi_video_decode_accelerator_unittest.cc | 11 +--
+ media/gpu/vaapi/vaapi_wrapper.cc              | 76 +++++++++----------
+ media/gpu/vaapi/vaapi_wrapper.h               |  8 +-
+ ui/ozone/platform/x11/ozone_platform_x11.cc   |  3 +
+ ui/ozone/public/ozone_platform.h              | 10 +++
+ 14 files changed, 108 insertions(+), 120 deletions(-)
+
+diff --git a/media/BUILD.gn b/media/BUILD.gn
+index dbee1d4338..d5c158c08f 100644
+--- a/media/BUILD.gn
++++ b/media/BUILD.gn
+@@ -130,9 +130,6 @@ component("media") {
+     public_deps += [ "//media/base/mac" ]
+   }
+ 
+-  if (use_x11) {
+-    deps += [ "//ui/base/x" ]
+-  }
+   if (use_ozone) {
+     deps += [ "//ui/ozone" ]
+   }
+diff --git a/media/gpu/BUILD.gn b/media/gpu/BUILD.gn
+index c7499485ac..3fedc78948 100644
+--- a/media/gpu/BUILD.gn
++++ b/media/gpu/BUILD.gn
+@@ -20,6 +20,7 @@ buildflag_header("buildflags") {
+     "USE_VAAPI_IMAGE_CODECS=$use_vaapi_image_codecs",
+     "USE_V4L2_CODEC=$use_v4l2_codec",
+     "USE_LIBV4L2=$use_v4lplugin",
++    "USE_VAAPI_X11=$use_vaapi_x11",
+   ]
+ }
+ 
+@@ -215,9 +216,7 @@ component("gpu") {
+       "windows/supported_profile_helpers.cc",
+       "windows/supported_profile_helpers.h",
+     ]
+-    configs += [
+-      "//third_party/khronos:khronos_headers",
+-    ]
++    configs += [ "//third_party/khronos:khronos_headers" ]
+     public_deps += [ "//media/base/win:media_foundation_util" ]
+     deps += [
+       "//gpu/ipc/common:common",
+diff --git a/media/gpu/args.gni b/media/gpu/args.gni
+index 4004937949..2f53843918 100644
+--- a/media/gpu/args.gni
++++ b/media/gpu/args.gni
+@@ -3,7 +3,15 @@
+ # found in the LICENSE file.
+ 
+ import("//build/config/chromeos/ui_mode.gni")
+-import("//build/config/ui.gni")
++import("//build/config/ozone.gni")
++
++declare_args() {
++  # Indicates if X11 VA-API-based hardware acceleration is to be used.
++  # See also the comment near the |use_vaapi| arg.
++  use_vaapi_x11 =
++      is_linux && ozone_platform_x11 && !is_chromecast && !is_chromeos_lacros &&
++      (target_cpu == "x86" || target_cpu == "x64")
++}
+ 
+ declare_args() {
+   # Indicates if V4L plugin is used.
+@@ -21,8 +29,7 @@ declare_args() {
+   # is typically the case on x86-based ChromeOS devices.
+   # VA-API should also be compiled by default on x11-using linux devices
+   # using x86/x64.
+-  use_vaapi =
+-      is_linux && use_x11 && (target_cpu == "x86" || target_cpu == "x64")
++  use_vaapi = use_vaapi_x11
+ 
+   # Indicates if ChromeOS protected media support exists. This is used
+   # to enable the CDM daemon in Chrome OS as well as support for
+diff --git a/media/gpu/vaapi/BUILD.gn b/media/gpu/vaapi/BUILD.gn
+index b11d2c60fa..0c2520dd6b 100644
+--- a/media/gpu/vaapi/BUILD.gn
++++ b/media/gpu/vaapi/BUILD.gn
+@@ -17,7 +17,7 @@ assert(use_vaapi)
+ generate_stubs("libva_stubs") {
+   extra_header = "va_stub_header.fragment"
+   sigs = [ "va.sigs" ]
+-  if (use_x11) {
++  if (use_vaapi_x11) {
+     sigs += [ "va_x11.sigs" ]
+   }
+   if (is_chromeos_ash) {
+@@ -131,14 +131,14 @@ source_set("vaapi") {
+     ]
+   }
+ 
+-  if (use_x11 || use_ozone || use_egl) {
++  if (use_ozone || use_egl) {
+     sources += [
+       "vaapi_picture_native_pixmap.cc",
+       "vaapi_picture_native_pixmap.h",
+     ]
+   }
+ 
+-  if (use_x11) {
++  if (use_vaapi_x11) {
+     deps += [ "//ui/gfx/x" ]
+     sources += [
+       "vaapi_picture_native_pixmap_angle.cc",
+@@ -197,7 +197,7 @@ source_set("common") {
+     deps += [ "//ui/ozone" ]
+   }
+ 
+-  if (use_x11) {
++  if (use_vaapi_x11) {
+     deps += [ "//ui/gfx/x" ]
+   }
+ 
+diff --git a/media/gpu/vaapi/va_stub_header.fragment b/media/gpu/vaapi/va_stub_header.fragment
+index bed198484d..e8c46c5e81 100644
+--- a/media/gpu/vaapi/va_stub_header.fragment
++++ b/media/gpu/vaapi/va_stub_header.fragment
+@@ -1,12 +1,14 @@
+ // The extra include header needed in the generated stub file for defining
+ // various libva types.
+ 
++#include "media/gpu/buildflags.h"
++
+ extern "C" {
+ 
+ #include <va/va_drm.h>
+ #include <va/va.h>
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+ #include <va/va_x11.h>
+-#endif
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ 
+ }
+diff --git a/media/gpu/vaapi/vaapi_picture_factory.cc b/media/gpu/vaapi/vaapi_picture_factory.cc
+index 719035b87c..9c7d7387d2 100644
+--- a/media/gpu/vaapi/vaapi_picture_factory.cc
++++ b/media/gpu/vaapi/vaapi_picture_factory.cc
+@@ -10,13 +10,13 @@
+ #include "ui/base/ui_base_features.h"
+ #include "ui/gl/gl_bindings.h"
+ 
+-#if defined(USE_X11)
+-#include "media/gpu/vaapi/vaapi_picture_native_pixmap_angle.h"
+-#include "media/gpu/vaapi/vaapi_picture_tfp.h"
+-#endif
+ #if defined(USE_OZONE)
+ #include "media/gpu/vaapi/vaapi_picture_native_pixmap_ozone.h"
+-#endif
++#endif  // defined(USE_OZONE)
++#if BUILDFLAG(USE_VAAPI_X11)
++#include "media/gpu/vaapi/vaapi_picture_native_pixmap_angle.h"
++#include "media/gpu/vaapi/vaapi_picture_tfp.h"
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ #if defined(USE_EGL)
+ #include "media/gpu/vaapi/vaapi_picture_native_pixmap_egl.h"
+ #endif
+@@ -46,15 +46,13 @@ VaapiPictureFactory::VaapiPictureFactory() {
+   vaapi_impl_pairs_.insert(
+       std::make_pair(gl::kGLImplementationEGLGLES2,
+                      VaapiPictureFactory::kVaapiImplementationDrm));
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+   vaapi_impl_pairs_.insert(
+       std::make_pair(gl::kGLImplementationEGLANGLE,
+                      VaapiPictureFactory::kVaapiImplementationAngle));
+-  if (!features::IsUsingOzonePlatform()) {
+-    vaapi_impl_pairs_.insert(
+-        std::make_pair(gl::kGLImplementationDesktopGL,
+-                       VaapiPictureFactory::kVaapiImplementationX11));
+-  }
++  vaapi_impl_pairs_.insert(
++      std::make_pair(gl::kGLImplementationDesktopGL,
++                     VaapiPictureFactory::kVaapiImplementationX11));
+ #endif
+ 
+   DeterminePictureCreationAndDownloadingMechanism();
+@@ -96,19 +94,19 @@ VaapiPictureFactory::GetVaapiImplementation(gl::GLImplementation gl_impl) {
+ }
+ 
+ uint32_t VaapiPictureFactory::GetGLTextureTarget() {
+-#if defined(USE_OZONE)
+-  if (features::IsUsingOzonePlatform())
+-    return GL_TEXTURE_EXTERNAL_OES;
+-#endif
++#if BUILDFLAG(USE_VAAPI_X11)
+   return GL_TEXTURE_2D;
++#else
++  return GL_TEXTURE_EXTERNAL_OES;
++#endif
+ }
+ 
+ gfx::BufferFormat VaapiPictureFactory::GetBufferFormat() {
+-#if defined(USE_OZONE)
+-  if (features::IsUsingOzonePlatform())
+-    return gfx::BufferFormat::YUV_420_BIPLANAR;
+-#endif
++#if BUILDFLAG(USE_VAAPI_X11)
+   return gfx::BufferFormat::RGBX_8888;
++#else
++  return gfx::BufferFormat::YUV_420_BIPLANAR;
++#endif
+ }
+ 
+ void VaapiPictureFactory::DeterminePictureCreationAndDownloadingMechanism() {
+@@ -116,51 +114,43 @@ void VaapiPictureFactory::DeterminePictureCreationAndDownloadingMechanism() {
+ #if defined(USE_OZONE)
+     // We can be called without GL initialized, which is valid if we use Ozone.
+     case kVaapiImplementationNone:
+-      if (features::IsUsingOzonePlatform()) {
+-        create_picture_cb_ = base::BindRepeating(
+-            &CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapOzone>);
+-        needs_vpp_for_downloading_ = true;
+-      }
+-
+-      // This is reached by unit tests which don't require create_picture_cb_
+-      // to be initialized or called.
++      create_picture_cb_ = base::BindRepeating(
++          &CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapOzone>);
++      needs_vpp_for_downloading_ = true;
+       break;
+ #endif  // defined(USE_OZONE)
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+     case kVaapiImplementationX11:
+-      DCHECK(!features::IsUsingOzonePlatform());
+       create_picture_cb_ =
+           base::BindRepeating(&CreateVaapiPictureNativeImpl<VaapiTFPPicture>);
+       // Neither VaapiTFPPicture or VaapiPictureNativePixmapAngle needs the VPP.
+       needs_vpp_for_downloading_ = false;
+       break;
+     case kVaapiImplementationAngle:
+-      DCHECK(!features::IsUsingOzonePlatform());
+       create_picture_cb_ = base::BindRepeating(
+           &CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapAngle>);
+       // Neither VaapiTFPPicture or VaapiPictureNativePixmapAngle needs the VPP.
+       needs_vpp_for_downloading_ = false;
+       break;
+-#endif  // defined(USE_X11)
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+     case kVaapiImplementationDrm:
+ #if defined(USE_OZONE)
+-      if (features::IsUsingOzonePlatform()) {
+-        create_picture_cb_ = base::BindRepeating(
+-            &CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapOzone>);
+-        needs_vpp_for_downloading_ = true;
+-        break;
+-      }
+-#endif  // defined(USE_OZONE)
+-#if defined(USE_EGL)
++      create_picture_cb_ = base::BindRepeating(
++          &CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapOzone>);
++      needs_vpp_for_downloading_ = true;
++      break;
++#elif defined(USE_EGL)
+       create_picture_cb_ = base::BindRepeating(
+           &CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapEgl>);
+       needs_vpp_for_downloading_ = true;
+       break;
+-#endif  // defined(USE_EGL)
++#else
+       // ozone or egl must be used to use the DRM implementation.
+-      NOTREACHED();
++      FALLTHROUGH;
++#endif
+     default:
+       NOTREACHED();
++      break;
+   }
+ }
+ 
+diff --git a/media/gpu/vaapi/vaapi_picture_native_pixmap_angle.cc b/media/gpu/vaapi/vaapi_picture_native_pixmap_angle.cc
+index 9de0c93b44..e5b9908490 100644
+--- a/media/gpu/vaapi/vaapi_picture_native_pixmap_angle.cc
++++ b/media/gpu/vaapi/vaapi_picture_native_pixmap_angle.cc
+@@ -6,7 +6,6 @@
+ 
+ #include "media/gpu/vaapi/va_surface.h"
+ #include "media/gpu/vaapi/vaapi_wrapper.h"
+-#include "ui/base/ui_base_features.h"
+ #include "ui/gfx/x/connection.h"
+ #include "ui/gfx/x/future.h"
+ #include "ui/gfx/x/xproto.h"
+@@ -92,7 +91,6 @@ Status VaapiPictureNativePixmapAngle::Allocate(gfx::BufferFormat format) {
+   if (!make_context_current_cb_ || !make_context_current_cb_.Run())
+     return StatusCode::kVaapiBadContext;
+ 
+-  DCHECK(!features::IsUsingOzonePlatform());
+   auto image =
+       base::MakeRefCounted<gl::GLImageEGLPixmap>(visible_size_, format);
+   if (!image)
+diff --git a/media/gpu/vaapi/vaapi_picture_tfp.cc b/media/gpu/vaapi/vaapi_picture_tfp.cc
+index 3f7e221d8a..11914e3640 100644
+--- a/media/gpu/vaapi/vaapi_picture_tfp.cc
++++ b/media/gpu/vaapi/vaapi_picture_tfp.cc
+@@ -6,7 +6,6 @@
+ 
+ #include "media/gpu/vaapi/va_surface.h"
+ #include "media/gpu/vaapi/vaapi_wrapper.h"
+-#include "ui/base/ui_base_features.h"
+ #include "ui/gfx/x/connection.h"
+ #include "ui/gfx/x/future.h"
+ #include "ui/gl/gl_bindings.h"
+@@ -37,7 +36,6 @@ VaapiTFPPicture::VaapiTFPPicture(
+       connection_(x11::Connection::Get()),
+       x_pixmap_(x11::Pixmap::None) {
+   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+-  DCHECK(!features::IsUsingOzonePlatform());
+   DCHECK(texture_id);
+   DCHECK(client_texture_id);
+ }
+diff --git a/media/gpu/vaapi/vaapi_video_decode_accelerator.cc b/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
+index 7514fe4fdd..e4cd7c8d89 100644
+--- a/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
++++ b/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
+@@ -184,12 +184,6 @@ bool VaapiVideoDecodeAccelerator::Initialize(const Config& config,
+                                              Client* client) {
+   DCHECK(task_runner_->BelongsToCurrentThread());
+ 
+-#if defined(USE_X11)
+-  // TODO(crbug/1116701): implement decode acceleration when running with Ozone.
+-  if (features::IsUsingOzonePlatform())
+-    return false;
+-#endif
+-
+   vaapi_picture_factory_ = std::make_unique<VaapiPictureFactory>();
+ 
+   if (config.is_encrypted()) {
+@@ -1213,12 +1207,11 @@ VaapiVideoDecodeAccelerator::GetSupportedProfiles() {
+ 
+ VaapiVideoDecodeAccelerator::BufferAllocationMode
+ VaapiVideoDecodeAccelerator::DecideBufferAllocationMode() {
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+   // The IMPORT mode is used for Android on Chrome OS, so this doesn't apply
+   // here.
+   DCHECK_NE(output_mode_, VideoDecodeAccelerator::Config::OutputMode::IMPORT);
+   // TODO(crbug/1116701): get video decode acceleration working with ozone.
+-  DCHECK(!features::IsUsingOzonePlatform());
+   // For H.264 on older devices, another +1 is experimentally needed for
+   // high-to-high resolution changes.
+   // TODO(mcasas): Figure out why and why only H264, see crbug.com/912295 and
+diff --git a/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc b/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc
+index 5b9a543386..826bb103b1 100644
+--- a/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc
++++ b/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc
+@@ -17,7 +17,6 @@
+ #include "media/gpu/vaapi/vaapi_wrapper.h"
+ #include "testing/gmock/include/gmock/gmock.h"
+ #include "testing/gtest/include/gtest/gtest.h"
+-#include "ui/base/ui_base_features.h"
+ 
+ using base::test::RunClosure;
+ using ::testing::_;
+@@ -416,12 +415,10 @@ TEST_P(VaapiVideoDecodeAcceleratorTest, SupportedPlatforms) {
+             mock_vaapi_picture_factory_->GetVaapiImplementation(
+                 gl::kGLImplementationEGLGLES2));
+ 
+-#if defined(USE_X11)
+-  if (!features::IsUsingOzonePlatform()) {
+-    EXPECT_EQ(VaapiPictureFactory::kVaapiImplementationX11,
+-              mock_vaapi_picture_factory_->GetVaapiImplementation(
+-                  gl::kGLImplementationDesktopGL));
+-  }
++#if BUILDFLAG(USE_VAAPI_X11)
++  EXPECT_EQ(VaapiPictureFactory::kVaapiImplementationX11,
++            mock_vaapi_picture_factory_->GetVaapiImplementation(
++                gl::kGLImplementationDesktopGL));
+ #endif
+ }
+ 
+diff --git a/media/gpu/vaapi/vaapi_wrapper.cc b/media/gpu/vaapi/vaapi_wrapper.cc
+index 754d258848..e528b0f84d 100644
+--- a/media/gpu/vaapi/vaapi_wrapper.cc
++++ b/media/gpu/vaapi/vaapi_wrapper.cc
+@@ -65,7 +65,7 @@
+ #include "ui/gl/gl_bindings.h"
+ #include "ui/gl/gl_implementation.h"
+ 
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+ typedef XID Drawable;
+ 
+ extern "C" {
+@@ -73,7 +73,7 @@ extern "C" {
+ }
+ 
+ #include "ui/gfx/x/connection.h"  // nogncheck
+-#endif
++#endif                            // BUILDFLAG(USE_VAAPI_X11)
+ 
+ #if defined(USE_OZONE)
+ #include "ui/ozone/public/ozone_platform.h"
+@@ -87,14 +87,14 @@ using media_gpu_vaapi::kModuleVa_prot;
+ 
+ using media_gpu_vaapi::kModuleVa;
+ using media_gpu_vaapi::kModuleVa_drm;
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+ using media_gpu_vaapi::kModuleVa_x11;
+-#endif
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ using media_gpu_vaapi::InitializeStubs;
+ using media_gpu_vaapi::IsVaInitialized;
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+ using media_gpu_vaapi::IsVa_x11Initialized;
+-#endif
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ using media_gpu_vaapi::IsVa_drmInitialized;
+ using media_gpu_vaapi::StubPathMap;
+ 
+@@ -559,10 +559,20 @@ VADisplayState::VADisplayState()
+ bool VADisplayState::Initialize() {
+   base::AutoLock auto_lock(va_lock_);
+ 
++#if defined(USE_OZONE) && defined(OS_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)
++    return false;
++#endif
++
+   bool libraries_initialized = IsVaInitialized() && IsVa_drmInitialized();
+-#if defined(USE_X11)
+-  if (!features::IsUsingOzonePlatform())
+-    libraries_initialized = libraries_initialized && IsVa_x11Initialized();
++#if BUILDFLAG(USE_VAAPI_X11)
++  libraries_initialized = libraries_initialized && IsVa_x11Initialized();
+ #endif
+   if (!libraries_initialized)
+     return false;
+@@ -577,34 +587,25 @@ bool VADisplayState::Initialize() {
+   return success;
+ }
+ 
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+ 
+ absl::optional<VADisplay> GetVADisplayStateX11(const base::ScopedFD& drm_fd) {
+-  bool use_drm_as_fallback = false;
+   switch (gl::GetGLImplementation()) {
+     case gl::kGLImplementationEGLGLES2:
+       return vaGetDisplayDRM(drm_fd.get());
+ 
+     case gl::kGLImplementationNone:
+-      use_drm_as_fallback = true;
+-      FALLTHROUGH;
+ 
+     case gl::kGLImplementationDesktopGL: {
+-      if (!features::IsUsingOzonePlatform()) {
+-        VADisplay display =
+-            vaGetDisplay(x11::Connection::Get()->GetXlibDisplay());
+-        if (vaDisplayIsValid(display))
+-          return display;
+-        return vaGetDisplayDRM(drm_fd.get());
+-      }
+-      break;
++      VADisplay display =
++          vaGetDisplay(x11::Connection::Get()->GetXlibDisplay());
++      if (vaDisplayIsValid(display))
++        return display;
++      return vaGetDisplayDRM(drm_fd.get());
+     }
+ 
+-    case gl::kGLImplementationEGLANGLE: {
+-      if (!features::IsUsingOzonePlatform())
+-        return vaGetDisplay(x11::Connection::Get()->GetXlibDisplay());
+-      break;
+-    }
++    case gl::kGLImplementationEGLANGLE:
++      return vaGetDisplay(x11::Connection::Get()->GetXlibDisplay());
+ 
+     default:
+       LOG(WARNING) << "VAAPI video acceleration not available for "
+@@ -612,10 +613,6 @@ absl::optional<VADisplay> GetVADisplayStateX11(const base::ScopedFD& drm_fd) {
+                           gl::GetGLImplementationParts());
+       return absl::nullopt;
+   }
+-
+-  if (use_drm_as_fallback)
+-    return vaGetDisplayDRM(drm_fd.get());
+-  return absl::nullopt;
+ }
+ 
+ #else
+@@ -633,11 +630,11 @@ absl::optional<VADisplay> GetVADisplayState(const base::ScopedFD& drm_fd) {
+   }
+ }
+ 
+-#endif  // defined(USE_X11)
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ 
+ bool VADisplayState::InitializeVaDisplay_Locked() {
+   absl::optional<VADisplay> display =
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+       GetVADisplayStateX11(drm_fd_);
+ #else
+       GetVADisplayState(drm_fd_);
+@@ -702,10 +699,9 @@ bool VADisplayState::InitializeOnce() {
+   if (!InitializeVaDisplay_Locked() || !InitializeVaDriver_Locked())
+     return false;
+ 
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+   if (gl::GetGLImplementation() == gl::kGLImplementationEGLANGLE &&
+       implementation_type_ == VAImplementation::kIntelIHD) {
+-    DCHECK(!features::IsUsingOzonePlatform());
+     constexpr char libva_driver_impl_env[] = "LIBVA_DRIVER_NAME";
+     // TODO(crbug/1116703) The libva intel-media driver has a known segfault in
+     // vaPutSurface, so until this is fixed, fall back to the i965 driver. There
+@@ -722,7 +718,7 @@ bool VADisplayState::InitializeOnce() {
+     if (!InitializeVaDisplay_Locked() || !InitializeVaDriver_Locked())
+       return false;
+   }
+-#endif  // USE_X11
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ 
+   return true;
+ }
+@@ -2452,11 +2448,10 @@ bool VaapiWrapper::MapAndCopyAndExecute(
+   return Execute_Locked(va_surface_id, va_buffer_ids);
+ }
+ 
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+ bool VaapiWrapper::PutSurfaceIntoPixmap(VASurfaceID va_surface_id,
+                                         x11::Pixmap x_pixmap,
+                                         gfx::Size dest_size) {
+-  DCHECK(!features::IsUsingOzonePlatform());
+   base::AutoLock auto_lock(*va_lock_);
+ 
+   VAStatus va_res = vaSyncSurface(va_display_, va_surface_id);
+@@ -2470,7 +2465,7 @@ bool VaapiWrapper::PutSurfaceIntoPixmap(VASurfaceID va_surface_id,
+   VA_SUCCESS_OR_RETURN(va_res, VaapiFunctions::kVAPutSurface, false);
+   return true;
+ }
+-#endif  // USE_X11
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ 
+ std::unique_ptr<ScopedVAImage> VaapiWrapper::CreateVaImage(
+     VASurfaceID va_surface_id,
+@@ -2844,9 +2839,8 @@ void VaapiWrapper::PreSandboxInitialization() {
+ 
+   paths[kModuleVa].push_back(std::string("libva.so.") + va_suffix);
+   paths[kModuleVa_drm].push_back(std::string("libva-drm.so.") + va_suffix);
+-#if defined(USE_X11)
+-  if (!features::IsUsingOzonePlatform())
+-    paths[kModuleVa_x11].push_back(std::string("libva-x11.so.") + va_suffix);
++#if BUILDFLAG(USE_VAAPI_X11)
++  paths[kModuleVa_x11].push_back(std::string("libva-x11.so.") + va_suffix);
+ #endif
+ #if BUILDFLAG(IS_CHROMEOS_ASH)
+   paths[kModuleVa_prot].push_back(std::string("libva.so.") + va_suffix);
+diff --git a/media/gpu/vaapi/vaapi_wrapper.h b/media/gpu/vaapi/vaapi_wrapper.h
+index 0e3da53624..88ffcd0799 100644
+--- a/media/gpu/vaapi/vaapi_wrapper.h
++++ b/media/gpu/vaapi/vaapi_wrapper.h
+@@ -36,9 +36,9 @@
+ #include "third_party/abseil-cpp/absl/types/optional.h"
+ #include "ui/gfx/geometry/size.h"
+ 
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+ #include "ui/gfx/x/xproto.h"  // nogncheck
+-#endif  // USE_X11
++#endif                        // BUILDFLAG(USE_VAAPI_X11)
+ 
+ namespace gfx {
+ enum class BufferFormat;
+@@ -426,13 +426,13 @@ class MEDIA_GPU_EXPORT VaapiWrapper
+       const std::vector<std::pair<VABufferID, VABufferDescriptor>>& va_buffers)
+       WARN_UNUSED_RESULT;
+ 
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+   // Put data from |va_surface_id| into |x_pixmap| of size
+   // |dest_size|, converting/scaling to it.
+   bool PutSurfaceIntoPixmap(VASurfaceID va_surface_id,
+                             x11::Pixmap x_pixmap,
+                             gfx::Size dest_size) WARN_UNUSED_RESULT;
+-#endif  // USE_X11
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ 
+   // 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 --git a/ui/ozone/platform/x11/ozone_platform_x11.cc b/ui/ozone/platform/x11/ozone_platform_x11.cc
+index 8889828e0f..963dc7a0cd 100644
+--- a/ui/ozone/platform/x11/ozone_platform_x11.cc
++++ b/ui/ozone/platform/x11/ozone_platform_x11.cc
+@@ -208,6 +208,9 @@ class OzonePlatformX11 : public OzonePlatform,
+       properties->supports_global_application_menus = true;
+       properties->app_modal_dialogs_use_event_blocker = true;
+       properties->fetch_buffer_formats_for_gmb_on_gpu = true;
++#if defined(OS_LINUX)
++      properties->supports_vaapi = true;
++#endif
+ 
+       initialised = true;
+     }
+diff --git a/ui/ozone/public/ozone_platform.h b/ui/ozone/public/ozone_platform.h
+index df95f07486..2d7f44bbfa 100644
+--- a/ui/ozone/public/ozone_platform.h
++++ b/ui/ozone/public/ozone_platform.h
+@@ -15,6 +15,7 @@
+ #include "base/macros.h"
+ #include "base/message_loop/message_pump_type.h"
+ #include "base/single_thread_task_runner.h"
++#include "build/build_config.h"
+ #include "mojo/public/cpp/bindings/binder_map.h"
+ #include "ui/gfx/buffer_types.h"
+ #include "ui/gfx/native_widget_types.h"
+@@ -154,6 +155,15 @@ class COMPONENT_EXPORT(OZONE) OzonePlatform {
+     // Determines whether buffer formats should be fetched on GPU and passed
+     // back via gpu extra info.
+     bool fetch_buffer_formats_for_gmb_on_gpu = false;
++
++#if defined(OS_LINUX)
++    // TODO(crbug.com/1116701): add vaapi support for other Ozone platforms on
++    // Linux. At the moment, VA-API Linux implementation supports only X11
++    // backend. This implementation must be refactored to support Ozone
++    // properly. As a temporary solution, VA-API on Linux checks if vaapi is
++    // supported (which implicitly means that it is Ozone/X11).
++    bool supports_vaapi = false;
++#endif
+   };
+ 
+   // Groups platform properties that can only be known at run time.
diff --git a/srcpkgs/chromium/template b/srcpkgs/chromium/template
index c57c29508dfc..eb588385f128 100644
--- a/srcpkgs/chromium/template
+++ b/srcpkgs/chromium/template
@@ -1,7 +1,7 @@
 # Template file for 'chromium'
 pkgname=chromium
 # See https://chromiumdash.appspot.com/releases?platform=Linux for the latest version
-version=94.0.4606.81
+version=95.0.4638.54
 revision=1
 archs="i686* x86_64* aarch64* armv7l* ppc64le*"
 short_desc="Google's attempt at creating a safer, faster, and more stable browser"
@@ -9,7 +9,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://www.chromium.org/"
 distfiles="https://commondatastorage.googleapis.com/chromium-browser-official/${pkgname}-${version}.tar.xz"
-checksum=7071aa2b2caf48094c2ae816395948b4daec940606f4982ad5bbf68e5d2de598
+checksum=3eef88d745e6ddaeaf507358f1510482d6f399cf335061bb1226a5f7120061fd
 nocross=yes
 
 lib32disabled=yes

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PR PATCH] [Updated] chromium: update to 95.0.4638.54.
  2021-10-20 22:14 [PR PATCH] chromium: update to 95.0.4638.54 Duncaen
  2021-10-20 22:45 ` [PR PATCH] [Updated] " Duncaen
  2021-10-21  0:06 ` Duncaen
@ 2021-10-21 12:34 ` Duncaen
  2021-10-22 19:09 ` Duncaen
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Duncaen @ 2021-10-21 12:34 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 391 bytes --]

There is an updated pull request by Duncaen against master on the void-packages repository

https://github.com/Duncaen/void-packages chromium-95
https://github.com/void-linux/void-packages/pull/33657

chromium: update to 95.0.4638.54.
[ci skip]

* [x] x86_64-glibc
* [x] x86_64-musl
* [ ] i686


A patch file from https://github.com/void-linux/void-packages/pull/33657.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-chromium-95-33657.patch --]
[-- Type: text/x-diff, Size: 37584 bytes --]

From 4a28585ab8b1330626f9e5f74dad6fc6e404e4f6 Mon Sep 17 00:00:00 2001
From: Duncaen <duncaen@voidlinux.org>
Date: Thu, 21 Oct 2021 00:13:28 +0200
Subject: [PATCH] chromium: update to 95.0.4638.54.

---
 .../chromium-i686-vaapi-fpermissive.patch     |  22 -
 .../files/musl-patches/resolver.patch         |  13 +-
 .../musl-patches/xxx-ppc64le-support.patch    |  16 +-
 .../chromium-94-CustomSpaces-include.patch    |  24 -
 .../patches/chromium-95-harfbuzz-3.patch      |  31 +
 .../patches/chromium-95-quiche-include.patch  |  25 +
 .../chromium-i686-vaapi-fpermissive.patch     |  23 +
 .../fix-bits-stdint-intn-include.patch        |  11 +
 .../patches/ozone-x11-fix-VA-API.patch        | 671 ++++++++++++++++++
 srcpkgs/chromium/template                     |  13 +-
 10 files changed, 778 insertions(+), 71 deletions(-)
 delete mode 100644 srcpkgs/chromium/files/i686-patches/chromium-i686-vaapi-fpermissive.patch
 delete mode 100644 srcpkgs/chromium/patches/chromium-94-CustomSpaces-include.patch
 create mode 100644 srcpkgs/chromium/patches/chromium-95-harfbuzz-3.patch
 create mode 100644 srcpkgs/chromium/patches/chromium-95-quiche-include.patch
 create mode 100644 srcpkgs/chromium/patches/chromium-i686-vaapi-fpermissive.patch
 create mode 100644 srcpkgs/chromium/patches/fix-bits-stdint-intn-include.patch
 create mode 100644 srcpkgs/chromium/patches/ozone-x11-fix-VA-API.patch

diff --git a/srcpkgs/chromium/files/i686-patches/chromium-i686-vaapi-fpermissive.patch b/srcpkgs/chromium/files/i686-patches/chromium-i686-vaapi-fpermissive.patch
deleted file mode 100644
index b4d8787c4798..000000000000
--- a/srcpkgs/chromium/files/i686-patches/chromium-i686-vaapi-fpermissive.patch
+++ /dev/null
@@ -1,22 +0,0 @@
---- media/gpu/vaapi/BUILD.gn.orig	2019-06-18 11:48:14.000000000 -0400
-+++ media/gpu/vaapi/BUILD.gn	2019-07-02 18:34:00.607864854 -0400
-@@ -11,6 +11,10 @@
- 
- assert(use_vaapi)
- 
-+config("vaapi_permissive") {
-+  cflags = [ "-fpermissive" ]
-+}
-+
- generate_stubs("libva_stubs") {
-   extra_header = "va_stub_header.fragment"
-   sigs = [ "va.sigs" ]
-@@ -89,6 +93,8 @@
-     deps += [ "//media/gpu/linux" ]
-   }
- 
-+  configs += [ ":vaapi_permissive" ]
-+
-   if (use_x11) {
-     configs += [ "//build/config/linux:x11" ]
-     deps += [ "//ui/gfx/x" ]
diff --git a/srcpkgs/chromium/files/musl-patches/resolver.patch b/srcpkgs/chromium/files/musl-patches/resolver.patch
index fb8b0ddccda6..091d3f3e88ef 100644
--- a/srcpkgs/chromium/files/musl-patches/resolver.patch
+++ b/srcpkgs/chromium/files/musl-patches/resolver.patch
@@ -51,10 +51,12 @@
      UMA_HISTOGRAM_BOOLEAN("Net.DNS.DnsConfig.Resolv.Read",
                            dns_config_.has_value());
      if (!dns_config_.has_value())
-@@ -486,20 +480,11 @@
+--- net/dns/public/resolv_reader.cc.orig
++++ net/dns/public/resolv_reader.cc
+@@ -20,19 +20,10 @@
+ namespace net {
  
- std::unique_ptr<struct __res_state>
- DnsConfigServiceLinux::ResolvReader::GetResState() {
+ std::unique_ptr<struct __res_state> ResolvReader::GetResState() {
 -  auto res = std::make_unique<struct __res_state>();
 -  memset(res.get(), 0, sizeof(struct __res_state));
 -
@@ -67,9 +69,8 @@
 +  return nullptr;
  }
  
- void DnsConfigServiceLinux::ResolvReader::CloseResState(
-     struct __res_state* res) {
+ void ResolvReader::CloseResState(struct __res_state* res) {
 -  res_nclose(res);
  }
  
- DnsConfigServiceLinux::DnsConfigServiceLinux()
+ absl::optional<std::vector<IPEndPoint>> GetNameservers(
diff --git a/srcpkgs/chromium/files/musl-patches/xxx-ppc64le-support.patch b/srcpkgs/chromium/files/musl-patches/xxx-ppc64le-support.patch
index 9ea233ba6256..681b1f011c31 100644
--- a/srcpkgs/chromium/files/musl-patches/xxx-ppc64le-support.patch
+++ b/srcpkgs/chromium/files/musl-patches/xxx-ppc64le-support.patch
@@ -1,11 +1,11 @@
---- base/allocator/partition_allocator/partition_alloc_config.h	2021-05-25 00:05:31.000000000 +0200
-+++ -	2021-05-26 22:23:47.172940826 +0200
-@@ -88,7 +88,8 @@
- // PUT_REF_COUNT_IN_PREVIOUS_SLOT does. In this case the refcount overlaps with
- // the next pointer shadow for the smallest bucket.
- #if !(defined(OS_MAC) && defined(ARCH_CPU_ARM64)) && \
--    !BUILDFLAG(PUT_REF_COUNT_IN_PREVIOUS_SLOT)
-+    !BUILDFLAG(PUT_REF_COUNT_IN_PREVIOUS_SLOT) && \
+--- base/allocator/partition_allocator/partition_alloc_config.h.orig
++++ base/allocator/partition_allocator/partition_alloc_config.h
+@@ -114,7 +114,8 @@
+ // platforms complicates things. Note that Chromium is not officially supported
+ // on any big endian architecture as well.
+ #if !BUILDFLAG(PUT_REF_COUNT_IN_PREVIOUS_SLOT) && \
+-    defined(ARCH_CPU_LITTLE_ENDIAN)
++    defined(ARCH_CPU_LITTLE_ENDIAN) && \
 +    !defined(__powerpc64__)
  #define PA_HAS_FREELIST_HARDENING
  #endif
diff --git a/srcpkgs/chromium/patches/chromium-94-CustomSpaces-include.patch b/srcpkgs/chromium/patches/chromium-94-CustomSpaces-include.patch
deleted file mode 100644
index 01757758c1e2..000000000000
--- a/srcpkgs/chromium/patches/chromium-94-CustomSpaces-include.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From 4eeacdaa57b29a079fe09315eb22557c06aa522e Mon Sep 17 00:00:00 2001
-From: Stephan Hartmann <stha09@googlemail.com>
-Date: Fri, 13 Aug 2021 12:57:42 +0000
-Subject: [PATCH] IWYU: add memory for std::unique_ptr in blink::CustomSpaces
-
----
- .../blink/renderer/platform/heap/v8_wrapper/custom_spaces.h      | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/third_party/blink/renderer/platform/heap/v8_wrapper/custom_spaces.h b/third_party/blink/renderer/platform/heap/v8_wrapper/custom_spaces.h
-index df0465a..640cb33 100644
---- a/third_party/blink/renderer/platform/heap/v8_wrapper/custom_spaces.h
-+++ b/third_party/blink/renderer/platform/heap/v8_wrapper/custom_spaces.h
-@@ -5,6 +5,7 @@
- #ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_V8_WRAPPER_CUSTOM_SPACES_H_
- #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_V8_WRAPPER_CUSTOM_SPACES_H_
- 
-+#include <memory>
- #include <vector>
- 
- #include "third_party/blink/renderer/platform/platform_export.h"
--- 
-2.31.1
-
diff --git a/srcpkgs/chromium/patches/chromium-95-harfbuzz-3.patch b/srcpkgs/chromium/patches/chromium-95-harfbuzz-3.patch
new file mode 100644
index 000000000000..33fe9556aaf3
--- /dev/null
+++ b/srcpkgs/chromium/patches/chromium-95-harfbuzz-3.patch
@@ -0,0 +1,31 @@
+From 9e00e702633c47c590a869bc66b5c2ceec09da50 Mon Sep 17 00:00:00 2001
+From: Dominik Röttsches <drott@chromium.org>
+Date: Tue, 28 Sep 2021 15:31:50 +0000
+Subject: [PATCH] Roll src/third_party/harfbuzz-ng/src/ 6602cbb70..a52c6df38 (80 commits)
+
+Fixed: 1252284
+Change-Id: Ie2ff99da5e41ca97b8881e1bd3e158881f4d5a8e
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3190252
+Commit-Queue: Dominik Röttsches <drott@chromium.org>
+Commit-Queue: Calder Kitagawa <ckitagawa@chromium.org>
+Auto-Submit: Dominik Röttsches <drott@chromium.org>
+Reviewed-by: Calder Kitagawa <ckitagawa@chromium.org>
+Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org>
+Cr-Commit-Position: refs/heads/main@{#925776}
+
+(only components/paint_preview/common/subset_font.cc)
+---
+
+diff --git a/components/paint_preview/common/subset_font.cc b/components/paint_preview/common/subset_font.cc
+index 45daea7b1..43a448e 100644
+--- a/components/paint_preview/common/subset_font.cc
++++ b/components/paint_preview/common/subset_font.cc
+@@ -79,7 +79,7 @@
+   // Retain all variation information for OpenType variation fonts. See:
+   // https://docs.microsoft.com/en-us/typography/opentype/spec/otvaroverview
+   hb_set_t* skip_subset =
+-      hb_subset_input_no_subset_tables_set(input.get());  // Owned by |input|.
++      hb_subset_input_set(input.get(), HB_SUBSET_SETS_NO_SUBSET_TABLE_TAG);
+   hb_set_add(skip_subset, HB_TAG('a', 'v', 'a', 'r'));
+   hb_set_add(skip_subset, HB_TAG('c', 'v', 'a', 'r'));
+   hb_set_add(skip_subset, HB_TAG('f', 'v', 'a', 'r'));
diff --git a/srcpkgs/chromium/patches/chromium-95-quiche-include.patch b/srcpkgs/chromium/patches/chromium-95-quiche-include.patch
new file mode 100644
index 000000000000..4bbd45cfc094
--- /dev/null
+++ b/srcpkgs/chromium/patches/chromium-95-quiche-include.patch
@@ -0,0 +1,25 @@
+From a9d986203bcfbaab84f270c1dc6c3abb4c450ee1 Mon Sep 17 00:00:00 2001
+From: Stephan Hartmann <stha09@googlemail.com>
+Date: Fri, 17 Sep 2021 14:57:33 +0000
+Subject: [PATCH] IWYU: add stddef.h for size_t in WindowManager
+
+---
+ net/third_party/quiche/src/http2/adapter/window_manager.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/net/third_party/quiche/src/http2/adapter/window_manager.h b/net/third_party/quiche/src/http2/adapter/window_manager.h
+index f15982d..5a7701e 100644
+--- a/net/third_party/quiche/src/http2/adapter/window_manager.h
++++ b/net/third_party/quiche/src/http2/adapter/window_manager.h
+@@ -1,6 +1,8 @@
+ #ifndef QUICHE_HTTP2_ADAPTER_WINDOW_MANAGER_H_
+ #define QUICHE_HTTP2_ADAPTER_WINDOW_MANAGER_H_
+ 
++#include <stddef.h>
++
+ #include <functional>
+ 
+ #include "common/platform/api/quiche_export.h"
+-- 
+2.32.0
+
diff --git a/srcpkgs/chromium/patches/chromium-i686-vaapi-fpermissive.patch b/srcpkgs/chromium/patches/chromium-i686-vaapi-fpermissive.patch
new file mode 100644
index 000000000000..77c0b58c94e1
--- /dev/null
+++ b/srcpkgs/chromium/patches/chromium-i686-vaapi-fpermissive.patch
@@ -0,0 +1,23 @@
+--- a/media/gpu/vaapi/BUILD.gn.orig
++++ b/media/gpu/vaapi/BUILD.gn
+@@ -14,6 +14,12 @@
+ assert(is_linux || is_chromeos)
+ assert(use_vaapi)
+ 
++config("vaapi_permissive") {
++  if (target_cpu == "x86") {
++    cflags = [ "-fpermissive" ]
++  }
++}
++
+ generate_stubs("libva_stubs") {
+   extra_header = "va_stub_header.fragment"
+   sigs = [ "va.sigs" ]
+@@ -90,6 +96,7 @@
+   configs += [
+     "//build/config/linux/libva",
+     "//third_party/libvpx:libvpx_config",
++    ":vaapi_permissive",
+   ]
+ 
+   deps = [
diff --git a/srcpkgs/chromium/patches/fix-bits-stdint-intn-include.patch b/srcpkgs/chromium/patches/fix-bits-stdint-intn-include.patch
new file mode 100644
index 000000000000..978cd6a493d6
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-bits-stdint-intn-include.patch
@@ -0,0 +1,11 @@
+--- a/ui/ozone/platform/wayland/host/wayland_window.cc.orig
++++ b/ui/ozone/platform/wayland/host/wayland_window.cc
+@@ -4,7 +4,7 @@
+ 
+ #include "ui/ozone/platform/wayland/host/wayland_window.h"
+ 
+-#include <bits/stdint-intn.h>
++#include <stdint.h>
+ #include <wayland-cursor.h>
+ #include <algorithm>
+ #include <memory>
diff --git a/srcpkgs/chromium/patches/ozone-x11-fix-VA-API.patch b/srcpkgs/chromium/patches/ozone-x11-fix-VA-API.patch
new file mode 100644
index 000000000000..61d72bfb0137
--- /dev/null
+++ b/srcpkgs/chromium/patches/ozone-x11-fix-VA-API.patch
@@ -0,0 +1,671 @@
+From a4de986102a45e29c3ef596f22704bdca244c26c Mon Sep 17 00:00:00 2001
+From: Maksim Sisov <msisov@igalia.com>
+Date: Fri, 17 Sep 2021 08:45:55 +0000
+Subject: [PATCH] ozone/x11: fix VA-API.
+
+This patch fixes VA-API usage with Ozone/X11 backend (which
+is our default backend now as X11 has been deprecated -
+crrev.com/c/3114071)).
+
+non-Ozone X11 is disabled now and Ozone is always used
+on Linux. However, VA-API implementation is not Ozone friendly
+yet and requires major refactoring. But given that VA-API
+implementation on Linux worked only with X11, it's fine for
+now to change USE_X11 and !IsUsingOzonePlatform to
+BUILDFLAG(OZONE_PLATFORM_X11) and fail VA-API initialization
+in VADisplayState::Initialize for Ozone/Linux other than
+non-X11 backends.
+
+Bug: 1121948
+Change-Id: If85d289235e6d358103d9fa2bbe0f741fb599a26
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3141878
+Commit-Queue: Maksim Sisov <msisov@igalia.com>
+Reviewed-by: Andres Calderon Jaramillo <andrescj@chromium.org>
+Reviewed-by: Robert Kroeger <rjkroege@chromium.org>
+Reviewed-by: Xiaohan Wang <xhwang@chromium.org>
+Reviewed-by: Alexander Dunaev <adunaev@igalia.com>
+Cr-Commit-Position: refs/heads/main@{#922466}
+---
+ media/BUILD.gn                                |  3 -
+ media/gpu/BUILD.gn                            |  5 +-
+ media/gpu/args.gni                            | 13 +++-
+ media/gpu/vaapi/BUILD.gn                      |  8 +-
+ media/gpu/vaapi/va_stub_header.fragment       |  6 +-
+ media/gpu/vaapi/vaapi_picture_factory.cc      | 72 ++++++++----------
+ .../vaapi_picture_native_pixmap_angle.cc      |  2 -
+ media/gpu/vaapi/vaapi_picture_tfp.cc          |  2 -
+ .../vaapi/vaapi_video_decode_accelerator.cc   |  9 +--
+ ...vaapi_video_decode_accelerator_unittest.cc | 11 +--
+ media/gpu/vaapi/vaapi_wrapper.cc              | 76 +++++++++----------
+ media/gpu/vaapi/vaapi_wrapper.h               |  8 +-
+ ui/ozone/platform/x11/ozone_platform_x11.cc   |  3 +
+ ui/ozone/public/ozone_platform.h              | 10 +++
+ 14 files changed, 108 insertions(+), 120 deletions(-)
+
+diff --git a/media/BUILD.gn b/media/BUILD.gn
+index dbee1d4338..d5c158c08f 100644
+--- a/media/BUILD.gn
++++ b/media/BUILD.gn
+@@ -130,9 +130,6 @@ component("media") {
+     public_deps += [ "//media/base/mac" ]
+   }
+ 
+-  if (use_x11) {
+-    deps += [ "//ui/base/x" ]
+-  }
+   if (use_ozone) {
+     deps += [ "//ui/ozone" ]
+   }
+diff --git a/media/gpu/BUILD.gn b/media/gpu/BUILD.gn
+index c7499485ac..3fedc78948 100644
+--- a/media/gpu/BUILD.gn
++++ b/media/gpu/BUILD.gn
+@@ -20,6 +20,7 @@ buildflag_header("buildflags") {
+     "USE_VAAPI_IMAGE_CODECS=$use_vaapi_image_codecs",
+     "USE_V4L2_CODEC=$use_v4l2_codec",
+     "USE_LIBV4L2=$use_v4lplugin",
++    "USE_VAAPI_X11=$use_vaapi_x11",
+   ]
+ }
+ 
+@@ -215,9 +216,7 @@ component("gpu") {
+       "windows/supported_profile_helpers.cc",
+       "windows/supported_profile_helpers.h",
+     ]
+-    configs += [
+-      "//third_party/khronos:khronos_headers",
+-    ]
++    configs += [ "//third_party/khronos:khronos_headers" ]
+     public_deps += [ "//media/base/win:media_foundation_util" ]
+     deps += [
+       "//gpu/ipc/common:common",
+diff --git a/media/gpu/args.gni b/media/gpu/args.gni
+index 4004937949..2f53843918 100644
+--- a/media/gpu/args.gni
++++ b/media/gpu/args.gni
+@@ -3,7 +3,15 @@
+ # found in the LICENSE file.
+ 
+ import("//build/config/chromeos/ui_mode.gni")
+-import("//build/config/ui.gni")
++import("//build/config/ozone.gni")
++
++declare_args() {
++  # Indicates if X11 VA-API-based hardware acceleration is to be used.
++  # See also the comment near the |use_vaapi| arg.
++  use_vaapi_x11 =
++      is_linux && ozone_platform_x11 && !is_chromecast && !is_chromeos_lacros &&
++      (target_cpu == "x86" || target_cpu == "x64")
++}
+ 
+ declare_args() {
+   # Indicates if V4L plugin is used.
+@@ -21,8 +29,7 @@ declare_args() {
+   # is typically the case on x86-based ChromeOS devices.
+   # VA-API should also be compiled by default on x11-using linux devices
+   # using x86/x64.
+-  use_vaapi =
+-      is_linux && use_x11 && (target_cpu == "x86" || target_cpu == "x64")
++  use_vaapi = use_vaapi_x11
+ 
+   # Indicates if ChromeOS protected media support exists. This is used
+   # to enable the CDM daemon in Chrome OS as well as support for
+diff --git a/media/gpu/vaapi/BUILD.gn b/media/gpu/vaapi/BUILD.gn
+index b11d2c60fa..0c2520dd6b 100644
+--- a/media/gpu/vaapi/BUILD.gn
++++ b/media/gpu/vaapi/BUILD.gn
+@@ -17,7 +17,7 @@ assert(use_vaapi)
+ generate_stubs("libva_stubs") {
+   extra_header = "va_stub_header.fragment"
+   sigs = [ "va.sigs" ]
+-  if (use_x11) {
++  if (use_vaapi_x11) {
+     sigs += [ "va_x11.sigs" ]
+   }
+   if (is_chromeos_ash) {
+@@ -131,14 +131,14 @@ source_set("vaapi") {
+     ]
+   }
+ 
+-  if (use_x11 || use_ozone || use_egl) {
++  if (use_ozone || use_egl) {
+     sources += [
+       "vaapi_picture_native_pixmap.cc",
+       "vaapi_picture_native_pixmap.h",
+     ]
+   }
+ 
+-  if (use_x11) {
++  if (use_vaapi_x11) {
+     deps += [ "//ui/gfx/x" ]
+     sources += [
+       "vaapi_picture_native_pixmap_angle.cc",
+@@ -197,7 +197,7 @@ source_set("common") {
+     deps += [ "//ui/ozone" ]
+   }
+ 
+-  if (use_x11) {
++  if (use_vaapi_x11) {
+     deps += [ "//ui/gfx/x" ]
+   }
+ 
+diff --git a/media/gpu/vaapi/va_stub_header.fragment b/media/gpu/vaapi/va_stub_header.fragment
+index bed198484d..e8c46c5e81 100644
+--- a/media/gpu/vaapi/va_stub_header.fragment
++++ b/media/gpu/vaapi/va_stub_header.fragment
+@@ -1,12 +1,14 @@
+ // The extra include header needed in the generated stub file for defining
+ // various libva types.
+ 
++#include "media/gpu/buildflags.h"
++
+ extern "C" {
+ 
+ #include <va/va_drm.h>
+ #include <va/va.h>
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+ #include <va/va_x11.h>
+-#endif
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ 
+ }
+diff --git a/media/gpu/vaapi/vaapi_picture_factory.cc b/media/gpu/vaapi/vaapi_picture_factory.cc
+index 719035b87c..9c7d7387d2 100644
+--- a/media/gpu/vaapi/vaapi_picture_factory.cc
++++ b/media/gpu/vaapi/vaapi_picture_factory.cc
+@@ -10,13 +10,13 @@
+ #include "ui/base/ui_base_features.h"
+ #include "ui/gl/gl_bindings.h"
+ 
+-#if defined(USE_X11)
+-#include "media/gpu/vaapi/vaapi_picture_native_pixmap_angle.h"
+-#include "media/gpu/vaapi/vaapi_picture_tfp.h"
+-#endif
+ #if defined(USE_OZONE)
+ #include "media/gpu/vaapi/vaapi_picture_native_pixmap_ozone.h"
+-#endif
++#endif  // defined(USE_OZONE)
++#if BUILDFLAG(USE_VAAPI_X11)
++#include "media/gpu/vaapi/vaapi_picture_native_pixmap_angle.h"
++#include "media/gpu/vaapi/vaapi_picture_tfp.h"
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ #if defined(USE_EGL)
+ #include "media/gpu/vaapi/vaapi_picture_native_pixmap_egl.h"
+ #endif
+@@ -46,15 +46,13 @@ VaapiPictureFactory::VaapiPictureFactory() {
+   vaapi_impl_pairs_.insert(
+       std::make_pair(gl::kGLImplementationEGLGLES2,
+                      VaapiPictureFactory::kVaapiImplementationDrm));
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+   vaapi_impl_pairs_.insert(
+       std::make_pair(gl::kGLImplementationEGLANGLE,
+                      VaapiPictureFactory::kVaapiImplementationAngle));
+-  if (!features::IsUsingOzonePlatform()) {
+-    vaapi_impl_pairs_.insert(
+-        std::make_pair(gl::kGLImplementationDesktopGL,
+-                       VaapiPictureFactory::kVaapiImplementationX11));
+-  }
++  vaapi_impl_pairs_.insert(
++      std::make_pair(gl::kGLImplementationDesktopGL,
++                     VaapiPictureFactory::kVaapiImplementationX11));
+ #endif
+ 
+   DeterminePictureCreationAndDownloadingMechanism();
+@@ -96,19 +94,19 @@ VaapiPictureFactory::GetVaapiImplementation(gl::GLImplementation gl_impl) {
+ }
+ 
+ uint32_t VaapiPictureFactory::GetGLTextureTarget() {
+-#if defined(USE_OZONE)
+-  if (features::IsUsingOzonePlatform())
+-    return GL_TEXTURE_EXTERNAL_OES;
+-#endif
++#if BUILDFLAG(USE_VAAPI_X11)
+   return GL_TEXTURE_2D;
++#else
++  return GL_TEXTURE_EXTERNAL_OES;
++#endif
+ }
+ 
+ gfx::BufferFormat VaapiPictureFactory::GetBufferFormat() {
+-#if defined(USE_OZONE)
+-  if (features::IsUsingOzonePlatform())
+-    return gfx::BufferFormat::YUV_420_BIPLANAR;
+-#endif
++#if BUILDFLAG(USE_VAAPI_X11)
+   return gfx::BufferFormat::RGBX_8888;
++#else
++  return gfx::BufferFormat::YUV_420_BIPLANAR;
++#endif
+ }
+ 
+ void VaapiPictureFactory::DeterminePictureCreationAndDownloadingMechanism() {
+@@ -116,51 +114,43 @@ void VaapiPictureFactory::DeterminePictureCreationAndDownloadingMechanism() {
+ #if defined(USE_OZONE)
+     // We can be called without GL initialized, which is valid if we use Ozone.
+     case kVaapiImplementationNone:
+-      if (features::IsUsingOzonePlatform()) {
+-        create_picture_cb_ = base::BindRepeating(
+-            &CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapOzone>);
+-        needs_vpp_for_downloading_ = true;
+-      }
+-
+-      // This is reached by unit tests which don't require create_picture_cb_
+-      // to be initialized or called.
++      create_picture_cb_ = base::BindRepeating(
++          &CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapOzone>);
++      needs_vpp_for_downloading_ = true;
+       break;
+ #endif  // defined(USE_OZONE)
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+     case kVaapiImplementationX11:
+-      DCHECK(!features::IsUsingOzonePlatform());
+       create_picture_cb_ =
+           base::BindRepeating(&CreateVaapiPictureNativeImpl<VaapiTFPPicture>);
+       // Neither VaapiTFPPicture or VaapiPictureNativePixmapAngle needs the VPP.
+       needs_vpp_for_downloading_ = false;
+       break;
+     case kVaapiImplementationAngle:
+-      DCHECK(!features::IsUsingOzonePlatform());
+       create_picture_cb_ = base::BindRepeating(
+           &CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapAngle>);
+       // Neither VaapiTFPPicture or VaapiPictureNativePixmapAngle needs the VPP.
+       needs_vpp_for_downloading_ = false;
+       break;
+-#endif  // defined(USE_X11)
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+     case kVaapiImplementationDrm:
+ #if defined(USE_OZONE)
+-      if (features::IsUsingOzonePlatform()) {
+-        create_picture_cb_ = base::BindRepeating(
+-            &CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapOzone>);
+-        needs_vpp_for_downloading_ = true;
+-        break;
+-      }
+-#endif  // defined(USE_OZONE)
+-#if defined(USE_EGL)
++      create_picture_cb_ = base::BindRepeating(
++          &CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapOzone>);
++      needs_vpp_for_downloading_ = true;
++      break;
++#elif defined(USE_EGL)
+       create_picture_cb_ = base::BindRepeating(
+           &CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapEgl>);
+       needs_vpp_for_downloading_ = true;
+       break;
+-#endif  // defined(USE_EGL)
++#else
+       // ozone or egl must be used to use the DRM implementation.
+-      NOTREACHED();
++      FALLTHROUGH;
++#endif
+     default:
+       NOTREACHED();
++      break;
+   }
+ }
+ 
+diff --git a/media/gpu/vaapi/vaapi_picture_native_pixmap_angle.cc b/media/gpu/vaapi/vaapi_picture_native_pixmap_angle.cc
+index 9de0c93b44..e5b9908490 100644
+--- a/media/gpu/vaapi/vaapi_picture_native_pixmap_angle.cc
++++ b/media/gpu/vaapi/vaapi_picture_native_pixmap_angle.cc
+@@ -6,7 +6,6 @@
+ 
+ #include "media/gpu/vaapi/va_surface.h"
+ #include "media/gpu/vaapi/vaapi_wrapper.h"
+-#include "ui/base/ui_base_features.h"
+ #include "ui/gfx/x/connection.h"
+ #include "ui/gfx/x/future.h"
+ #include "ui/gfx/x/xproto.h"
+@@ -92,7 +91,6 @@ Status VaapiPictureNativePixmapAngle::Allocate(gfx::BufferFormat format) {
+   if (!make_context_current_cb_ || !make_context_current_cb_.Run())
+     return StatusCode::kVaapiBadContext;
+ 
+-  DCHECK(!features::IsUsingOzonePlatform());
+   auto image =
+       base::MakeRefCounted<gl::GLImageEGLPixmap>(visible_size_, format);
+   if (!image)
+diff --git a/media/gpu/vaapi/vaapi_picture_tfp.cc b/media/gpu/vaapi/vaapi_picture_tfp.cc
+index 3f7e221d8a..11914e3640 100644
+--- a/media/gpu/vaapi/vaapi_picture_tfp.cc
++++ b/media/gpu/vaapi/vaapi_picture_tfp.cc
+@@ -6,7 +6,6 @@
+ 
+ #include "media/gpu/vaapi/va_surface.h"
+ #include "media/gpu/vaapi/vaapi_wrapper.h"
+-#include "ui/base/ui_base_features.h"
+ #include "ui/gfx/x/connection.h"
+ #include "ui/gfx/x/future.h"
+ #include "ui/gl/gl_bindings.h"
+@@ -37,7 +36,6 @@ VaapiTFPPicture::VaapiTFPPicture(
+       connection_(x11::Connection::Get()),
+       x_pixmap_(x11::Pixmap::None) {
+   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+-  DCHECK(!features::IsUsingOzonePlatform());
+   DCHECK(texture_id);
+   DCHECK(client_texture_id);
+ }
+diff --git a/media/gpu/vaapi/vaapi_video_decode_accelerator.cc b/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
+index 7514fe4fdd..e4cd7c8d89 100644
+--- a/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
++++ b/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
+@@ -184,12 +184,6 @@ bool VaapiVideoDecodeAccelerator::Initialize(const Config& config,
+                                              Client* client) {
+   DCHECK(task_runner_->BelongsToCurrentThread());
+ 
+-#if defined(USE_X11)
+-  // TODO(crbug/1116701): implement decode acceleration when running with Ozone.
+-  if (features::IsUsingOzonePlatform())
+-    return false;
+-#endif
+-
+   vaapi_picture_factory_ = std::make_unique<VaapiPictureFactory>();
+ 
+   if (config.is_encrypted()) {
+@@ -1213,12 +1207,11 @@ VaapiVideoDecodeAccelerator::GetSupportedProfiles() {
+ 
+ VaapiVideoDecodeAccelerator::BufferAllocationMode
+ VaapiVideoDecodeAccelerator::DecideBufferAllocationMode() {
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+   // The IMPORT mode is used for Android on Chrome OS, so this doesn't apply
+   // here.
+   DCHECK_NE(output_mode_, VideoDecodeAccelerator::Config::OutputMode::IMPORT);
+   // TODO(crbug/1116701): get video decode acceleration working with ozone.
+-  DCHECK(!features::IsUsingOzonePlatform());
+   // For H.264 on older devices, another +1 is experimentally needed for
+   // high-to-high resolution changes.
+   // TODO(mcasas): Figure out why and why only H264, see crbug.com/912295 and
+diff --git a/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc b/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc
+index 5b9a543386..826bb103b1 100644
+--- a/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc
++++ b/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc
+@@ -17,7 +17,6 @@
+ #include "media/gpu/vaapi/vaapi_wrapper.h"
+ #include "testing/gmock/include/gmock/gmock.h"
+ #include "testing/gtest/include/gtest/gtest.h"
+-#include "ui/base/ui_base_features.h"
+ 
+ using base::test::RunClosure;
+ using ::testing::_;
+@@ -416,12 +415,10 @@ TEST_P(VaapiVideoDecodeAcceleratorTest, SupportedPlatforms) {
+             mock_vaapi_picture_factory_->GetVaapiImplementation(
+                 gl::kGLImplementationEGLGLES2));
+ 
+-#if defined(USE_X11)
+-  if (!features::IsUsingOzonePlatform()) {
+-    EXPECT_EQ(VaapiPictureFactory::kVaapiImplementationX11,
+-              mock_vaapi_picture_factory_->GetVaapiImplementation(
+-                  gl::kGLImplementationDesktopGL));
+-  }
++#if BUILDFLAG(USE_VAAPI_X11)
++  EXPECT_EQ(VaapiPictureFactory::kVaapiImplementationX11,
++            mock_vaapi_picture_factory_->GetVaapiImplementation(
++                gl::kGLImplementationDesktopGL));
+ #endif
+ }
+ 
+diff --git a/media/gpu/vaapi/vaapi_wrapper.cc b/media/gpu/vaapi/vaapi_wrapper.cc
+index 754d258848..e528b0f84d 100644
+--- a/media/gpu/vaapi/vaapi_wrapper.cc
++++ b/media/gpu/vaapi/vaapi_wrapper.cc
+@@ -65,7 +65,7 @@
+ #include "ui/gl/gl_bindings.h"
+ #include "ui/gl/gl_implementation.h"
+ 
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+ typedef XID Drawable;
+ 
+ extern "C" {
+@@ -73,7 +73,7 @@ extern "C" {
+ }
+ 
+ #include "ui/gfx/x/connection.h"  // nogncheck
+-#endif
++#endif                            // BUILDFLAG(USE_VAAPI_X11)
+ 
+ #if defined(USE_OZONE)
+ #include "ui/ozone/public/ozone_platform.h"
+@@ -87,14 +87,14 @@ using media_gpu_vaapi::kModuleVa_prot;
+ 
+ using media_gpu_vaapi::kModuleVa;
+ using media_gpu_vaapi::kModuleVa_drm;
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+ using media_gpu_vaapi::kModuleVa_x11;
+-#endif
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ using media_gpu_vaapi::InitializeStubs;
+ using media_gpu_vaapi::IsVaInitialized;
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+ using media_gpu_vaapi::IsVa_x11Initialized;
+-#endif
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ using media_gpu_vaapi::IsVa_drmInitialized;
+ using media_gpu_vaapi::StubPathMap;
+ 
+@@ -559,10 +559,20 @@ VADisplayState::VADisplayState()
+ bool VADisplayState::Initialize() {
+   base::AutoLock auto_lock(va_lock_);
+ 
++#if defined(USE_OZONE) && defined(OS_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)
++    return false;
++#endif
++
+   bool libraries_initialized = IsVaInitialized() && IsVa_drmInitialized();
+-#if defined(USE_X11)
+-  if (!features::IsUsingOzonePlatform())
+-    libraries_initialized = libraries_initialized && IsVa_x11Initialized();
++#if BUILDFLAG(USE_VAAPI_X11)
++  libraries_initialized = libraries_initialized && IsVa_x11Initialized();
+ #endif
+   if (!libraries_initialized)
+     return false;
+@@ -577,34 +587,25 @@ bool VADisplayState::Initialize() {
+   return success;
+ }
+ 
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+ 
+ absl::optional<VADisplay> GetVADisplayStateX11(const base::ScopedFD& drm_fd) {
+-  bool use_drm_as_fallback = false;
+   switch (gl::GetGLImplementation()) {
+     case gl::kGLImplementationEGLGLES2:
+       return vaGetDisplayDRM(drm_fd.get());
+ 
+     case gl::kGLImplementationNone:
+-      use_drm_as_fallback = true;
+-      FALLTHROUGH;
+ 
+     case gl::kGLImplementationDesktopGL: {
+-      if (!features::IsUsingOzonePlatform()) {
+-        VADisplay display =
+-            vaGetDisplay(x11::Connection::Get()->GetXlibDisplay());
+-        if (vaDisplayIsValid(display))
+-          return display;
+-        return vaGetDisplayDRM(drm_fd.get());
+-      }
+-      break;
++      VADisplay display =
++          vaGetDisplay(x11::Connection::Get()->GetXlibDisplay());
++      if (vaDisplayIsValid(display))
++        return display;
++      return vaGetDisplayDRM(drm_fd.get());
+     }
+ 
+-    case gl::kGLImplementationEGLANGLE: {
+-      if (!features::IsUsingOzonePlatform())
+-        return vaGetDisplay(x11::Connection::Get()->GetXlibDisplay());
+-      break;
+-    }
++    case gl::kGLImplementationEGLANGLE:
++      return vaGetDisplay(x11::Connection::Get()->GetXlibDisplay());
+ 
+     default:
+       LOG(WARNING) << "VAAPI video acceleration not available for "
+@@ -612,10 +613,6 @@ absl::optional<VADisplay> GetVADisplayStateX11(const base::ScopedFD& drm_fd) {
+                           gl::GetGLImplementationParts());
+       return absl::nullopt;
+   }
+-
+-  if (use_drm_as_fallback)
+-    return vaGetDisplayDRM(drm_fd.get());
+-  return absl::nullopt;
+ }
+ 
+ #else
+@@ -633,11 +630,11 @@ absl::optional<VADisplay> GetVADisplayState(const base::ScopedFD& drm_fd) {
+   }
+ }
+ 
+-#endif  // defined(USE_X11)
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ 
+ bool VADisplayState::InitializeVaDisplay_Locked() {
+   absl::optional<VADisplay> display =
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+       GetVADisplayStateX11(drm_fd_);
+ #else
+       GetVADisplayState(drm_fd_);
+@@ -702,10 +699,9 @@ bool VADisplayState::InitializeOnce() {
+   if (!InitializeVaDisplay_Locked() || !InitializeVaDriver_Locked())
+     return false;
+ 
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+   if (gl::GetGLImplementation() == gl::kGLImplementationEGLANGLE &&
+       implementation_type_ == VAImplementation::kIntelIHD) {
+-    DCHECK(!features::IsUsingOzonePlatform());
+     constexpr char libva_driver_impl_env[] = "LIBVA_DRIVER_NAME";
+     // TODO(crbug/1116703) The libva intel-media driver has a known segfault in
+     // vaPutSurface, so until this is fixed, fall back to the i965 driver. There
+@@ -722,7 +718,7 @@ bool VADisplayState::InitializeOnce() {
+     if (!InitializeVaDisplay_Locked() || !InitializeVaDriver_Locked())
+       return false;
+   }
+-#endif  // USE_X11
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ 
+   return true;
+ }
+@@ -2452,11 +2448,10 @@ bool VaapiWrapper::MapAndCopyAndExecute(
+   return Execute_Locked(va_surface_id, va_buffer_ids);
+ }
+ 
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+ bool VaapiWrapper::PutSurfaceIntoPixmap(VASurfaceID va_surface_id,
+                                         x11::Pixmap x_pixmap,
+                                         gfx::Size dest_size) {
+-  DCHECK(!features::IsUsingOzonePlatform());
+   base::AutoLock auto_lock(*va_lock_);
+ 
+   VAStatus va_res = vaSyncSurface(va_display_, va_surface_id);
+@@ -2470,7 +2465,7 @@ bool VaapiWrapper::PutSurfaceIntoPixmap(VASurfaceID va_surface_id,
+   VA_SUCCESS_OR_RETURN(va_res, VaapiFunctions::kVAPutSurface, false);
+   return true;
+ }
+-#endif  // USE_X11
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ 
+ std::unique_ptr<ScopedVAImage> VaapiWrapper::CreateVaImage(
+     VASurfaceID va_surface_id,
+@@ -2844,9 +2839,8 @@ void VaapiWrapper::PreSandboxInitialization() {
+ 
+   paths[kModuleVa].push_back(std::string("libva.so.") + va_suffix);
+   paths[kModuleVa_drm].push_back(std::string("libva-drm.so.") + va_suffix);
+-#if defined(USE_X11)
+-  if (!features::IsUsingOzonePlatform())
+-    paths[kModuleVa_x11].push_back(std::string("libva-x11.so.") + va_suffix);
++#if BUILDFLAG(USE_VAAPI_X11)
++  paths[kModuleVa_x11].push_back(std::string("libva-x11.so.") + va_suffix);
+ #endif
+ #if BUILDFLAG(IS_CHROMEOS_ASH)
+   paths[kModuleVa_prot].push_back(std::string("libva.so.") + va_suffix);
+diff --git a/media/gpu/vaapi/vaapi_wrapper.h b/media/gpu/vaapi/vaapi_wrapper.h
+index 0e3da53624..88ffcd0799 100644
+--- a/media/gpu/vaapi/vaapi_wrapper.h
++++ b/media/gpu/vaapi/vaapi_wrapper.h
+@@ -36,9 +36,9 @@
+ #include "third_party/abseil-cpp/absl/types/optional.h"
+ #include "ui/gfx/geometry/size.h"
+ 
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+ #include "ui/gfx/x/xproto.h"  // nogncheck
+-#endif  // USE_X11
++#endif                        // BUILDFLAG(USE_VAAPI_X11)
+ 
+ namespace gfx {
+ enum class BufferFormat;
+@@ -426,13 +426,13 @@ class MEDIA_GPU_EXPORT VaapiWrapper
+       const std::vector<std::pair<VABufferID, VABufferDescriptor>>& va_buffers)
+       WARN_UNUSED_RESULT;
+ 
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+   // Put data from |va_surface_id| into |x_pixmap| of size
+   // |dest_size|, converting/scaling to it.
+   bool PutSurfaceIntoPixmap(VASurfaceID va_surface_id,
+                             x11::Pixmap x_pixmap,
+                             gfx::Size dest_size) WARN_UNUSED_RESULT;
+-#endif  // USE_X11
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ 
+   // 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 --git a/ui/ozone/platform/x11/ozone_platform_x11.cc b/ui/ozone/platform/x11/ozone_platform_x11.cc
+index 8889828e0f..963dc7a0cd 100644
+--- a/ui/ozone/platform/x11/ozone_platform_x11.cc
++++ b/ui/ozone/platform/x11/ozone_platform_x11.cc
+@@ -208,6 +208,9 @@ class OzonePlatformX11 : public OzonePlatform,
+       properties->supports_global_application_menus = true;
+       properties->app_modal_dialogs_use_event_blocker = true;
+       properties->fetch_buffer_formats_for_gmb_on_gpu = true;
++#if defined(OS_LINUX)
++      properties->supports_vaapi = true;
++#endif
+ 
+       initialised = true;
+     }
+diff --git a/ui/ozone/public/ozone_platform.h b/ui/ozone/public/ozone_platform.h
+index df95f07486..2d7f44bbfa 100644
+--- a/ui/ozone/public/ozone_platform.h
++++ b/ui/ozone/public/ozone_platform.h
+@@ -15,6 +15,7 @@
+ #include "base/macros.h"
+ #include "base/message_loop/message_pump_type.h"
+ #include "base/single_thread_task_runner.h"
++#include "build/build_config.h"
+ #include "mojo/public/cpp/bindings/binder_map.h"
+ #include "ui/gfx/buffer_types.h"
+ #include "ui/gfx/native_widget_types.h"
+@@ -154,6 +155,15 @@ class COMPONENT_EXPORT(OZONE) OzonePlatform {
+     // Determines whether buffer formats should be fetched on GPU and passed
+     // back via gpu extra info.
+     bool fetch_buffer_formats_for_gmb_on_gpu = false;
++
++#if defined(OS_LINUX)
++    // TODO(crbug.com/1116701): add vaapi support for other Ozone platforms on
++    // Linux. At the moment, VA-API Linux implementation supports only X11
++    // backend. This implementation must be refactored to support Ozone
++    // properly. As a temporary solution, VA-API on Linux checks if vaapi is
++    // supported (which implicitly means that it is Ozone/X11).
++    bool supports_vaapi = false;
++#endif
+   };
+ 
+   // Groups platform properties that can only be known at run time.
diff --git a/srcpkgs/chromium/template b/srcpkgs/chromium/template
index c57c29508dfc..dfe427489f8f 100644
--- a/srcpkgs/chromium/template
+++ b/srcpkgs/chromium/template
@@ -1,7 +1,7 @@
 # Template file for 'chromium'
 pkgname=chromium
 # See https://chromiumdash.appspot.com/releases?platform=Linux for the latest version
-version=94.0.4606.81
+version=95.0.4638.54
 revision=1
 archs="i686* x86_64* aarch64* armv7l* ppc64le*"
 short_desc="Google's attempt at creating a safer, faster, and more stable browser"
@@ -9,7 +9,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://www.chromium.org/"
 distfiles="https://commondatastorage.googleapis.com/chromium-browser-official/${pkgname}-${version}.tar.xz"
-checksum=7071aa2b2caf48094c2ae816395948b4daec940606f4982ad5bbf68e5d2de598
+checksum=3eef88d745e6ddaeaf507358f1510482d6f399cf335061bb1226a5f7120061fd
 nocross=yes
 
 lib32disabled=yes
@@ -51,15 +51,6 @@ post_patch() {
 		done
 	fi
 
-	case "${XBPS_TARGET_MACHINE}" in
-	i686*)
-		for f in "${FILESDIR}"/i686-patches/*.patch; do
-			echo "Applying $f"
-			patch -Np0 -i "$f"
-		done
-		;;
-	esac
-
 	# Use the file at run time instead of effectively compiling it in
 	sed 's|//third_party/usb_ids/usb.ids|/usr/share/hwdata/usb.ids|g' \
 		-i services/device/public/cpp/usb/BUILD.gn

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PR PATCH] [Updated] chromium: update to 95.0.4638.54.
  2021-10-20 22:14 [PR PATCH] chromium: update to 95.0.4638.54 Duncaen
                   ` (2 preceding siblings ...)
  2021-10-21 12:34 ` Duncaen
@ 2021-10-22 19:09 ` Duncaen
  2021-10-22 23:10 ` Duncaen
  2021-10-22 23:11 ` [PR PATCH] [Merged]: " Duncaen
  5 siblings, 0 replies; 7+ messages in thread
From: Duncaen @ 2021-10-22 19:09 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 391 bytes --]

There is an updated pull request by Duncaen against master on the void-packages repository

https://github.com/Duncaen/void-packages chromium-95
https://github.com/void-linux/void-packages/pull/33657

chromium: update to 95.0.4638.54.
[ci skip]

* [x] x86_64-glibc
* [x] x86_64-musl
* [x] i686


A patch file from https://github.com/void-linux/void-packages/pull/33657.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-chromium-95-33657.patch --]
[-- Type: text/x-diff, Size: 37584 bytes --]

From a262a19e5316ca28d234fd7f6b16cd8c1d6a47e8 Mon Sep 17 00:00:00 2001
From: Duncaen <duncaen@voidlinux.org>
Date: Thu, 21 Oct 2021 00:13:28 +0200
Subject: [PATCH] chromium: update to 95.0.4638.54.

---
 .../chromium-i686-vaapi-fpermissive.patch     |  22 -
 .../files/musl-patches/resolver.patch         |  13 +-
 .../musl-patches/xxx-ppc64le-support.patch    |  16 +-
 .../chromium-94-CustomSpaces-include.patch    |  24 -
 .../patches/chromium-95-harfbuzz-3.patch      |  31 +
 .../patches/chromium-95-quiche-include.patch  |  25 +
 .../chromium-i686-vaapi-fpermissive.patch     |  23 +
 .../fix-bits-stdint-intn-include.patch        |  11 +
 .../patches/ozone-x11-fix-VA-API.patch        | 671 ++++++++++++++++++
 srcpkgs/chromium/template                     |  13 +-
 10 files changed, 778 insertions(+), 71 deletions(-)
 delete mode 100644 srcpkgs/chromium/files/i686-patches/chromium-i686-vaapi-fpermissive.patch
 delete mode 100644 srcpkgs/chromium/patches/chromium-94-CustomSpaces-include.patch
 create mode 100644 srcpkgs/chromium/patches/chromium-95-harfbuzz-3.patch
 create mode 100644 srcpkgs/chromium/patches/chromium-95-quiche-include.patch
 create mode 100644 srcpkgs/chromium/patches/chromium-i686-vaapi-fpermissive.patch
 create mode 100644 srcpkgs/chromium/patches/fix-bits-stdint-intn-include.patch
 create mode 100644 srcpkgs/chromium/patches/ozone-x11-fix-VA-API.patch

diff --git a/srcpkgs/chromium/files/i686-patches/chromium-i686-vaapi-fpermissive.patch b/srcpkgs/chromium/files/i686-patches/chromium-i686-vaapi-fpermissive.patch
deleted file mode 100644
index b4d8787c4798..000000000000
--- a/srcpkgs/chromium/files/i686-patches/chromium-i686-vaapi-fpermissive.patch
+++ /dev/null
@@ -1,22 +0,0 @@
---- media/gpu/vaapi/BUILD.gn.orig	2019-06-18 11:48:14.000000000 -0400
-+++ media/gpu/vaapi/BUILD.gn	2019-07-02 18:34:00.607864854 -0400
-@@ -11,6 +11,10 @@
- 
- assert(use_vaapi)
- 
-+config("vaapi_permissive") {
-+  cflags = [ "-fpermissive" ]
-+}
-+
- generate_stubs("libva_stubs") {
-   extra_header = "va_stub_header.fragment"
-   sigs = [ "va.sigs" ]
-@@ -89,6 +93,8 @@
-     deps += [ "//media/gpu/linux" ]
-   }
- 
-+  configs += [ ":vaapi_permissive" ]
-+
-   if (use_x11) {
-     configs += [ "//build/config/linux:x11" ]
-     deps += [ "//ui/gfx/x" ]
diff --git a/srcpkgs/chromium/files/musl-patches/resolver.patch b/srcpkgs/chromium/files/musl-patches/resolver.patch
index fb8b0ddccda6..091d3f3e88ef 100644
--- a/srcpkgs/chromium/files/musl-patches/resolver.patch
+++ b/srcpkgs/chromium/files/musl-patches/resolver.patch
@@ -51,10 +51,12 @@
      UMA_HISTOGRAM_BOOLEAN("Net.DNS.DnsConfig.Resolv.Read",
                            dns_config_.has_value());
      if (!dns_config_.has_value())
-@@ -486,20 +480,11 @@
+--- net/dns/public/resolv_reader.cc.orig
++++ net/dns/public/resolv_reader.cc
+@@ -20,19 +20,10 @@
+ namespace net {
  
- std::unique_ptr<struct __res_state>
- DnsConfigServiceLinux::ResolvReader::GetResState() {
+ std::unique_ptr<struct __res_state> ResolvReader::GetResState() {
 -  auto res = std::make_unique<struct __res_state>();
 -  memset(res.get(), 0, sizeof(struct __res_state));
 -
@@ -67,9 +69,8 @@
 +  return nullptr;
  }
  
- void DnsConfigServiceLinux::ResolvReader::CloseResState(
-     struct __res_state* res) {
+ void ResolvReader::CloseResState(struct __res_state* res) {
 -  res_nclose(res);
  }
  
- DnsConfigServiceLinux::DnsConfigServiceLinux()
+ absl::optional<std::vector<IPEndPoint>> GetNameservers(
diff --git a/srcpkgs/chromium/files/musl-patches/xxx-ppc64le-support.patch b/srcpkgs/chromium/files/musl-patches/xxx-ppc64le-support.patch
index 9ea233ba6256..681b1f011c31 100644
--- a/srcpkgs/chromium/files/musl-patches/xxx-ppc64le-support.patch
+++ b/srcpkgs/chromium/files/musl-patches/xxx-ppc64le-support.patch
@@ -1,11 +1,11 @@
---- base/allocator/partition_allocator/partition_alloc_config.h	2021-05-25 00:05:31.000000000 +0200
-+++ -	2021-05-26 22:23:47.172940826 +0200
-@@ -88,7 +88,8 @@
- // PUT_REF_COUNT_IN_PREVIOUS_SLOT does. In this case the refcount overlaps with
- // the next pointer shadow for the smallest bucket.
- #if !(defined(OS_MAC) && defined(ARCH_CPU_ARM64)) && \
--    !BUILDFLAG(PUT_REF_COUNT_IN_PREVIOUS_SLOT)
-+    !BUILDFLAG(PUT_REF_COUNT_IN_PREVIOUS_SLOT) && \
+--- base/allocator/partition_allocator/partition_alloc_config.h.orig
++++ base/allocator/partition_allocator/partition_alloc_config.h
+@@ -114,7 +114,8 @@
+ // platforms complicates things. Note that Chromium is not officially supported
+ // on any big endian architecture as well.
+ #if !BUILDFLAG(PUT_REF_COUNT_IN_PREVIOUS_SLOT) && \
+-    defined(ARCH_CPU_LITTLE_ENDIAN)
++    defined(ARCH_CPU_LITTLE_ENDIAN) && \
 +    !defined(__powerpc64__)
  #define PA_HAS_FREELIST_HARDENING
  #endif
diff --git a/srcpkgs/chromium/patches/chromium-94-CustomSpaces-include.patch b/srcpkgs/chromium/patches/chromium-94-CustomSpaces-include.patch
deleted file mode 100644
index 01757758c1e2..000000000000
--- a/srcpkgs/chromium/patches/chromium-94-CustomSpaces-include.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From 4eeacdaa57b29a079fe09315eb22557c06aa522e Mon Sep 17 00:00:00 2001
-From: Stephan Hartmann <stha09@googlemail.com>
-Date: Fri, 13 Aug 2021 12:57:42 +0000
-Subject: [PATCH] IWYU: add memory for std::unique_ptr in blink::CustomSpaces
-
----
- .../blink/renderer/platform/heap/v8_wrapper/custom_spaces.h      | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/third_party/blink/renderer/platform/heap/v8_wrapper/custom_spaces.h b/third_party/blink/renderer/platform/heap/v8_wrapper/custom_spaces.h
-index df0465a..640cb33 100644
---- a/third_party/blink/renderer/platform/heap/v8_wrapper/custom_spaces.h
-+++ b/third_party/blink/renderer/platform/heap/v8_wrapper/custom_spaces.h
-@@ -5,6 +5,7 @@
- #ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_V8_WRAPPER_CUSTOM_SPACES_H_
- #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_V8_WRAPPER_CUSTOM_SPACES_H_
- 
-+#include <memory>
- #include <vector>
- 
- #include "third_party/blink/renderer/platform/platform_export.h"
--- 
-2.31.1
-
diff --git a/srcpkgs/chromium/patches/chromium-95-harfbuzz-3.patch b/srcpkgs/chromium/patches/chromium-95-harfbuzz-3.patch
new file mode 100644
index 000000000000..33fe9556aaf3
--- /dev/null
+++ b/srcpkgs/chromium/patches/chromium-95-harfbuzz-3.patch
@@ -0,0 +1,31 @@
+From 9e00e702633c47c590a869bc66b5c2ceec09da50 Mon Sep 17 00:00:00 2001
+From: Dominik Röttsches <drott@chromium.org>
+Date: Tue, 28 Sep 2021 15:31:50 +0000
+Subject: [PATCH] Roll src/third_party/harfbuzz-ng/src/ 6602cbb70..a52c6df38 (80 commits)
+
+Fixed: 1252284
+Change-Id: Ie2ff99da5e41ca97b8881e1bd3e158881f4d5a8e
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3190252
+Commit-Queue: Dominik Röttsches <drott@chromium.org>
+Commit-Queue: Calder Kitagawa <ckitagawa@chromium.org>
+Auto-Submit: Dominik Röttsches <drott@chromium.org>
+Reviewed-by: Calder Kitagawa <ckitagawa@chromium.org>
+Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org>
+Cr-Commit-Position: refs/heads/main@{#925776}
+
+(only components/paint_preview/common/subset_font.cc)
+---
+
+diff --git a/components/paint_preview/common/subset_font.cc b/components/paint_preview/common/subset_font.cc
+index 45daea7b1..43a448e 100644
+--- a/components/paint_preview/common/subset_font.cc
++++ b/components/paint_preview/common/subset_font.cc
+@@ -79,7 +79,7 @@
+   // Retain all variation information for OpenType variation fonts. See:
+   // https://docs.microsoft.com/en-us/typography/opentype/spec/otvaroverview
+   hb_set_t* skip_subset =
+-      hb_subset_input_no_subset_tables_set(input.get());  // Owned by |input|.
++      hb_subset_input_set(input.get(), HB_SUBSET_SETS_NO_SUBSET_TABLE_TAG);
+   hb_set_add(skip_subset, HB_TAG('a', 'v', 'a', 'r'));
+   hb_set_add(skip_subset, HB_TAG('c', 'v', 'a', 'r'));
+   hb_set_add(skip_subset, HB_TAG('f', 'v', 'a', 'r'));
diff --git a/srcpkgs/chromium/patches/chromium-95-quiche-include.patch b/srcpkgs/chromium/patches/chromium-95-quiche-include.patch
new file mode 100644
index 000000000000..4bbd45cfc094
--- /dev/null
+++ b/srcpkgs/chromium/patches/chromium-95-quiche-include.patch
@@ -0,0 +1,25 @@
+From a9d986203bcfbaab84f270c1dc6c3abb4c450ee1 Mon Sep 17 00:00:00 2001
+From: Stephan Hartmann <stha09@googlemail.com>
+Date: Fri, 17 Sep 2021 14:57:33 +0000
+Subject: [PATCH] IWYU: add stddef.h for size_t in WindowManager
+
+---
+ net/third_party/quiche/src/http2/adapter/window_manager.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/net/third_party/quiche/src/http2/adapter/window_manager.h b/net/third_party/quiche/src/http2/adapter/window_manager.h
+index f15982d..5a7701e 100644
+--- a/net/third_party/quiche/src/http2/adapter/window_manager.h
++++ b/net/third_party/quiche/src/http2/adapter/window_manager.h
+@@ -1,6 +1,8 @@
+ #ifndef QUICHE_HTTP2_ADAPTER_WINDOW_MANAGER_H_
+ #define QUICHE_HTTP2_ADAPTER_WINDOW_MANAGER_H_
+ 
++#include <stddef.h>
++
+ #include <functional>
+ 
+ #include "common/platform/api/quiche_export.h"
+-- 
+2.32.0
+
diff --git a/srcpkgs/chromium/patches/chromium-i686-vaapi-fpermissive.patch b/srcpkgs/chromium/patches/chromium-i686-vaapi-fpermissive.patch
new file mode 100644
index 000000000000..77c0b58c94e1
--- /dev/null
+++ b/srcpkgs/chromium/patches/chromium-i686-vaapi-fpermissive.patch
@@ -0,0 +1,23 @@
+--- a/media/gpu/vaapi/BUILD.gn.orig
++++ b/media/gpu/vaapi/BUILD.gn
+@@ -14,6 +14,12 @@
+ assert(is_linux || is_chromeos)
+ assert(use_vaapi)
+ 
++config("vaapi_permissive") {
++  if (target_cpu == "x86") {
++    cflags = [ "-fpermissive" ]
++  }
++}
++
+ generate_stubs("libva_stubs") {
+   extra_header = "va_stub_header.fragment"
+   sigs = [ "va.sigs" ]
+@@ -90,6 +96,7 @@
+   configs += [
+     "//build/config/linux/libva",
+     "//third_party/libvpx:libvpx_config",
++    ":vaapi_permissive",
+   ]
+ 
+   deps = [
diff --git a/srcpkgs/chromium/patches/fix-bits-stdint-intn-include.patch b/srcpkgs/chromium/patches/fix-bits-stdint-intn-include.patch
new file mode 100644
index 000000000000..978cd6a493d6
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-bits-stdint-intn-include.patch
@@ -0,0 +1,11 @@
+--- a/ui/ozone/platform/wayland/host/wayland_window.cc.orig
++++ b/ui/ozone/platform/wayland/host/wayland_window.cc
+@@ -4,7 +4,7 @@
+ 
+ #include "ui/ozone/platform/wayland/host/wayland_window.h"
+ 
+-#include <bits/stdint-intn.h>
++#include <stdint.h>
+ #include <wayland-cursor.h>
+ #include <algorithm>
+ #include <memory>
diff --git a/srcpkgs/chromium/patches/ozone-x11-fix-VA-API.patch b/srcpkgs/chromium/patches/ozone-x11-fix-VA-API.patch
new file mode 100644
index 000000000000..61d72bfb0137
--- /dev/null
+++ b/srcpkgs/chromium/patches/ozone-x11-fix-VA-API.patch
@@ -0,0 +1,671 @@
+From a4de986102a45e29c3ef596f22704bdca244c26c Mon Sep 17 00:00:00 2001
+From: Maksim Sisov <msisov@igalia.com>
+Date: Fri, 17 Sep 2021 08:45:55 +0000
+Subject: [PATCH] ozone/x11: fix VA-API.
+
+This patch fixes VA-API usage with Ozone/X11 backend (which
+is our default backend now as X11 has been deprecated -
+crrev.com/c/3114071)).
+
+non-Ozone X11 is disabled now and Ozone is always used
+on Linux. However, VA-API implementation is not Ozone friendly
+yet and requires major refactoring. But given that VA-API
+implementation on Linux worked only with X11, it's fine for
+now to change USE_X11 and !IsUsingOzonePlatform to
+BUILDFLAG(OZONE_PLATFORM_X11) and fail VA-API initialization
+in VADisplayState::Initialize for Ozone/Linux other than
+non-X11 backends.
+
+Bug: 1121948
+Change-Id: If85d289235e6d358103d9fa2bbe0f741fb599a26
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3141878
+Commit-Queue: Maksim Sisov <msisov@igalia.com>
+Reviewed-by: Andres Calderon Jaramillo <andrescj@chromium.org>
+Reviewed-by: Robert Kroeger <rjkroege@chromium.org>
+Reviewed-by: Xiaohan Wang <xhwang@chromium.org>
+Reviewed-by: Alexander Dunaev <adunaev@igalia.com>
+Cr-Commit-Position: refs/heads/main@{#922466}
+---
+ media/BUILD.gn                                |  3 -
+ media/gpu/BUILD.gn                            |  5 +-
+ media/gpu/args.gni                            | 13 +++-
+ media/gpu/vaapi/BUILD.gn                      |  8 +-
+ media/gpu/vaapi/va_stub_header.fragment       |  6 +-
+ media/gpu/vaapi/vaapi_picture_factory.cc      | 72 ++++++++----------
+ .../vaapi_picture_native_pixmap_angle.cc      |  2 -
+ media/gpu/vaapi/vaapi_picture_tfp.cc          |  2 -
+ .../vaapi/vaapi_video_decode_accelerator.cc   |  9 +--
+ ...vaapi_video_decode_accelerator_unittest.cc | 11 +--
+ media/gpu/vaapi/vaapi_wrapper.cc              | 76 +++++++++----------
+ media/gpu/vaapi/vaapi_wrapper.h               |  8 +-
+ ui/ozone/platform/x11/ozone_platform_x11.cc   |  3 +
+ ui/ozone/public/ozone_platform.h              | 10 +++
+ 14 files changed, 108 insertions(+), 120 deletions(-)
+
+diff --git a/media/BUILD.gn b/media/BUILD.gn
+index dbee1d4338..d5c158c08f 100644
+--- a/media/BUILD.gn
++++ b/media/BUILD.gn
+@@ -130,9 +130,6 @@ component("media") {
+     public_deps += [ "//media/base/mac" ]
+   }
+ 
+-  if (use_x11) {
+-    deps += [ "//ui/base/x" ]
+-  }
+   if (use_ozone) {
+     deps += [ "//ui/ozone" ]
+   }
+diff --git a/media/gpu/BUILD.gn b/media/gpu/BUILD.gn
+index c7499485ac..3fedc78948 100644
+--- a/media/gpu/BUILD.gn
++++ b/media/gpu/BUILD.gn
+@@ -20,6 +20,7 @@ buildflag_header("buildflags") {
+     "USE_VAAPI_IMAGE_CODECS=$use_vaapi_image_codecs",
+     "USE_V4L2_CODEC=$use_v4l2_codec",
+     "USE_LIBV4L2=$use_v4lplugin",
++    "USE_VAAPI_X11=$use_vaapi_x11",
+   ]
+ }
+ 
+@@ -215,9 +216,7 @@ component("gpu") {
+       "windows/supported_profile_helpers.cc",
+       "windows/supported_profile_helpers.h",
+     ]
+-    configs += [
+-      "//third_party/khronos:khronos_headers",
+-    ]
++    configs += [ "//third_party/khronos:khronos_headers" ]
+     public_deps += [ "//media/base/win:media_foundation_util" ]
+     deps += [
+       "//gpu/ipc/common:common",
+diff --git a/media/gpu/args.gni b/media/gpu/args.gni
+index 4004937949..2f53843918 100644
+--- a/media/gpu/args.gni
++++ b/media/gpu/args.gni
+@@ -3,7 +3,15 @@
+ # found in the LICENSE file.
+ 
+ import("//build/config/chromeos/ui_mode.gni")
+-import("//build/config/ui.gni")
++import("//build/config/ozone.gni")
++
++declare_args() {
++  # Indicates if X11 VA-API-based hardware acceleration is to be used.
++  # See also the comment near the |use_vaapi| arg.
++  use_vaapi_x11 =
++      is_linux && ozone_platform_x11 && !is_chromecast && !is_chromeos_lacros &&
++      (target_cpu == "x86" || target_cpu == "x64")
++}
+ 
+ declare_args() {
+   # Indicates if V4L plugin is used.
+@@ -21,8 +29,7 @@ declare_args() {
+   # is typically the case on x86-based ChromeOS devices.
+   # VA-API should also be compiled by default on x11-using linux devices
+   # using x86/x64.
+-  use_vaapi =
+-      is_linux && use_x11 && (target_cpu == "x86" || target_cpu == "x64")
++  use_vaapi = use_vaapi_x11
+ 
+   # Indicates if ChromeOS protected media support exists. This is used
+   # to enable the CDM daemon in Chrome OS as well as support for
+diff --git a/media/gpu/vaapi/BUILD.gn b/media/gpu/vaapi/BUILD.gn
+index b11d2c60fa..0c2520dd6b 100644
+--- a/media/gpu/vaapi/BUILD.gn
++++ b/media/gpu/vaapi/BUILD.gn
+@@ -17,7 +17,7 @@ assert(use_vaapi)
+ generate_stubs("libva_stubs") {
+   extra_header = "va_stub_header.fragment"
+   sigs = [ "va.sigs" ]
+-  if (use_x11) {
++  if (use_vaapi_x11) {
+     sigs += [ "va_x11.sigs" ]
+   }
+   if (is_chromeos_ash) {
+@@ -131,14 +131,14 @@ source_set("vaapi") {
+     ]
+   }
+ 
+-  if (use_x11 || use_ozone || use_egl) {
++  if (use_ozone || use_egl) {
+     sources += [
+       "vaapi_picture_native_pixmap.cc",
+       "vaapi_picture_native_pixmap.h",
+     ]
+   }
+ 
+-  if (use_x11) {
++  if (use_vaapi_x11) {
+     deps += [ "//ui/gfx/x" ]
+     sources += [
+       "vaapi_picture_native_pixmap_angle.cc",
+@@ -197,7 +197,7 @@ source_set("common") {
+     deps += [ "//ui/ozone" ]
+   }
+ 
+-  if (use_x11) {
++  if (use_vaapi_x11) {
+     deps += [ "//ui/gfx/x" ]
+   }
+ 
+diff --git a/media/gpu/vaapi/va_stub_header.fragment b/media/gpu/vaapi/va_stub_header.fragment
+index bed198484d..e8c46c5e81 100644
+--- a/media/gpu/vaapi/va_stub_header.fragment
++++ b/media/gpu/vaapi/va_stub_header.fragment
+@@ -1,12 +1,14 @@
+ // The extra include header needed in the generated stub file for defining
+ // various libva types.
+ 
++#include "media/gpu/buildflags.h"
++
+ extern "C" {
+ 
+ #include <va/va_drm.h>
+ #include <va/va.h>
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+ #include <va/va_x11.h>
+-#endif
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ 
+ }
+diff --git a/media/gpu/vaapi/vaapi_picture_factory.cc b/media/gpu/vaapi/vaapi_picture_factory.cc
+index 719035b87c..9c7d7387d2 100644
+--- a/media/gpu/vaapi/vaapi_picture_factory.cc
++++ b/media/gpu/vaapi/vaapi_picture_factory.cc
+@@ -10,13 +10,13 @@
+ #include "ui/base/ui_base_features.h"
+ #include "ui/gl/gl_bindings.h"
+ 
+-#if defined(USE_X11)
+-#include "media/gpu/vaapi/vaapi_picture_native_pixmap_angle.h"
+-#include "media/gpu/vaapi/vaapi_picture_tfp.h"
+-#endif
+ #if defined(USE_OZONE)
+ #include "media/gpu/vaapi/vaapi_picture_native_pixmap_ozone.h"
+-#endif
++#endif  // defined(USE_OZONE)
++#if BUILDFLAG(USE_VAAPI_X11)
++#include "media/gpu/vaapi/vaapi_picture_native_pixmap_angle.h"
++#include "media/gpu/vaapi/vaapi_picture_tfp.h"
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ #if defined(USE_EGL)
+ #include "media/gpu/vaapi/vaapi_picture_native_pixmap_egl.h"
+ #endif
+@@ -46,15 +46,13 @@ VaapiPictureFactory::VaapiPictureFactory() {
+   vaapi_impl_pairs_.insert(
+       std::make_pair(gl::kGLImplementationEGLGLES2,
+                      VaapiPictureFactory::kVaapiImplementationDrm));
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+   vaapi_impl_pairs_.insert(
+       std::make_pair(gl::kGLImplementationEGLANGLE,
+                      VaapiPictureFactory::kVaapiImplementationAngle));
+-  if (!features::IsUsingOzonePlatform()) {
+-    vaapi_impl_pairs_.insert(
+-        std::make_pair(gl::kGLImplementationDesktopGL,
+-                       VaapiPictureFactory::kVaapiImplementationX11));
+-  }
++  vaapi_impl_pairs_.insert(
++      std::make_pair(gl::kGLImplementationDesktopGL,
++                     VaapiPictureFactory::kVaapiImplementationX11));
+ #endif
+ 
+   DeterminePictureCreationAndDownloadingMechanism();
+@@ -96,19 +94,19 @@ VaapiPictureFactory::GetVaapiImplementation(gl::GLImplementation gl_impl) {
+ }
+ 
+ uint32_t VaapiPictureFactory::GetGLTextureTarget() {
+-#if defined(USE_OZONE)
+-  if (features::IsUsingOzonePlatform())
+-    return GL_TEXTURE_EXTERNAL_OES;
+-#endif
++#if BUILDFLAG(USE_VAAPI_X11)
+   return GL_TEXTURE_2D;
++#else
++  return GL_TEXTURE_EXTERNAL_OES;
++#endif
+ }
+ 
+ gfx::BufferFormat VaapiPictureFactory::GetBufferFormat() {
+-#if defined(USE_OZONE)
+-  if (features::IsUsingOzonePlatform())
+-    return gfx::BufferFormat::YUV_420_BIPLANAR;
+-#endif
++#if BUILDFLAG(USE_VAAPI_X11)
+   return gfx::BufferFormat::RGBX_8888;
++#else
++  return gfx::BufferFormat::YUV_420_BIPLANAR;
++#endif
+ }
+ 
+ void VaapiPictureFactory::DeterminePictureCreationAndDownloadingMechanism() {
+@@ -116,51 +114,43 @@ void VaapiPictureFactory::DeterminePictureCreationAndDownloadingMechanism() {
+ #if defined(USE_OZONE)
+     // We can be called without GL initialized, which is valid if we use Ozone.
+     case kVaapiImplementationNone:
+-      if (features::IsUsingOzonePlatform()) {
+-        create_picture_cb_ = base::BindRepeating(
+-            &CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapOzone>);
+-        needs_vpp_for_downloading_ = true;
+-      }
+-
+-      // This is reached by unit tests which don't require create_picture_cb_
+-      // to be initialized or called.
++      create_picture_cb_ = base::BindRepeating(
++          &CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapOzone>);
++      needs_vpp_for_downloading_ = true;
+       break;
+ #endif  // defined(USE_OZONE)
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+     case kVaapiImplementationX11:
+-      DCHECK(!features::IsUsingOzonePlatform());
+       create_picture_cb_ =
+           base::BindRepeating(&CreateVaapiPictureNativeImpl<VaapiTFPPicture>);
+       // Neither VaapiTFPPicture or VaapiPictureNativePixmapAngle needs the VPP.
+       needs_vpp_for_downloading_ = false;
+       break;
+     case kVaapiImplementationAngle:
+-      DCHECK(!features::IsUsingOzonePlatform());
+       create_picture_cb_ = base::BindRepeating(
+           &CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapAngle>);
+       // Neither VaapiTFPPicture or VaapiPictureNativePixmapAngle needs the VPP.
+       needs_vpp_for_downloading_ = false;
+       break;
+-#endif  // defined(USE_X11)
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+     case kVaapiImplementationDrm:
+ #if defined(USE_OZONE)
+-      if (features::IsUsingOzonePlatform()) {
+-        create_picture_cb_ = base::BindRepeating(
+-            &CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapOzone>);
+-        needs_vpp_for_downloading_ = true;
+-        break;
+-      }
+-#endif  // defined(USE_OZONE)
+-#if defined(USE_EGL)
++      create_picture_cb_ = base::BindRepeating(
++          &CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapOzone>);
++      needs_vpp_for_downloading_ = true;
++      break;
++#elif defined(USE_EGL)
+       create_picture_cb_ = base::BindRepeating(
+           &CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapEgl>);
+       needs_vpp_for_downloading_ = true;
+       break;
+-#endif  // defined(USE_EGL)
++#else
+       // ozone or egl must be used to use the DRM implementation.
+-      NOTREACHED();
++      FALLTHROUGH;
++#endif
+     default:
+       NOTREACHED();
++      break;
+   }
+ }
+ 
+diff --git a/media/gpu/vaapi/vaapi_picture_native_pixmap_angle.cc b/media/gpu/vaapi/vaapi_picture_native_pixmap_angle.cc
+index 9de0c93b44..e5b9908490 100644
+--- a/media/gpu/vaapi/vaapi_picture_native_pixmap_angle.cc
++++ b/media/gpu/vaapi/vaapi_picture_native_pixmap_angle.cc
+@@ -6,7 +6,6 @@
+ 
+ #include "media/gpu/vaapi/va_surface.h"
+ #include "media/gpu/vaapi/vaapi_wrapper.h"
+-#include "ui/base/ui_base_features.h"
+ #include "ui/gfx/x/connection.h"
+ #include "ui/gfx/x/future.h"
+ #include "ui/gfx/x/xproto.h"
+@@ -92,7 +91,6 @@ Status VaapiPictureNativePixmapAngle::Allocate(gfx::BufferFormat format) {
+   if (!make_context_current_cb_ || !make_context_current_cb_.Run())
+     return StatusCode::kVaapiBadContext;
+ 
+-  DCHECK(!features::IsUsingOzonePlatform());
+   auto image =
+       base::MakeRefCounted<gl::GLImageEGLPixmap>(visible_size_, format);
+   if (!image)
+diff --git a/media/gpu/vaapi/vaapi_picture_tfp.cc b/media/gpu/vaapi/vaapi_picture_tfp.cc
+index 3f7e221d8a..11914e3640 100644
+--- a/media/gpu/vaapi/vaapi_picture_tfp.cc
++++ b/media/gpu/vaapi/vaapi_picture_tfp.cc
+@@ -6,7 +6,6 @@
+ 
+ #include "media/gpu/vaapi/va_surface.h"
+ #include "media/gpu/vaapi/vaapi_wrapper.h"
+-#include "ui/base/ui_base_features.h"
+ #include "ui/gfx/x/connection.h"
+ #include "ui/gfx/x/future.h"
+ #include "ui/gl/gl_bindings.h"
+@@ -37,7 +36,6 @@ VaapiTFPPicture::VaapiTFPPicture(
+       connection_(x11::Connection::Get()),
+       x_pixmap_(x11::Pixmap::None) {
+   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+-  DCHECK(!features::IsUsingOzonePlatform());
+   DCHECK(texture_id);
+   DCHECK(client_texture_id);
+ }
+diff --git a/media/gpu/vaapi/vaapi_video_decode_accelerator.cc b/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
+index 7514fe4fdd..e4cd7c8d89 100644
+--- a/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
++++ b/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
+@@ -184,12 +184,6 @@ bool VaapiVideoDecodeAccelerator::Initialize(const Config& config,
+                                              Client* client) {
+   DCHECK(task_runner_->BelongsToCurrentThread());
+ 
+-#if defined(USE_X11)
+-  // TODO(crbug/1116701): implement decode acceleration when running with Ozone.
+-  if (features::IsUsingOzonePlatform())
+-    return false;
+-#endif
+-
+   vaapi_picture_factory_ = std::make_unique<VaapiPictureFactory>();
+ 
+   if (config.is_encrypted()) {
+@@ -1213,12 +1207,11 @@ VaapiVideoDecodeAccelerator::GetSupportedProfiles() {
+ 
+ VaapiVideoDecodeAccelerator::BufferAllocationMode
+ VaapiVideoDecodeAccelerator::DecideBufferAllocationMode() {
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+   // The IMPORT mode is used for Android on Chrome OS, so this doesn't apply
+   // here.
+   DCHECK_NE(output_mode_, VideoDecodeAccelerator::Config::OutputMode::IMPORT);
+   // TODO(crbug/1116701): get video decode acceleration working with ozone.
+-  DCHECK(!features::IsUsingOzonePlatform());
+   // For H.264 on older devices, another +1 is experimentally needed for
+   // high-to-high resolution changes.
+   // TODO(mcasas): Figure out why and why only H264, see crbug.com/912295 and
+diff --git a/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc b/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc
+index 5b9a543386..826bb103b1 100644
+--- a/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc
++++ b/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc
+@@ -17,7 +17,6 @@
+ #include "media/gpu/vaapi/vaapi_wrapper.h"
+ #include "testing/gmock/include/gmock/gmock.h"
+ #include "testing/gtest/include/gtest/gtest.h"
+-#include "ui/base/ui_base_features.h"
+ 
+ using base::test::RunClosure;
+ using ::testing::_;
+@@ -416,12 +415,10 @@ TEST_P(VaapiVideoDecodeAcceleratorTest, SupportedPlatforms) {
+             mock_vaapi_picture_factory_->GetVaapiImplementation(
+                 gl::kGLImplementationEGLGLES2));
+ 
+-#if defined(USE_X11)
+-  if (!features::IsUsingOzonePlatform()) {
+-    EXPECT_EQ(VaapiPictureFactory::kVaapiImplementationX11,
+-              mock_vaapi_picture_factory_->GetVaapiImplementation(
+-                  gl::kGLImplementationDesktopGL));
+-  }
++#if BUILDFLAG(USE_VAAPI_X11)
++  EXPECT_EQ(VaapiPictureFactory::kVaapiImplementationX11,
++            mock_vaapi_picture_factory_->GetVaapiImplementation(
++                gl::kGLImplementationDesktopGL));
+ #endif
+ }
+ 
+diff --git a/media/gpu/vaapi/vaapi_wrapper.cc b/media/gpu/vaapi/vaapi_wrapper.cc
+index 754d258848..e528b0f84d 100644
+--- a/media/gpu/vaapi/vaapi_wrapper.cc
++++ b/media/gpu/vaapi/vaapi_wrapper.cc
+@@ -65,7 +65,7 @@
+ #include "ui/gl/gl_bindings.h"
+ #include "ui/gl/gl_implementation.h"
+ 
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+ typedef XID Drawable;
+ 
+ extern "C" {
+@@ -73,7 +73,7 @@ extern "C" {
+ }
+ 
+ #include "ui/gfx/x/connection.h"  // nogncheck
+-#endif
++#endif                            // BUILDFLAG(USE_VAAPI_X11)
+ 
+ #if defined(USE_OZONE)
+ #include "ui/ozone/public/ozone_platform.h"
+@@ -87,14 +87,14 @@ using media_gpu_vaapi::kModuleVa_prot;
+ 
+ using media_gpu_vaapi::kModuleVa;
+ using media_gpu_vaapi::kModuleVa_drm;
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+ using media_gpu_vaapi::kModuleVa_x11;
+-#endif
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ using media_gpu_vaapi::InitializeStubs;
+ using media_gpu_vaapi::IsVaInitialized;
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+ using media_gpu_vaapi::IsVa_x11Initialized;
+-#endif
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ using media_gpu_vaapi::IsVa_drmInitialized;
+ using media_gpu_vaapi::StubPathMap;
+ 
+@@ -559,10 +559,20 @@ VADisplayState::VADisplayState()
+ bool VADisplayState::Initialize() {
+   base::AutoLock auto_lock(va_lock_);
+ 
++#if defined(USE_OZONE) && defined(OS_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)
++    return false;
++#endif
++
+   bool libraries_initialized = IsVaInitialized() && IsVa_drmInitialized();
+-#if defined(USE_X11)
+-  if (!features::IsUsingOzonePlatform())
+-    libraries_initialized = libraries_initialized && IsVa_x11Initialized();
++#if BUILDFLAG(USE_VAAPI_X11)
++  libraries_initialized = libraries_initialized && IsVa_x11Initialized();
+ #endif
+   if (!libraries_initialized)
+     return false;
+@@ -577,34 +587,25 @@ bool VADisplayState::Initialize() {
+   return success;
+ }
+ 
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+ 
+ absl::optional<VADisplay> GetVADisplayStateX11(const base::ScopedFD& drm_fd) {
+-  bool use_drm_as_fallback = false;
+   switch (gl::GetGLImplementation()) {
+     case gl::kGLImplementationEGLGLES2:
+       return vaGetDisplayDRM(drm_fd.get());
+ 
+     case gl::kGLImplementationNone:
+-      use_drm_as_fallback = true;
+-      FALLTHROUGH;
+ 
+     case gl::kGLImplementationDesktopGL: {
+-      if (!features::IsUsingOzonePlatform()) {
+-        VADisplay display =
+-            vaGetDisplay(x11::Connection::Get()->GetXlibDisplay());
+-        if (vaDisplayIsValid(display))
+-          return display;
+-        return vaGetDisplayDRM(drm_fd.get());
+-      }
+-      break;
++      VADisplay display =
++          vaGetDisplay(x11::Connection::Get()->GetXlibDisplay());
++      if (vaDisplayIsValid(display))
++        return display;
++      return vaGetDisplayDRM(drm_fd.get());
+     }
+ 
+-    case gl::kGLImplementationEGLANGLE: {
+-      if (!features::IsUsingOzonePlatform())
+-        return vaGetDisplay(x11::Connection::Get()->GetXlibDisplay());
+-      break;
+-    }
++    case gl::kGLImplementationEGLANGLE:
++      return vaGetDisplay(x11::Connection::Get()->GetXlibDisplay());
+ 
+     default:
+       LOG(WARNING) << "VAAPI video acceleration not available for "
+@@ -612,10 +613,6 @@ absl::optional<VADisplay> GetVADisplayStateX11(const base::ScopedFD& drm_fd) {
+                           gl::GetGLImplementationParts());
+       return absl::nullopt;
+   }
+-
+-  if (use_drm_as_fallback)
+-    return vaGetDisplayDRM(drm_fd.get());
+-  return absl::nullopt;
+ }
+ 
+ #else
+@@ -633,11 +630,11 @@ absl::optional<VADisplay> GetVADisplayState(const base::ScopedFD& drm_fd) {
+   }
+ }
+ 
+-#endif  // defined(USE_X11)
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ 
+ bool VADisplayState::InitializeVaDisplay_Locked() {
+   absl::optional<VADisplay> display =
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+       GetVADisplayStateX11(drm_fd_);
+ #else
+       GetVADisplayState(drm_fd_);
+@@ -702,10 +699,9 @@ bool VADisplayState::InitializeOnce() {
+   if (!InitializeVaDisplay_Locked() || !InitializeVaDriver_Locked())
+     return false;
+ 
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+   if (gl::GetGLImplementation() == gl::kGLImplementationEGLANGLE &&
+       implementation_type_ == VAImplementation::kIntelIHD) {
+-    DCHECK(!features::IsUsingOzonePlatform());
+     constexpr char libva_driver_impl_env[] = "LIBVA_DRIVER_NAME";
+     // TODO(crbug/1116703) The libva intel-media driver has a known segfault in
+     // vaPutSurface, so until this is fixed, fall back to the i965 driver. There
+@@ -722,7 +718,7 @@ bool VADisplayState::InitializeOnce() {
+     if (!InitializeVaDisplay_Locked() || !InitializeVaDriver_Locked())
+       return false;
+   }
+-#endif  // USE_X11
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ 
+   return true;
+ }
+@@ -2452,11 +2448,10 @@ bool VaapiWrapper::MapAndCopyAndExecute(
+   return Execute_Locked(va_surface_id, va_buffer_ids);
+ }
+ 
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+ bool VaapiWrapper::PutSurfaceIntoPixmap(VASurfaceID va_surface_id,
+                                         x11::Pixmap x_pixmap,
+                                         gfx::Size dest_size) {
+-  DCHECK(!features::IsUsingOzonePlatform());
+   base::AutoLock auto_lock(*va_lock_);
+ 
+   VAStatus va_res = vaSyncSurface(va_display_, va_surface_id);
+@@ -2470,7 +2465,7 @@ bool VaapiWrapper::PutSurfaceIntoPixmap(VASurfaceID va_surface_id,
+   VA_SUCCESS_OR_RETURN(va_res, VaapiFunctions::kVAPutSurface, false);
+   return true;
+ }
+-#endif  // USE_X11
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ 
+ std::unique_ptr<ScopedVAImage> VaapiWrapper::CreateVaImage(
+     VASurfaceID va_surface_id,
+@@ -2844,9 +2839,8 @@ void VaapiWrapper::PreSandboxInitialization() {
+ 
+   paths[kModuleVa].push_back(std::string("libva.so.") + va_suffix);
+   paths[kModuleVa_drm].push_back(std::string("libva-drm.so.") + va_suffix);
+-#if defined(USE_X11)
+-  if (!features::IsUsingOzonePlatform())
+-    paths[kModuleVa_x11].push_back(std::string("libva-x11.so.") + va_suffix);
++#if BUILDFLAG(USE_VAAPI_X11)
++  paths[kModuleVa_x11].push_back(std::string("libva-x11.so.") + va_suffix);
+ #endif
+ #if BUILDFLAG(IS_CHROMEOS_ASH)
+   paths[kModuleVa_prot].push_back(std::string("libva.so.") + va_suffix);
+diff --git a/media/gpu/vaapi/vaapi_wrapper.h b/media/gpu/vaapi/vaapi_wrapper.h
+index 0e3da53624..88ffcd0799 100644
+--- a/media/gpu/vaapi/vaapi_wrapper.h
++++ b/media/gpu/vaapi/vaapi_wrapper.h
+@@ -36,9 +36,9 @@
+ #include "third_party/abseil-cpp/absl/types/optional.h"
+ #include "ui/gfx/geometry/size.h"
+ 
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+ #include "ui/gfx/x/xproto.h"  // nogncheck
+-#endif  // USE_X11
++#endif                        // BUILDFLAG(USE_VAAPI_X11)
+ 
+ namespace gfx {
+ enum class BufferFormat;
+@@ -426,13 +426,13 @@ class MEDIA_GPU_EXPORT VaapiWrapper
+       const std::vector<std::pair<VABufferID, VABufferDescriptor>>& va_buffers)
+       WARN_UNUSED_RESULT;
+ 
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+   // Put data from |va_surface_id| into |x_pixmap| of size
+   // |dest_size|, converting/scaling to it.
+   bool PutSurfaceIntoPixmap(VASurfaceID va_surface_id,
+                             x11::Pixmap x_pixmap,
+                             gfx::Size dest_size) WARN_UNUSED_RESULT;
+-#endif  // USE_X11
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ 
+   // 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 --git a/ui/ozone/platform/x11/ozone_platform_x11.cc b/ui/ozone/platform/x11/ozone_platform_x11.cc
+index 8889828e0f..963dc7a0cd 100644
+--- a/ui/ozone/platform/x11/ozone_platform_x11.cc
++++ b/ui/ozone/platform/x11/ozone_platform_x11.cc
+@@ -208,6 +208,9 @@ class OzonePlatformX11 : public OzonePlatform,
+       properties->supports_global_application_menus = true;
+       properties->app_modal_dialogs_use_event_blocker = true;
+       properties->fetch_buffer_formats_for_gmb_on_gpu = true;
++#if defined(OS_LINUX)
++      properties->supports_vaapi = true;
++#endif
+ 
+       initialised = true;
+     }
+diff --git a/ui/ozone/public/ozone_platform.h b/ui/ozone/public/ozone_platform.h
+index df95f07486..2d7f44bbfa 100644
+--- a/ui/ozone/public/ozone_platform.h
++++ b/ui/ozone/public/ozone_platform.h
+@@ -15,6 +15,7 @@
+ #include "base/macros.h"
+ #include "base/message_loop/message_pump_type.h"
+ #include "base/single_thread_task_runner.h"
++#include "build/build_config.h"
+ #include "mojo/public/cpp/bindings/binder_map.h"
+ #include "ui/gfx/buffer_types.h"
+ #include "ui/gfx/native_widget_types.h"
+@@ -154,6 +155,15 @@ class COMPONENT_EXPORT(OZONE) OzonePlatform {
+     // Determines whether buffer formats should be fetched on GPU and passed
+     // back via gpu extra info.
+     bool fetch_buffer_formats_for_gmb_on_gpu = false;
++
++#if defined(OS_LINUX)
++    // TODO(crbug.com/1116701): add vaapi support for other Ozone platforms on
++    // Linux. At the moment, VA-API Linux implementation supports only X11
++    // backend. This implementation must be refactored to support Ozone
++    // properly. As a temporary solution, VA-API on Linux checks if vaapi is
++    // supported (which implicitly means that it is Ozone/X11).
++    bool supports_vaapi = false;
++#endif
+   };
+ 
+   // Groups platform properties that can only be known at run time.
diff --git a/srcpkgs/chromium/template b/srcpkgs/chromium/template
index c57c29508dfc..dfe427489f8f 100644
--- a/srcpkgs/chromium/template
+++ b/srcpkgs/chromium/template
@@ -1,7 +1,7 @@
 # Template file for 'chromium'
 pkgname=chromium
 # See https://chromiumdash.appspot.com/releases?platform=Linux for the latest version
-version=94.0.4606.81
+version=95.0.4638.54
 revision=1
 archs="i686* x86_64* aarch64* armv7l* ppc64le*"
 short_desc="Google's attempt at creating a safer, faster, and more stable browser"
@@ -9,7 +9,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://www.chromium.org/"
 distfiles="https://commondatastorage.googleapis.com/chromium-browser-official/${pkgname}-${version}.tar.xz"
-checksum=7071aa2b2caf48094c2ae816395948b4daec940606f4982ad5bbf68e5d2de598
+checksum=3eef88d745e6ddaeaf507358f1510482d6f399cf335061bb1226a5f7120061fd
 nocross=yes
 
 lib32disabled=yes
@@ -51,15 +51,6 @@ post_patch() {
 		done
 	fi
 
-	case "${XBPS_TARGET_MACHINE}" in
-	i686*)
-		for f in "${FILESDIR}"/i686-patches/*.patch; do
-			echo "Applying $f"
-			patch -Np0 -i "$f"
-		done
-		;;
-	esac
-
 	# Use the file at run time instead of effectively compiling it in
 	sed 's|//third_party/usb_ids/usb.ids|/usr/share/hwdata/usb.ids|g' \
 		-i services/device/public/cpp/usb/BUILD.gn

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PR PATCH] [Updated] chromium: update to 95.0.4638.54.
  2021-10-20 22:14 [PR PATCH] chromium: update to 95.0.4638.54 Duncaen
                   ` (3 preceding siblings ...)
  2021-10-22 19:09 ` Duncaen
@ 2021-10-22 23:10 ` Duncaen
  2021-10-22 23:11 ` [PR PATCH] [Merged]: " Duncaen
  5 siblings, 0 replies; 7+ messages in thread
From: Duncaen @ 2021-10-22 23:10 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 391 bytes --]

There is an updated pull request by Duncaen against master on the void-packages repository

https://github.com/Duncaen/void-packages chromium-95
https://github.com/void-linux/void-packages/pull/33657

chromium: update to 95.0.4638.54.
[ci skip]

* [x] x86_64-glibc
* [x] x86_64-musl
* [x] i686


A patch file from https://github.com/void-linux/void-packages/pull/33657.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-chromium-95-33657.patch --]
[-- Type: text/x-diff, Size: 37584 bytes --]

From 78212c28acfd1dac39298cfe689c3b536b449299 Mon Sep 17 00:00:00 2001
From: Duncaen <duncaen@voidlinux.org>
Date: Thu, 21 Oct 2021 00:13:28 +0200
Subject: [PATCH] chromium: update to 95.0.4638.54.

---
 .../chromium-i686-vaapi-fpermissive.patch     |  22 -
 .../files/musl-patches/resolver.patch         |  13 +-
 .../musl-patches/xxx-ppc64le-support.patch    |  16 +-
 .../chromium-94-CustomSpaces-include.patch    |  24 -
 .../patches/chromium-95-harfbuzz-3.patch      |  31 +
 .../patches/chromium-95-quiche-include.patch  |  25 +
 .../chromium-i686-vaapi-fpermissive.patch     |  23 +
 .../fix-bits-stdint-intn-include.patch        |  11 +
 .../patches/ozone-x11-fix-VA-API.patch        | 671 ++++++++++++++++++
 srcpkgs/chromium/template                     |  13 +-
 10 files changed, 778 insertions(+), 71 deletions(-)
 delete mode 100644 srcpkgs/chromium/files/i686-patches/chromium-i686-vaapi-fpermissive.patch
 delete mode 100644 srcpkgs/chromium/patches/chromium-94-CustomSpaces-include.patch
 create mode 100644 srcpkgs/chromium/patches/chromium-95-harfbuzz-3.patch
 create mode 100644 srcpkgs/chromium/patches/chromium-95-quiche-include.patch
 create mode 100644 srcpkgs/chromium/patches/chromium-i686-vaapi-fpermissive.patch
 create mode 100644 srcpkgs/chromium/patches/fix-bits-stdint-intn-include.patch
 create mode 100644 srcpkgs/chromium/patches/ozone-x11-fix-VA-API.patch

diff --git a/srcpkgs/chromium/files/i686-patches/chromium-i686-vaapi-fpermissive.patch b/srcpkgs/chromium/files/i686-patches/chromium-i686-vaapi-fpermissive.patch
deleted file mode 100644
index b4d8787c4798..000000000000
--- a/srcpkgs/chromium/files/i686-patches/chromium-i686-vaapi-fpermissive.patch
+++ /dev/null
@@ -1,22 +0,0 @@
---- media/gpu/vaapi/BUILD.gn.orig	2019-06-18 11:48:14.000000000 -0400
-+++ media/gpu/vaapi/BUILD.gn	2019-07-02 18:34:00.607864854 -0400
-@@ -11,6 +11,10 @@
- 
- assert(use_vaapi)
- 
-+config("vaapi_permissive") {
-+  cflags = [ "-fpermissive" ]
-+}
-+
- generate_stubs("libva_stubs") {
-   extra_header = "va_stub_header.fragment"
-   sigs = [ "va.sigs" ]
-@@ -89,6 +93,8 @@
-     deps += [ "//media/gpu/linux" ]
-   }
- 
-+  configs += [ ":vaapi_permissive" ]
-+
-   if (use_x11) {
-     configs += [ "//build/config/linux:x11" ]
-     deps += [ "//ui/gfx/x" ]
diff --git a/srcpkgs/chromium/files/musl-patches/resolver.patch b/srcpkgs/chromium/files/musl-patches/resolver.patch
index fb8b0ddccda6..091d3f3e88ef 100644
--- a/srcpkgs/chromium/files/musl-patches/resolver.patch
+++ b/srcpkgs/chromium/files/musl-patches/resolver.patch
@@ -51,10 +51,12 @@
      UMA_HISTOGRAM_BOOLEAN("Net.DNS.DnsConfig.Resolv.Read",
                            dns_config_.has_value());
      if (!dns_config_.has_value())
-@@ -486,20 +480,11 @@
+--- net/dns/public/resolv_reader.cc.orig
++++ net/dns/public/resolv_reader.cc
+@@ -20,19 +20,10 @@
+ namespace net {
  
- std::unique_ptr<struct __res_state>
- DnsConfigServiceLinux::ResolvReader::GetResState() {
+ std::unique_ptr<struct __res_state> ResolvReader::GetResState() {
 -  auto res = std::make_unique<struct __res_state>();
 -  memset(res.get(), 0, sizeof(struct __res_state));
 -
@@ -67,9 +69,8 @@
 +  return nullptr;
  }
  
- void DnsConfigServiceLinux::ResolvReader::CloseResState(
-     struct __res_state* res) {
+ void ResolvReader::CloseResState(struct __res_state* res) {
 -  res_nclose(res);
  }
  
- DnsConfigServiceLinux::DnsConfigServiceLinux()
+ absl::optional<std::vector<IPEndPoint>> GetNameservers(
diff --git a/srcpkgs/chromium/files/musl-patches/xxx-ppc64le-support.patch b/srcpkgs/chromium/files/musl-patches/xxx-ppc64le-support.patch
index 9ea233ba6256..681b1f011c31 100644
--- a/srcpkgs/chromium/files/musl-patches/xxx-ppc64le-support.patch
+++ b/srcpkgs/chromium/files/musl-patches/xxx-ppc64le-support.patch
@@ -1,11 +1,11 @@
---- base/allocator/partition_allocator/partition_alloc_config.h	2021-05-25 00:05:31.000000000 +0200
-+++ -	2021-05-26 22:23:47.172940826 +0200
-@@ -88,7 +88,8 @@
- // PUT_REF_COUNT_IN_PREVIOUS_SLOT does. In this case the refcount overlaps with
- // the next pointer shadow for the smallest bucket.
- #if !(defined(OS_MAC) && defined(ARCH_CPU_ARM64)) && \
--    !BUILDFLAG(PUT_REF_COUNT_IN_PREVIOUS_SLOT)
-+    !BUILDFLAG(PUT_REF_COUNT_IN_PREVIOUS_SLOT) && \
+--- base/allocator/partition_allocator/partition_alloc_config.h.orig
++++ base/allocator/partition_allocator/partition_alloc_config.h
+@@ -114,7 +114,8 @@
+ // platforms complicates things. Note that Chromium is not officially supported
+ // on any big endian architecture as well.
+ #if !BUILDFLAG(PUT_REF_COUNT_IN_PREVIOUS_SLOT) && \
+-    defined(ARCH_CPU_LITTLE_ENDIAN)
++    defined(ARCH_CPU_LITTLE_ENDIAN) && \
 +    !defined(__powerpc64__)
  #define PA_HAS_FREELIST_HARDENING
  #endif
diff --git a/srcpkgs/chromium/patches/chromium-94-CustomSpaces-include.patch b/srcpkgs/chromium/patches/chromium-94-CustomSpaces-include.patch
deleted file mode 100644
index 01757758c1e2..000000000000
--- a/srcpkgs/chromium/patches/chromium-94-CustomSpaces-include.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From 4eeacdaa57b29a079fe09315eb22557c06aa522e Mon Sep 17 00:00:00 2001
-From: Stephan Hartmann <stha09@googlemail.com>
-Date: Fri, 13 Aug 2021 12:57:42 +0000
-Subject: [PATCH] IWYU: add memory for std::unique_ptr in blink::CustomSpaces
-
----
- .../blink/renderer/platform/heap/v8_wrapper/custom_spaces.h      | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/third_party/blink/renderer/platform/heap/v8_wrapper/custom_spaces.h b/third_party/blink/renderer/platform/heap/v8_wrapper/custom_spaces.h
-index df0465a..640cb33 100644
---- a/third_party/blink/renderer/platform/heap/v8_wrapper/custom_spaces.h
-+++ b/third_party/blink/renderer/platform/heap/v8_wrapper/custom_spaces.h
-@@ -5,6 +5,7 @@
- #ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_V8_WRAPPER_CUSTOM_SPACES_H_
- #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_HEAP_V8_WRAPPER_CUSTOM_SPACES_H_
- 
-+#include <memory>
- #include <vector>
- 
- #include "third_party/blink/renderer/platform/platform_export.h"
--- 
-2.31.1
-
diff --git a/srcpkgs/chromium/patches/chromium-95-harfbuzz-3.patch b/srcpkgs/chromium/patches/chromium-95-harfbuzz-3.patch
new file mode 100644
index 000000000000..33fe9556aaf3
--- /dev/null
+++ b/srcpkgs/chromium/patches/chromium-95-harfbuzz-3.patch
@@ -0,0 +1,31 @@
+From 9e00e702633c47c590a869bc66b5c2ceec09da50 Mon Sep 17 00:00:00 2001
+From: Dominik Röttsches <drott@chromium.org>
+Date: Tue, 28 Sep 2021 15:31:50 +0000
+Subject: [PATCH] Roll src/third_party/harfbuzz-ng/src/ 6602cbb70..a52c6df38 (80 commits)
+
+Fixed: 1252284
+Change-Id: Ie2ff99da5e41ca97b8881e1bd3e158881f4d5a8e
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3190252
+Commit-Queue: Dominik Röttsches <drott@chromium.org>
+Commit-Queue: Calder Kitagawa <ckitagawa@chromium.org>
+Auto-Submit: Dominik Röttsches <drott@chromium.org>
+Reviewed-by: Calder Kitagawa <ckitagawa@chromium.org>
+Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org>
+Cr-Commit-Position: refs/heads/main@{#925776}
+
+(only components/paint_preview/common/subset_font.cc)
+---
+
+diff --git a/components/paint_preview/common/subset_font.cc b/components/paint_preview/common/subset_font.cc
+index 45daea7b1..43a448e 100644
+--- a/components/paint_preview/common/subset_font.cc
++++ b/components/paint_preview/common/subset_font.cc
+@@ -79,7 +79,7 @@
+   // Retain all variation information for OpenType variation fonts. See:
+   // https://docs.microsoft.com/en-us/typography/opentype/spec/otvaroverview
+   hb_set_t* skip_subset =
+-      hb_subset_input_no_subset_tables_set(input.get());  // Owned by |input|.
++      hb_subset_input_set(input.get(), HB_SUBSET_SETS_NO_SUBSET_TABLE_TAG);
+   hb_set_add(skip_subset, HB_TAG('a', 'v', 'a', 'r'));
+   hb_set_add(skip_subset, HB_TAG('c', 'v', 'a', 'r'));
+   hb_set_add(skip_subset, HB_TAG('f', 'v', 'a', 'r'));
diff --git a/srcpkgs/chromium/patches/chromium-95-quiche-include.patch b/srcpkgs/chromium/patches/chromium-95-quiche-include.patch
new file mode 100644
index 000000000000..4bbd45cfc094
--- /dev/null
+++ b/srcpkgs/chromium/patches/chromium-95-quiche-include.patch
@@ -0,0 +1,25 @@
+From a9d986203bcfbaab84f270c1dc6c3abb4c450ee1 Mon Sep 17 00:00:00 2001
+From: Stephan Hartmann <stha09@googlemail.com>
+Date: Fri, 17 Sep 2021 14:57:33 +0000
+Subject: [PATCH] IWYU: add stddef.h for size_t in WindowManager
+
+---
+ net/third_party/quiche/src/http2/adapter/window_manager.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/net/third_party/quiche/src/http2/adapter/window_manager.h b/net/third_party/quiche/src/http2/adapter/window_manager.h
+index f15982d..5a7701e 100644
+--- a/net/third_party/quiche/src/http2/adapter/window_manager.h
++++ b/net/third_party/quiche/src/http2/adapter/window_manager.h
+@@ -1,6 +1,8 @@
+ #ifndef QUICHE_HTTP2_ADAPTER_WINDOW_MANAGER_H_
+ #define QUICHE_HTTP2_ADAPTER_WINDOW_MANAGER_H_
+ 
++#include <stddef.h>
++
+ #include <functional>
+ 
+ #include "common/platform/api/quiche_export.h"
+-- 
+2.32.0
+
diff --git a/srcpkgs/chromium/patches/chromium-i686-vaapi-fpermissive.patch b/srcpkgs/chromium/patches/chromium-i686-vaapi-fpermissive.patch
new file mode 100644
index 000000000000..77c0b58c94e1
--- /dev/null
+++ b/srcpkgs/chromium/patches/chromium-i686-vaapi-fpermissive.patch
@@ -0,0 +1,23 @@
+--- a/media/gpu/vaapi/BUILD.gn.orig
++++ b/media/gpu/vaapi/BUILD.gn
+@@ -14,6 +14,12 @@
+ assert(is_linux || is_chromeos)
+ assert(use_vaapi)
+ 
++config("vaapi_permissive") {
++  if (target_cpu == "x86") {
++    cflags = [ "-fpermissive" ]
++  }
++}
++
+ generate_stubs("libva_stubs") {
+   extra_header = "va_stub_header.fragment"
+   sigs = [ "va.sigs" ]
+@@ -90,6 +96,7 @@
+   configs += [
+     "//build/config/linux/libva",
+     "//third_party/libvpx:libvpx_config",
++    ":vaapi_permissive",
+   ]
+ 
+   deps = [
diff --git a/srcpkgs/chromium/patches/fix-bits-stdint-intn-include.patch b/srcpkgs/chromium/patches/fix-bits-stdint-intn-include.patch
new file mode 100644
index 000000000000..978cd6a493d6
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-bits-stdint-intn-include.patch
@@ -0,0 +1,11 @@
+--- a/ui/ozone/platform/wayland/host/wayland_window.cc.orig
++++ b/ui/ozone/platform/wayland/host/wayland_window.cc
+@@ -4,7 +4,7 @@
+ 
+ #include "ui/ozone/platform/wayland/host/wayland_window.h"
+ 
+-#include <bits/stdint-intn.h>
++#include <stdint.h>
+ #include <wayland-cursor.h>
+ #include <algorithm>
+ #include <memory>
diff --git a/srcpkgs/chromium/patches/ozone-x11-fix-VA-API.patch b/srcpkgs/chromium/patches/ozone-x11-fix-VA-API.patch
new file mode 100644
index 000000000000..61d72bfb0137
--- /dev/null
+++ b/srcpkgs/chromium/patches/ozone-x11-fix-VA-API.patch
@@ -0,0 +1,671 @@
+From a4de986102a45e29c3ef596f22704bdca244c26c Mon Sep 17 00:00:00 2001
+From: Maksim Sisov <msisov@igalia.com>
+Date: Fri, 17 Sep 2021 08:45:55 +0000
+Subject: [PATCH] ozone/x11: fix VA-API.
+
+This patch fixes VA-API usage with Ozone/X11 backend (which
+is our default backend now as X11 has been deprecated -
+crrev.com/c/3114071)).
+
+non-Ozone X11 is disabled now and Ozone is always used
+on Linux. However, VA-API implementation is not Ozone friendly
+yet and requires major refactoring. But given that VA-API
+implementation on Linux worked only with X11, it's fine for
+now to change USE_X11 and !IsUsingOzonePlatform to
+BUILDFLAG(OZONE_PLATFORM_X11) and fail VA-API initialization
+in VADisplayState::Initialize for Ozone/Linux other than
+non-X11 backends.
+
+Bug: 1121948
+Change-Id: If85d289235e6d358103d9fa2bbe0f741fb599a26
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3141878
+Commit-Queue: Maksim Sisov <msisov@igalia.com>
+Reviewed-by: Andres Calderon Jaramillo <andrescj@chromium.org>
+Reviewed-by: Robert Kroeger <rjkroege@chromium.org>
+Reviewed-by: Xiaohan Wang <xhwang@chromium.org>
+Reviewed-by: Alexander Dunaev <adunaev@igalia.com>
+Cr-Commit-Position: refs/heads/main@{#922466}
+---
+ media/BUILD.gn                                |  3 -
+ media/gpu/BUILD.gn                            |  5 +-
+ media/gpu/args.gni                            | 13 +++-
+ media/gpu/vaapi/BUILD.gn                      |  8 +-
+ media/gpu/vaapi/va_stub_header.fragment       |  6 +-
+ media/gpu/vaapi/vaapi_picture_factory.cc      | 72 ++++++++----------
+ .../vaapi_picture_native_pixmap_angle.cc      |  2 -
+ media/gpu/vaapi/vaapi_picture_tfp.cc          |  2 -
+ .../vaapi/vaapi_video_decode_accelerator.cc   |  9 +--
+ ...vaapi_video_decode_accelerator_unittest.cc | 11 +--
+ media/gpu/vaapi/vaapi_wrapper.cc              | 76 +++++++++----------
+ media/gpu/vaapi/vaapi_wrapper.h               |  8 +-
+ ui/ozone/platform/x11/ozone_platform_x11.cc   |  3 +
+ ui/ozone/public/ozone_platform.h              | 10 +++
+ 14 files changed, 108 insertions(+), 120 deletions(-)
+
+diff --git a/media/BUILD.gn b/media/BUILD.gn
+index dbee1d4338..d5c158c08f 100644
+--- a/media/BUILD.gn
++++ b/media/BUILD.gn
+@@ -130,9 +130,6 @@ component("media") {
+     public_deps += [ "//media/base/mac" ]
+   }
+ 
+-  if (use_x11) {
+-    deps += [ "//ui/base/x" ]
+-  }
+   if (use_ozone) {
+     deps += [ "//ui/ozone" ]
+   }
+diff --git a/media/gpu/BUILD.gn b/media/gpu/BUILD.gn
+index c7499485ac..3fedc78948 100644
+--- a/media/gpu/BUILD.gn
++++ b/media/gpu/BUILD.gn
+@@ -20,6 +20,7 @@ buildflag_header("buildflags") {
+     "USE_VAAPI_IMAGE_CODECS=$use_vaapi_image_codecs",
+     "USE_V4L2_CODEC=$use_v4l2_codec",
+     "USE_LIBV4L2=$use_v4lplugin",
++    "USE_VAAPI_X11=$use_vaapi_x11",
+   ]
+ }
+ 
+@@ -215,9 +216,7 @@ component("gpu") {
+       "windows/supported_profile_helpers.cc",
+       "windows/supported_profile_helpers.h",
+     ]
+-    configs += [
+-      "//third_party/khronos:khronos_headers",
+-    ]
++    configs += [ "//third_party/khronos:khronos_headers" ]
+     public_deps += [ "//media/base/win:media_foundation_util" ]
+     deps += [
+       "//gpu/ipc/common:common",
+diff --git a/media/gpu/args.gni b/media/gpu/args.gni
+index 4004937949..2f53843918 100644
+--- a/media/gpu/args.gni
++++ b/media/gpu/args.gni
+@@ -3,7 +3,15 @@
+ # found in the LICENSE file.
+ 
+ import("//build/config/chromeos/ui_mode.gni")
+-import("//build/config/ui.gni")
++import("//build/config/ozone.gni")
++
++declare_args() {
++  # Indicates if X11 VA-API-based hardware acceleration is to be used.
++  # See also the comment near the |use_vaapi| arg.
++  use_vaapi_x11 =
++      is_linux && ozone_platform_x11 && !is_chromecast && !is_chromeos_lacros &&
++      (target_cpu == "x86" || target_cpu == "x64")
++}
+ 
+ declare_args() {
+   # Indicates if V4L plugin is used.
+@@ -21,8 +29,7 @@ declare_args() {
+   # is typically the case on x86-based ChromeOS devices.
+   # VA-API should also be compiled by default on x11-using linux devices
+   # using x86/x64.
+-  use_vaapi =
+-      is_linux && use_x11 && (target_cpu == "x86" || target_cpu == "x64")
++  use_vaapi = use_vaapi_x11
+ 
+   # Indicates if ChromeOS protected media support exists. This is used
+   # to enable the CDM daemon in Chrome OS as well as support for
+diff --git a/media/gpu/vaapi/BUILD.gn b/media/gpu/vaapi/BUILD.gn
+index b11d2c60fa..0c2520dd6b 100644
+--- a/media/gpu/vaapi/BUILD.gn
++++ b/media/gpu/vaapi/BUILD.gn
+@@ -17,7 +17,7 @@ assert(use_vaapi)
+ generate_stubs("libva_stubs") {
+   extra_header = "va_stub_header.fragment"
+   sigs = [ "va.sigs" ]
+-  if (use_x11) {
++  if (use_vaapi_x11) {
+     sigs += [ "va_x11.sigs" ]
+   }
+   if (is_chromeos_ash) {
+@@ -131,14 +131,14 @@ source_set("vaapi") {
+     ]
+   }
+ 
+-  if (use_x11 || use_ozone || use_egl) {
++  if (use_ozone || use_egl) {
+     sources += [
+       "vaapi_picture_native_pixmap.cc",
+       "vaapi_picture_native_pixmap.h",
+     ]
+   }
+ 
+-  if (use_x11) {
++  if (use_vaapi_x11) {
+     deps += [ "//ui/gfx/x" ]
+     sources += [
+       "vaapi_picture_native_pixmap_angle.cc",
+@@ -197,7 +197,7 @@ source_set("common") {
+     deps += [ "//ui/ozone" ]
+   }
+ 
+-  if (use_x11) {
++  if (use_vaapi_x11) {
+     deps += [ "//ui/gfx/x" ]
+   }
+ 
+diff --git a/media/gpu/vaapi/va_stub_header.fragment b/media/gpu/vaapi/va_stub_header.fragment
+index bed198484d..e8c46c5e81 100644
+--- a/media/gpu/vaapi/va_stub_header.fragment
++++ b/media/gpu/vaapi/va_stub_header.fragment
+@@ -1,12 +1,14 @@
+ // The extra include header needed in the generated stub file for defining
+ // various libva types.
+ 
++#include "media/gpu/buildflags.h"
++
+ extern "C" {
+ 
+ #include <va/va_drm.h>
+ #include <va/va.h>
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+ #include <va/va_x11.h>
+-#endif
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ 
+ }
+diff --git a/media/gpu/vaapi/vaapi_picture_factory.cc b/media/gpu/vaapi/vaapi_picture_factory.cc
+index 719035b87c..9c7d7387d2 100644
+--- a/media/gpu/vaapi/vaapi_picture_factory.cc
++++ b/media/gpu/vaapi/vaapi_picture_factory.cc
+@@ -10,13 +10,13 @@
+ #include "ui/base/ui_base_features.h"
+ #include "ui/gl/gl_bindings.h"
+ 
+-#if defined(USE_X11)
+-#include "media/gpu/vaapi/vaapi_picture_native_pixmap_angle.h"
+-#include "media/gpu/vaapi/vaapi_picture_tfp.h"
+-#endif
+ #if defined(USE_OZONE)
+ #include "media/gpu/vaapi/vaapi_picture_native_pixmap_ozone.h"
+-#endif
++#endif  // defined(USE_OZONE)
++#if BUILDFLAG(USE_VAAPI_X11)
++#include "media/gpu/vaapi/vaapi_picture_native_pixmap_angle.h"
++#include "media/gpu/vaapi/vaapi_picture_tfp.h"
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ #if defined(USE_EGL)
+ #include "media/gpu/vaapi/vaapi_picture_native_pixmap_egl.h"
+ #endif
+@@ -46,15 +46,13 @@ VaapiPictureFactory::VaapiPictureFactory() {
+   vaapi_impl_pairs_.insert(
+       std::make_pair(gl::kGLImplementationEGLGLES2,
+                      VaapiPictureFactory::kVaapiImplementationDrm));
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+   vaapi_impl_pairs_.insert(
+       std::make_pair(gl::kGLImplementationEGLANGLE,
+                      VaapiPictureFactory::kVaapiImplementationAngle));
+-  if (!features::IsUsingOzonePlatform()) {
+-    vaapi_impl_pairs_.insert(
+-        std::make_pair(gl::kGLImplementationDesktopGL,
+-                       VaapiPictureFactory::kVaapiImplementationX11));
+-  }
++  vaapi_impl_pairs_.insert(
++      std::make_pair(gl::kGLImplementationDesktopGL,
++                     VaapiPictureFactory::kVaapiImplementationX11));
+ #endif
+ 
+   DeterminePictureCreationAndDownloadingMechanism();
+@@ -96,19 +94,19 @@ VaapiPictureFactory::GetVaapiImplementation(gl::GLImplementation gl_impl) {
+ }
+ 
+ uint32_t VaapiPictureFactory::GetGLTextureTarget() {
+-#if defined(USE_OZONE)
+-  if (features::IsUsingOzonePlatform())
+-    return GL_TEXTURE_EXTERNAL_OES;
+-#endif
++#if BUILDFLAG(USE_VAAPI_X11)
+   return GL_TEXTURE_2D;
++#else
++  return GL_TEXTURE_EXTERNAL_OES;
++#endif
+ }
+ 
+ gfx::BufferFormat VaapiPictureFactory::GetBufferFormat() {
+-#if defined(USE_OZONE)
+-  if (features::IsUsingOzonePlatform())
+-    return gfx::BufferFormat::YUV_420_BIPLANAR;
+-#endif
++#if BUILDFLAG(USE_VAAPI_X11)
+   return gfx::BufferFormat::RGBX_8888;
++#else
++  return gfx::BufferFormat::YUV_420_BIPLANAR;
++#endif
+ }
+ 
+ void VaapiPictureFactory::DeterminePictureCreationAndDownloadingMechanism() {
+@@ -116,51 +114,43 @@ void VaapiPictureFactory::DeterminePictureCreationAndDownloadingMechanism() {
+ #if defined(USE_OZONE)
+     // We can be called without GL initialized, which is valid if we use Ozone.
+     case kVaapiImplementationNone:
+-      if (features::IsUsingOzonePlatform()) {
+-        create_picture_cb_ = base::BindRepeating(
+-            &CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapOzone>);
+-        needs_vpp_for_downloading_ = true;
+-      }
+-
+-      // This is reached by unit tests which don't require create_picture_cb_
+-      // to be initialized or called.
++      create_picture_cb_ = base::BindRepeating(
++          &CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapOzone>);
++      needs_vpp_for_downloading_ = true;
+       break;
+ #endif  // defined(USE_OZONE)
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+     case kVaapiImplementationX11:
+-      DCHECK(!features::IsUsingOzonePlatform());
+       create_picture_cb_ =
+           base::BindRepeating(&CreateVaapiPictureNativeImpl<VaapiTFPPicture>);
+       // Neither VaapiTFPPicture or VaapiPictureNativePixmapAngle needs the VPP.
+       needs_vpp_for_downloading_ = false;
+       break;
+     case kVaapiImplementationAngle:
+-      DCHECK(!features::IsUsingOzonePlatform());
+       create_picture_cb_ = base::BindRepeating(
+           &CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapAngle>);
+       // Neither VaapiTFPPicture or VaapiPictureNativePixmapAngle needs the VPP.
+       needs_vpp_for_downloading_ = false;
+       break;
+-#endif  // defined(USE_X11)
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+     case kVaapiImplementationDrm:
+ #if defined(USE_OZONE)
+-      if (features::IsUsingOzonePlatform()) {
+-        create_picture_cb_ = base::BindRepeating(
+-            &CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapOzone>);
+-        needs_vpp_for_downloading_ = true;
+-        break;
+-      }
+-#endif  // defined(USE_OZONE)
+-#if defined(USE_EGL)
++      create_picture_cb_ = base::BindRepeating(
++          &CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapOzone>);
++      needs_vpp_for_downloading_ = true;
++      break;
++#elif defined(USE_EGL)
+       create_picture_cb_ = base::BindRepeating(
+           &CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapEgl>);
+       needs_vpp_for_downloading_ = true;
+       break;
+-#endif  // defined(USE_EGL)
++#else
+       // ozone or egl must be used to use the DRM implementation.
+-      NOTREACHED();
++      FALLTHROUGH;
++#endif
+     default:
+       NOTREACHED();
++      break;
+   }
+ }
+ 
+diff --git a/media/gpu/vaapi/vaapi_picture_native_pixmap_angle.cc b/media/gpu/vaapi/vaapi_picture_native_pixmap_angle.cc
+index 9de0c93b44..e5b9908490 100644
+--- a/media/gpu/vaapi/vaapi_picture_native_pixmap_angle.cc
++++ b/media/gpu/vaapi/vaapi_picture_native_pixmap_angle.cc
+@@ -6,7 +6,6 @@
+ 
+ #include "media/gpu/vaapi/va_surface.h"
+ #include "media/gpu/vaapi/vaapi_wrapper.h"
+-#include "ui/base/ui_base_features.h"
+ #include "ui/gfx/x/connection.h"
+ #include "ui/gfx/x/future.h"
+ #include "ui/gfx/x/xproto.h"
+@@ -92,7 +91,6 @@ Status VaapiPictureNativePixmapAngle::Allocate(gfx::BufferFormat format) {
+   if (!make_context_current_cb_ || !make_context_current_cb_.Run())
+     return StatusCode::kVaapiBadContext;
+ 
+-  DCHECK(!features::IsUsingOzonePlatform());
+   auto image =
+       base::MakeRefCounted<gl::GLImageEGLPixmap>(visible_size_, format);
+   if (!image)
+diff --git a/media/gpu/vaapi/vaapi_picture_tfp.cc b/media/gpu/vaapi/vaapi_picture_tfp.cc
+index 3f7e221d8a..11914e3640 100644
+--- a/media/gpu/vaapi/vaapi_picture_tfp.cc
++++ b/media/gpu/vaapi/vaapi_picture_tfp.cc
+@@ -6,7 +6,6 @@
+ 
+ #include "media/gpu/vaapi/va_surface.h"
+ #include "media/gpu/vaapi/vaapi_wrapper.h"
+-#include "ui/base/ui_base_features.h"
+ #include "ui/gfx/x/connection.h"
+ #include "ui/gfx/x/future.h"
+ #include "ui/gl/gl_bindings.h"
+@@ -37,7 +36,6 @@ VaapiTFPPicture::VaapiTFPPicture(
+       connection_(x11::Connection::Get()),
+       x_pixmap_(x11::Pixmap::None) {
+   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+-  DCHECK(!features::IsUsingOzonePlatform());
+   DCHECK(texture_id);
+   DCHECK(client_texture_id);
+ }
+diff --git a/media/gpu/vaapi/vaapi_video_decode_accelerator.cc b/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
+index 7514fe4fdd..e4cd7c8d89 100644
+--- a/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
++++ b/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
+@@ -184,12 +184,6 @@ bool VaapiVideoDecodeAccelerator::Initialize(const Config& config,
+                                              Client* client) {
+   DCHECK(task_runner_->BelongsToCurrentThread());
+ 
+-#if defined(USE_X11)
+-  // TODO(crbug/1116701): implement decode acceleration when running with Ozone.
+-  if (features::IsUsingOzonePlatform())
+-    return false;
+-#endif
+-
+   vaapi_picture_factory_ = std::make_unique<VaapiPictureFactory>();
+ 
+   if (config.is_encrypted()) {
+@@ -1213,12 +1207,11 @@ VaapiVideoDecodeAccelerator::GetSupportedProfiles() {
+ 
+ VaapiVideoDecodeAccelerator::BufferAllocationMode
+ VaapiVideoDecodeAccelerator::DecideBufferAllocationMode() {
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+   // The IMPORT mode is used for Android on Chrome OS, so this doesn't apply
+   // here.
+   DCHECK_NE(output_mode_, VideoDecodeAccelerator::Config::OutputMode::IMPORT);
+   // TODO(crbug/1116701): get video decode acceleration working with ozone.
+-  DCHECK(!features::IsUsingOzonePlatform());
+   // For H.264 on older devices, another +1 is experimentally needed for
+   // high-to-high resolution changes.
+   // TODO(mcasas): Figure out why and why only H264, see crbug.com/912295 and
+diff --git a/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc b/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc
+index 5b9a543386..826bb103b1 100644
+--- a/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc
++++ b/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc
+@@ -17,7 +17,6 @@
+ #include "media/gpu/vaapi/vaapi_wrapper.h"
+ #include "testing/gmock/include/gmock/gmock.h"
+ #include "testing/gtest/include/gtest/gtest.h"
+-#include "ui/base/ui_base_features.h"
+ 
+ using base::test::RunClosure;
+ using ::testing::_;
+@@ -416,12 +415,10 @@ TEST_P(VaapiVideoDecodeAcceleratorTest, SupportedPlatforms) {
+             mock_vaapi_picture_factory_->GetVaapiImplementation(
+                 gl::kGLImplementationEGLGLES2));
+ 
+-#if defined(USE_X11)
+-  if (!features::IsUsingOzonePlatform()) {
+-    EXPECT_EQ(VaapiPictureFactory::kVaapiImplementationX11,
+-              mock_vaapi_picture_factory_->GetVaapiImplementation(
+-                  gl::kGLImplementationDesktopGL));
+-  }
++#if BUILDFLAG(USE_VAAPI_X11)
++  EXPECT_EQ(VaapiPictureFactory::kVaapiImplementationX11,
++            mock_vaapi_picture_factory_->GetVaapiImplementation(
++                gl::kGLImplementationDesktopGL));
+ #endif
+ }
+ 
+diff --git a/media/gpu/vaapi/vaapi_wrapper.cc b/media/gpu/vaapi/vaapi_wrapper.cc
+index 754d258848..e528b0f84d 100644
+--- a/media/gpu/vaapi/vaapi_wrapper.cc
++++ b/media/gpu/vaapi/vaapi_wrapper.cc
+@@ -65,7 +65,7 @@
+ #include "ui/gl/gl_bindings.h"
+ #include "ui/gl/gl_implementation.h"
+ 
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+ typedef XID Drawable;
+ 
+ extern "C" {
+@@ -73,7 +73,7 @@ extern "C" {
+ }
+ 
+ #include "ui/gfx/x/connection.h"  // nogncheck
+-#endif
++#endif                            // BUILDFLAG(USE_VAAPI_X11)
+ 
+ #if defined(USE_OZONE)
+ #include "ui/ozone/public/ozone_platform.h"
+@@ -87,14 +87,14 @@ using media_gpu_vaapi::kModuleVa_prot;
+ 
+ using media_gpu_vaapi::kModuleVa;
+ using media_gpu_vaapi::kModuleVa_drm;
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+ using media_gpu_vaapi::kModuleVa_x11;
+-#endif
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ using media_gpu_vaapi::InitializeStubs;
+ using media_gpu_vaapi::IsVaInitialized;
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+ using media_gpu_vaapi::IsVa_x11Initialized;
+-#endif
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ using media_gpu_vaapi::IsVa_drmInitialized;
+ using media_gpu_vaapi::StubPathMap;
+ 
+@@ -559,10 +559,20 @@ VADisplayState::VADisplayState()
+ bool VADisplayState::Initialize() {
+   base::AutoLock auto_lock(va_lock_);
+ 
++#if defined(USE_OZONE) && defined(OS_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)
++    return false;
++#endif
++
+   bool libraries_initialized = IsVaInitialized() && IsVa_drmInitialized();
+-#if defined(USE_X11)
+-  if (!features::IsUsingOzonePlatform())
+-    libraries_initialized = libraries_initialized && IsVa_x11Initialized();
++#if BUILDFLAG(USE_VAAPI_X11)
++  libraries_initialized = libraries_initialized && IsVa_x11Initialized();
+ #endif
+   if (!libraries_initialized)
+     return false;
+@@ -577,34 +587,25 @@ bool VADisplayState::Initialize() {
+   return success;
+ }
+ 
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+ 
+ absl::optional<VADisplay> GetVADisplayStateX11(const base::ScopedFD& drm_fd) {
+-  bool use_drm_as_fallback = false;
+   switch (gl::GetGLImplementation()) {
+     case gl::kGLImplementationEGLGLES2:
+       return vaGetDisplayDRM(drm_fd.get());
+ 
+     case gl::kGLImplementationNone:
+-      use_drm_as_fallback = true;
+-      FALLTHROUGH;
+ 
+     case gl::kGLImplementationDesktopGL: {
+-      if (!features::IsUsingOzonePlatform()) {
+-        VADisplay display =
+-            vaGetDisplay(x11::Connection::Get()->GetXlibDisplay());
+-        if (vaDisplayIsValid(display))
+-          return display;
+-        return vaGetDisplayDRM(drm_fd.get());
+-      }
+-      break;
++      VADisplay display =
++          vaGetDisplay(x11::Connection::Get()->GetXlibDisplay());
++      if (vaDisplayIsValid(display))
++        return display;
++      return vaGetDisplayDRM(drm_fd.get());
+     }
+ 
+-    case gl::kGLImplementationEGLANGLE: {
+-      if (!features::IsUsingOzonePlatform())
+-        return vaGetDisplay(x11::Connection::Get()->GetXlibDisplay());
+-      break;
+-    }
++    case gl::kGLImplementationEGLANGLE:
++      return vaGetDisplay(x11::Connection::Get()->GetXlibDisplay());
+ 
+     default:
+       LOG(WARNING) << "VAAPI video acceleration not available for "
+@@ -612,10 +613,6 @@ absl::optional<VADisplay> GetVADisplayStateX11(const base::ScopedFD& drm_fd) {
+                           gl::GetGLImplementationParts());
+       return absl::nullopt;
+   }
+-
+-  if (use_drm_as_fallback)
+-    return vaGetDisplayDRM(drm_fd.get());
+-  return absl::nullopt;
+ }
+ 
+ #else
+@@ -633,11 +630,11 @@ absl::optional<VADisplay> GetVADisplayState(const base::ScopedFD& drm_fd) {
+   }
+ }
+ 
+-#endif  // defined(USE_X11)
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ 
+ bool VADisplayState::InitializeVaDisplay_Locked() {
+   absl::optional<VADisplay> display =
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+       GetVADisplayStateX11(drm_fd_);
+ #else
+       GetVADisplayState(drm_fd_);
+@@ -702,10 +699,9 @@ bool VADisplayState::InitializeOnce() {
+   if (!InitializeVaDisplay_Locked() || !InitializeVaDriver_Locked())
+     return false;
+ 
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+   if (gl::GetGLImplementation() == gl::kGLImplementationEGLANGLE &&
+       implementation_type_ == VAImplementation::kIntelIHD) {
+-    DCHECK(!features::IsUsingOzonePlatform());
+     constexpr char libva_driver_impl_env[] = "LIBVA_DRIVER_NAME";
+     // TODO(crbug/1116703) The libva intel-media driver has a known segfault in
+     // vaPutSurface, so until this is fixed, fall back to the i965 driver. There
+@@ -722,7 +718,7 @@ bool VADisplayState::InitializeOnce() {
+     if (!InitializeVaDisplay_Locked() || !InitializeVaDriver_Locked())
+       return false;
+   }
+-#endif  // USE_X11
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ 
+   return true;
+ }
+@@ -2452,11 +2448,10 @@ bool VaapiWrapper::MapAndCopyAndExecute(
+   return Execute_Locked(va_surface_id, va_buffer_ids);
+ }
+ 
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+ bool VaapiWrapper::PutSurfaceIntoPixmap(VASurfaceID va_surface_id,
+                                         x11::Pixmap x_pixmap,
+                                         gfx::Size dest_size) {
+-  DCHECK(!features::IsUsingOzonePlatform());
+   base::AutoLock auto_lock(*va_lock_);
+ 
+   VAStatus va_res = vaSyncSurface(va_display_, va_surface_id);
+@@ -2470,7 +2465,7 @@ bool VaapiWrapper::PutSurfaceIntoPixmap(VASurfaceID va_surface_id,
+   VA_SUCCESS_OR_RETURN(va_res, VaapiFunctions::kVAPutSurface, false);
+   return true;
+ }
+-#endif  // USE_X11
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ 
+ std::unique_ptr<ScopedVAImage> VaapiWrapper::CreateVaImage(
+     VASurfaceID va_surface_id,
+@@ -2844,9 +2839,8 @@ void VaapiWrapper::PreSandboxInitialization() {
+ 
+   paths[kModuleVa].push_back(std::string("libva.so.") + va_suffix);
+   paths[kModuleVa_drm].push_back(std::string("libva-drm.so.") + va_suffix);
+-#if defined(USE_X11)
+-  if (!features::IsUsingOzonePlatform())
+-    paths[kModuleVa_x11].push_back(std::string("libva-x11.so.") + va_suffix);
++#if BUILDFLAG(USE_VAAPI_X11)
++  paths[kModuleVa_x11].push_back(std::string("libva-x11.so.") + va_suffix);
+ #endif
+ #if BUILDFLAG(IS_CHROMEOS_ASH)
+   paths[kModuleVa_prot].push_back(std::string("libva.so.") + va_suffix);
+diff --git a/media/gpu/vaapi/vaapi_wrapper.h b/media/gpu/vaapi/vaapi_wrapper.h
+index 0e3da53624..88ffcd0799 100644
+--- a/media/gpu/vaapi/vaapi_wrapper.h
++++ b/media/gpu/vaapi/vaapi_wrapper.h
+@@ -36,9 +36,9 @@
+ #include "third_party/abseil-cpp/absl/types/optional.h"
+ #include "ui/gfx/geometry/size.h"
+ 
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+ #include "ui/gfx/x/xproto.h"  // nogncheck
+-#endif  // USE_X11
++#endif                        // BUILDFLAG(USE_VAAPI_X11)
+ 
+ namespace gfx {
+ enum class BufferFormat;
+@@ -426,13 +426,13 @@ class MEDIA_GPU_EXPORT VaapiWrapper
+       const std::vector<std::pair<VABufferID, VABufferDescriptor>>& va_buffers)
+       WARN_UNUSED_RESULT;
+ 
+-#if defined(USE_X11)
++#if BUILDFLAG(USE_VAAPI_X11)
+   // Put data from |va_surface_id| into |x_pixmap| of size
+   // |dest_size|, converting/scaling to it.
+   bool PutSurfaceIntoPixmap(VASurfaceID va_surface_id,
+                             x11::Pixmap x_pixmap,
+                             gfx::Size dest_size) WARN_UNUSED_RESULT;
+-#endif  // USE_X11
++#endif  // BUILDFLAG(USE_VAAPI_X11)
+ 
+   // 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 --git a/ui/ozone/platform/x11/ozone_platform_x11.cc b/ui/ozone/platform/x11/ozone_platform_x11.cc
+index 8889828e0f..963dc7a0cd 100644
+--- a/ui/ozone/platform/x11/ozone_platform_x11.cc
++++ b/ui/ozone/platform/x11/ozone_platform_x11.cc
+@@ -208,6 +208,9 @@ class OzonePlatformX11 : public OzonePlatform,
+       properties->supports_global_application_menus = true;
+       properties->app_modal_dialogs_use_event_blocker = true;
+       properties->fetch_buffer_formats_for_gmb_on_gpu = true;
++#if defined(OS_LINUX)
++      properties->supports_vaapi = true;
++#endif
+ 
+       initialised = true;
+     }
+diff --git a/ui/ozone/public/ozone_platform.h b/ui/ozone/public/ozone_platform.h
+index df95f07486..2d7f44bbfa 100644
+--- a/ui/ozone/public/ozone_platform.h
++++ b/ui/ozone/public/ozone_platform.h
+@@ -15,6 +15,7 @@
+ #include "base/macros.h"
+ #include "base/message_loop/message_pump_type.h"
+ #include "base/single_thread_task_runner.h"
++#include "build/build_config.h"
+ #include "mojo/public/cpp/bindings/binder_map.h"
+ #include "ui/gfx/buffer_types.h"
+ #include "ui/gfx/native_widget_types.h"
+@@ -154,6 +155,15 @@ class COMPONENT_EXPORT(OZONE) OzonePlatform {
+     // Determines whether buffer formats should be fetched on GPU and passed
+     // back via gpu extra info.
+     bool fetch_buffer_formats_for_gmb_on_gpu = false;
++
++#if defined(OS_LINUX)
++    // TODO(crbug.com/1116701): add vaapi support for other Ozone platforms on
++    // Linux. At the moment, VA-API Linux implementation supports only X11
++    // backend. This implementation must be refactored to support Ozone
++    // properly. As a temporary solution, VA-API on Linux checks if vaapi is
++    // supported (which implicitly means that it is Ozone/X11).
++    bool supports_vaapi = false;
++#endif
+   };
+ 
+   // Groups platform properties that can only be known at run time.
diff --git a/srcpkgs/chromium/template b/srcpkgs/chromium/template
index c57c29508dfc..dfe427489f8f 100644
--- a/srcpkgs/chromium/template
+++ b/srcpkgs/chromium/template
@@ -1,7 +1,7 @@
 # Template file for 'chromium'
 pkgname=chromium
 # See https://chromiumdash.appspot.com/releases?platform=Linux for the latest version
-version=94.0.4606.81
+version=95.0.4638.54
 revision=1
 archs="i686* x86_64* aarch64* armv7l* ppc64le*"
 short_desc="Google's attempt at creating a safer, faster, and more stable browser"
@@ -9,7 +9,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://www.chromium.org/"
 distfiles="https://commondatastorage.googleapis.com/chromium-browser-official/${pkgname}-${version}.tar.xz"
-checksum=7071aa2b2caf48094c2ae816395948b4daec940606f4982ad5bbf68e5d2de598
+checksum=3eef88d745e6ddaeaf507358f1510482d6f399cf335061bb1226a5f7120061fd
 nocross=yes
 
 lib32disabled=yes
@@ -51,15 +51,6 @@ post_patch() {
 		done
 	fi
 
-	case "${XBPS_TARGET_MACHINE}" in
-	i686*)
-		for f in "${FILESDIR}"/i686-patches/*.patch; do
-			echo "Applying $f"
-			patch -Np0 -i "$f"
-		done
-		;;
-	esac
-
 	# Use the file at run time instead of effectively compiling it in
 	sed 's|//third_party/usb_ids/usb.ids|/usr/share/hwdata/usb.ids|g' \
 		-i services/device/public/cpp/usb/BUILD.gn

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PR PATCH] [Merged]: chromium: update to 95.0.4638.54.
  2021-10-20 22:14 [PR PATCH] chromium: update to 95.0.4638.54 Duncaen
                   ` (4 preceding siblings ...)
  2021-10-22 23:10 ` Duncaen
@ 2021-10-22 23:11 ` Duncaen
  5 siblings, 0 replies; 7+ messages in thread
From: Duncaen @ 2021-10-22 23:11 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 231 bytes --]

There's a merged pull request on the void-packages repository

chromium: update to 95.0.4638.54.
https://github.com/void-linux/void-packages/pull/33657

Description:
[ci skip]

* [x] x86_64-glibc
* [x] x86_64-musl
* [x] i686


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-10-22 23:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-20 22:14 [PR PATCH] chromium: update to 95.0.4638.54 Duncaen
2021-10-20 22:45 ` [PR PATCH] [Updated] " Duncaen
2021-10-21  0:06 ` Duncaen
2021-10-21 12:34 ` Duncaen
2021-10-22 19:09 ` Duncaen
2021-10-22 23:10 ` Duncaen
2021-10-22 23:11 ` [PR PATCH] [Merged]: " Duncaen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).