diff options
Diffstat (limited to 'nixpkgs/pkgs/applications/networking/browsers/ungoogled-chromium/patches')
7 files changed, 250 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/networking/browsers/ungoogled-chromium/patches/dont-use-ANGLE-by-default.patch b/nixpkgs/pkgs/applications/networking/browsers/ungoogled-chromium/patches/dont-use-ANGLE-by-default.patch new file mode 100644 index 000000000000..9f14a304eb34 --- /dev/null +++ b/nixpkgs/pkgs/applications/networking/browsers/ungoogled-chromium/patches/dont-use-ANGLE-by-default.patch @@ -0,0 +1,26 @@ +A field trial currently enables the passthrough command decoder, which causes +gl_factory.cc to try kGLImplementationEGLANGLE first, which causes Chromium to fail +to load libGLESv2.so on NixOS. It somehow does not try kGLImplementationDesktopGL, +and so there is no GL support at all. + +Revert to using the validating command decoder, which prevents gl_factory.cc +from touching allowed_impls, allowing it to successfully use kGLImplementationDesktopGL. + +diff --git a/ui/gl/gl_utils.cc b/ui/gl/gl_utils.cc +index 697cbed5fe2d..8419bdb21a2f 100644 +--- a/ui/gl/gl_utils.cc ++++ b/ui/gl/gl_utils.cc +@@ -71,9 +71,10 @@ bool UsePassthroughCommandDecoder(const base::CommandLine* command_line) { + } else if (switch_value == kCmdDecoderValidatingName) { + return false; + } else { +- // Unrecognized or missing switch, use the default. +- return base::FeatureList::IsEnabled( +- features::kDefaultPassthroughCommandDecoder); ++ // Ignore the field trial that enables it; disable it until ++ // gl_factory.cc kGLImplementationEGLANGLE issues are sorted ++ // out on NixOS. ++ return false; + } + } + } diff --git a/nixpkgs/pkgs/applications/networking/browsers/ungoogled-chromium/patches/enable-vdpau-support-for-nvidia.patch b/nixpkgs/pkgs/applications/networking/browsers/ungoogled-chromium/patches/enable-vdpau-support-for-nvidia.patch new file mode 100644 index 000000000000..b5372d1a2556 --- /dev/null +++ b/nixpkgs/pkgs/applications/networking/browsers/ungoogled-chromium/patches/enable-vdpau-support-for-nvidia.patch @@ -0,0 +1,74 @@ +--- a/media/gpu/vaapi/vaapi_video_decode_accelerator.cc ++++ b/media/gpu/vaapi/vaapi_video_decode_accelerator.cc +@@ -641,6 +641,7 @@ void VaapiVideoDecodeAccelerator::AssignPictureBuffers( + // |vpp_vaapi_wrapper_| for VaapiPicture to DownloadFromSurface() the VA's + // internal decoded frame. + if (buffer_allocation_mode_ != BufferAllocationMode::kNone && ++ buffer_allocation_mode_ != BufferAllocationMode::kWrapVdpau && + !vpp_vaapi_wrapper_) { + vpp_vaapi_wrapper_ = VaapiWrapper::Create( + VaapiWrapper::kVideoProcess, VAProfileNone, +@@ -665,7 +666,8 @@ void VaapiVideoDecodeAccelerator::AssignPictureBuffers( + PictureBuffer buffer = buffers[i]; + buffer.set_size(requested_pic_size_); + std::unique_ptr<VaapiPicture> picture = vaapi_picture_factory_->Create( +- (buffer_allocation_mode_ == BufferAllocationMode::kNone) ++ ((buffer_allocation_mode_ == BufferAllocationMode::kNone) || ++ (buffer_allocation_mode_ == BufferAllocationMode::kWrapVdpau)) + ? vaapi_wrapper_ + : vpp_vaapi_wrapper_, + make_context_current_cb_, bind_image_cb_, buffer); +@@ -1093,6 +1095,12 @@ VaapiVideoDecodeAccelerator::GetSupportedProfiles() { + + VaapiVideoDecodeAccelerator::BufferAllocationMode + VaapiVideoDecodeAccelerator::DecideBufferAllocationMode() { ++ // NVIDIA blobs use VDPAU ++ if (VaapiWrapper::GetImplementationType() == VAImplementation::kNVIDIAVDPAU) { ++ LOG(INFO) << "VA-API driver on VDPAU backend"; ++ return BufferAllocationMode::kWrapVdpau; ++ } ++ + // TODO(crbug.com/912295): Enable a better BufferAllocationMode for IMPORT + // |output_mode_| as well. + if (output_mode_ == VideoDecodeAccelerator::Config::OutputMode::IMPORT) +@@ -1105,7 +1113,7 @@ VaapiVideoDecodeAccelerator::DecideBufferAllocationMode() { + // depends on the bitstream and sometimes it's not enough to cover the amount + // of frames needed by the client pipeline (see b/133733739). + // TODO(crbug.com/911754): Enable for VP9 Profile 2. +- if (IsGeminiLakeOrLater() && ++ if (false && IsGeminiLakeOrLater() && + (profile_ == VP9PROFILE_PROFILE0 || profile_ == VP8PROFILE_ANY)) { + // Add one to the reference frames for the one being currently egressed, and + // an extra allocation for both |client_| and |decoder_|, see +--- a/media/gpu/vaapi/vaapi_video_decode_accelerator.h ++++ b/media/gpu/vaapi/vaapi_video_decode_accelerator.h +@@ -204,6 +204,7 @@ class MEDIA_GPU_EXPORT VaapiVideoDecodeAccelerator + // Using |client_|s provided PictureBuffers and as many internally + // allocated. + kNormal, ++ kWrapVdpau, + }; + + // Decides the concrete buffer allocation mode, depending on the hardware +--- a/media/gpu/vaapi/vaapi_wrapper.cc ++++ b/media/gpu/vaapi/vaapi_wrapper.cc +@@ -131,6 +131,9 @@ media::VAImplementation VendorStringToImplementationType( + } else if (base::StartsWith(va_vendor_string, "Intel iHD driver", + base::CompareCase::SENSITIVE)) { + return media::VAImplementation::kIntelIHD; ++ } else if (base::StartsWith(va_vendor_string, "Splitted-Desktop Systems VDPAU", ++ base::CompareCase::SENSITIVE)) { ++ return media::VAImplementation::kNVIDIAVDPAU; + } + return media::VAImplementation::kOther; + } +--- a/media/gpu/vaapi/vaapi_wrapper.h ++++ b/media/gpu/vaapi/vaapi_wrapper.h +@@ -79,6 +79,7 @@ enum class VAImplementation { + kIntelIHD, + kOther, + kInvalid, ++ kNVIDIAVDPAU, + }; + + // This class handles VA-API calls and ensures proper locking of VA-API calls diff --git a/nixpkgs/pkgs/applications/networking/browsers/ungoogled-chromium/patches/enable-video-acceleration-on-linux.patch b/nixpkgs/pkgs/applications/networking/browsers/ungoogled-chromium/patches/enable-video-acceleration-on-linux.patch new file mode 100644 index 000000000000..bd278633f67e --- /dev/null +++ b/nixpkgs/pkgs/applications/networking/browsers/ungoogled-chromium/patches/enable-video-acceleration-on-linux.patch @@ -0,0 +1,48 @@ +From b2144fd28e09cd52e7a88a62a9d9b54cf9922f9f Mon Sep 17 00:00:00 2001 +From: Michael Weiss <dev.primeos@gmail.com> +Date: Tue, 14 Apr 2020 14:16:10 +0200 +Subject: [PATCH] Enable accelerated video decode on Linux + +This will enable accelerated video decode on Linux by default (i.e. +without "--ignore-gpu-blacklist"), but on NixOS we'll provide +"--disable-accelerated-video-decode" and +"--disable-accelerated-video-encode" by default to avoid regressions +(e.g. VA-API doesn't work properly for some radeon drivers). + +Video acceleration can then be enabled via: +chromium.override { enableVaapi = true; } +without rebuilding Chromium. +--- + gpu/config/software_rendering_list.json | 16 ---------------- + 1 file changed, 16 deletions(-) + +diff --git a/gpu/config/software_rendering_list.json b/gpu/config/software_rendering_list.json +index 22712bdbf38f..a06dd19a50e4 100644 +--- a/gpu/config/software_rendering_list.json ++++ b/gpu/config/software_rendering_list.json +@@ -336,22 +336,6 @@ + ] + }, + { +- "id": 48, +- "description": "Accelerated video decode is unavailable on Linux", +- "cr_bugs": [137247, 1032907], +- "os": { +- "type": "linux" +- }, +- "exceptions": [ +- { +- "machine_model_name": ["Chromecast"] +- } +- ], +- "features": [ +- "accelerated_video_decode" +- ] +- }, +- { + "id": 50, + "description": "Disable VMware software renderer on older Mesa", + "cr_bugs": [145531, 332596, 571899, 629434], +-- +2.11.0 + diff --git a/nixpkgs/pkgs/applications/networking/browsers/ungoogled-chromium/patches/nix_plugin_paths_68.patch b/nixpkgs/pkgs/applications/networking/browsers/ungoogled-chromium/patches/nix_plugin_paths_68.patch new file mode 100644 index 000000000000..da6a4c92b460 --- /dev/null +++ b/nixpkgs/pkgs/applications/networking/browsers/ungoogled-chromium/patches/nix_plugin_paths_68.patch @@ -0,0 +1,61 @@ +diff --git a/chrome/common/chrome_paths.cc b/chrome/common/chrome_paths.cc +index f4e119d..d9775bd 100644 +--- a/chrome/common/chrome_paths.cc ++++ b/chrome/common/chrome_paths.cc +@@ -68,21 +68,14 @@ static base::LazyInstance<base::FilePath> + g_invalid_specified_user_data_dir = LAZY_INSTANCE_INITIALIZER; + + // Gets the path for internal plugins. +-bool GetInternalPluginsDirectory(base::FilePath* result) { +-#if defined(OS_MACOSX) +- // If called from Chrome, get internal plugins from a subdirectory of the +- // framework. +- if (base::mac::AmIBundled()) { +- *result = chrome::GetFrameworkBundlePath(); +- DCHECK(!result->empty()); +- *result = result->Append("Internet Plug-Ins"); +- return true; +- } +- // In tests, just look in the module directory (below). +-#endif +- +- // The rest of the world expects plugins in the module directory. +- return base::PathService::Get(base::DIR_MODULE, result); ++bool GetInternalPluginsDirectory(base::FilePath* result, ++ const std::string& ident) { ++ std::string full_env = std::string("NIX_CHROMIUM_PLUGIN_PATH_") + ident; ++ const char* value = getenv(full_env.c_str()); ++ if (value == NULL) ++ return base::PathService::Get(base::DIR_MODULE, result); ++ else ++ *result = base::FilePath(value); + } + + // Gets the path for bundled implementations of components. Note that these +@@ -272,7 +265,7 @@ bool PathProvider(int key, base::FilePath* result) { + create_dir = true; + break; + case chrome::DIR_INTERNAL_PLUGINS: +- if (!GetInternalPluginsDirectory(&cur)) ++ if (!GetInternalPluginsDirectory(&cur, "ALL")) + return false; + break; + case chrome::DIR_COMPONENTS: +@@ -280,7 +273,7 @@ bool PathProvider(int key, base::FilePath* result) { + return false; + break; + case chrome::DIR_PEPPER_FLASH_PLUGIN: +- if (!GetInternalPluginsDirectory(&cur)) ++ if (!GetInternalPluginsDirectory(&cur, "PEPPERFLASH")) + return false; + cur = cur.Append(kPepperFlashBaseDirectory); + break; +@@ -358,7 +351,7 @@ bool PathProvider(int key, base::FilePath* result) { + cur = cur.DirName(); + } + #else +- if (!GetInternalPluginsDirectory(&cur)) ++ if (!GetInternalPluginsDirectory(&cur, "PNACL")) + return false; + #endif + cur = cur.Append(FILE_PATH_LITERAL("pnacl")); diff --git a/nixpkgs/pkgs/applications/networking/browsers/ungoogled-chromium/patches/no-build-timestamps.patch b/nixpkgs/pkgs/applications/networking/browsers/ungoogled-chromium/patches/no-build-timestamps.patch new file mode 100644 index 000000000000..6b788f43d29c --- /dev/null +++ b/nixpkgs/pkgs/applications/networking/browsers/ungoogled-chromium/patches/no-build-timestamps.patch @@ -0,0 +1,17 @@ +--- chromium-70.0.3538.67/build/compute_build_timestamp.py.orig 2018-11-02 16:00:34.368933077 +0200 ++++ chromium-70.0.3538.67/build/compute_build_timestamp.py 2018-11-08 04:06:21.658105129 +0200 +@@ -94,6 +94,14 @@ + 'build_type', help='The type of build', choices=('official', 'default')) + args = argument_parser.parse_args() + ++ # I don't trust LASTCHANGE magic, and I definelly want something deterministic here ++ SOURCE_DATE_EPOCH = os.getenv("SOURCE_DATE_EPOCH", None) ++ if SOURCE_DATE_EPOCH is not None: ++ print(SOURCE_DATE_EPOCH) ++ return 0 ++ else: ++ raise RuntimeError("SOURCE_DATE_EPOCH not set") ++ + # The mtime of the revision in build/util/LASTCHANGE is stored in a file + # next to it. Read it, to get a deterministic time close to "now". + # That date is then modified as described at the top of the file so that diff --git a/nixpkgs/pkgs/applications/networking/browsers/ungoogled-chromium/patches/remove-webp-include-69.patch b/nixpkgs/pkgs/applications/networking/browsers/ungoogled-chromium/patches/remove-webp-include-69.patch new file mode 100644 index 000000000000..07572cf7ee94 --- /dev/null +++ b/nixpkgs/pkgs/applications/networking/browsers/ungoogled-chromium/patches/remove-webp-include-69.patch @@ -0,0 +1,11 @@ +--- a/third_party/blink/renderer/platform/image-encoders/image_encoder.cc ++++ b/third_party/blink/renderer/platform/image-encoders/image_encoder.cc +@@ -13,7 +13,7 @@ + + #include "jpeglib.h" // for JPEG_MAX_DIMENSION + +-#include "third_party/libwebp/src/webp/encode.h" // for WEBP_MAX_DIMENSION ++#define WEBP_MAX_DIMENSION 16383 + + namespace blink { + diff --git a/nixpkgs/pkgs/applications/networking/browsers/ungoogled-chromium/patches/widevine-79.patch b/nixpkgs/pkgs/applications/networking/browsers/ungoogled-chromium/patches/widevine-79.patch new file mode 100644 index 000000000000..32f0ae2fb5e6 --- /dev/null +++ b/nixpkgs/pkgs/applications/networking/browsers/ungoogled-chromium/patches/widevine-79.patch @@ -0,0 +1,13 @@ +diff --git a/third_party/widevine/cdm/BUILD.gn b/third_party/widevine/cdm/BUILD.gn +index ed0e2f5208b..5b431a030d5 100644 +--- a/third_party/widevine/cdm/BUILD.gn ++++ b/third_party/widevine/cdm/BUILD.gn +@@ -14,7 +14,7 @@ buildflag_header("buildflags") { + + flags = [ + "ENABLE_WIDEVINE=$enable_widevine", +- "BUNDLE_WIDEVINE_CDM=$bundle_widevine_cdm", ++ "BUNDLE_WIDEVINE_CDM=true", + "ENABLE_WIDEVINE_CDM_COMPONENT=$enable_widevine_cdm_component", + ] + } |