post M117 updates

This commit is contained in:
Alexander Frick 2023-10-12 10:32:11 -05:00
parent 30f7b7b518
commit f7f1fda03e
12 changed files with 237 additions and 279 deletions

View File

@ -24,3 +24,13 @@
- For ChromeOS only: If you plan on adding a new accelerator and want it
displayed in the Shortcuts app, please follow the instructions at: `ash/webui/shortcut_customization_ui/backend/accelerator_layout_table.h`.
### Notes
Google recommends Thorium > Alex313031 recommends Thorium
violates the Thorium > violates the Chrome
Google Thorium > Thorium
made possible by Chromium

View File

@ -129,7 +129,6 @@ config("compiler") {
# "/fp:fast", enables FMA.
if (current_cpu == "x86" || current_cpu == "x64") {
cflags += [
"/O2",
"-mavx",
"-mavx2",
"-maes",

View File

@ -129,7 +129,6 @@ config("compiler") {
# "/fp:fast", enables FMA.
if (current_cpu == "x86" || current_cpu == "x64") {
cflags += [
"/O2",
"-msse3",
"/clang:-O3",
"/clang:-msse3",

View File

@ -129,7 +129,6 @@ config("compiler") {
# "/fp:fast", enables FMA.
if (current_cpu == "x86" || current_cpu == "x64") {
cflags += [
"/O2",
"-mavx",
"-maes",
"-mpclmul",

View File

@ -14339,7 +14339,7 @@ Please help our engineers fix this problem. Tell us what happened right before y
Switch to a smart and secure browser
</message>
<message name="IDS_WIN10_TOAST_RECOMMENDATION" desc="Toast header label noting Google recommends Thorium.">
Google recommends Thorium
Alex313031 recommends Thorium
</message>
<message name="IDS_WIN10_TOAST_OPEN_CHROME" desc="The label on the button to dismiss the toast and launch Thorium.">
Open Thorium

View File

@ -5539,7 +5539,7 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
Use Lite mode on Google Thorium
</message>
<message name="IDS_CHROME_REENGAGEMENT_NOTIFICATION_3_TITLE" desc="The title of a notification shown to suggest that users use Thorium. Users probably have not opened Thorium in a while.">
Google recommends Thorium
Alex313031 recommends Thorium
</message>
<message name="IDS_CHROME_REENGAGEMENT_NOTIFICATION_3_DESCRIPTION" desc="The title of a notification shown to suggest that users use Thorium. Users probably have not opened Thorium in a while. Promotes data savings and relevant news.">
Save up to 60% data, read today's news

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
# Copyright 2014 The Chromium Authors. All rights reserved.
# Copyright 2023 The Chromium Authors, Alex313031, and Midzer. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

View File

@ -1,4 +1,4 @@
# Copyright 2023 The Chromium Authors and Alex313031
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

221
src/third_party/libaom/cmake_update.sh vendored Executable file
View File

@ -0,0 +1,221 @@
#!/bin/bash
#
# Copyright 2023 The Chromium Authors and Alex313031
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This script is used to generate .gni files and files in the
# config/platform directories needed to build libaom.
#
# Every time the upstream source code is updated this script must be run.
#
# Usage:
# $ ./cmake_update.sh
# Requirements:
# Install the following Debian packages.
# - cmake
# - yasm or nasm
# Toolchain for armv7:
# - gcc-arm-linux-gnueabihf
# - g++-arm-linux-gnueabihf
# Toolchain for arm64:
# - gcc-aarch64-linux-gnu
# - g++-aarch64-linux-gnu
# 32bit build environment for cmake. Including but potentially not limited to:
# - lib32gcc-12-dev
# - lib32stdc++-12-dev
# Alternatively: treat 32bit builds like Windows and manually tweak aom_config.h
set -eE
# sort() consistently.
export LC_ALL=C
BASE=$(pwd)
SRC="${BASE}/source/libaom"
CFG="${BASE}/source/config"
function cleanup() {
rm -rf "${TMP}"
}
# Create empty temp and config directories.
# $1 - Header file directory.
function reset_dirs() {
cd ..
rm -rf "${TMP}"
mkdir "${TMP}"
cd "${TMP}"
echo "Generate ${1} config files."
rm -fr "${CFG}/${1}"
mkdir -p "${CFG}/${1}/config"
}
if [[ $# -ne 0 ]]; then
echo "Unknown option(s): ${@}"
exit 1
fi
# Missing function:
# find_duplicates
# We may have enough targets to avoid re-implementing this.
# Generate Config files.
# $1 - Header file directory.
# $2 - cmake options.
function gen_config_files() {
cmake "${SRC}" ${2} &> cmake.txt
case "${1}" in
*x64*|*ia32*)
egrep "#define [A-Z0-9_]+ [01]" config/aom_config.h \
| awk '{print "%define " $2 " " $3}' > config/aom_config.asm
;;
esac
cp config/aom_config.{h,c,asm} "${CFG}/${1}/config/"
cp config/*_rtcd.h "${CFG}/${1}/config/"
}
function update_readme() {
local IFS=$'\n'
# Split git log output '<date>\n<commit hash>' on the newline to produce 2
# array entries.
local vals=($(git -C "${SRC}" --no-pager log -1 --format="%cd%n%H" \
--date=format:"%A %B %d %Y"))
sed -E -i.bak \
-e "s/^(Date:)[[:space:]]+.*$/\1 ${vals[0]}/" \
-e "s/^(Revision:)[[:space:]]+[a-f0-9]{40}/\1 ${vals[1]}/" \
${BASE}/README.chromium
rm ${BASE}/README.chromium.bak
cat <<EOF
README.chromium updated with:
Date: ${vals[0]}
Revision: ${vals[1]}
EOF
}
# Update aom_config.h to support Windows instead of linux because cmake doesn't
# generate VS project files on linux.
#
# $1 - File to modify.
function convert_to_windows() {
sed -i.bak \
-e 's/\(#define[[:space:]]INLINE[[:space:]]*\)inline/\1 __inline/' \
-e 's/\(#define[[:space:]]HAVE_PTHREAD_H[[:space:]]*\)1/\1 0/' \
-e 's/\(#define[[:space:]]HAVE_UNISTD_H[[:space:]]*\)1/\1 0/' \
-e 's/\(#define[[:space:]]CONFIG_GCC[[:space:]]*\)1/\1 0/' \
-e 's/\(#define[[:space:]]CONFIG_MSVS[[:space:]]*\)0/\1 1/' \
"${1}"
rm "${1}.bak"
}
# Scope 'trap' error reporting to configuration generation.
(
TMP=$(mktemp -d "${BASE}/build.XXXX")
cd "${TMP}"
trap '{
[[ -f ${TMP}/cmake.txt ]] && cat ${TMP}/cmake.txt
echo "Build directory ${TMP} not removed automatically."
}' ERR
all_platforms="-DCONFIG_SIZE_LIMIT=1"
all_platforms+=" -DDECODE_HEIGHT_LIMIT=16384 -DDECODE_WIDTH_LIMIT=16384"
all_platforms+=" -DCONFIG_AV1_ENCODER=1"
all_platforms+=" -DCONFIG_MAX_DECODE_PROFILE=0"
all_platforms+=" -DCONFIG_NORMAL_TILE_MODE=1"
all_platforms+=" -DCONFIG_LIBYUV=0"
# Use low bit depth.
all_platforms+=" -DCONFIG_AV1_HIGHBITDEPTH=0"
# Use real-time only build.
all_platforms+=" -DCONFIG_REALTIME_ONLY=1"
all_platforms+=" -DCONFIG_AV1_TEMPORAL_DENOISING=1"
# avx2 optimizations account for ~0.3mb of the decoder.
#all_platforms+=" -DENABLE_AVX2=0"
toolchain="-DCMAKE_TOOLCHAIN_FILE=${SRC}/build/cmake/toolchains"
reset_dirs linux/generic
gen_config_files linux/generic "-DAOM_TARGET_CPU=generic ${all_platforms}"
# Strip .pl files from gni
sed -i.bak '/\.pl",$/d' libaom_srcs.gni
rm libaom_srcs.gni.bak
# libaom_srcs.gni, libaom_test_srcs.gni, usage_exit.c
# and aom_version.h are shared.
cp libaom_srcs.gni "${BASE}"
cp libaom_test_srcs.gni "${BASE}"
cp gen_src/usage_exit.c "${BASE}/source/gen_src"
cp config/aom_version.h "${CFG}/config/"
reset_dirs linux/ia32
gen_config_files linux/ia32 "${toolchain}/x86-linux.cmake ${all_platforms} \
-DCONFIG_PIC=1 \
-DAOM_RTCD_FLAGS=--require-mmx;--require-sse;--require-sse2"
reset_dirs linux/x64
gen_config_files linux/x64 "${all_platforms}"
# Copy linux configurations and modify for Windows.
reset_dirs win/ia32
cp "${CFG}/linux/ia32/config"/* "${CFG}/win/ia32/config/"
convert_to_windows "${CFG}/win/ia32/config/aom_config.h"
egrep \
"#define [A-Z0-9_]+[[:space:]]+[01]" "${CFG}/win/ia32/config/aom_config.h" \
| awk '{print "%define " $2 " " $3}' > "${CFG}/win/ia32/config/aom_config.asm"
# Copy linux configurations and modify for Windows.
reset_dirs win/x64
cp "${CFG}/linux/x64/config"/* "${CFG}/win/x64/config/"
convert_to_windows "${CFG}/win/x64/config/aom_config.h"
egrep \
"#define [A-Z0-9_]+[[:space:]]+[01]" "${CFG}/win/x64/config/aom_config.h" \
| awk '{print "%define " $2 " " $3}' > "${CFG}/win/x64/config/aom_config.asm"
reset_dirs linux/arm
gen_config_files linux/arm \
"${toolchain}/armv7-linux-gcc.cmake -DENABLE_NEON=0 ${all_platforms}"
reset_dirs linux/arm-neon
gen_config_files linux/arm-neon \
"${toolchain}/armv7-linux-gcc.cmake -DCONFIG_RUNTIME_CPU_DETECT=0 \
${all_platforms}"
reset_dirs linux/arm-neon-cpu-detect
gen_config_files linux/arm-neon-cpu-detect \
"${toolchain}/armv7-linux-gcc.cmake -DCONFIG_RUNTIME_CPU_DETECT=1 -DENABLE_NEON_DOTPROD=0 -DENABLE_NEON_I8MM=0 \
${all_platforms}"
reset_dirs linux/arm64-cpu-detect
gen_config_files linux/arm64-cpu-detect \
"${toolchain}/arm64-linux-gcc.cmake -DCONFIG_RUNTIME_CPU_DETECT=1 -DENABLE_NEON_DOTPROD=0 -DENABLE_NEON_I8MM=0 \
${all_platforms}"
# CMAKE_INSTALL_NAME_TOOL is set to a non-empty/true value to allow this
# configuration to complete on platforms without `install_name`. The build
# commands are not invoked so the value doesn't matter.
reset_dirs ios/arm-neon
gen_config_files ios/arm-neon \
"${toolchain}/armv7-ios.cmake -DCMAKE_INSTALL_NAME_TOOL=no-such-command -DENABLE_NEON_DOTPROD=0 -DENABLE_NEON_I8MM=0 \
${all_platforms}"
reset_dirs ios/arm64
gen_config_files ios/arm64 \
"${toolchain}/arm64-ios.cmake -DCMAKE_INSTALL_NAME_TOOL=no-such-command -DENABLE_NEON_DOTPROD=0 -DENABLE_NEON_I8MM=0 \
${all_platforms}"
# Copy linux configurations and modify for Windows.
reset_dirs win/arm64-cpu-detect
cp "${CFG}/linux/arm64-cpu-detect/config"/* \
"${CFG}/win/arm64-cpu-detect/config/"
convert_to_windows "${CFG}/win/arm64-cpu-detect/config/aom_config.h"
)
update_readme
git cl format > /dev/null \
|| echo "WARNING: 'git cl format' failed. Please run 'git cl format' manually."
cleanup

View File

@ -1,157 +0,0 @@
/*
* Copyright (c) 2023, Alliance for Open Media. All rights reserved
*
* This source code is subject to the terms of the BSD 2 Clause License and
* the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
* was not distributed with this source code in the LICENSE file, you can
* obtain it at www.aomedia.org/license/software. If the Alliance for Open
* Media Patent License 1.0 was not distributed with this source code in the
* PATENTS file, you can obtain it at www.aomedia.org/license/patent.
*/
#include "arm_cpudetect.h"
#if defined(__APPLE__)
#include <sys/sysctl.h>
#endif
#if !CONFIG_RUNTIME_CPU_DETECT
static int arm_get_cpu_caps(void) {
// This function should actually be a no-op. There is no way to adjust any of
// these because the RTCD tables do not exist: the functions are called
// statically.
int flags = 0;
#if HAVE_NEON
flags |= HAS_NEON;
#endif // HAVE_NEON
return flags;
}
#elif defined(__APPLE__) // end !CONFIG_RUNTIME_CPU_DETECT
// sysctlbyname() parameter documentation for instruction set characteristics:
// https://developer.apple.com/documentation/kernel/1387446-sysctlbyname/determining_instruction_set_characteristics
static INLINE bool have_feature(const char *feature) {
int64_t feature_present = 0;
size_t size = sizeof(feature_present);
if (sysctlbyname(feature, &feature_present, &size, NULL, 0) != 0) {
return false;
}
return feature_present;
}
static int arm_get_cpu_caps(void) {
int flags = 0;
#if HAVE_NEON
flags |= HAS_NEON;
#endif // HAVE_NEON
#if HAVE_ARM_CRC32
if (have_feature("hw.optional.armv8_crc32")) flags |= HAS_ARM_CRC32;
#endif // HAVE_ARM_CRC32
}
#elif defined(_MSC_VER) // end __APPLE__
static int arm_get_cpu_caps(void) {
int flags = 0;
// IsProcessorFeaturePresent() parameter documentation:
// https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-isprocessorfeaturepresent#parameters
#if HAVE_NEON
flags |= HAS_NEON; // Neon is mandatory in Armv8.0-A.
#endif // HAVE_NEON
#if HAVE_ARM_CRC32
if (IsProcessorFeaturePresent(PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE)) {
flags |= HAS_ARM_CRC32;
}
#endif // HAVE_ARM_CRC32
// No I8MM or SVE feature detection available on Windows at time of writing.
return flags;
}
#elif defined(ANDROID_USE_CPU_FEATURES_LIB)
static int arm_get_cpu_caps(void) {
int flags = 0;
#if HAVE_NEON
flags |= HAS_NEON; // Neon is mandatory in Armv8.0-A.
#endif // HAVE_NEON
return flags;
}
#elif defined(__linux__) // end defined(AOM_USE_ANDROID_CPU_FEATURES)
#include <sys/auxv.h>
// Define hwcap values ourselves: building with an old auxv header where these
// hwcap values are not defined should not prevent features from being enabled.
#define AOM_AARCH64_HWCAP_CRC32 (1 << 7)
#define AOM_AARCH64_HWCAP_ASIMDDP (1 << 20)
#define AOM_AARCH64_HWCAP_SVE (1 << 22)
#define AOM_AARCH64_HWCAP2_I8MM (1 << 13)
static int arm_get_cpu_caps(void) {
int flags = 0;
unsigned long hwcap = getauxval(AT_HWCAP);
unsigned long hwcap2 = getauxval(AT_HWCAP2);
#if HAVE_NEON
flags |= HAS_NEON; // Neon is mandatory in Armv8.0-A.
#endif // HAVE_NEON
#if HAVE_ARM_CRC32
if (hwcap & AOM_AARCH64_HWCAP_CRC32) flags |= HAS_ARM_CRC32;
#endif // HAVE_ARM_CRC32
return flags;
}
#elif defined(__Fuchsia__) // end __linux__
#include <zircon/features.h>
#include <zircon/syscalls.h>
// Added in https://fuchsia-review.googlesource.com/c/fuchsia/+/894282.
#ifndef ZX_ARM64_FEATURE_ISA_I8MM
#define ZX_ARM64_FEATURE_ISA_I8MM ((uint32_t)(1u << 19))
#endif
// Added in https://fuchsia-review.googlesource.com/c/fuchsia/+/895083.
#ifndef ZX_ARM64_FEATURE_ISA_SVE
#define ZX_ARM64_FEATURE_ISA_SVE ((uint32_t)(1u << 20))
#endif
static int arm_get_cpu_caps(void) {
int flags = 0;
#if HAVE_NEON
flags |= HAS_NEON; // Neon is mandatory in Armv8.0-A.
#endif // HAVE_NEON
uint32_t features;
zx_status_t status = zx_system_get_features(ZX_FEATURE_KIND_CPU, &features);
if (status != ZX_OK) return flags;
#if HAVE_ARM_CRC32
if (features & ZX_ARM64_FEATURE_ISA_CRC32) flags |= HAS_ARM_CRC32;
#endif // HAVE_ARM_CRC32
#if HAVE_SVE
if (features & ZX_ARM64_FEATURE_ISA_SVE) flags |= HAS_SVE;
#endif // HAVE_SVE
return flags;
}
#else // end __Fuchsia__
#error \
"Runtime CPU detection selected, but no CPU detection method " \
"available for your platform. Rerun cmake with -DCONFIG_RUNTIME_CPU_DETECT=0."
#endif
int aom_arm_cpu_caps(void) {
int flags = 0;
if (!arm_cpu_env_flags(&flags)) {
flags = arm_get_cpu_caps() & arm_cpu_env_mask();
}
// Restrict flags: FEAT_I8MM assumes that FEAT_DotProd is available.
if (!(flags & HAS_NEON_DOTPROD)) flags &= ~HAS_NEON_I8MM;
// Restrict flags: SVE assumes that FEAT_{DotProd,I8MM} are available.
if (!(flags & HAS_NEON_DOTPROD)) flags &= ~HAS_SVE;
if (!(flags & HAS_NEON_I8MM)) flags &= ~HAS_SVE;
return flags;
}

View File

@ -1,115 +0,0 @@
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/buildflag_header.gni")
import("//build/config/chrome_build.gni")
import("//build/config/chromeos/ui_mode.gni")
import("//build/config/chromeos/ui_mode.gni")
import("//build/config/features.gni")
import("//build/toolchain/toolchain.gni")
import("//media/media_options.gni")
import("//third_party/widevine/cdm/widevine.gni")
if (bundle_widevine_cdm) {
import("//media/cdm/library_cdm/cdm_paths.gni")
}
assert(!bundle_widevine_cdm || (enable_widevine && enable_library_cdms))
buildflag_header("buildflags") {
header = "buildflags.h"
flags = [
"ENABLE_WIDEVINE=$enable_widevine",
"BUNDLE_WIDEVINE_CDM=$bundle_widevine_cdm",
"ENABLE_WIDEVINE_CDM_COMPONENT=$enable_widevine_cdm_component",
"ENABLE_MEDIA_FOUNDATION_WIDEVINE_CDM=$enable_media_foundation_widevine_cdm",
]
}
# TODO(xhwang): widevine_cdm_version.h is only used in few places. Clean this up
# so we don't need to copy it in most cases.
# Also, merge the bundle_widevine_cdm blocks as much as possible.
if (bundle_widevine_cdm) {
widevine_arch = target_cpu
widevine_cdm_root = "${widevine_root}/${target_os}/${widevine_arch}"
cdm_file_name = "${shlib_prefix}widevinecdm${shlib_extension}"
widevine_cdm_version_h_file = "${widevine_cdm_root}/widevine_cdm_version.h"
widevine_cdm_binary_files = [ "${widevine_cdm_root}/${cdm_file_name}" ]
widevine_cdm_manifest_and_license_files = [
"${widevine_cdm_root}/manifest.json",
"../LICENSE",
]
if (enable_widevine_cdm_host_verification) {
widevine_cdm_binary_files += [ "${widevine_cdm_root}/${cdm_file_name}.sig" ]
}
} else {
# The CDM is not bundled. Use the default file.
widevine_cdm_version_h_file = "widevine_cdm_version.h"
}
copy("version_h") {
visibility = [ ":*" ] # Depend on ":headers" instead.
sources = [ widevine_cdm_version_h_file ]
# TODO(brettw) this should go into target_out_dir and callers should include
# it from there. This requires, however, renaming the default
# widevine_cdm_version.h in this directory to avoid conflicts.
outputs = [ "${root_gen_dir}/widevine_cdm_version.h" ]
}
source_set("headers") {
public = [ "widevine_cdm_common.h" ]
public_deps = [
":buildflags",
":version_h", # Forward permission to use version header.
"//base",
]
}
if (bundle_widevine_cdm) {
copy("widevine_cdm_manifest_and_license") {
sources = widevine_cdm_manifest_and_license_files
outputs = [ "${root_out_dir}/WidevineCdm/{{source_file_part}}" ]
}
copy("widevine_cdm_binary") {
sources = widevine_cdm_binary_files
outputs = [ "${root_out_dir}/${widevine_cdm_path}/{{source_file_part}}" ]
# TODO(jrummell)
# 'COPY_PHASE_STRIP': 'NO',
}
group("cdm") {
# Needed at run time by tests, e.g. swarming tests to generate isolate.
# See https://crbug.com/824493 for context.
data_deps = [
":widevine_cdm_binary",
":widevine_cdm_manifest_and_license",
]
# Needed at build time e.g. for mac bundle (//chrome:chrome_framework).
public_deps = [
":widevine_cdm_binary",
":widevine_cdm_manifest_and_license",
]
}
} else {
group("cdm") {
# NOP
}
}
# This target exists for tests to depend on that pulls in a runtime dependency
# on the license server.
group("widevine_test_license_server") {
if (bundle_widevine_cdm && (is_linux || is_chromeos)) {
data = [ "//third_party/widevine/test/license_server/" ]
}
}

View File

@ -78,6 +78,8 @@ gclient sync --with_branch_heads --with_tags -f -R -D &&
git clean -ffd &&
gclient runhooks &&
printf "\n" &&
printf "${GRE}Done! ${YEL}You can now run \'./version.sh\'\n" &&
tput sgr0 &&