diff options
author | JustKidding <jk@vin.ovh> | 2023-11-12 06:13:33 -0500 |
---|---|---|
committer | JustKidding <jk@vin.ovh> | 2023-11-12 06:13:33 -0500 |
commit | 98c36ce2846436a575cd15ae3ee260efb87efe49 (patch) | |
tree | 67d0038811ce9a135e7e8f693e05d2fa2eef93ce | |
parent | b28313510259259115a505c7d980958a2a214425 (diff) | |
download | ungoogled-chromium-98c36ce2846436a575cd15ae3ee260efb87efe49.tar.gz ungoogled-chromium-98c36ce2846436a575cd15ae3ee260efb87efe49.tar.bz2 ungoogled-chromium-98c36ce2846436a575cd15ae3ee260efb87efe49.zip |
upgpkg: ungoogled-chromium 119.0.6045.123-1
upstream release
-rw-r--r-- | .SRCINFO | 30 | ||||
-rw-r--r-- | 0001-adjust-buffer-format-order.patch | 65 | ||||
-rw-r--r-- | 0001-enable-linux-unstable-deb-target.patch | 33 | ||||
-rw-r--r-- | 0001-ozone-wayland-implement-text_input_manager-fixes.patch | 42 | ||||
-rw-r--r-- | 0001-ozone-wayland-implement-text_input_manager_v3.patch | 521 | ||||
-rw-r--r-- | 0001-vaapi-flag-ozone-wayland.patch | 23 | ||||
-rw-r--r-- | PKGBUILD | 37 | ||||
-rw-r--r-- | ozone-add-va-api-support-to-wayland.patch | 128 | ||||
-rw-r--r-- | remove-main-main10-profile-limit.patch | 33 | ||||
-rw-r--r-- | vaapi-add-av1-support.patch | 51 |
10 files changed, 727 insertions, 236 deletions
@@ -1,6 +1,6 @@ pkgbase = ungoogled-chromium pkgdesc = A lightweight approach to removing Google web service dependency - pkgver = 119.0.6045.105 + pkgver = 119.0.6045.123 pkgrel = 1 url = https://github.com/ungoogled-software/ungoogled-chromium arch = x86_64 @@ -56,28 +56,32 @@ pkgbase = ungoogled-chromium optdepends = gtk4: for --gtk-version=4 (GTK4 IME might work better on Wayland) optdepends = org.freedesktop.secrets: password storage backend on GNOME / Xfce optdepends = kwallet: support for storing passwords in KWallet on Plasma - provides = chromium=119.0.6045.105 - provides = chromedriver=119.0.6045.105 + provides = chromium=119.0.6045.123 + provides = chromedriver=119.0.6045.123 conflicts = chromium conflicts = chromedriver options = !lto - source = https://commondatastorage.googleapis.com/chromium-browser-official/chromium-119.0.6045.105.tar.xz + source = https://commondatastorage.googleapis.com/chromium-browser-official/chromium-119.0.6045.123.tar.xz source = https://github.com/foutrelis/chromium-launcher/archive/v8/chromium-launcher-8.tar.gz source = https://gitlab.com/Matt.Jolly/chromium-patches/-/archive/119/chromium-patches-119.tar.bz2 source = REVERT-disable-autoupgrading-debug-info.patch source = use-oauth2-client-switches-as-default.patch - source = ungoogled-chromium-119.0.6045.105-1.tar.gz::https://github.com/ungoogled-software/ungoogled-chromium/archive/119.0.6045.105-1.tar.gz - source = ozone-add-va-api-support-to-wayland.patch - source = vaapi-add-av1-support.patch - source = remove-main-main10-profile-limit.patch - sha256sums = 73cb8c39e928f8c627d747d37a3b020f08913ef5508f893758d70bdbd545dbcf + source = ungoogled-chromium-119.0.6045.123-1.tar.gz::https://github.com/ungoogled-software/ungoogled-chromium/archive/119.0.6045.123-1.tar.gz + source = 0001-vaapi-flag-ozone-wayland.patch + source = 0001-adjust-buffer-format-order.patch + source = 0001-enable-linux-unstable-deb-target.patch + source = 0001-ozone-wayland-implement-text_input_manager_v3.patch + source = 0001-ozone-wayland-implement-text_input_manager-fixes.patch + sha256sums = 6b61b87d0a201113b9c4e3d0ce48df52ecf869179c207e34b71add957fb7b48f sha256sums = 213e50f48b67feb4441078d50b0fd431df34323be15be97c55302d3fdac4483a sha256sums = 09ecf142254525ddb9c2dbbb2c71775e68722412923a5a9bba5cc2e46af8d087 sha256sums = 1b782b0f6d4f645e4e0daa8a4852d63f0c972aa0473319216ff04613a0592a69 sha256sums = e393174d7695d0bafed69e868c5fbfecf07aa6969f3b64596d0bae8b067e1711 - sha256sums = e5d74a46cd79b79a3f2f8f8fadce8329ad50f4a4facd76365d28e0761173aa26 - sha256sums = e9e8d3a82da818f0a67d4a09be4ecff5680b0534d7f0198befb3654e9fab5b69 - sha256sums = e742cc5227b6ad6c3e0c2026edd561c6d3151e7bf0afb618578ede181451b307 - sha256sums = be8d3475427553feb5bd46665ead3086301ed93c9a41cf6cc2644811c5bda51c + sha256sums = e20df54944837fc5097369b3c52b6d6922c1a32a57f25769c5bbff8a4db8bebe + sha256sums = 9a5594293616e1390462af1f50276ee29fd6075ffab0e3f944f6346cb2eb8aec + sha256sums = 8ba5c67b7eb6cacd2dbbc29e6766169f0fca3bbb07779b1a0a76c913f17d343f + sha256sums = 2a44756404e13c97d000cc0d859604d6848163998ea2f838b3b9bb2c840967e3 + sha256sums = d9974ddb50777be428fd0fa1e01ffe4b587065ba6adefea33678e1b3e25d1285 + sha256sums = a2da75d0c20529f2d635050e0662941c0820264ea9371eb900b9d90b5968fa6a pkgname = ungoogled-chromium diff --git a/0001-adjust-buffer-format-order.patch b/0001-adjust-buffer-format-order.patch new file mode 100644 index 0000000..23830ce --- /dev/null +++ b/0001-adjust-buffer-format-order.patch @@ -0,0 +1,65 @@ +From 44a44adecbc97242371cf67f8bbd5553c95fa123 Mon Sep 17 00:00:00 2001 +From: Yaowei Zhou <yaowei.zhou@intel.com> +Date: Wed, 18 Jan 2023 17:00:50 +0800 +Subject: [PATCH] Adjust the order of wayland drm and zwp dma buf in WaylandBufferFactory + +Adjust the order as buffer format implementation of zwp dma buffer from +Mutter, which will cause inconsistent with gbm support format list of +GPU process. + +Bug: N/A +Change-Id: Ice63c52fbd6eff0a099c35c0943e24c1fd1a1d70 +--- + +diff --git a/ui/ozone/platform/wayland/host/wayland_buffer_factory.cc b/ui/ozone/platform/wayland/host/wayland_buffer_factory.cc +index 2376d77..7d6c032e 100644 +--- a/ui/ozone/platform/wayland/host/wayland_buffer_factory.cc ++++ b/ui/ozone/platform/wayland/host/wayland_buffer_factory.cc +@@ -25,13 +25,13 @@ + uint32_t planes_count, + wl::OnRequestBufferCallback callback) const { + DCHECK(SupportsDmabuf()); +- if (wayland_zwp_dmabuf_) { ++ if (wayland_drm_) { ++ wayland_drm_->CreateBuffer(fd, size, strides, offsets, modifiers, format, ++ planes_count, std::move(callback)); ++ } else if (wayland_zwp_dmabuf_) { + wayland_zwp_dmabuf_->CreateBuffer(fd, size, strides, offsets, modifiers, + format, planes_count, + std::move(callback)); +- } else if (wayland_drm_) { +- wayland_drm_->CreateBuffer(fd, size, strides, offsets, modifiers, format, +- planes_count, std::move(callback)); + } else { + // This method must never be called if neither zwp_linux_dmabuf or wl_drm + // are supported. +@@ -52,10 +52,11 @@ + wl::BufferFormatsWithModifiersMap + WaylandBufferFactory::GetSupportedBufferFormats() const { + #if defined(WAYLAND_GBM) +- if (wayland_zwp_dmabuf_) +- return wayland_zwp_dmabuf_->supported_buffer_formats(); +- else if (wayland_drm_) ++ if (wayland_drm_) { + return wayland_drm_->supported_buffer_formats(); ++ } else if (wayland_zwp_dmabuf_) { ++ return wayland_zwp_dmabuf_->supported_buffer_formats(); ++ } + #endif + return {}; + } +@@ -71,10 +72,11 @@ + + bool WaylandBufferFactory::CanCreateDmabufImmed() const { + #if defined(WAYLAND_GBM) +- if (wayland_zwp_dmabuf_) +- return wayland_zwp_dmabuf_->CanCreateBufferImmed(); +- else if (wayland_drm_) ++ if (wayland_drm_) { + return wayland_drm_->CanCreateBufferImmed(); ++ } else if (wayland_zwp_dmabuf_) { ++ return wayland_zwp_dmabuf_->CanCreateBufferImmed(); ++ } + #endif + return false; + } diff --git a/0001-enable-linux-unstable-deb-target.patch b/0001-enable-linux-unstable-deb-target.patch new file mode 100644 index 0000000..4ae23e0 --- /dev/null +++ b/0001-enable-linux-unstable-deb-target.patch @@ -0,0 +1,33 @@ +From 22fe045deac0551720d7292022f443b22703f336 Mon Sep 17 00:00:00 2001 +From: Yaowei Zhou <yaowei.zhou@intel.com> +Date: Thu, 20 Apr 2023 14:37:26 +0800 +Subject: [PATCH] Enable "linux:unstable_deb" build target when using the chromium minigbm + +Bug: N/A +Change-Id: Ic37059be0f0719895acdba756292aed71820feba +--- + +diff --git a/third_party/minigbm/BUILD.gn b/third_party/minigbm/BUILD.gn +index 739e278..50bf5d8 100644 +--- a/third_party/minigbm/BUILD.gn ++++ b/third_party/minigbm/BUILD.gn +@@ -58,7 +58,7 @@ + } + } + +- shared_library("minigbm") { ++ static_library("minigbm") { + sources = [ + "src/amdgpu.c", + "src/dri.c", +@@ -89,8 +89,8 @@ + } + + # Clients need this to pick up the shared library correctly. +- all_dependent_configs = +- [ "//build/config/gcc:rpath_for_built_shared_libraries" ] ++ #all_dependent_configs = ++ # [ "//build/config/gcc:rpath_for_built_shared_libraries" ] + } + + # This target is used for Chromecast build, which expects the resulting lib diff --git a/0001-ozone-wayland-implement-text_input_manager-fixes.patch b/0001-ozone-wayland-implement-text_input_manager-fixes.patch new file mode 100644 index 0000000..0d4e551 --- /dev/null +++ b/0001-ozone-wayland-implement-text_input_manager-fixes.patch @@ -0,0 +1,42 @@ + +ui/ozone/platform/wayland/host/zwp_text_input_wrapper.h + +# https://github.com/chromium/chromium/commit/de30ba3f21f824be05443d5820b988d226780d68 +Support offset of surrounding text in Lacros wayland client. + +# https://github.com/chromium/chromium/commit/71bba2b7ae8117fdf053563a864d6cff018d7e94 +Support large size surrounding text in Lacros. + +--- +diff --git a/ui/ozone/platform/wayland/host/zwp_text_input_wrapper_v3.cc b/ui/ozone/platform/wayland/host/zwp_text_input_wrapper_v3.cc +index a3ce6e4..83f2c58 100644 +--- a/ui/ozone/platform/wayland/host/zwp_text_input_wrapper_v3.cc ++++ b/ui/ozone/platform/wayland/host/zwp_text_input_wrapper_v3.cc +@@ -147,6 +147,14 @@ void ZWPTextInputWrapperV3::SetSurroundingText( + zwp_text_input_v3_commit(obj_.get()); + } + ++bool ZWPTextInputWrapperV3::HasAdvancedSurroundingTextSupport() const { ++ return false; ++} ++ ++void ZWPTextInputWrapperV3::SetSurroundingTextOffsetUtf16( ++ uint32_t offset_utf16) { ++} ++ + void ZWPTextInputWrapperV3::ResetPendingState() { + commit_string_.clear(); + delete_surrounding_text_before_length_ = 0; +diff --git a/ui/ozone/platform/wayland/host/zwp_text_input_wrapper_v3.h b/ui/ozone/platform/wayland/host/zwp_text_input_wrapper_v3.h +index 204d7e3..5d03a1d 100644 +--- a/ui/ozone/platform/wayland/host/zwp_text_input_wrapper_v3.h ++++ b/ui/ozone/platform/wayland/host/zwp_text_input_wrapper_v3.h +@@ -45,6 +45,8 @@ class ZWPTextInputWrapperV3 : public ZWPTextInputWrapper { + void SetCursorRect(const gfx::Rect& rect) override; + void SetSurroundingText(const std::string& text, + const gfx::Range& selection_range) override; ++ bool HasAdvancedSurroundingTextSupport() const override; ++ void SetSurroundingTextOffsetUtf16(uint32_t offset_utf16) override; + void SetContentType(TextInputType type, + TextInputMode mode, + uint32_t flags, diff --git a/0001-ozone-wayland-implement-text_input_manager_v3.patch b/0001-ozone-wayland-implement-text_input_manager_v3.patch new file mode 100644 index 0000000..7691178 --- /dev/null +++ b/0001-ozone-wayland-implement-text_input_manager_v3.patch @@ -0,0 +1,521 @@ +From dba362808a97ced4f43635cbd73de6b06d156527 Mon Sep 17 00:00:00 2001 +From: Moon Sungjoon <sumoon@seoulsaram.org> +Date: Wed, 26 Apr 2023 03:25:44 +0900 +Subject: [PATCH] ui/ozone/platform/wayland: Implement text_input_manager_v3 + +Based on the original work of Lukas Lihotzki <lukas@lihotzki.de> in https://crrev.com/c/3015331 + +Bug: 1227719 +Change-Id: Ib883c9087377c9f1a0dfacc45a27e3e67ccf042e +--- + +diff --git a/AUTHORS b/AUTHORS +index f275151..a43a528 100644 +--- a/AUTHORS ++++ b/AUTHORS +@@ -942,6 +942,7 @@ Mohit Bhalla <bhallam@amazon.com> + Moiseanu Rares-Marian <moiseanurares@gmail.com> + Momoka Yamamoto <momoka.my6@gmail.com> + Momoko Hattori <momohatt10@gmail.com> ++Moon Sungjoon <sumoon@seoulsaram.org> + Mostafa Sedaghat joo <mostafa.sedaghat@gmail.com> + Mrunal Kapade <mrunal.kapade@intel.com> + Munira Tursunova <moonira@google.com> +diff --git a/third_party/wayland-protocols/BUILD.gn b/third_party/wayland-protocols/BUILD.gn +index c84ec11..dffa0aa 100644 +--- a/third_party/wayland-protocols/BUILD.gn ++++ b/third_party/wayland-protocols/BUILD.gn +@@ -141,7 +141,10 @@ wayland_protocol("text_input_extension_protocol") { + } + + wayland_protocol("text_input_protocol") { +- sources = [ "src/unstable/text-input/text-input-unstable-v1.xml" ] ++ sources = [ ++ "src/unstable/text-input/text-input-unstable-v1.xml", ++ "src/unstable/text-input/text-input-unstable-v3.xml", ++ ] + } + + wayland_protocol("touchpad_haptics_protocol") { +diff --git a/ui/ozone/platform/wayland/BUILD.gn b/ui/ozone/platform/wayland/BUILD.gn +index 31314f3..c22888c 100644 +--- a/ui/ozone/platform/wayland/BUILD.gn ++++ b/ui/ozone/platform/wayland/BUILD.gn +@@ -221,6 +221,8 @@ source_set("wayland") { + "host/zwp_text_input_wrapper.h", + "host/zwp_text_input_wrapper_v1.cc", + "host/zwp_text_input_wrapper_v1.h", ++ "host/zwp_text_input_wrapper_v3.cc", ++ "host/zwp_text_input_wrapper_v3.h", + "ozone_platform_wayland.cc", + "ozone_platform_wayland.h", + "wayland_utils.cc", +diff --git a/ui/ozone/platform/wayland/common/wayland_object.cc b/ui/ozone/platform/wayland/common/wayland_object.cc +index bcc48aa..009667b 100644 +--- a/ui/ozone/platform/wayland/common/wayland_object.cc ++++ b/ui/ozone/platform/wayland/common/wayland_object.cc +@@ -30,6 +30,7 @@ + #include <surface-augmenter-client-protocol.h> + #include <text-input-extension-unstable-v1-client-protocol.h> + #include <text-input-unstable-v1-client-protocol.h> ++#include <text-input-unstable-v3-client-protocol.h> + #include <touchpad-haptics-unstable-v1-client-protocol.h> + #include <viewporter-client-protocol.h> + #include <wayland-client-core.h> +@@ -287,6 +288,8 @@ IMPLEMENT_WAYLAND_OBJECT_TRAITS(zwp_relative_pointer_manager_v1) + IMPLEMENT_WAYLAND_OBJECT_TRAITS(zwp_relative_pointer_v1) + IMPLEMENT_WAYLAND_OBJECT_TRAITS(zwp_text_input_manager_v1) + IMPLEMENT_WAYLAND_OBJECT_TRAITS(zwp_text_input_v1) ++IMPLEMENT_WAYLAND_OBJECT_TRAITS(zwp_text_input_manager_v3) ++IMPLEMENT_WAYLAND_OBJECT_TRAITS(zwp_text_input_v3) + IMPLEMENT_WAYLAND_OBJECT_TRAITS(zxdg_decoration_manager_v1) + IMPLEMENT_WAYLAND_OBJECT_TRAITS(zxdg_exporter_v1) + IMPLEMENT_WAYLAND_OBJECT_TRAITS(zxdg_exported_v1) +diff --git a/ui/ozone/platform/wayland/common/wayland_object.h b/ui/ozone/platform/wayland/common/wayland_object.h +index c84c084..0817e78 100644 +--- a/ui/ozone/platform/wayland/common/wayland_object.h ++++ b/ui/ozone/platform/wayland/common/wayland_object.h +@@ -202,6 +202,8 @@ DECLARE_WAYLAND_OBJECT_TRAITS(zwp_relative_pointer_manager_v1) + DECLARE_WAYLAND_OBJECT_TRAITS(zwp_relative_pointer_v1) + DECLARE_WAYLAND_OBJECT_TRAITS(zwp_text_input_manager_v1) + DECLARE_WAYLAND_OBJECT_TRAITS(zwp_text_input_v1) ++DECLARE_WAYLAND_OBJECT_TRAITS(zwp_text_input_manager_v3) ++DECLARE_WAYLAND_OBJECT_TRAITS(zwp_text_input_v3) + DECLARE_WAYLAND_OBJECT_TRAITS(zxdg_decoration_manager_v1) + DECLARE_WAYLAND_OBJECT_TRAITS(zxdg_exporter_v1) + DECLARE_WAYLAND_OBJECT_TRAITS(zxdg_exported_v1) +diff --git a/ui/ozone/platform/wayland/host/wayland_connection.cc b/ui/ozone/platform/wayland/host/wayland_connection.cc +index ad3bbd6..995b1e2 100644 +--- a/ui/ozone/platform/wayland/host/wayland_connection.cc ++++ b/ui/ozone/platform/wayland/host/wayland_connection.cc +@@ -647,6 +647,14 @@ void WaylandConnection::HandleGlobal(wl_registry* registry, + strcmp(interface, "zcr_text_input_extension_v1") == 0) { + text_input_extension_v1_ = wl::Bind<zcr_text_input_extension_v1>( + registry, name, std::min(version, kMaxTextInputExtensionVersion)); ++ } else if (!text_input_manager_v3_ && ++ strcmp(interface, "zwp_text_input_manager_v3") == 0) { ++ text_input_manager_v3_ = wl::Bind<zwp_text_input_manager_v3>( ++ registry, name, std::min(version, kMaxTextInputManagerVersion)); ++ if (!text_input_manager_v3_) { ++ LOG(ERROR) << "Failed to bind to zwp_text_input_manager_v3 global"; ++ return; ++ } + } else if (!xdg_decoration_manager_ && + strcmp(interface, "zxdg_decoration_manager_v1") == 0) { + xdg_decoration_manager_ = wl::Bind<zxdg_decoration_manager_v1>( +diff --git a/ui/ozone/platform/wayland/host/wayland_connection.h b/ui/ozone/platform/wayland/host/wayland_connection.h +index 6659bc5..f9739ea 100644 +--- a/ui/ozone/platform/wayland/host/wayland_connection.h ++++ b/ui/ozone/platform/wayland/host/wayland_connection.h +@@ -149,6 +149,9 @@ class WaylandConnection { + zcr_text_input_extension_v1* text_input_extension_v1() const { + return text_input_extension_v1_.get(); + } ++ zwp_text_input_manager_v3* text_input_manager_v3() const { ++ return text_input_manager_v3_.get(); ++ } + zwp_linux_explicit_synchronization_v1* linux_explicit_synchronization_v1() + const { + return linux_explicit_synchronization_.get(); +@@ -447,6 +450,7 @@ class WaylandConnection { + wl::Object<zcr_stylus_v2> zcr_stylus_v2_; + wl::Object<zwp_text_input_manager_v1> text_input_manager_v1_; + wl::Object<zcr_text_input_extension_v1> text_input_extension_v1_; ++ wl::Object<zwp_text_input_manager_v3> text_input_manager_v3_; + wl::Object<zwp_linux_explicit_synchronization_v1> + linux_explicit_synchronization_; + wl::Object<zxdg_decoration_manager_v1> xdg_decoration_manager_; +diff --git a/ui/ozone/platform/wayland/host/wayland_input_method_context.cc b/ui/ozone/platform/wayland/host/wayland_input_method_context.cc +index caa5074..c2e1798 100644 +--- a/ui/ozone/platform/wayland/host/wayland_input_method_context.cc ++++ b/ui/ozone/platform/wayland/host/wayland_input_method_context.cc +@@ -35,6 +35,7 @@ + #include "ui/ozone/platform/wayland/host/wayland_seat.h" + #include "ui/ozone/platform/wayland/host/wayland_window.h" + #include "ui/ozone/platform/wayland/host/zwp_text_input_wrapper_v1.h" ++#include "ui/ozone/platform/wayland/host/zwp_text_input_wrapper_v3.h" + #include "ui/ozone/public/ozone_switches.h" + + #if BUILDFLAG(USE_XKBCOMMON) +@@ -285,11 +286,18 @@ void WaylandInputMethodContext::Init(bool initialize_for_testing) { + // If text input instance is not created then all ime context operations + // are noop. This option is because in some environments someone might not + // want to enable ime/virtual keyboard even if it's available. +- if (use_ozone_wayland_vkb && !text_input_ && +- connection_->text_input_manager_v1()) { ++ if (!use_ozone_wayland_vkb || text_input_) ++ return; ++ ++ // Prefer text_input_manager_v1 because it is more powerful. ++ // It supports preedit styling for example. ++ if (connection_->text_input_manager_v1()) { + text_input_ = std::make_unique<ZWPTextInputWrapperV1>( + connection_, this, connection_->text_input_manager_v1(), + connection_->text_input_extension_v1()); ++ } else if (connection_->text_input_manager_v3()) { ++ text_input_ = std::make_unique<ZWPTextInputWrapperV3>( ++ connection_, this, connection_->text_input_manager_v3()); + } + } + +@@ -657,6 +665,11 @@ void WaylandInputMethodContext::OnCursorPosition(int32_t index, + + void WaylandInputMethodContext::OnDeleteSurroundingText(int32_t index, + uint32_t length) { ++ // Never fail if length is 0. ++ if (length == 0) { ++ return; ++ } ++ + const auto& [surrounding_text, utf16_offset, selection, unsused_composition] = + surrounding_text_tracker_.predicted_state(); + DCHECK(selection.IsValid()); +diff --git a/ui/ozone/platform/wayland/host/zwp_text_input_wrapper_v3.cc b/ui/ozone/platform/wayland/host/zwp_text_input_wrapper_v3.cc +new file mode 100644 +index 0000000..a3ce6e4 +--- /dev/null ++++ b/ui/ozone/platform/wayland/host/zwp_text_input_wrapper_v3.cc +@@ -0,0 +1,239 @@ ++// Copyright 2023 The Chromium Authors ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++#include "ui/ozone/platform/wayland/host/zwp_text_input_wrapper_v3.h" ++ ++#include <string> ++#include <utility> ++ ++#include "base/logging.h" ++#include "base/memory/ptr_util.h" ++#include "ui/base/wayland/wayland_client_input_types.h" ++#include "ui/gfx/range/range.h" ++#include "ui/ozone/platform/wayland/host/wayland_connection.h" ++#include "ui/ozone/platform/wayland/host/wayland_seat.h" ++#include "ui/ozone/platform/wayland/host/wayland_window.h" ++ ++namespace ui { ++ ++// Converts Chrome's TextInputType into wayland's content_purpose. ++// Some of TextInputType values do not have clearly corresponding wayland value, ++// and they fallback to closer type. ++uint32_t InputTypeToContentPurpose(TextInputType input_type) { ++ switch (input_type) { ++ case TEXT_INPUT_TYPE_NONE: ++ return ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_NORMAL; ++ case TEXT_INPUT_TYPE_TEXT: ++ return ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_NORMAL; ++ case TEXT_INPUT_TYPE_PASSWORD: ++ return ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_PASSWORD; ++ case TEXT_INPUT_TYPE_SEARCH: ++ return ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_NORMAL; ++ case TEXT_INPUT_TYPE_EMAIL: ++ return ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_EMAIL; ++ case TEXT_INPUT_TYPE_NUMBER: ++ return ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_NUMBER; ++ case TEXT_INPUT_TYPE_TELEPHONE: ++ return ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_PHONE; ++ case TEXT_INPUT_TYPE_URL: ++ return ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_URL; ++ case TEXT_INPUT_TYPE_DATE: ++ return ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_DATE; ++ case TEXT_INPUT_TYPE_DATE_TIME: ++ return ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_DATETIME; ++ case TEXT_INPUT_TYPE_DATE_TIME_LOCAL: ++ return ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_DATETIME; ++ case TEXT_INPUT_TYPE_MONTH: ++ return ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_DATE; ++ case TEXT_INPUT_TYPE_TIME: ++ return ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_TIME; ++ case TEXT_INPUT_TYPE_WEEK: ++ return ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_DATE; ++ case TEXT_INPUT_TYPE_TEXT_AREA: ++ return ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_NORMAL; ++ case TEXT_INPUT_TYPE_CONTENT_EDITABLE: ++ return ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_NORMAL; ++ case TEXT_INPUT_TYPE_DATE_TIME_FIELD: ++ return ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_DATETIME; ++ case TEXT_INPUT_TYPE_NULL: ++ return ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_NORMAL; ++ } ++} ++ ++// Converts Chrome's TextInputType into wayland's content_hint. ++uint32_t InputFlagsToContentHint(int input_flags) { ++ uint32_t hint = 0; ++ if (input_flags & TEXT_INPUT_FLAG_AUTOCOMPLETE_ON) ++ hint |= ZWP_TEXT_INPUT_V3_CONTENT_HINT_COMPLETION; ++ if (input_flags & TEXT_INPUT_FLAG_SPELLCHECK_ON) ++ hint |= ZWP_TEXT_INPUT_V3_CONTENT_HINT_SPELLCHECK; ++ // No good match. Fallback to AUTO_CORRECTION. ++ if (input_flags & TEXT_INPUT_FLAG_AUTOCORRECT_ON) ++ hint |= ZWP_TEXT_INPUT_V3_CONTENT_HINT_SPELLCHECK; ++ if (input_flags & TEXT_INPUT_FLAG_AUTOCAPITALIZE_CHARACTERS) ++ hint |= ZWP_TEXT_INPUT_V3_CONTENT_HINT_AUTO_CAPITALIZATION; ++ if (input_flags & TEXT_INPUT_FLAG_AUTOCAPITALIZE_WORDS) ++ hint |= ZWP_TEXT_INPUT_V3_CONTENT_HINT_AUTO_CAPITALIZATION; ++ if (input_flags & TEXT_INPUT_FLAG_AUTOCAPITALIZE_SENTENCES) ++ hint |= ZWP_TEXT_INPUT_V3_CONTENT_HINT_AUTO_CAPITALIZATION; ++ if (input_flags & TEXT_INPUT_FLAG_HAS_BEEN_PASSWORD) ++ hint |= ZWP_TEXT_INPUT_V3_CONTENT_HINT_SENSITIVE_DATA; ++ return hint; ++} ++ ++ZWPTextInputWrapperV3::ZWPTextInputWrapperV3( ++ WaylandConnection* connection, ++ ZWPTextInputWrapperClient* client, ++ zwp_text_input_manager_v3* text_input_manager) ++ : connection_(connection), client_(client) { ++ static const zwp_text_input_v3_listener text_input_listener = { ++ &OnEnter, // text_input_enter, ++ &OnLeave, // text_input_leave, ++ &OnPreeditString, // text_input_preedit_string, ++ &OnCommitString, // text_input_commit_string, ++ &OnDeleteSurroundingText, // text_input_delete_surrounding_text, ++ &OnDone, // text_input_done, ++ }; ++ ++ DCHECK(text_input_manager); ++ auto* text_input = zwp_text_input_manager_v3_get_text_input( ++ text_input_manager, connection_->seat()->wl_object()); ++ obj_ = wl::Object<zwp_text_input_v3>(text_input); ++ ++ zwp_text_input_v3_add_listener(text_input, &text_input_listener, this); ++} ++ ++ZWPTextInputWrapperV3::~ZWPTextInputWrapperV3() = default; ++ ++void ZWPTextInputWrapperV3::Reset() { ++ NOTIMPLEMENTED_LOG_ONCE(); ++} ++ ++void ZWPTextInputWrapperV3::Activate(WaylandWindow* window, ++ TextInputClient::FocusReason reason) { ++ zwp_text_input_v3_enable(obj_.get()); ++ zwp_text_input_v3_commit(obj_.get()); ++} ++ ++void ZWPTextInputWrapperV3::Deactivate() { ++ zwp_text_input_v3_disable(obj_.get()); ++ zwp_text_input_v3_commit(obj_.get()); ++} ++ ++void ZWPTextInputWrapperV3::ShowInputPanel() { ++ // Not directly supported in zwp_text_input_v3 ++ // Enable again to show the screen keyboard in GNOME: ++ // https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1543#note_1051704 ++ zwp_text_input_v3_enable(obj_.get()); ++ zwp_text_input_v3_commit(obj_.get()); ++} ++ ++void ZWPTextInputWrapperV3::HideInputPanel() { ++ // unsupported in zwp_text_input_v3 ++} ++ ++void ZWPTextInputWrapperV3::SetCursorRect(const gfx::Rect& rect) { ++ zwp_text_input_v3_set_cursor_rectangle(obj_.get(), rect.x(), rect.y(), ++ rect.width(), rect.height()); ++ zwp_text_input_v3_commit(obj_.get()); ++} ++ ++void ZWPTextInputWrapperV3::SetSurroundingText( ++ const std::string& text, ++ const gfx::Range& selection_range) { ++ zwp_text_input_v3_set_surrounding_text( ++ obj_.get(), text.c_str(), selection_range.start(), selection_range.end()); ++ zwp_text_input_v3_commit(obj_.get()); ++} ++ ++void ZWPTextInputWrapperV3::ResetPendingState() { ++ commit_string_.clear(); ++ delete_surrounding_text_before_length_ = 0; ++ delete_surrounding_text_after_length_ = 0; ++ preedit_string_.clear(); ++ preedit_string_cursor_begin_ = 0; ++ preedit_string_cursor_end_ = 0; ++} ++ ++void ZWPTextInputWrapperV3::SetContentType(ui::TextInputType type, ++ ui::TextInputMode mode, ++ uint32_t flags, ++ bool should_do_learning, ++ bool can_compose_inline) { ++ // V3 doesn't have extension ++ uint32_t content_purpose = InputTypeToContentPurpose(type); ++ uint32_t content_hint = InputFlagsToContentHint(flags); ++ static_cast<void>(flags); ++ static_cast<void>(should_do_learning); ++ zwp_text_input_v3_set_content_type(obj_.get(), content_hint, content_purpose); ++} ++ ++void ZWPTextInputWrapperV3::OnEnter(void* data, ++ struct zwp_text_input_v3* text_input, ++ struct wl_surface* surface) { ++ NOTIMPLEMENTED_LOG_ONCE(); ++} ++ ++void ZWPTextInputWrapperV3::OnLeave(void* data, ++ struct zwp_text_input_v3* text_input, ++ struct wl_surface* surface) { ++ NOTIMPLEMENTED_LOG_ONCE(); ++} ++ ++void ZWPTextInputWrapperV3::OnPreeditString( ++ void* data, ++ struct zwp_text_input_v3* text_input, ++ const char* text, ++ int32_t cursor_begin, ++ int32_t cursor_end) { ++ auto* wti = static_cast<ZWPTextInputWrapperV3*>(data); ++ wti->preedit_string_ = text ? text : ""; ++ wti->preedit_string_cursor_begin_ = cursor_begin; ++ wti->preedit_string_cursor_end_ = cursor_end; ++} ++ ++void ZWPTextInputWrapperV3::OnCommitString(void* data, ++ struct zwp_text_input_v3* text_input, ++ const char* text) { ++ auto* wti = static_cast<ZWPTextInputWrapperV3*>(data); ++ wti->commit_string_ = text ? text : ""; ++} ++ ++void ZWPTextInputWrapperV3::OnDeleteSurroundingText( ++ void* data, ++ struct zwp_text_input_v3* text_input, ++ uint32_t before_length, ++ uint32_t after_length) { ++ auto* wti = static_cast<ZWPTextInputWrapperV3*>(data); ++ wti->delete_surrounding_text_before_length_ = before_length; ++ wti->delete_surrounding_text_after_length_ = after_length; ++} ++ ++void ZWPTextInputWrapperV3::OnDone(void* data, ++ struct zwp_text_input_v3* text_input, ++ uint32_t serial) { ++ auto* wti = static_cast<ZWPTextInputWrapperV3*>(data); ++ wti->client_->OnPreeditString("", {}, 0); ++ wti->client_->OnDeleteSurroundingText( ++ -int32_t(wti->delete_surrounding_text_before_length_), ++ int32_t(wti->delete_surrounding_text_before_length_) + ++ int32_t(wti->delete_surrounding_text_after_length_)); ++ wti->client_->OnCommitString(wti->commit_string_.c_str()); ++ wti->client_->OnPreeditString(wti->preedit_string_.c_str(), {}, ++ wti->preedit_string_cursor_begin_); ++ wti->ResetPendingState(); ++} ++ ++void ZWPTextInputWrapperV3::SetGrammarFragmentAtCursor( ++ const ui::GrammarFragment& fragment) { ++ NOTIMPLEMENTED_LOG_ONCE(); ++} ++ ++void ZWPTextInputWrapperV3::SetAutocorrectInfo( ++ const gfx::Range& autocorrect_range, ++ const gfx::Rect& autocorrect_bounds) { ++ NOTIMPLEMENTED_LOG_ONCE(); ++} ++ ++} // namespace ui +diff --git a/ui/ozone/platform/wayland/host/zwp_text_input_wrapper_v3.h b/ui/ozone/platform/wayland/host/zwp_text_input_wrapper_v3.h +new file mode 100644 +index 0000000..204d7e3 +--- /dev/null ++++ b/ui/ozone/platform/wayland/host/zwp_text_input_wrapper_v3.h +@@ -0,0 +1,98 @@ ++// Copyright 2023 The Chromium Authors ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++#ifndef UI_OZONE_PLATFORM_WAYLAND_HOST_ZWP_TEXT_INPUT_WRAPPER_V3_H_ ++#define UI_OZONE_PLATFORM_WAYLAND_HOST_ZWP_TEXT_INPUT_WRAPPER_V3_H_ ++ ++#include <cstdint> ++#include <string> ++ ++#include <text-input-unstable-v3-client-protocol.h> ++ ++#include "base/memory/raw_ptr.h" ++#include "ui/ozone/platform/wayland/common/wayland_object.h" ++#include "ui/ozone/platform/wayland/host/zwp_text_input_wrapper.h" ++ ++namespace gfx { ++class Rect; ++} ++ ++namespace ui { ++ ++class WaylandConnection; ++class WaylandWindow; ++ ++// Text input wrapper for text-input-unstable-v3 ++class ZWPTextInputWrapperV3 : public ZWPTextInputWrapper { ++ public: ++ ZWPTextInputWrapperV3(WaylandConnection* connection, ++ ZWPTextInputWrapperClient* client, ++ zwp_text_input_manager_v3* text_input_manager); ++ ZWPTextInputWrapperV3(const ZWPTextInputWrapperV3&) = delete; ++ ZWPTextInputWrapperV3& operator=(const ZWPTextInputWrapperV3&) = delete; ++ ~ZWPTextInputWrapperV3() override; ++ ++ void Reset() override; ++ ++ void Activate(WaylandWindow* window, ++ ui::TextInputClient::FocusReason reason) override; ++ void Deactivate() override; ++ ++ void ShowInputPanel() override; ++ void HideInputPanel() override; ++ ++ void SetCursorRect(const gfx::Rect& rect) override; ++ void SetSurroundingText(const std::string& text, ++ const gfx::Range& selection_range) override; ++ void SetContentType(TextInputType type, ++ TextInputMode mode, ++ uint32_t flags, ++ bool should_do_learning, ++ bool can_compose_inline) override; ++ void SetGrammarFragmentAtCursor(const ui::GrammarFragment& fragment) override; ++ void SetAutocorrectInfo(const gfx::Range& autocorrect_range, ++ const gfx::Rect& autocorrect_bounds) override; ++ ++ private: ++ void ResetPendingState(); ++ ++ // zwp_text_input_v3_listener ++ static void OnEnter(void* data, ++ struct zwp_text_input_v3* text_input, ++ struct wl_surface* surface); ++ static void OnLeave(void* data, ++ struct zwp_text_input_v3* text_input, ++ struct wl_surface* surface); ++ static void OnPreeditString(void* data, ++ struct zwp_text_input_v3* text_input, ++ const char* text, ++ int32_t cursor_begin, ++ int32_t cursor_end); ++ static void OnCommitString(void* data, ++ struct zwp_text_input_v3* text_input, ++ const char* text); ++ static void OnDeleteSurroundingText(void* data, ++ struct zwp_text_input_v3* text_input, ++ uint32_t before_length, ++ uint32_t after_length); ++ static void OnDone(void* data, ++ struct zwp_text_input_v3* text_input, ++ uint32_t serial); ++ ++ const raw_ptr<WaylandConnection> connection_; ++ wl::Object<zwp_text_input_v3> obj_; ++ const raw_ptr<ZWPTextInputWrapperClient> client_; ++ ++ // pending state until OnDone ++ std::string commit_string_; ++ uint32_t delete_surrounding_text_before_length_ = 0; ++ uint32_t delete_surrounding_text_after_length_ = 0; ++ std::string preedit_string_; // preedit string of pending state ++ int32_t preedit_string_cursor_begin_ = 0; ++ int32_t preedit_string_cursor_end_ = 0; ++}; ++ ++} // namespace ui ++ ++#endif // UI_OZONE_PLATFORM_WAYLAND_HOST_ZWP_TEXT_INPUT_WRAPPER_V3_H_ diff --git a/0001-vaapi-flag-ozone-wayland.patch b/0001-vaapi-flag-ozone-wayland.patch new file mode 100644 index 0000000..3cdaaa8 --- /dev/null +++ b/0001-vaapi-flag-ozone-wayland.patch @@ -0,0 +1,23 @@ +From 12724af6284195381377e074cc7f7c2fbc6cb05c Mon Sep 17 00:00:00 2001 +From: Yaowei Zhou <yaowei.zhou@intel.com> +Date: Tue, 30 May 2023 12:45:27 +0800 +Subject: [PATCH] Enable VA-API flag on ozone wayland + +Bug: POC +Change-Id: I4af3c2c4925958bbca86a25a4d9c66fd8922c806 +--- + +diff --git a/ui/ozone/platform/wayland/ozone_platform_wayland.cc b/ui/ozone/platform/wayland/ozone_platform_wayland.cc +index 1de5c418..9f2f1f5 100644 +--- a/ui/ozone/platform/wayland/ozone_platform_wayland.cc ++++ b/ui/ozone/platform/wayland/ozone_platform_wayland.cc +@@ -311,6 +311,9 @@ + // arbitrary position. + properties->supports_global_screen_coordinates = + kDefaultScreenCoordinateEnabled; ++ ++ properties->supports_vaapi = true; ++ + initialised = true; + } + @@ -11,7 +11,7 @@ # Contributor: Daniel J Griffiths <ghost1227@archlinux.us> pkgname=ungoogled-chromium -pkgver=119.0.6045.105 +pkgver=119.0.6045.123 pkgrel=1 _launcher_ver=8 _manual_clone=0 @@ -36,7 +36,7 @@ source=(https://commondatastorage.googleapis.com/chromium-browser-official/chrom https://gitlab.com/Matt.Jolly/chromium-patches/-/archive/${pkgver%%.*}/chromium-patches-${pkgver%%.*}.tar.bz2 REVERT-disable-autoupgrading-debug-info.patch use-oauth2-client-switches-as-default.patch) -sha256sums=('73cb8c39e928f8c627d747d37a3b020f08913ef5508f893758d70bdbd545dbcf' +sha256sums=('6b61b87d0a201113b9c4e3d0ce48df52ecf869179c207e34b71add957fb7b48f' '213e50f48b67feb4441078d50b0fd431df34323be15be97c55302d3fdac4483a' '09ecf142254525ddb9c2dbbb2c71775e68722412923a5a9bba5cc2e46af8d087' '1b782b0f6d4f645e4e0daa8a4852d63f0c972aa0473319216ff04613a0592a69' @@ -53,14 +53,19 @@ _uc_usr=ungoogled-software _uc_ver=$pkgver-1 source=(${source[@]} $pkgname-$_uc_ver.tar.gz::https://github.com/$_uc_usr/ungoogled-chromium/archive/$_uc_ver.tar.gz - ozone-add-va-api-support-to-wayland.patch - vaapi-add-av1-support.patch - remove-main-main10-profile-limit.patch) + 0001-vaapi-flag-ozone-wayland.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) sha256sums=(${sha256sums[@]} - 'e5d74a46cd79b79a3f2f8f8fadce8329ad50f4a4facd76365d28e0761173aa26' - 'e9e8d3a82da818f0a67d4a09be4ecff5680b0534d7f0198befb3654e9fab5b69' - 'e742cc5227b6ad6c3e0c2026edd561c6d3151e7bf0afb618578ede181451b307' - 'be8d3475427553feb5bd46665ead3086301ed93c9a41cf6cc2644811c5bda51c') + 'e20df54944837fc5097369b3c52b6d6922c1a32a57f25769c5bbff8a4db8bebe' + '9a5594293616e1390462af1f50276ee29fd6075ffab0e3f944f6346cb2eb8aec' + '8ba5c67b7eb6cacd2dbbc29e6766169f0fca3bbb07779b1a0a76c913f17d343f' + '2a44756404e13c97d000cc0d859604d6848163998ea2f838b3b9bb2c840967e3' + 'd9974ddb50777be428fd0fa1e01ffe4b587065ba6adefea33678e1b3e25d1285' + 'a2da75d0c20529f2d635050e0662941c0820264ea9371eb900b9d90b5968fa6a') + # 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 @@ -138,11 +143,21 @@ prepare() { patch -Np1 -i ../chromium-patches-*/chromium-119-clang16.patch # Custom Patches - #patch -Np1 -i ../ozone-add-va-api-support-to-wayland.patch - #patch -Np1 -i ../vaapi-add-av1-support.patch sed -i '/^bool IsHevcProfileSupported(const VideoType& type) {$/{s++bool IsHevcProfileSupported(const VideoType\& type) { return true;+;h};${x;/./{x;q0};x;q1}' \ media/base/supported_types.cc + # Implement text_input_manager_v3 + # https://chromium-review.googlesource.com/c/chromium/src/+/3750452 + patch -Np1 -i ../0001-ozone-wayland-implement-text_input_manager_v3.patch + patch -Np1 -i ../0001-ozone-wayland-implement-text_input_manager-fixes.patch + + # Enable VAAPI on Wayland + # https://discourse.ubuntu.com/t/chromium-hardware-accelerated-build-for-intel-based-platforms-available-for-beta-testing/35625 + # https://git.launchpad.net/~chromium-team/chromium-browser/+git/snap-from-source/ + # patch -Np1 -i ../0001-enable-linux-unstable-deb-target.patch + patch -Np1 -i ../0001-adjust-buffer-format-order.patch + patch -Np1 -i ../0001-vaapi-flag-ozone-wayland.patch + # Ungoogled Chromium changes _ungoogled_repo="$srcdir/$pkgname-$_uc_ver" _utils="${_ungoogled_repo}/utils" diff --git a/ozone-add-va-api-support-to-wayland.patch b/ozone-add-va-api-support-to-wayland.patch deleted file mode 100644 index 5abe859..0000000 --- a/ozone-add-va-api-support-to-wayland.patch +++ /dev/null @@ -1,128 +0,0 @@ -From: Maksim Sisov <msisov@igalia.com> -Date: Wed, 20 Jan 2021 09:50:22 +0200 -Subject: [PATCH] ozone/wayland: add VA-API support. - -This patch ads VA-API support utilizing old VA-API path used for -ChromeOS, which can be buggy on some devices (currently tested -on Intel Gen8 and Gen9 with Gen8 having some minor bugs). - -It's known that a new VA-API is being developed atm and once it's ready, -we will switch to a new path, which should be more stable. - -Upstream-Status: Inappropriate - -The patch is based on the old va-api path. ChromeOS -team is working on the new path, which will be also employed -by Wayland later. - ---- -diff --git a/media/gpu/vaapi/vaapi_picture_factory.cc b/media/gpu/vaapi/vaapi_picture_factory.cc -index 54825cd..0a57166 100644 ---- a/media/gpu/vaapi/vaapi_picture_factory.cc -+++ b/media/gpu/vaapi/vaapi_picture_factory.cc -@@ -105,7 +105,7 @@ uint32_t VaapiPictureFactory::GetGLTextureTarget() { - } - - gfx::BufferFormat VaapiPictureFactory::GetBufferFormat() { --#if BUILDFLAG(USE_VAAPI_X11) -+#if BUILDFLAG(IS_LINUX) - return gfx::BufferFormat::RGBX_8888; - #else - return gfx::BufferFormat::YUV_420_BIPLANAR; -diff --git a/media/gpu/vaapi/vaapi_picture_native_pixmap.cc b/media/gpu/vaapi/vaapi_picture_native_pixmap.cc -index 18c6c22..fe614b6 100644 ---- a/media/gpu/vaapi/vaapi_picture_native_pixmap.cc -+++ b/media/gpu/vaapi/vaapi_picture_native_pixmap.cc -@@ -4,6 +4,7 @@ - - #include "media/gpu/vaapi/vaapi_picture_native_pixmap.h" - -+#include "media/gpu/macros.h" - #include "media/gpu/vaapi/va_surface.h" - #include "media/gpu/vaapi/vaapi_wrapper.h" - #include "ui/gfx/buffer_format_util.h" -@@ -40,7 +41,21 @@ VaapiPictureNativePixmap::~VaapiPictureNativePixmap() = default; - bool VaapiPictureNativePixmap::DownloadFromSurface( - scoped_refptr<VASurface> va_surface) { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); -- return vaapi_wrapper_->BlitSurface(*va_surface, *va_surface_); -+ if (!vaapi_wrapper_->SyncSurface(va_surface->id())) { -+ VLOGF(1) << "Cannot sync VPP input surface"; -+ return false; -+ } -+ if (!vaapi_wrapper_->BlitSurface(*va_surface, *va_surface_)) { -+ VLOGF(1) << "Cannot convert decoded image into output buffer"; -+ return false; -+ } -+ -+ // Sync target surface since the buffer is returning to client. -+ if (!vaapi_wrapper_->SyncSurface(va_surface_->id())) { -+ VLOGF(1) << "Cannot sync VPP output surface"; -+ return false; -+ } -+ return true; - } - - bool VaapiPictureNativePixmap::AllowOverlay() const { -diff --git a/media/gpu/vaapi/vaapi_video_decode_accelerator.cc b/media/gpu/vaapi/vaapi_video_decode_accelerator.cc -index 37e3520..9d17122 100644 ---- a/media/gpu/vaapi/vaapi_video_decode_accelerator.cc -+++ b/media/gpu/vaapi/vaapi_video_decode_accelerator.cc -@@ -560,12 +560,12 @@ void VaapiVideoDecodeAccelerator::InitiateSurfaceSetChange( - requested_visible_rect_ = visible_rect; - if (buffer_allocation_mode_ == BufferAllocationMode::kSuperReduced) { - // Add one to the reference frames for the one being currently egressed. -- requested_num_reference_frames_ = num_reference_frames + 1; -+ requested_num_reference_frames_ = num_reference_frames + 4; - requested_num_pics_ = num_pics - num_reference_frames; - } else if (buffer_allocation_mode_ == BufferAllocationMode::kReduced) { - // Add one to the reference frames for the one being currently egressed, - // and an extra allocation for both |client_| and |decoder_|. -- requested_num_reference_frames_ = num_reference_frames + 2; -+ requested_num_reference_frames_ = num_reference_frames + 5; - requested_num_pics_ = num_pics - num_reference_frames + 1; - } else { - requested_num_reference_frames_ = 0; -diff --git a/ui/ozone/platform/wayland/gpu/gbm_pixmap_wayland.cc b/ui/ozone/platform/wayland/gpu/gbm_pixmap_wayland.cc -index 1a5016b..eca714b 100644 ---- a/ui/ozone/platform/wayland/gpu/gbm_pixmap_wayland.cc -+++ b/ui/ozone/platform/wayland/gpu/gbm_pixmap_wayland.cc -@@ -32,7 +32,9 @@ GbmPixmapWayland::GbmPixmapWayland(WaylandBufferManagerGpu* buffer_manager) - buffer_id_(buffer_manager->AllocateBufferID()) {} - - GbmPixmapWayland::~GbmPixmapWayland() { -- if (created_wl_buffer_) -+ // gfx::BufferUsage::SCANOUT_VDA_WRITE doesn't result in creation of -+ // wl_buffers. -+ if (created_wl_buffer_ && usage_ != gfx::BufferUsage::SCANOUT_VDA_WRITE) - buffer_manager_->DestroyBuffer(buffer_id_); - } - -diff --git a/ui/ozone/platform/wayland/gpu/gbm_pixmap_wayland.h b/ui/ozone/platform/wayland/gpu/gbm_pixmap_wayland.h -index 84ebcba..dfb2675 100644 ---- a/ui/ozone/platform/wayland/gpu/gbm_pixmap_wayland.h -+++ b/ui/ozone/platform/wayland/gpu/gbm_pixmap_wayland.h -@@ -92,6 +92,9 @@ class GbmPixmapWayland : public gfx::NativePixmap { - - // Says a wl_buffer has been created and must removed. - bool created_wl_buffer_ = false; -+ -+ // Tells the usage of this pixmap. -+ gfx::BufferUsage usage_ = gfx::BufferUsage::SCANOUT; - }; - - } // namespace ui -diff --git a/ui/ozone/platform/wayland/ozone_platform_wayland.cc b/ui/ozone/platform/wayland/ozone_platform_wayland.cc -index afbd464..189678f 100644 ---- a/ui/ozone/platform/wayland/ozone_platform_wayland.cc -+++ b/ui/ozone/platform/wayland/ozone_platform_wayland.cc -@@ -295,6 +295,9 @@ class OzonePlatformWayland : public OzonePlatform, - properties->supports_global_screen_coordinates = - features::IsWaylandScreenCoordinatesEnabled(); - -+ // Let the media know this platform supports va-api. -+ properties->supports_vaapi = true; -+ - initialised = true; - } - diff --git a/remove-main-main10-profile-limit.patch b/remove-main-main10-profile-limit.patch deleted file mode 100644 index 15bd6a7..0000000 --- a/remove-main-main10-profile-limit.patch +++ /dev/null @@ -1,33 +0,0 @@ -diff --git a/media/base/supported_types.cc b/media/base/supported_types.cc -index 2ebbdf9..861dc50 100644 ---- a/media/base/supported_types.cc -+++ b/media/base/supported_types.cc -@@ -205,28 +205,7 @@ bool IsAudioCodecProprietary(AudioCodec codec) { - #endif // !BUILDFLAG(USE_PROPRIETARY_CODECS) - - bool IsHevcProfileSupported(const VideoType& type) { -- if (!IsColorSpaceSupported(type.color_space)) -- return false; -- --#if BUILDFLAG(ENABLE_PLATFORM_HEVC) --#if BUILDFLAG(PLATFORM_HAS_OPTIONAL_HEVC_SUPPORT) --#if BUILDFLAG(IS_CHROMEOS_LACROS) -- // TODO(b/171813538): For Lacros, the supplemental profile cache will be -- // asking lacros-gpu, but we will be doing decoding in ash-gpu. Until the -- // codec detection is plumbed through to ash-gpu we can do this extra check -- // for HEVC support. -- if (base::CommandLine::ForCurrentProcess()->HasSwitch( -- switches::kLacrosEnablePlatformHevc)) { - return true; -- } --#endif // BUILDFLAG(IS_CHROMEOS_LACROS) -- return GetSupplementalProfileCache()->IsProfileSupported(type.profile); --#else -- return true; --#endif // BUIDFLAG(PLATFORM_HAS_OPTIONAL_HEVC_SUPPORT) --#else -- return false; --#endif // BUILDFLAG(ENABLE_PLATFORM_HEVC) - } - - bool IsVp9ProfileSupported(const VideoType& type) { diff --git a/vaapi-add-av1-support.patch b/vaapi-add-av1-support.patch deleted file mode 100644 index f1a62eb..0000000 --- a/vaapi-add-av1-support.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 1245d8c56a0e9197e20f73b33b31f2bf6cfbe4bd Mon Sep 17 00:00:00 2001 -From: Xuanxi Leng <xuanxi.leng@intel.com> -Date: Fri, 14 Oct 2022 09:36:39 -0400 -Subject: [PATCH] VaVDA: Add 'VDAVideoDecoder' support for AV1. - -This CL adds 'VDAVideoDecoder' support for AV1. - -Bug: 1325824 -Change-Id: I7787761c080aba680543e173bef12254ab7ccafe ---- - -diff --git a/media/gpu/vaapi/vaapi_video_decode_accelerator.cc b/media/gpu/vaapi/vaapi_video_decode_accelerator.cc -index 37e3520..4e77924 100644 ---- a/media/gpu/vaapi/vaapi_video_decode_accelerator.cc -+++ b/media/gpu/vaapi/vaapi_video_decode_accelerator.cc -@@ -41,6 +41,7 @@ - #include "media/gpu/vaapi/vaapi_utils.h" - #include "media/gpu/vaapi/vp8_vaapi_video_decoder_delegate.h" - #include "media/gpu/vaapi/vp9_vaapi_video_decoder_delegate.h" -+#include "media/gpu/vaapi/av1_vaapi_video_decoder_delegate.h" - #include "media/gpu/vp8_decoder.h" - #include "media/gpu/vp9_decoder.h" - #include "media/video/picture.h" -@@ -229,6 +230,12 @@ - decoder_delegate_ = accelerator.get(); - decoder_.reset(new VP9Decoder(std::move(accelerator), profile, - config.container_color_space)); -+ } else if (profile >= AV1PROFILE_MIN && profile <= AV1PROFILE_MAX) { -+ auto accelerator = -+ std::make_unique<AV1VaapiVideoDecoderDelegate>(this, vaapi_wrapper_); -+ decoder_delegate_ = accelerator.get(); -+ decoder_.reset(new AV1Decoder(std::move(accelerator), profile, -+ config.container_color_space)); - } else { - VLOGF(1) << "Unsupported profile " << GetProfileName(profile); - return false; -@@ -1196,12 +1203,11 @@ - VaapiVideoDecodeAccelerator::GetSupportedProfiles() { - VideoDecodeAccelerator::SupportedProfiles profiles = - VaapiWrapper::GetSupportedDecodeProfiles(); -- // VaVDA never supported VP9 Profile 2, AV1 and HEVC, but VaapiWrapper does. -+ // VaVDA never supported VP9 Profile 2 and HEVC, but VaapiWrapper does. - // Filter them out. - base::EraseIf(profiles, [](const auto& profile) { - VideoCodec codec = VideoCodecProfileToVideoCodec(profile.profile); -- return profile.profile == VP9PROFILE_PROFILE2 || -- codec == VideoCodec::kAV1 || codec == VideoCodec::kHEVC; -+ return profile.profile == VP9PROFILE_PROFILE2 || codec == VideoCodec::kHEVC; - }); - return profiles; - } |