Skip to content

Commit

Permalink
PKGBUILD+Patches: Upgrade to extra/chromium and ungoogled-chromium re…
Browse files Browse the repository at this point in the history
…lease 129.0.6668.58-1
  • Loading branch information
networkException committed Sep 21, 2024
1 parent 90d4eab commit fe91533
Show file tree
Hide file tree
Showing 4 changed files with 148 additions and 54 deletions.
23 changes: 13 additions & 10 deletions PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
# Contributor: Daniel J Griffiths <[email protected]>

pkgname=ungoogled-chromium
pkgver=128.0.6613.137
pkgver=129.0.6668.58
pkgrel=1
_launcher_ver=8
_system_clang=1
# ungoogled chromium variables
_uc_usr=ungoogled-software
_uc_ver=128.0.6613.137-1
_uc_ver=129.0.6668.58-1
pkgdesc="A lightweight approach to removing Google web service dependency"
arch=('x86_64')
url="https://github.com/ungoogled-software/ungoogled-chromium"
Expand All @@ -38,27 +38,29 @@ options=('!lto') # Chromium adds its own flags for ThinLTO
source=(https://commondatastorage.googleapis.com/chromium-browser-official/chromium-$pkgver.tar.xz
$pkgname-$_uc_ver.tar.gz::https://github.com/$_uc_usr/ungoogled-chromium/archive/$_uc_ver.tar.gz
https://github.com/foutrelis/chromium-launcher/archive/v$_launcher_ver/chromium-launcher-$_launcher_ver.tar.gz
allow-ANGLEImplementation-kVulkan.patch
compiler-rt-adjust-paths.patch
increase-fortify-level.patch
use-oauth2-client-switches-as-default.patch
0001-adjust-buffer-format-order.patch
0001-enable-linux-unstable-deb-target.patch
0001-ozone-wayland-implement-text_input_manager_v3.patch
0001-ozone-wayland-implement-text_input_manager-fixes.patch
0001-vaapi-flag-ozone-wayland.patch)
sha256sums=('e1d39c170dfdc2627a7b003e11d77f04a578b8e1cfe41e714cdaa345c91f4943'
'94e2f80f72b1c0f791c826c734a676cd0cb60ebaaf2a8a4941a8475a15f5508d'
0001-vaapi-flag-ozone-wayland.patch
p010-Zero-Copy-for-VA-API-Decoding-for-Vulkan.patch
add-feature-to-allow-zero-copy-video-formats.patch)
sha256sums=('eaf850183d32627ce0cde9f3d3f853bc11c217ef7f41540303214ed47803d96d'
'a52872325dcf1121acbabec781edfabe068a50a9080e81e69b249dd6301f2eac'
'213e50f48b67feb4441078d50b0fd431df34323be15be97c55302d3fdac4483a'
'1a5bc75a90abad153c8eb6dbdce138132a5f11190b0a40c925958a72d706b2aa'
'b3de01b7df227478687d7517f61a777450dca765756002c80c4915f271e2d961'
'd634d2ce1fc63da7ac41f432b1e84c59b7cceabf19d510848a7cff40c8025342'
'a9b417b96daec33c9059065e15b3a92ae1bf4b59f89d353659b335d9e0379db6'
'8ba5c67b7eb6cacd2dbbc29e6766169f0fca3bbb07779b1a0a76c913f17d343f'
'2a44756404e13c97d000cc0d859604d6848163998ea2f838b3b9bb2c840967e3'
'd9974ddb50777be428fd0fa1e01ffe4b587065ba6adefea33678e1b3e25d1285'
'a2da75d0c20529f2d635050e0662941c0820264ea9371eb900b9d90b5968fa6a'
'9a5594293616e1390462af1f50276ee29fd6075ffab0e3f944f6346cb2eb8aec')
'9a5594293616e1390462af1f50276ee29fd6075ffab0e3f944f6346cb2eb8aec'
'40db59162df2b7a2c0387bd620802f15424f637c09ba305b674fc09410ab21d1'
'713dab4f8c26790c0e4a4c5ce6a9269e90446df5370cc14214a01a363f7afe39')

# Possible replacements are listed in build/linux/unbundle/replace_gn_files.py
# Keys are the names in the above script; values are the dependencies in Arch
Expand All @@ -75,7 +77,7 @@ declare -gA _system_libs=(
#[libaom]=aom
#[libavif]=libavif # needs -DAVIF_ENABLE_EXPERIMENTAL_GAIN_MAP=ON
[libdrm]=
[libjpeg]=libjpeg
[libjpeg]=libjpeg-turbo
[libpng]=libpng
#[libvpx]=libvpx
[libwebp]=libwebp
Expand Down Expand Up @@ -112,7 +114,8 @@ prepare() {
patch -Np1 -i ../use-oauth2-client-switches-as-default.patch

# Upstream fixes
patch -Np1 -i ../allow-ANGLEImplementation-kVulkan.patch
patch -Np1 -i ../p010-Zero-Copy-for-VA-API-Decoding-for-Vulkan.patch
patch -Np1 -i ../add-feature-to-allow-zero-copy-video-formats.patch

# Allow libclang_rt.builtins from compiler-rt >= 16 to be used
patch -Np1 -i ../compiler-rt-adjust-paths.patch
Expand Down
62 changes: 62 additions & 0 deletions add-feature-to-allow-zero-copy-video-formats.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
From fb42a91ffae45f6a7c1639ebf0f1622b7c346d1d Mon Sep 17 00:00:00 2001
From: Robert Mader <[email protected]>
Date: Thu, 5 Sep 2024 23:56:20 +0000
Subject: [PATCH] media: Add feature to allow zero-copy video formats with GL
on Linux

With EGL formats like NV12 can usually be imported directly from VA-API
and V4L2 decoders. Doing so can improve performance a lot - and in cases
where there is no PP to convert to RGB, not supporting it can break HW
decoding altogether.
Unfortunately allowing it unconditionally could cause regressions in
various scenarios - such as when using GLX or a driver that doesn't
support sampling NV12.

Thus introduce a feature - disabled by default for now - to make it easy
to enable these formats.

Note that on Wayland it might be required to disable overlay delegation
with `--disable-features=WaylandOverlayDelegation`.

Change-Id: I8ee396de5f6d4958278b0f0bd53bfa9a7007c8c7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5038617
Reviewed-by: Ted (Chromium) Meyer <[email protected]>
Reviewed-by: Andres Calderon Jaramillo <[email protected]>
Commit-Queue: Andres Calderon Jaramillo <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1351792}
---
media/mojo/services/gpu_mojo_media_client_linux.cc | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/media/mojo/services/gpu_mojo_media_client_linux.cc b/media/mojo/services/gpu_mojo_media_client_linux.cc
index c592c2e4c2c2..cd86a3253e07 100644
--- a/media/mojo/services/gpu_mojo_media_client_linux.cc
+++ b/media/mojo/services/gpu_mojo_media_client_linux.cc
@@ -18,6 +18,10 @@ namespace media {

namespace {

+BASE_FEATURE(kVaapiVideoDecodeLinuxZeroCopyGL,
+ "VaapiVideoDecodeLinuxZeroCopyGL",
+ base::FEATURE_DISABLED_BY_DEFAULT);
+
VideoDecoderType GetPreferredLinuxDecoderImplementation() {
// VaapiVideoDecoder flag is required for VaapiVideoDecoder.
if (!base::FeatureList::IsEnabled(kVaapiVideoDecodeLinux)) {
@@ -50,8 +54,15 @@ std::vector<Fourcc> GetPreferredRenderableFourccs(
if (gpu_preferences.gr_context_type == gpu::GrContextType::kVulkan) {
renderable_fourccs.emplace_back(Fourcc::NV12);
renderable_fourccs.emplace_back(Fourcc::P010);
- }
+ } else
#endif // BUILDFLAG(ENABLE_VULKAN)
+ // Allow zero-copy formats with GL for testing or in controlled
+ // environments.
+ if (gpu_preferences.gr_context_type == gpu::GrContextType::kGL &&
+ base::FeatureList::IsEnabled(kVaapiVideoDecodeLinuxZeroCopyGL)) {
+ renderable_fourccs.emplace_back(Fourcc::NV12);
+ renderable_fourccs.emplace_back(Fourcc::P010);
+ }

// Support 1-copy argb textures.
//
44 changes: 0 additions & 44 deletions allow-ANGLEImplementation-kVulkan.patch

This file was deleted.

73 changes: 73 additions & 0 deletions p010-Zero-Copy-for-VA-API-Decoding-for-Vulkan.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
From 882f184c471fc8e5c59ead4e4c8eaf06dc7f89da Mon Sep 17 00:00:00 2001
From: Jianhui Dai <[email protected]>
Date: Wed, 4 Sep 2024 01:28:15 +0000
Subject: [PATCH] vaapi_decoder/linux: P010 Zero-Copy for VA-API Video Decoding
for Vulkan

This CL adds P010 to the list of renderable formats for Vulkan, enabling
zero-copy video decoding via VA-API. By avoiding the unnecessary
conversion from P010 to NV12, this optimization preserves color depth
and improves overall performance.

Test on Ubuntu 22.04 for Alder Lake:
Linux Ozone-Wayland Vulkan:
`
chrome --ignore-gpu-blocklist --disable-gpu-driver-bug-workaround
--enable-features=Vulkan,VaapiIgnoreDriverChecks,DefaultANGLEVulkan,VulkanFromANGLE
--use-gl=angle --use-angle=vulkan --ozone-platform=wayland
`

Linux Ozone-X11 Vulkan:
`
chrome --ignore-gpu-blocklist --disable-gpu-driver-bug-workaround
--enable-features=Vulkan,VaapiIgnoreDriverChecks,DefaultANGLEVulkan,VulkanFromANGLE
--use-gl=angle --use-angle=vulkan --ozone-platform=x11
`

HEVC Main 10 10-bit test video:
https://developer.apple.com/videos/play/wwdc2024/10136/

Bug: 349428388
Change-Id: I4a5524d8224982e44a928467bb37a46b8404d402
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5831505
Reviewed-by: Ted (Chromium) Meyer <[email protected]>
Reviewed-by: Andres Calderon Jaramillo <[email protected]>
Commit-Queue: Jianhui J Dai <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1350537}
---
.../mojo/services/gpu_mojo_media_client_linux.cc | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/media/mojo/services/gpu_mojo_media_client_linux.cc b/media/mojo/services/gpu_mojo_media_client_linux.cc
index 6c8dcffca050..c592c2e4c2c2 100644
--- a/media/mojo/services/gpu_mojo_media_client_linux.cc
+++ b/media/mojo/services/gpu_mojo_media_client_linux.cc
@@ -45,20 +45,21 @@ VideoDecoderType GetPreferredLinuxDecoderImplementation() {
std::vector<Fourcc> GetPreferredRenderableFourccs(
const gpu::GpuPreferences& gpu_preferences) {
std::vector<Fourcc> renderable_fourccs;
- // TODO(crbug.com/349428388): For HEVC Main 10 and VP9 Profile2 10-bit video,
- // the current implementation requires additional VPP to convert the P010
- // format to a renderable format. This VPP happens on the Vulkan path
- // (P010 -> NV12) and OpenGL path (P010 -> AR24). While this VPP introduces a
- // loss of color depth, it should be optimized for zero-copy path in the
- // future.
#if BUILDFLAG(ENABLE_VULKAN)
- // Support for zero-copy NV12 textures preferentially.
+ // Support for zero-copy NV12/P010 textures preferentially.
if (gpu_preferences.gr_context_type == gpu::GrContextType::kVulkan) {
renderable_fourccs.emplace_back(Fourcc::NV12);
+ renderable_fourccs.emplace_back(Fourcc::P010);
}
#endif // BUILDFLAG(ENABLE_VULKAN)

// Support 1-copy argb textures.
+ //
+ // TODO(crbug.com/349428388): For VP9 Profile2 and HEVC Main 10 10-bit video,
+ // the current implementation requires additional VPP to convert the NV12/P010
+ // format to a renderable format AR24. While this VPP introduces a loss of
+ // color depth (P010 -> AR24), it should be optimized for zero-copy path in
+ // the future.
renderable_fourccs.emplace_back(Fourcc::AR24);

return renderable_fourccs;

0 comments on commit fe91533

Please sign in to comment.