This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/cgit.cgi/v4l-utils.git tree:

Subject: v4l-utils: sync-with-kernel
Author:  Hans Verkuil <hverkuil-ci...@xs4all.nl>
Date:    Mon Mar 25 10:46:51 2024 +0100

Update v4l-utils to the latest kernel headers.

Signed-off-by: Hans Verkuil <hverkuil-ci...@xs4all.nl>

 contrib/freebsd/include/linux/input-event-codes.h |   1 +
 contrib/freebsd/include/linux/videodev2.h         |  32 ++---
 include/linux/bpf.h                               | 166 +++++++++++++++++++---
 include/linux/fb.h                                |   8 +-
 include/linux/vesa.h                              |  18 +++
 include/linux/videodev2.h                         |  32 ++---
 sync-with-kernel.sh                               |   2 +
 utils/common/codec-fwht.c                         |   2 +-
 utils/common/v4l2-tpg-core.c                      |  52 +++++--
 utils/keytable/parse.h                            |   1 +
 10 files changed, 241 insertions(+), 73 deletions(-)

---

http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=c6750117665b6e3eb29df829b731bcb583baee12
diff --git a/contrib/freebsd/include/linux/input-event-codes.h 
b/contrib/freebsd/include/linux/input-event-codes.h
index c46be93da083..45de2062ee12 100644
--- a/contrib/freebsd/include/linux/input-event-codes.h
+++ b/contrib/freebsd/include/linux/input-event-codes.h
@@ -602,6 +602,7 @@
 
 #define KEY_ALS_TOGGLE         0x230   /* Ambient light sensor */
 #define KEY_ROTATE_LOCK_TOGGLE 0x231   /* Display rotation lock */
+#define KEY_REFRESH_RATE_TOGGLE        0x232   /* Display refresh rate toggle 
*/
 
 #define KEY_BUTTONCONFIG               0x240   /* AL Button Configuration */
 #define KEY_TASKMANAGER                0x241   /* AL Task/Project Manager */
diff --git a/contrib/freebsd/include/linux/videodev2.h 
b/contrib/freebsd/include/linux/videodev2.h
index 4a8746ceeaea..e38532ea74ac 100644
--- a/contrib/freebsd/include/linux/videodev2.h
+++ b/contrib/freebsd/include/linux/videodev2.h
@@ -1031,13 +1031,13 @@ struct v4l2_requestbuffers {
  * struct v4l2_plane - plane info for multi-planar buffers
  * @bytesused:         number of bytes occupied by data in the plane (payload)
  * @length:            size of this plane (NOT the payload) in bytes
- * @mem_offset:                when memory in the associated struct 
v4l2_buffer is
+ * @m.mem_offset:      when memory in the associated struct v4l2_buffer is
  *                     V4L2_MEMORY_MMAP, equals the offset from the start of
  *                     the device memory for this plane (or is a "cookie" that
  *                     should be passed to mmap() called on the video node)
- * @userptr:           when memory is V4L2_MEMORY_USERPTR, a userspace pointer
+ * @m.userptr:         when memory is V4L2_MEMORY_USERPTR, a userspace pointer
  *                     pointing to this plane
- * @fd:                        when memory is V4L2_MEMORY_DMABUF, a userspace 
file
+ * @m.fd:              when memory is V4L2_MEMORY_DMABUF, a userspace file
  *                     descriptor associated with this plane
  * @m:                 union of @mem_offset, @userptr and @fd
  * @data_offset:       offset in the plane to the start of data; usually 0,
@@ -1075,14 +1075,14 @@ struct v4l2_plane {
  * @sequence:  sequence count of this frame
  * @memory:    enum v4l2_memory; the method, in which the actual video data is
  *             passed
- * @offset:    for non-multiplanar buffers with memory == V4L2_MEMORY_MMAP;
+ * @m.offset:  for non-multiplanar buffers with memory == V4L2_MEMORY_MMAP;
  *             offset from the start of the device memory for this plane,
  *             (or a "cookie" that should be passed to mmap() as offset)
- * @userptr:   for non-multiplanar buffers with memory == V4L2_MEMORY_USERPTR;
+ * @m.userptr: for non-multiplanar buffers with memory == V4L2_MEMORY_USERPTR;
  *             a userspace pointer pointing to this buffer
- * @fd:                for non-multiplanar buffers with memory == 
V4L2_MEMORY_DMABUF;
+ * @m.fd:              for non-multiplanar buffers with memory == 
V4L2_MEMORY_DMABUF;
  *             a userspace file descriptor associated with this buffer
- * @planes:    for multiplanar buffers; userspace pointer to the array of plane
+ * @m.planes:  for multiplanar buffers; userspace pointer to the array of plane
  *             info structs for this buffer
  * @m:         union of @offset, @userptr, @planes and @fd
  * @length:    size in bytes of the buffer (NOT its payload) for single-plane
@@ -2401,15 +2401,15 @@ struct v4l2_meta_format {
 
 /**
  * struct v4l2_format - stream data format
- * @type:      enum v4l2_buf_type; type of the data stream
- * @pix:       definition of an image format
- * @pix_mp:    definition of a multiplanar image format
- * @win:       definition of an overlaid image
- * @vbi:       raw VBI capture or output parameters
- * @sliced:    sliced VBI capture or output parameters
- * @raw_data:  placeholder for future extensions and custom formats
- * @fmt:       union of @pix, @pix_mp, @win, @vbi, @sliced, @sdr, @meta
- *             and @raw_data
+ * @type:              enum v4l2_buf_type; type of the data stream
+ * @fmt.pix:           definition of an image format
+ * @fmt.pix_mp:                definition of a multiplanar image format
+ * @fmt.win:           definition of an overlaid image
+ * @fmt.vbi:           raw VBI capture or output parameters
+ * @fmt.sliced:                sliced VBI capture or output parameters
+ * @fmt.raw_data:      placeholder for future extensions and custom formats
+ * @fmt:               union of @pix, @pix_mp, @win, @vbi, @sliced, @sdr,
+ *                     @meta and @raw_data
  */
 struct v4l2_format {
        uint32_t         type;
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index cdd6006d79fb..109ad86f772c 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -42,6 +42,7 @@
 #define BPF_JSGE       0x70    /* SGE is signed '>=', GE in x86 */
 #define BPF_JSLT       0xc0    /* SLT is signed, '<' */
 #define BPF_JSLE       0xd0    /* SLE is signed, '<=' */
+#define BPF_JCOND      0xe0    /* conditional pseudo jumps: may_goto, 
goto_or_nop */
 #define BPF_CALL       0x80    /* function call */
 #define BPF_EXIT       0x90    /* function return */
 
@@ -50,6 +51,10 @@
 #define BPF_XCHG       (0xe0 | BPF_FETCH)      /* atomic exchange */
 #define BPF_CMPXCHG    (0xf0 | BPF_FETCH)      /* atomic compare-and-write */
 
+enum bpf_cond_pseudo_jmp {
+       BPF_MAY_GOTO = 0,
+};
+
 /* Register numbers */
 enum {
        BPF_REG_0 = 0,
@@ -77,12 +82,29 @@ struct bpf_insn {
        __s32   imm;            /* signed immediate constant */
 };
 
-/* Key of an a BPF_MAP_TYPE_LPM_TRIE entry */
+/* Deprecated: use struct bpf_lpm_trie_key_u8 (when the "data" member is 
needed for
+ * byte access) or struct bpf_lpm_trie_key_hdr (when using an alternative type 
for
+ * the trailing flexible array member) instead.
+ */
 struct bpf_lpm_trie_key {
        __u32   prefixlen;      /* up to 32 for AF_INET, 128 for AF_INET6 */
        __u8    data[0];        /* Arbitrary size */
 };
 
+/* Header for bpf_lpm_trie_key structs */
+struct bpf_lpm_trie_key_hdr {
+       __u32   prefixlen;
+};
+
+/* Key of an a BPF_MAP_TYPE_LPM_TRIE entry, with trailing byte array. */
+struct bpf_lpm_trie_key_u8 {
+       union {
+               struct bpf_lpm_trie_key_hdr     hdr;
+               __u32                           prefixlen;
+       };
+       __u8    data[];         /* Arbitrary size */
+};
+
 struct bpf_cgroup_storage_key {
        __u64   cgroup_inode_id;        /* cgroup inode id */
        __u32   attach_type;            /* program attach type (enum 
bpf_attach_type) */
@@ -617,7 +639,11 @@ union bpf_iter_link_info {
  *             to NULL to begin the batched operation. After each subsequent
  *             **BPF_MAP_LOOKUP_BATCH**, the caller should pass the resultant
  *             *out_batch* as the *in_batch* for the next operation to
- *             continue iteration from the current point.
+ *             continue iteration from the current point. Both *in_batch* and
+ *             *out_batch* must point to memory large enough to hold a key,
+ *             except for maps of type **BPF_MAP_TYPE_{HASH, PERCPU_HASH,
+ *             LRU_HASH, LRU_PERCPU_HASH}**, for which batch parameters
+ *             must be at least 4 bytes wide regardless of key size.
  *
  *             The *keys* and *values* are output parameters which must point
  *             to memory large enough to hold *count* items based on the key
@@ -847,6 +873,36 @@ union bpf_iter_link_info {
  *             Returns zero on success. On error, -1 is returned and *errno*
  *             is set appropriately.
  *
+ * BPF_TOKEN_CREATE
+ *     Description
+ *             Create BPF token with embedded information about what
+ *             BPF-related functionality it allows:
+ *             - a set of allowed bpf() syscall commands;
+ *             - a set of allowed BPF map types to be created with
+ *             BPF_MAP_CREATE command, if BPF_MAP_CREATE itself is allowed;
+ *             - a set of allowed BPF program types and BPF program attach
+ *             types to be loaded with BPF_PROG_LOAD command, if
+ *             BPF_PROG_LOAD itself is allowed.
+ *
+ *             BPF token is created (derived) from an instance of BPF FS,
+ *             assuming it has necessary delegation mount options specified.
+ *             This BPF token can be passed as an extra parameter to various
+ *             bpf() syscall commands to grant BPF subsystem functionality to
+ *             unprivileged processes.
+ *
+ *             When created, BPF token is "associated" with the owning
+ *             user namespace of BPF FS instance (super block) that it was
+ *             derived from, and subsequent BPF operations performed with
+ *             BPF token would be performing capabilities checks (i.e.,
+ *             CAP_BPF, CAP_PERFMON, CAP_NET_ADMIN, CAP_SYS_ADMIN) within
+ *             that user namespace. Without BPF token, such capabilities
+ *             have to be granted in init user namespace, making bpf()
+ *             syscall incompatible with user namespace, for the most part.
+ *
+ *     Return
+ *             A new file descriptor (a nonnegative integer), or -1 if an
+ *             error occurred (in which case, *errno* is set appropriately).
+ *
  * NOTES
  *     eBPF objects (maps and programs) can be shared between processes.
  *
@@ -901,6 +957,8 @@ enum bpf_cmd {
        BPF_ITER_CREATE,
        BPF_LINK_DETACH,
        BPF_PROG_BIND_MAP,
+       BPF_TOKEN_CREATE,
+       __MAX_BPF_CMD,
 };
 
 enum bpf_map_type {
@@ -951,6 +1009,8 @@ enum bpf_map_type {
        BPF_MAP_TYPE_BLOOM_FILTER,
        BPF_MAP_TYPE_USER_RINGBUF,
        BPF_MAP_TYPE_CGRP_STORAGE,
+       BPF_MAP_TYPE_ARENA,
+       __MAX_BPF_MAP_TYPE
 };
 
 /* Note that tracing related programs such as
@@ -995,6 +1055,7 @@ enum bpf_prog_type {
        BPF_PROG_TYPE_SK_LOOKUP,
        BPF_PROG_TYPE_SYSCALL, /* a program that can execute syscalls */
        BPF_PROG_TYPE_NETFILTER,
+       __MAX_BPF_PROG_TYPE
 };
 
 enum bpf_attach_type {
@@ -1074,9 +1135,11 @@ enum bpf_link_type {
        BPF_LINK_TYPE_TCX = 11,
        BPF_LINK_TYPE_UPROBE_MULTI = 12,
        BPF_LINK_TYPE_NETKIT = 13,
-       MAX_BPF_LINK_TYPE,
+       __MAX_BPF_LINK_TYPE,
 };
 
+#define MAX_BPF_LINK_TYPE __MAX_BPF_LINK_TYPE
+
 enum bpf_perf_event_type {
        BPF_PERF_EVENT_UNSPEC = 0,
        BPF_PERF_EVENT_UPROBE = 1,
@@ -1200,6 +1263,9 @@ enum bpf_perf_event_type {
  */
 #define BPF_F_XDP_DEV_BOUND_ONLY       (1U << 6)
 
+/* The verifier internal test flag. Behavior is undefined */
+#define BPF_F_TEST_REG_INVARIANTS      (1U << 7)
+
 /* link_create.kprobe_multi.flags used in LINK_CREATE command for
  * BPF_TRACE_KPROBE_MULTI attach type to create return probe.
  */
@@ -1273,6 +1339,10 @@ enum {
  */
 #define BPF_PSEUDO_KFUNC_CALL  2
 
+enum bpf_addr_space_cast {
+       BPF_ADDR_SPACE_CAST = 1,
+};
+
 /* flags for BPF_MAP_UPDATE_ELEM command */
 enum {
        BPF_ANY         = 0, /* create new element or update existing */
@@ -1325,6 +1395,18 @@ enum {
 
 /* Get path from provided FD in BPF_OBJ_PIN/BPF_OBJ_GET commands */
        BPF_F_PATH_FD           = (1U << 14),
+
+/* Flag for value_type_btf_obj_fd, the fd is available */
+       BPF_F_VTYPE_BTF_OBJ_FD  = (1U << 15),
+
+/* BPF token FD is passed in a corresponding command's token_fd field */
+       BPF_F_TOKEN_FD          = (1U << 16),
+
+/* When user space page faults in bpf_arena send SIGSEGV instead of inserting 
new page */
+       BPF_F_SEGV_ON_FAULT     = (1U << 17),
+
+/* Do not translate kernel bpf_arena pointers to user pointers */
+       BPF_F_NO_USER_CONV      = (1U << 18),
 };
 
 /* Flags for BPF_PROG_QUERY. */
@@ -1396,8 +1478,20 @@ union bpf_attr {
                 * BPF_MAP_TYPE_BLOOM_FILTER - the lowest 4 bits indicate the
                 * number of hash functions (if 0, the bloom filter will default
                 * to using 5 hash functions).
+                *
+                * BPF_MAP_TYPE_ARENA - contains the address where user space
+                * is going to mmap() the arena. It has to be page aligned.
                 */
                __u64   map_extra;
+
+               __s32   value_type_btf_obj_fd;  /* fd pointing to a BTF
+                                                * type data for
+                                                * btf_vmlinux_value_type_id.
+                                                */
+               /* BPF token FD to use with BPF_MAP_CREATE operation.
+                * If provided, map_flags should have BPF_F_TOKEN_FD flag set.
+                */
+               __s32   map_token_fd;
        };
 
        struct { /* anonymous struct used by BPF_MAP_*_ELEM commands */
@@ -1467,6 +1561,10 @@ union bpf_attr {
                 * truncated), or smaller (if log buffer wasn't filled 
completely).
                 */
                __u32           log_true_size;
+               /* BPF token FD to use with BPF_PROG_LOAD operation.
+                * If provided, prog_flags should have BPF_F_TOKEN_FD flag set.
+                */
+               __s32           prog_token_fd;
        };
 
        struct { /* anonymous struct used by BPF_OBJ_* commands */
@@ -1579,6 +1677,11 @@ union bpf_attr {
                 * truncated), or smaller (if log buffer wasn't filled 
completely).
                 */
                __u32           btf_log_true_size;
+               __u32           btf_flags;
+               /* BPF token FD to use with BPF_BTF_LOAD operation.
+                * If provided, btf_flags should have BPF_F_TOKEN_FD flag set.
+                */
+               __s32           btf_token_fd;
        };
 
        struct {
@@ -1709,6 +1812,11 @@ union bpf_attr {
                __u32           flags;          /* extra flags */
        } prog_bind_map;
 
+       struct { /* struct used by BPF_TOKEN_CREATE command */
+               __u32           flags;
+               __u32           bpffs_fd;
+       } token_create;
+
 } __attribute__((aligned(8)));
 
 /* The description below is an attempt at providing documentation to eBPF
@@ -4517,6 +4625,8 @@ union bpf_attr {
  * long bpf_get_task_stack(struct task_struct *task, void *buf, u32 size, u64 
flags)
  *     Description
  *             Return a user or a kernel stack in bpf program provided buffer.
+ *             Note: the user stack will only be populated if the *task* is
+ *             the current task; all other tasks will return -EOPNOTSUPP.
  *             To achieve this, the helper needs *task*, which is a valid
  *             pointer to **struct task_struct**. To store the stacktrace, the
  *             bpf program provides *buf* with a nonnegative *size*.
@@ -4528,6 +4638,7 @@ union bpf_attr {
  *
  *             **BPF_F_USER_STACK**
  *                     Collect a user space stack instead of a kernel stack.
+ *                     The *task* must be the current task.
  *             **BPF_F_USER_BUILD_ID**
  *                     Collect buildid+offset instead of ips for user stack,
  *                     only valid if **BPF_F_USER_STACK** is also specified.
@@ -4831,9 +4942,9 @@ union bpf_attr {
  *             going through the CPU's backlog queue.
  *
  *             The *flags* argument is reserved and must be 0. The helper is
- *             currently only supported for tc BPF program types at the ingress
- *             hook and for veth device types. The peer device must reside in a
- *             different network namespace.
+ *             currently only supported for tc BPF program types at the
+ *             ingress hook and for veth and netkit target device types. The
+ *             peer device must reside in a different network namespace.
  *     Return
  *             The helper returns **TC_ACT_REDIRECT** on success or
  *             **TC_ACT_SHOT** on error.
@@ -6479,7 +6590,7 @@ struct bpf_map_info {
        __u32 btf_id;
        __u32 btf_key_type_id;
        __u32 btf_value_type_id;
-       __u32 :32;      /* alignment pad */
+       __u32 btf_vmlinux_id;
        __u64 map_extra;
 } __attribute__((aligned(8)));
 
@@ -6555,7 +6666,18 @@ struct bpf_link_info {
                        __u32 count; /* in/out: kprobe_multi function count */
                        __u32 flags;
                        __u64 missed;
+                       __aligned_u64 cookies;
                } kprobe_multi;
+               struct {
+                       __aligned_u64 path;
+                       __aligned_u64 offsets;
+                       __aligned_u64 ref_ctr_offsets;
+                       __aligned_u64 cookies;
+                       __u32 path_size; /* in/out: real path size on success, 
including zero byte */
+                       __u32 count; /* in/out: uprobe_multi 
offsets/ref_ctr_offsets/cookies count */
+                       __u32 flags;
+                       __u32 pid;
+               } uprobe_multi;
                struct {
                        __u32 type; /* enum bpf_perf_event_type */
                        __u32 :32;
@@ -6564,6 +6686,7 @@ struct bpf_link_info {
                                        __aligned_u64 file_name; /* in/out */
                                        __u32 name_len;
                                        __u32 offset; /* offset from file_name 
*/
+                                       __u64 cookie;
                                } uprobe; /* BPF_PERF_EVENT_UPROBE, 
BPF_PERF_EVENT_URETPROBE */
                                struct {
                                        __aligned_u64 func_name; /* in/out */
@@ -6571,14 +6694,19 @@ struct bpf_link_info {
                                        __u32 offset; /* offset from func_name 
*/
                                        __u64 addr;
                                        __u64 missed;
+                                       __u64 cookie;
                                } kprobe; /* BPF_PERF_EVENT_KPROBE, 
BPF_PERF_EVENT_KRETPROBE */
                                struct {
                                        __aligned_u64 tp_name;   /* in/out */
                                        __u32 name_len;
+                                       __u32 :32;
+                                       __u64 cookie;
                                } tracepoint; /* BPF_PERF_EVENT_TRACEPOINT */
                                struct {
                                        __u64 config;
                                        __u32 type;
+                                       __u32 :32;
+                                       __u64 cookie;
                                } event; /* BPF_PERF_EVENT_EVENT */
                        };
                } perf_event;
@@ -6886,6 +7014,7 @@ enum {
        BPF_TCP_LISTEN,
        BPF_TCP_CLOSING,        /* Now a valid state */
        BPF_TCP_NEW_SYN_RECV,
+       BPF_TCP_BOUND_INACTIVE,
 
        BPF_TCP_MAX_STATES      /* Leave at the end! */
 };
@@ -7151,40 +7280,31 @@ struct bpf_spin_lock {
 };
 
 struct bpf_timer {
-       __u64 :64;
-       __u64 :64;
+       __u64 __opaque[2];
 } __attribute__((aligned(8)));
 
 struct bpf_dynptr {
-       __u64 :64;
-       __u64 :64;
+       __u64 __opaque[2];
 } __attribute__((aligned(8)));
 
 struct bpf_list_head {
-       __u64 :64;
-       __u64 :64;
+       __u64 __opaque[2];
 } __attribute__((aligned(8)));
 
 struct bpf_list_node {
-       __u64 :64;
-       __u64 :64;
-       __u64 :64;
+       __u64 __opaque[3];
 } __attribute__((aligned(8)));
 
 struct bpf_rb_root {
-       __u64 :64;
-       __u64 :64;
+       __u64 __opaque[2];
 } __attribute__((aligned(8)));
 
 struct bpf_rb_node {
-       __u64 :64;
-       __u64 :64;
-       __u64 :64;
-       __u64 :64;
+       __u64 __opaque[4];
 } __attribute__((aligned(8)));
 
 struct bpf_refcount {
-       __u32 :32;
+       __u32 __opaque[1];
 } __attribute__((aligned(4)));
 
 struct bpf_sysctl {
diff --git a/include/linux/fb.h b/include/linux/fb.h
index ec7ef0e7cf0c..33c006d2e352 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -4,6 +4,7 @@
 
 #include <linux/types.h>
 #include <linux/i2c.h>
+#include <linux/vesa.h>
 
 /* Definitions of frame buffers                                                
*/
 
@@ -291,13 +292,6 @@ struct fb_con2fbmap {
        __u32 framebuffer;
 };
 
-/* VESA Blanking Levels */
-#define VESA_NO_BLANKING        0
-#define VESA_VSYNC_SUSPEND      1
-#define VESA_HSYNC_SUSPEND      2
-#define VESA_POWERDOWN          3
-
-
 enum {
        /* screen: unblanked, hsync: on,  vsync: on */
        FB_BLANK_UNBLANK       = VESA_NO_BLANKING,
diff --git a/include/linux/vesa.h b/include/linux/vesa.h
new file mode 100644
index 000000000000..984cfda6131f
--- /dev/null
+++ b/include/linux/vesa.h
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
+#ifndef _LINUX_VESA_H
+#define _LINUX_VESA_H
+
+/* VESA Blanking Levels */
+enum vesa_blank_mode {
+       VESA_NO_BLANKING        = 0,
+#define VESA_NO_BLANKING       VESA_NO_BLANKING
+       VESA_VSYNC_SUSPEND      = 1,
+#define VESA_VSYNC_SUSPEND     VESA_VSYNC_SUSPEND
+       VESA_HSYNC_SUSPEND      = 2,
+#define VESA_HSYNC_SUSPEND     VESA_HSYNC_SUSPEND
+       VESA_POWERDOWN          = VESA_VSYNC_SUSPEND | VESA_HSYNC_SUSPEND,
+#define VESA_POWERDOWN         VESA_POWERDOWN
+       VESA_BLANK_MAX          = VESA_POWERDOWN,
+};
+
+#endif
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 397a99e3658b..d1da8545be6d 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -997,13 +997,13 @@ struct v4l2_requestbuffers {
  * struct v4l2_plane - plane info for multi-planar buffers
  * @bytesused:         number of bytes occupied by data in the plane (payload)
  * @length:            size of this plane (NOT the payload) in bytes
- * @mem_offset:                when memory in the associated struct 
v4l2_buffer is
+ * @m.mem_offset:      when memory in the associated struct v4l2_buffer is
  *                     V4L2_MEMORY_MMAP, equals the offset from the start of
  *                     the device memory for this plane (or is a "cookie" that
  *                     should be passed to mmap() called on the video node)
- * @userptr:           when memory is V4L2_MEMORY_USERPTR, a userspace pointer
+ * @m.userptr:         when memory is V4L2_MEMORY_USERPTR, a userspace pointer
  *                     pointing to this plane
- * @fd:                        when memory is V4L2_MEMORY_DMABUF, a userspace 
file
+ * @m.fd:              when memory is V4L2_MEMORY_DMABUF, a userspace file
  *                     descriptor associated with this plane
  * @m:                 union of @mem_offset, @userptr and @fd
  * @data_offset:       offset in the plane to the start of data; usually 0,
@@ -1041,14 +1041,14 @@ struct v4l2_plane {
  * @sequence:  sequence count of this frame
  * @memory:    enum v4l2_memory; the method, in which the actual video data is
  *             passed
- * @offset:    for non-multiplanar buffers with memory == V4L2_MEMORY_MMAP;
+ * @m.offset:  for non-multiplanar buffers with memory == V4L2_MEMORY_MMAP;
  *             offset from the start of the device memory for this plane,
  *             (or a "cookie" that should be passed to mmap() as offset)
- * @userptr:   for non-multiplanar buffers with memory == V4L2_MEMORY_USERPTR;
+ * @m.userptr: for non-multiplanar buffers with memory == V4L2_MEMORY_USERPTR;
  *             a userspace pointer pointing to this buffer
- * @fd:                for non-multiplanar buffers with memory == 
V4L2_MEMORY_DMABUF;
+ * @m.fd:              for non-multiplanar buffers with memory == 
V4L2_MEMORY_DMABUF;
  *             a userspace file descriptor associated with this buffer
- * @planes:    for multiplanar buffers; userspace pointer to the array of plane
+ * @m.planes:  for multiplanar buffers; userspace pointer to the array of plane
  *             info structs for this buffer
  * @m:         union of @offset, @userptr, @planes and @fd
  * @length:    size in bytes of the buffer (NOT its payload) for single-plane
@@ -2367,15 +2367,15 @@ struct v4l2_meta_format {
 
 /**
  * struct v4l2_format - stream data format
- * @type:      enum v4l2_buf_type; type of the data stream
- * @pix:       definition of an image format
- * @pix_mp:    definition of a multiplanar image format
- * @win:       definition of an overlaid image
- * @vbi:       raw VBI capture or output parameters
- * @sliced:    sliced VBI capture or output parameters
- * @raw_data:  placeholder for future extensions and custom formats
- * @fmt:       union of @pix, @pix_mp, @win, @vbi, @sliced, @sdr, @meta
- *             and @raw_data
+ * @type:              enum v4l2_buf_type; type of the data stream
+ * @fmt.pix:           definition of an image format
+ * @fmt.pix_mp:                definition of a multiplanar image format
+ * @fmt.win:           definition of an overlaid image
+ * @fmt.vbi:           raw VBI capture or output parameters
+ * @fmt.sliced:                sliced VBI capture or output parameters
+ * @fmt.raw_data:      placeholder for future extensions and custom formats
+ * @fmt:               union of @pix, @pix_mp, @win, @vbi, @sliced, @sdr,
+ *                     @meta and @raw_data
  */
 struct v4l2_format {
        __u32    type;
diff --git a/sync-with-kernel.sh b/sync-with-kernel.sh
index f003bc7e6f35..a11545dd8d0d 100755
--- a/sync-with-kernel.sh
+++ b/sync-with-kernel.sh
@@ -7,6 +7,7 @@ KERNEL_DIR=$1
 if [ -z "${KERNEL_DIR}" -o \
      ! -f ${KERNEL_DIR}/usr/include/linux/videodev2.h -o \
      ! -f ${KERNEL_DIR}/usr/include/linux/fb.h -o \
+     ! -f ${KERNEL_DIR}/usr/include/linux/vesa.h -o \
      ! -f ${KERNEL_DIR}/usr/include/linux/v4l2-controls.h -o \
      ! -f ${KERNEL_DIR}/usr/include/linux/v4l2-common.h -o \
      ! -f ${KERNEL_DIR}/usr/include/linux/v4l2-subdev.h -o \
@@ -28,6 +29,7 @@ fi
 
 cp -a ${KERNEL_DIR}/usr/include/linux/videodev2.h ${TOPSRCDIR}/include/linux
 cp -a ${KERNEL_DIR}/usr/include/linux/fb.h ${TOPSRCDIR}/include/linux
+cp -a ${KERNEL_DIR}/usr/include/linux/vesa.h ${TOPSRCDIR}/include/linux
 cp -a ${KERNEL_DIR}/usr/include/linux/v4l2-controls.h 
${TOPSRCDIR}/include/linux
 patch -d ${TOPSRCDIR} --no-backup-if-mismatch -p1 
<${TOPSRCDIR}/utils/common/v4l2-controls.patch
 cp -a ${KERNEL_DIR}/usr/include/linux/v4l2-common.h ${TOPSRCDIR}/include/linux
diff --git a/utils/common/codec-fwht.c b/utils/common/codec-fwht.c
index 1ce682e1b85c..fd75457d03b2 100644
--- a/utils/common/codec-fwht.c
+++ b/utils/common/codec-fwht.c
@@ -49,7 +49,7 @@ static const uint8_t zigzag[64] = {
 
 /*
  * noinline_for_stack to work around
- * https://bugs.llvm.org/show_bug.cgi?id=38809
+ * https://llvm.org/pr38809
  */
 static int noinline_for_stack
 rlc(const s16 *in, __be16 *output, int blocktype)
diff --git a/utils/common/v4l2-tpg-core.c b/utils/common/v4l2-tpg-core.c
index b4075bcb7ea7..fe19327cd286 100644
--- a/utils/common/v4l2-tpg-core.c
+++ b/utils/common/v4l2-tpg-core.c
@@ -109,6 +109,7 @@ int tpg_alloc(struct tpg_data *tpg, unsigned max_w)
 {
        unsigned pat;
        unsigned plane;
+       int ret = 0;
 
        tpg->max_line_width = max_w;
        for (pat = 0; pat < TPG_MAX_PAT_LINES; pat++) {
@@ -117,14 +118,18 @@ int tpg_alloc(struct tpg_data *tpg, unsigned max_w)
 
                        tpg->lines[pat][plane] =
                                vzalloc(array3_size(max_w, 2, pixelsz));
-                       if (!tpg->lines[pat][plane])
-                               return -ENOMEM;
+                       if (!tpg->lines[pat][plane]) {
+                               ret = -ENOMEM;
+                               goto free_lines;
+                       }
                        if (plane == 0)
                                continue;
                        tpg->downsampled_lines[pat][plane] =
                                vzalloc(array3_size(max_w, 2, pixelsz));
-                       if (!tpg->downsampled_lines[pat][plane])
-                               return -ENOMEM;
+                       if (!tpg->downsampled_lines[pat][plane]) {
+                               ret = -ENOMEM;
+                               goto free_lines;
+                       }
                }
        }
        for (plane = 0; plane < TPG_MAX_PLANES; plane++) {
@@ -132,18 +137,45 @@ int tpg_alloc(struct tpg_data *tpg, unsigned max_w)
 
                tpg->contrast_line[plane] =
                        vzalloc(array_size(pixelsz, max_w));
-               if (!tpg->contrast_line[plane])
-                       return -ENOMEM;
+               if (!tpg->contrast_line[plane]) {
+                       ret = -ENOMEM;
+                       goto free_contrast_line;
+               }
                tpg->black_line[plane] =
                        vzalloc(array_size(pixelsz, max_w));
-               if (!tpg->black_line[plane])
-                       return -ENOMEM;
+               if (!tpg->black_line[plane]) {
+                       ret = -ENOMEM;
+                       goto free_contrast_line;
+               }
                tpg->random_line[plane] =
                        vzalloc(array3_size(max_w, 2, pixelsz));
-               if (!tpg->random_line[plane])
-                       return -ENOMEM;
+               if (!tpg->random_line[plane]) {
+                       ret = -ENOMEM;
+                       goto free_contrast_line;
+               }
        }
        return 0;
+
+free_contrast_line:
+       for (plane = 0; plane < TPG_MAX_PLANES; plane++) {
+               vfree(tpg->contrast_line[plane]);
+               vfree(tpg->black_line[plane]);
+               vfree(tpg->random_line[plane]);
+               tpg->contrast_line[plane] = NULL;
+               tpg->black_line[plane] = NULL;
+               tpg->random_line[plane] = NULL;
+       }
+free_lines:
+       for (pat = 0; pat < TPG_MAX_PAT_LINES; pat++)
+               for (plane = 0; plane < TPG_MAX_PLANES; plane++) {
+                       vfree(tpg->lines[pat][plane]);
+                       tpg->lines[pat][plane] = NULL;
+                       if (plane == 0)
+                               continue;
+                       vfree(tpg->downsampled_lines[pat][plane]);
+                       tpg->downsampled_lines[pat][plane] = NULL;
+               }
+       return ret;
 }
 
 void tpg_free(struct tpg_data *tpg)
diff --git a/utils/keytable/parse.h b/utils/keytable/parse.h
index 08b0c7a31e01..a8f53673fa20 100644
--- a/utils/keytable/parse.h
+++ b/utils/keytable/parse.h
@@ -518,6 +518,7 @@ struct parse_event key_events[] = {
        {"BTN_DPAD_RIGHT", 0x223},
        {"KEY_ALS_TOGGLE", 0x230},
        {"KEY_ROTATE_LOCK_TOGGLE", 0x231},
+       {"KEY_REFRESH_RATE_TOGGLE", 0x232},
        {"KEY_BUTTONCONFIG", 0x240},
        {"KEY_TASKMANAGER", 0x241},
        {"KEY_JOURNAL", 0x242},

Reply via email to