mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-31 14:37:59 +00:00
Merge pull request #7534 from heitbaum/v4l-utils
v4l-utils: update to 1.24.1
This commit is contained in:
commit
ec9ebc0b52
@ -5,8 +5,8 @@
|
|||||||
# with 1.0.0 repeat delay is broken. test on upgrade
|
# with 1.0.0 repeat delay is broken. test on upgrade
|
||||||
|
|
||||||
PKG_NAME="v4l-utils"
|
PKG_NAME="v4l-utils"
|
||||||
PKG_VERSION="1.22.1"
|
PKG_VERSION="1.24.1"
|
||||||
PKG_SHA256="65c6fbe830a44ca105c443b027182c1b2c9053a91d1e72ad849dfab388b94e31"
|
PKG_SHA256="cbb7fe8a6307f5ce533a05cded70bb93c3ba06395ab9b6d007eb53b75d805f5b"
|
||||||
PKG_LICENSE="GPL"
|
PKG_LICENSE="GPL"
|
||||||
PKG_SITE="http://linuxtv.org/"
|
PKG_SITE="http://linuxtv.org/"
|
||||||
PKG_URL="http://linuxtv.org/downloads/v4l-utils/${PKG_NAME}-${PKG_VERSION}.tar.bz2"
|
PKG_URL="http://linuxtv.org/downloads/v4l-utils/${PKG_NAME}-${PKG_VERSION}.tar.bz2"
|
||||||
|
@ -1,140 +0,0 @@
|
|||||||
From dce0e3e1e4ea91d3e46098362a880371ec5afe1b Mon Sep 17 00:00:00 2001
|
|
||||||
From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
|
|
||||||
Date: Tue, 1 Nov 2022 20:25:28 +0000
|
|
||||||
Subject: keytable: Convert deprecated libbpf API
|
|
||||||
|
|
||||||
The libbpf APIs bpf_load_program_xattr(), bpf_create_map_node() and
|
|
||||||
bpf_create_map_in_map_node() have been deprecated since v0.7. Convert
|
|
||||||
them to use bpf_prog_load() and bpf_map_create().
|
|
||||||
Also, modify config script to add a check for libbpf version.
|
|
||||||
|
|
||||||
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
|
|
||||||
Signed-off-by: Sean Young <sean@mess.org>
|
|
||||||
---
|
|
||||||
configure.ac | 2 +-
|
|
||||||
utils/keytable/bpf_load.c | 59 ++++++++++++++++++++++++++---------------------
|
|
||||||
2 files changed, 34 insertions(+), 27 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/configure.ac b/configure.ac
|
|
||||||
index 05298981..9b7c371d 100644
|
|
||||||
--- a/configure.ac
|
|
||||||
+++ b/configure.ac
|
|
||||||
@@ -564,7 +564,7 @@ AM_CONDITIONAL([WITH_V4L2_CTL_32], [test x${enable_v4l2_ctl_32} = xyes])
|
|
||||||
AM_CONDITIONAL([WITH_V4L2_COMPLIANCE], [test x$ac_cv_func_fork = xyes])
|
|
||||||
AM_CONDITIONAL([WITH_V4L2_COMPLIANCE_LIBV4L], [test x$ac_cv_func_fork = xyes -a x${enable_v4l2_compliance_libv4l} != xno])
|
|
||||||
AM_CONDITIONAL([WITH_V4L2_COMPLIANCE_32], [test x$ac_cv_func_fork = xyes -a x${enable_v4l2_compliance_32} = xyes])
|
|
||||||
-PKG_CHECK_MODULES([LIBBPF], [libbpf], [bpf_pc=yes], [bpf_pc=no])
|
|
||||||
+PKG_CHECK_MODULES([LIBBPF], [libbpf >= 0.7], [bpf_pc=yes], [bpf_pc=no])
|
|
||||||
AM_CONDITIONAL([WITH_BPF], [test x$enable_bpf != xno -a x$libelf_pkgconfig = xyes -a x$CLANG = xclang -a x$bpf_pc = xyes])
|
|
||||||
|
|
||||||
# append -static to libtool compile and link command to enforce static libs
|
|
||||||
diff --git a/utils/keytable/bpf_load.c b/utils/keytable/bpf_load.c
|
|
||||||
index 7c633dac..06098fc3 100644
|
|
||||||
--- a/utils/keytable/bpf_load.c
|
|
||||||
+++ b/utils/keytable/bpf_load.c
|
|
||||||
@@ -63,19 +63,17 @@ struct bpf_file {
|
|
||||||
|
|
||||||
static int load_and_attach(int lirc_fd, struct bpf_file *bpf_file, struct bpf_insn *prog, int size)
|
|
||||||
{
|
|
||||||
- struct bpf_load_program_attr load_attr;
|
|
||||||
- int fd, err;
|
|
||||||
+ LIBBPF_OPTS(bpf_prog_load_opts, opts);
|
|
||||||
+ int fd, err, insn_cnt;
|
|
||||||
|
|
||||||
- memset(&load_attr, 0, sizeof(struct bpf_load_program_attr));
|
|
||||||
+ insn_cnt = size / sizeof(struct bpf_insn);
|
|
||||||
|
|
||||||
- load_attr.prog_type = BPF_PROG_TYPE_LIRC_MODE2;
|
|
||||||
- load_attr.expected_attach_type = BPF_LIRC_MODE2;
|
|
||||||
- load_attr.name = bpf_file->name;
|
|
||||||
- load_attr.insns = prog;
|
|
||||||
- load_attr.insns_cnt = size / sizeof(struct bpf_insn);
|
|
||||||
- load_attr.license = bpf_file->license;
|
|
||||||
+ opts.expected_attach_type = BPF_LIRC_MODE2;
|
|
||||||
+ opts.log_buf = bpf_log_buf;
|
|
||||||
+ opts.log_size = LOG_BUF_SIZE;
|
|
||||||
|
|
||||||
- fd = bpf_load_program_xattr(&load_attr, bpf_log_buf, LOG_BUF_SIZE);
|
|
||||||
+ fd = bpf_prog_load(BPF_PROG_TYPE_LIRC_MODE2, bpf_file->name,
|
|
||||||
+ bpf_file->license, prog, insn_cnt, &opts);
|
|
||||||
if (fd < 0) {
|
|
||||||
printf("bpf_load_program() err=%m\n%s", bpf_log_buf);
|
|
||||||
return -1;
|
|
||||||
@@ -95,6 +93,9 @@ static int build_raw_map(struct bpf_map_data *map, struct raw_entry *raw, int nu
|
|
||||||
int no_patterns, value_size, fd, key, i;
|
|
||||||
struct raw_entry *e;
|
|
||||||
struct raw_pattern *p;
|
|
||||||
+ LIBBPF_OPTS(bpf_map_create_opts, opts,
|
|
||||||
+ .map_flags = map->def.map_flags,
|
|
||||||
+ );
|
|
||||||
|
|
||||||
no_patterns = 0;
|
|
||||||
|
|
||||||
@@ -110,14 +111,13 @@ static int build_raw_map(struct bpf_map_data *map, struct raw_entry *raw, int nu
|
|
||||||
|
|
||||||
value_size = sizeof(struct raw_pattern) + max_length * sizeof(short);
|
|
||||||
|
|
||||||
- fd = bpf_create_map_node(map->def.type,
|
|
||||||
- map->name,
|
|
||||||
- map->def.key_size,
|
|
||||||
- value_size,
|
|
||||||
- no_patterns,
|
|
||||||
- map->def.map_flags,
|
|
||||||
- numa_node);
|
|
||||||
-
|
|
||||||
+ opts.numa_node = numa_node;
|
|
||||||
+ fd = bpf_map_create(map->def.type,
|
|
||||||
+ map->name,
|
|
||||||
+ map->def.key_size,
|
|
||||||
+ value_size,
|
|
||||||
+ no_patterns,
|
|
||||||
+ &opts);
|
|
||||||
if (fd < 0) {
|
|
||||||
printf(_("failed to create a map: %d %s\n"),
|
|
||||||
errno, strerror(errno));
|
|
||||||
@@ -174,27 +174,34 @@ static int load_maps(struct bpf_file *bpf_file, struct raw_entry *raw)
|
|
||||||
|
|
||||||
if (maps[i].def.type == BPF_MAP_TYPE_ARRAY_OF_MAPS ||
|
|
||||||
maps[i].def.type == BPF_MAP_TYPE_HASH_OF_MAPS) {
|
|
||||||
- int inner_map_fd = bpf_file->map_fd[maps[i].def.inner_map_idx];
|
|
||||||
+ LIBBPF_OPTS(bpf_map_create_opts, opts,
|
|
||||||
+ .inner_map_fd = bpf_file->map_fd[maps[i].def.inner_map_idx],
|
|
||||||
+ .map_flags = maps[i].def.map_flags,
|
|
||||||
+ .numa_node = numa_node,
|
|
||||||
+ );
|
|
||||||
|
|
||||||
- bpf_file->map_fd[i] = bpf_create_map_in_map_node(
|
|
||||||
+ bpf_file->map_fd[i] = bpf_map_create(
|
|
||||||
maps[i].def.type,
|
|
||||||
maps[i].name,
|
|
||||||
maps[i].def.key_size,
|
|
||||||
- inner_map_fd,
|
|
||||||
+ 4,
|
|
||||||
maps[i].def.max_entries,
|
|
||||||
- maps[i].def.map_flags,
|
|
||||||
- numa_node);
|
|
||||||
+ &opts);
|
|
||||||
} else if (!strcmp(maps[i].name, "raw_map")) {
|
|
||||||
bpf_file->map_fd[i] = build_raw_map(&maps[i], raw, numa_node);
|
|
||||||
} else {
|
|
||||||
- bpf_file->map_fd[i] = bpf_create_map_node(
|
|
||||||
+ LIBBPF_OPTS(bpf_map_create_opts, opts,
|
|
||||||
+ .map_flags = maps[i].def.map_flags,
|
|
||||||
+ .numa_node = numa_node,
|
|
||||||
+ );
|
|
||||||
+
|
|
||||||
+ bpf_file->map_fd[i] = bpf_map_create(
|
|
||||||
maps[i].def.type,
|
|
||||||
maps[i].name,
|
|
||||||
maps[i].def.key_size,
|
|
||||||
maps[i].def.value_size,
|
|
||||||
maps[i].def.max_entries,
|
|
||||||
- maps[i].def.map_flags,
|
|
||||||
- numa_node);
|
|
||||||
+ &opts);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (bpf_file->map_fd[i] < 0) {
|
|
||||||
--
|
|
||||||
cgit v1.2.1
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user