Blame SOURCES/0078-v4l2-improve-buffer-flag-decoding.patch

86f512
From 97a57bbf35066d436230fe004f9f44e524a6e807 Mon Sep 17 00:00:00 2001
86f512
From: Eugene Syromyatnikov <evgsyr@gmail.com>
86f512
Date: Sun, 25 Nov 2018 16:14:11 +0100
86f512
Subject: [PATCH 77/82] v4l2: improve buffer flag decoding
86f512
86f512
* xlat/v4l2_buf_flags.in: Add fallback values.
86f512
* xlat/v4l2_buf_flags_masks.in: New file.
86f512
* xlat/v4l2_buf_flags_ts_src.in: Likewise.
86f512
* xlat/v4l2_buf_flags_ts_type.in: Likewise.
86f512
* v4l2.c: Include xlat/v4l2_buf_flags_ts_type.h,
86f512
xlat/v4l2_buf_flags_ts_src.h, xlat/v4l2_buf_flags_masks.h.
86f512
(print_v4l2_buffer_flags): New function.
86f512
(print_v4l2_buffer): Call print_v4l2_buffer_flags for printing flags field.
86f512
---
86f512
 v4l2.c                         | 25 ++++++++++++++++++++++++-
86f512
 xlat/v4l2_buf_flags.in         | 33 ++++++++++++++-------------------
86f512
 xlat/v4l2_buf_flags_masks.in   |  2 ++
86f512
 xlat/v4l2_buf_flags_ts_src.in  |  3 +++
86f512
 xlat/v4l2_buf_flags_ts_type.in |  4 ++++
86f512
 5 files changed, 47 insertions(+), 20 deletions(-)
86f512
 create mode 100644 xlat/v4l2_buf_flags_masks.in
86f512
 create mode 100644 xlat/v4l2_buf_flags_ts_src.in
86f512
 create mode 100644 xlat/v4l2_buf_flags_ts_type.in
86f512
86f512
Index: strace-5.1/v4l2.c
86f512
===================================================================
86f512
--- strace-5.1.orig/v4l2.c	2020-01-29 12:41:14.883725929 +0100
86f512
+++ strace-5.1/v4l2.c	2020-01-29 14:19:20.356865977 +0100
86f512
@@ -385,6 +385,29 @@
86f512
 }
86f512
 
86f512
 #include "xlat/v4l2_buf_flags.h"
86f512
+#include "xlat/v4l2_buf_flags_ts_type.h"
86f512
+#include "xlat/v4l2_buf_flags_ts_src.h"
86f512
+
86f512
+#define XLAT_MACROS_ONLY
86f512
+# include "xlat/v4l2_buf_flags_masks.h"
86f512
+#undef XLAT_MACROS_ONLY
86f512
+
86f512
+static void
86f512
+print_v4l2_buffer_flags(uint32_t val)
86f512
+{
86f512
+	const uint32_t ts_type = val & V4L2_BUF_FLAG_TIMESTAMP_MASK;
86f512
+	const uint32_t ts_src  = val & V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
86f512
+	const uint32_t flags   = val & ~ts_type & ~ts_src;
86f512
+
86f512
+
86f512
+	printflags(v4l2_buf_flags, flags, "V4L2_BUF_FLAG_???");
86f512
+	tprints("|");
86f512
+	printxval(v4l2_buf_flags_ts_type, ts_type,
86f512
+		  "V4L2_BUF_FLAG_TIMESTAMP_???");
86f512
+	tprints("|");
86f512
+	printxval(v4l2_buf_flags_ts_type, ts_src,
86f512
+		  "V4L2_BUF_FLAG_TSTAMP_SRC_???");
86f512
+}
86f512
 
86f512
 static int
86f512
 print_v4l2_buffer(struct tcb *const tcp, const unsigned int code,
86f512
@@ -419,7 +442,7 @@
86f512
 
86f512
 		tprintf(", length=%u, bytesused=%u, flags=",
86f512
 			b.length, b.bytesused);
86f512
-		printflags(v4l2_buf_flags, b.flags, "V4L2_BUF_FLAG_???");
86f512
+		print_v4l2_buffer_flags(b.flags);
86f512
 		if (code == VIDIOC_DQBUF) {
86f512
 			tprints(", timestamp = ");
86f512
 			MPERS_FUNC_NAME(print_struct_timeval)(&b.timestamp);
86f512
Index: strace-5.1/xlat/v4l2_buf_flags.in
86f512
===================================================================
86f512
--- strace-5.1.orig/xlat/v4l2_buf_flags.in	2017-04-07 03:21:36.000000000 +0200
86f512
+++ strace-5.1/xlat/v4l2_buf_flags.in	2020-01-29 14:19:20.357865967 +0100
86f512
@@ -1,19 +1,14 @@
86f512
-V4L2_BUF_FLAG_MAPPED
86f512
-V4L2_BUF_FLAG_QUEUED
86f512
-V4L2_BUF_FLAG_DONE
86f512
-V4L2_BUF_FLAG_KEYFRAME
86f512
-V4L2_BUF_FLAG_PFRAME
86f512
-V4L2_BUF_FLAG_BFRAME
86f512
-V4L2_BUF_FLAG_TIMECODE
86f512
-V4L2_BUF_FLAG_INPUT
86f512
-V4L2_BUF_FLAG_PREPARED
86f512
-V4L2_BUF_FLAG_NO_CACHE_INVALIDATE
86f512
-V4L2_BUF_FLAG_NO_CACHE_CLEAN
86f512
-V4L2_BUF_FLAG_TIMESTAMP_MASK
86f512
-V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN
86f512
-V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC
86f512
-V4L2_BUF_FLAG_TIMESTAMP_COPY
86f512
-V4L2_BUF_FLAG_TSTAMP_SRC_MASK
86f512
-V4L2_BUF_FLAG_TSTAMP_SRC_EOF
86f512
-V4L2_BUF_FLAG_TSTAMP_SRC_SOE
86f512
-V4L2_BUF_FLAG_LAST
86f512
+V4L2_BUF_FLAG_MAPPED			0x00000001
86f512
+V4L2_BUF_FLAG_QUEUED			0x00000002
86f512
+V4L2_BUF_FLAG_DONE			0x00000004
86f512
+V4L2_BUF_FLAG_KEYFRAME			0x00000008
86f512
+V4L2_BUF_FLAG_PFRAME			0x00000010
86f512
+V4L2_BUF_FLAG_BFRAME			0x00000020
86f512
+V4L2_BUF_FLAG_ERROR			0x00000040
86f512
+V4L2_BUF_FLAG_IN_REQUEST		0x00000080
86f512
+V4L2_BUF_FLAG_TIMECODE			0x00000100
86f512
+V4L2_BUF_FLAG_PREPARED			0x00000400
86f512
+V4L2_BUF_FLAG_NO_CACHE_INVALIDATE	0x00000800
86f512
+V4L2_BUF_FLAG_NO_CACHE_CLEAN		0x00001000
86f512
+V4L2_BUF_FLAG_LAST			0x00100000
86f512
+V4L2_BUF_FLAG_REQUEST_FD		0x00800000
86f512
Index: strace-5.1/xlat/v4l2_buf_flags_masks.in
86f512
===================================================================
86f512
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
86f512
+++ strace-5.1/xlat/v4l2_buf_flags_masks.in	2020-01-29 14:19:20.358865958 +0100
86f512
@@ -0,0 +1,2 @@
86f512
+V4L2_BUF_FLAG_TIMESTAMP_MASK	0x0000e000
86f512
+V4L2_BUF_FLAG_TSTAMP_SRC_MASK	0x00070000
86f512
Index: strace-5.1/xlat/v4l2_buf_flags_ts_src.in
86f512
===================================================================
86f512
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
86f512
+++ strace-5.1/xlat/v4l2_buf_flags_ts_src.in	2020-01-29 14:19:20.358865958 +0100
86f512
@@ -0,0 +1,3 @@
86f512
+/* V4L2_BUF_FLAG_TSTAMP_SRC_MASK	0x00070000 */
86f512
+V4L2_BUF_FLAG_TSTAMP_SRC_EOF		0x00000000
86f512
+V4L2_BUF_FLAG_TSTAMP_SRC_SOE		0x00010000
86f512
Index: strace-5.1/xlat/v4l2_buf_flags_ts_type.in
86f512
===================================================================
86f512
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
86f512
+++ strace-5.1/xlat/v4l2_buf_flags_ts_type.in	2020-01-29 14:19:20.358865958 +0100
86f512
@@ -0,0 +1,4 @@
86f512
+/* V4L2_BUF_FLAG_TIMESTAMP_MASK		0x0000e000 */
86f512
+V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN		0x00000000
86f512
+V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC	0x00002000
86f512
+V4L2_BUF_FLAG_TIMESTAMP_COPY		0x00004000
86f512
Index: strace-5.1/xlat/v4l2_buf_flags_masks.h
86f512
===================================================================
86f512
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
86f512
+++ strace-5.1/xlat/v4l2_buf_flags_masks.h	2020-01-29 14:20:25.816233898 +0100
86f512
@@ -0,0 +1,40 @@
86f512
+/* Generated by ./xlat/gen.sh from ./xlat/v4l2_buf_flags_masks.in; do not edit. */
86f512
+
86f512
+#include "gcc_compat.h"
86f512
+#include "static_assert.h"
86f512
+
86f512
+#if defined(V4L2_BUF_FLAG_TIMESTAMP_MASK) || (defined(HAVE_DECL_V4L2_BUF_FLAG_TIMESTAMP_MASK) && HAVE_DECL_V4L2_BUF_FLAG_TIMESTAMP_MASK)
86f512
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+static_assert((V4L2_BUF_FLAG_TIMESTAMP_MASK) == (0x0000e000), "V4L2_BUF_FLAG_TIMESTAMP_MASK != 0x0000e000");
86f512
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+#else
86f512
+# define V4L2_BUF_FLAG_TIMESTAMP_MASK 0x0000e000
86f512
+#endif
86f512
+#if defined(V4L2_BUF_FLAG_TSTAMP_SRC_MASK) || (defined(HAVE_DECL_V4L2_BUF_FLAG_TSTAMP_SRC_MASK) && HAVE_DECL_V4L2_BUF_FLAG_TSTAMP_SRC_MASK)
86f512
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+static_assert((V4L2_BUF_FLAG_TSTAMP_SRC_MASK) == (0x00070000), "V4L2_BUF_FLAG_TSTAMP_SRC_MASK != 0x00070000");
86f512
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+#else
86f512
+# define V4L2_BUF_FLAG_TSTAMP_SRC_MASK 0x00070000
86f512
+#endif
86f512
+
86f512
+#ifndef XLAT_MACROS_ONLY
86f512
+
86f512
+# ifdef IN_MPERS
86f512
+
86f512
+extern const struct xlat v4l2_buf_flags_masks[];
86f512
+
86f512
+# else
86f512
+
86f512
+#  if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS)
86f512
+static
86f512
+#  endif
86f512
+const struct xlat v4l2_buf_flags_masks[] = {
86f512
+ XLAT(V4L2_BUF_FLAG_TIMESTAMP_MASK),
86f512
+ XLAT(V4L2_BUF_FLAG_TSTAMP_SRC_MASK),
86f512
+ XLAT_END
86f512
+};
86f512
+
86f512
+# endif /* !IN_MPERS */
86f512
+
86f512
+#endif /* !XLAT_MACROS_ONLY */
86f512
Index: strace-5.1/xlat/v4l2_buf_flags_ts_src.h
86f512
===================================================================
86f512
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
86f512
+++ strace-5.1/xlat/v4l2_buf_flags_ts_src.h	2020-01-29 14:20:26.039231745 +0100
86f512
@@ -0,0 +1,41 @@
86f512
+/* Generated by ./xlat/gen.sh from ./xlat/v4l2_buf_flags_ts_src.in; do not edit. */
86f512
+
86f512
+#include "gcc_compat.h"
86f512
+#include "static_assert.h"
86f512
+
86f512
+#if defined(V4L2_BUF_FLAG_TSTAMP_SRC_EOF) || (defined(HAVE_DECL_V4L2_BUF_FLAG_TSTAMP_SRC_EOF) && HAVE_DECL_V4L2_BUF_FLAG_TSTAMP_SRC_EOF)
86f512
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+static_assert((V4L2_BUF_FLAG_TSTAMP_SRC_EOF) == (0x00000000), "V4L2_BUF_FLAG_TSTAMP_SRC_EOF != 0x00000000");
86f512
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+#else
86f512
+# define V4L2_BUF_FLAG_TSTAMP_SRC_EOF 0x00000000
86f512
+#endif
86f512
+#if defined(V4L2_BUF_FLAG_TSTAMP_SRC_SOE) || (defined(HAVE_DECL_V4L2_BUF_FLAG_TSTAMP_SRC_SOE) && HAVE_DECL_V4L2_BUF_FLAG_TSTAMP_SRC_SOE)
86f512
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+static_assert((V4L2_BUF_FLAG_TSTAMP_SRC_SOE) == (0x00010000), "V4L2_BUF_FLAG_TSTAMP_SRC_SOE != 0x00010000");
86f512
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+#else
86f512
+# define V4L2_BUF_FLAG_TSTAMP_SRC_SOE 0x00010000
86f512
+#endif
86f512
+
86f512
+#ifndef XLAT_MACROS_ONLY
86f512
+
86f512
+# ifdef IN_MPERS
86f512
+
86f512
+extern const struct xlat v4l2_buf_flags_ts_src[];
86f512
+
86f512
+# else
86f512
+
86f512
+#  if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS)
86f512
+static
86f512
+#  endif
86f512
+const struct xlat v4l2_buf_flags_ts_src[] = {
86f512
+
86f512
+ XLAT(V4L2_BUF_FLAG_TSTAMP_SRC_EOF),
86f512
+ XLAT(V4L2_BUF_FLAG_TSTAMP_SRC_SOE),
86f512
+ XLAT_END
86f512
+};
86f512
+
86f512
+# endif /* !IN_MPERS */
86f512
+
86f512
+#endif /* !XLAT_MACROS_ONLY */
86f512
Index: strace-5.1/xlat/v4l2_buf_flags_ts_type.h
86f512
===================================================================
86f512
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
86f512
+++ strace-5.1/xlat/v4l2_buf_flags_ts_type.h	2020-01-29 14:20:26.244229766 +0100
86f512
@@ -0,0 +1,49 @@
86f512
+/* Generated by ./xlat/gen.sh from ./xlat/v4l2_buf_flags_ts_type.in; do not edit. */
86f512
+
86f512
+#include "gcc_compat.h"
86f512
+#include "static_assert.h"
86f512
+
86f512
+#if defined(V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN) || (defined(HAVE_DECL_V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN) && HAVE_DECL_V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN)
86f512
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+static_assert((V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN) == (0x00000000), "V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN != 0x00000000");
86f512
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+#else
86f512
+# define V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN 0x00000000
86f512
+#endif
86f512
+#if defined(V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC) || (defined(HAVE_DECL_V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC) && HAVE_DECL_V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC)
86f512
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+static_assert((V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC) == (0x00002000), "V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC != 0x00002000");
86f512
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+#else
86f512
+# define V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC 0x00002000
86f512
+#endif
86f512
+#if defined(V4L2_BUF_FLAG_TIMESTAMP_COPY) || (defined(HAVE_DECL_V4L2_BUF_FLAG_TIMESTAMP_COPY) && HAVE_DECL_V4L2_BUF_FLAG_TIMESTAMP_COPY)
86f512
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+static_assert((V4L2_BUF_FLAG_TIMESTAMP_COPY) == (0x00004000), "V4L2_BUF_FLAG_TIMESTAMP_COPY != 0x00004000");
86f512
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+#else
86f512
+# define V4L2_BUF_FLAG_TIMESTAMP_COPY 0x00004000
86f512
+#endif
86f512
+
86f512
+#ifndef XLAT_MACROS_ONLY
86f512
+
86f512
+# ifdef IN_MPERS
86f512
+
86f512
+extern const struct xlat v4l2_buf_flags_ts_type[];
86f512
+
86f512
+# else
86f512
+
86f512
+#  if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS)
86f512
+static
86f512
+#  endif
86f512
+const struct xlat v4l2_buf_flags_ts_type[] = {
86f512
+
86f512
+ XLAT(V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN),
86f512
+ XLAT(V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC),
86f512
+ XLAT(V4L2_BUF_FLAG_TIMESTAMP_COPY),
86f512
+ XLAT_END
86f512
+};
86f512
+
86f512
+# endif /* !IN_MPERS */
86f512
+
86f512
+#endif /* !XLAT_MACROS_ONLY */
86f512
Index: strace-5.1/xlat/v4l2_buf_flags.h
86f512
===================================================================
86f512
--- strace-5.1.orig/xlat/v4l2_buf_flags.h	2019-05-22 15:08:31.000000000 +0200
86f512
+++ strace-5.1/xlat/v4l2_buf_flags.h	2020-01-29 14:20:53.627965347 +0100
86f512
@@ -3,76 +3,131 @@
86f512
 #include "gcc_compat.h"
86f512
 #include "static_assert.h"
86f512
 
86f512
-
86f512
-#ifndef XLAT_MACROS_ONLY
86f512
-
86f512
-# ifdef IN_MPERS
86f512
-
86f512
-extern const struct xlat v4l2_buf_flags[];
86f512
-
86f512
-# else
86f512
-
86f512
-#  if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS)
86f512
-static
86f512
-#  endif
86f512
-const struct xlat v4l2_buf_flags[] = {
86f512
 #if defined(V4L2_BUF_FLAG_MAPPED) || (defined(HAVE_DECL_V4L2_BUF_FLAG_MAPPED) && HAVE_DECL_V4L2_BUF_FLAG_MAPPED)
86f512
-  XLAT(V4L2_BUF_FLAG_MAPPED),
86f512
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+static_assert((V4L2_BUF_FLAG_MAPPED) == (0x00000001), "V4L2_BUF_FLAG_MAPPED != 0x00000001");
86f512
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+#else
86f512
+# define V4L2_BUF_FLAG_MAPPED 0x00000001
86f512
 #endif
86f512
 #if defined(V4L2_BUF_FLAG_QUEUED) || (defined(HAVE_DECL_V4L2_BUF_FLAG_QUEUED) && HAVE_DECL_V4L2_BUF_FLAG_QUEUED)
86f512
-  XLAT(V4L2_BUF_FLAG_QUEUED),
86f512
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+static_assert((V4L2_BUF_FLAG_QUEUED) == (0x00000002), "V4L2_BUF_FLAG_QUEUED != 0x00000002");
86f512
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+#else
86f512
+# define V4L2_BUF_FLAG_QUEUED 0x00000002
86f512
 #endif
86f512
 #if defined(V4L2_BUF_FLAG_DONE) || (defined(HAVE_DECL_V4L2_BUF_FLAG_DONE) && HAVE_DECL_V4L2_BUF_FLAG_DONE)
86f512
-  XLAT(V4L2_BUF_FLAG_DONE),
86f512
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+static_assert((V4L2_BUF_FLAG_DONE) == (0x00000004), "V4L2_BUF_FLAG_DONE != 0x00000004");
86f512
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+#else
86f512
+# define V4L2_BUF_FLAG_DONE 0x00000004
86f512
 #endif
86f512
 #if defined(V4L2_BUF_FLAG_KEYFRAME) || (defined(HAVE_DECL_V4L2_BUF_FLAG_KEYFRAME) && HAVE_DECL_V4L2_BUF_FLAG_KEYFRAME)
86f512
-  XLAT(V4L2_BUF_FLAG_KEYFRAME),
86f512
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+static_assert((V4L2_BUF_FLAG_KEYFRAME) == (0x00000008), "V4L2_BUF_FLAG_KEYFRAME != 0x00000008");
86f512
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+#else
86f512
+# define V4L2_BUF_FLAG_KEYFRAME 0x00000008
86f512
 #endif
86f512
 #if defined(V4L2_BUF_FLAG_PFRAME) || (defined(HAVE_DECL_V4L2_BUF_FLAG_PFRAME) && HAVE_DECL_V4L2_BUF_FLAG_PFRAME)
86f512
-  XLAT(V4L2_BUF_FLAG_PFRAME),
86f512
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+static_assert((V4L2_BUF_FLAG_PFRAME) == (0x00000010), "V4L2_BUF_FLAG_PFRAME != 0x00000010");
86f512
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+#else
86f512
+# define V4L2_BUF_FLAG_PFRAME 0x00000010
86f512
 #endif
86f512
 #if defined(V4L2_BUF_FLAG_BFRAME) || (defined(HAVE_DECL_V4L2_BUF_FLAG_BFRAME) && HAVE_DECL_V4L2_BUF_FLAG_BFRAME)
86f512
-  XLAT(V4L2_BUF_FLAG_BFRAME),
86f512
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+static_assert((V4L2_BUF_FLAG_BFRAME) == (0x00000020), "V4L2_BUF_FLAG_BFRAME != 0x00000020");
86f512
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+#else
86f512
+# define V4L2_BUF_FLAG_BFRAME 0x00000020
86f512
+#endif
86f512
+#if defined(V4L2_BUF_FLAG_ERROR) || (defined(HAVE_DECL_V4L2_BUF_FLAG_ERROR) && HAVE_DECL_V4L2_BUF_FLAG_ERROR)
86f512
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+static_assert((V4L2_BUF_FLAG_ERROR) == (0x00000040), "V4L2_BUF_FLAG_ERROR != 0x00000040");
86f512
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+#else
86f512
+# define V4L2_BUF_FLAG_ERROR 0x00000040
86f512
+#endif
86f512
+#if defined(V4L2_BUF_FLAG_IN_REQUEST) || (defined(HAVE_DECL_V4L2_BUF_FLAG_IN_REQUEST) && HAVE_DECL_V4L2_BUF_FLAG_IN_REQUEST)
86f512
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+static_assert((V4L2_BUF_FLAG_IN_REQUEST) == (0x00000080), "V4L2_BUF_FLAG_IN_REQUEST != 0x00000080");
86f512
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+#else
86f512
+# define V4L2_BUF_FLAG_IN_REQUEST 0x00000080
86f512
 #endif
86f512
 #if defined(V4L2_BUF_FLAG_TIMECODE) || (defined(HAVE_DECL_V4L2_BUF_FLAG_TIMECODE) && HAVE_DECL_V4L2_BUF_FLAG_TIMECODE)
86f512
-  XLAT(V4L2_BUF_FLAG_TIMECODE),
86f512
-#endif
86f512
-#if defined(V4L2_BUF_FLAG_INPUT) || (defined(HAVE_DECL_V4L2_BUF_FLAG_INPUT) && HAVE_DECL_V4L2_BUF_FLAG_INPUT)
86f512
-  XLAT(V4L2_BUF_FLAG_INPUT),
86f512
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+static_assert((V4L2_BUF_FLAG_TIMECODE) == (0x00000100), "V4L2_BUF_FLAG_TIMECODE != 0x00000100");
86f512
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+#else
86f512
+# define V4L2_BUF_FLAG_TIMECODE 0x00000100
86f512
 #endif
86f512
 #if defined(V4L2_BUF_FLAG_PREPARED) || (defined(HAVE_DECL_V4L2_BUF_FLAG_PREPARED) && HAVE_DECL_V4L2_BUF_FLAG_PREPARED)
86f512
-  XLAT(V4L2_BUF_FLAG_PREPARED),
86f512
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+static_assert((V4L2_BUF_FLAG_PREPARED) == (0x00000400), "V4L2_BUF_FLAG_PREPARED != 0x00000400");
86f512
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+#else
86f512
+# define V4L2_BUF_FLAG_PREPARED 0x00000400
86f512
 #endif
86f512
 #if defined(V4L2_BUF_FLAG_NO_CACHE_INVALIDATE) || (defined(HAVE_DECL_V4L2_BUF_FLAG_NO_CACHE_INVALIDATE) && HAVE_DECL_V4L2_BUF_FLAG_NO_CACHE_INVALIDATE)
86f512
-  XLAT(V4L2_BUF_FLAG_NO_CACHE_INVALIDATE),
86f512
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+static_assert((V4L2_BUF_FLAG_NO_CACHE_INVALIDATE) == (0x00000800), "V4L2_BUF_FLAG_NO_CACHE_INVALIDATE != 0x00000800");
86f512
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+#else
86f512
+# define V4L2_BUF_FLAG_NO_CACHE_INVALIDATE 0x00000800
86f512
 #endif
86f512
 #if defined(V4L2_BUF_FLAG_NO_CACHE_CLEAN) || (defined(HAVE_DECL_V4L2_BUF_FLAG_NO_CACHE_CLEAN) && HAVE_DECL_V4L2_BUF_FLAG_NO_CACHE_CLEAN)
86f512
-  XLAT(V4L2_BUF_FLAG_NO_CACHE_CLEAN),
86f512
-#endif
86f512
-#if defined(V4L2_BUF_FLAG_TIMESTAMP_MASK) || (defined(HAVE_DECL_V4L2_BUF_FLAG_TIMESTAMP_MASK) && HAVE_DECL_V4L2_BUF_FLAG_TIMESTAMP_MASK)
86f512
-  XLAT(V4L2_BUF_FLAG_TIMESTAMP_MASK),
86f512
-#endif
86f512
-#if defined(V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN) || (defined(HAVE_DECL_V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN) && HAVE_DECL_V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN)
86f512
-  XLAT(V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN),
86f512
-#endif
86f512
-#if defined(V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC) || (defined(HAVE_DECL_V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC) && HAVE_DECL_V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC)
86f512
-  XLAT(V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC),
86f512
-#endif
86f512
-#if defined(V4L2_BUF_FLAG_TIMESTAMP_COPY) || (defined(HAVE_DECL_V4L2_BUF_FLAG_TIMESTAMP_COPY) && HAVE_DECL_V4L2_BUF_FLAG_TIMESTAMP_COPY)
86f512
-  XLAT(V4L2_BUF_FLAG_TIMESTAMP_COPY),
86f512
-#endif
86f512
-#if defined(V4L2_BUF_FLAG_TSTAMP_SRC_MASK) || (defined(HAVE_DECL_V4L2_BUF_FLAG_TSTAMP_SRC_MASK) && HAVE_DECL_V4L2_BUF_FLAG_TSTAMP_SRC_MASK)
86f512
-  XLAT(V4L2_BUF_FLAG_TSTAMP_SRC_MASK),
86f512
-#endif
86f512
-#if defined(V4L2_BUF_FLAG_TSTAMP_SRC_EOF) || (defined(HAVE_DECL_V4L2_BUF_FLAG_TSTAMP_SRC_EOF) && HAVE_DECL_V4L2_BUF_FLAG_TSTAMP_SRC_EOF)
86f512
-  XLAT(V4L2_BUF_FLAG_TSTAMP_SRC_EOF),
86f512
-#endif
86f512
-#if defined(V4L2_BUF_FLAG_TSTAMP_SRC_SOE) || (defined(HAVE_DECL_V4L2_BUF_FLAG_TSTAMP_SRC_SOE) && HAVE_DECL_V4L2_BUF_FLAG_TSTAMP_SRC_SOE)
86f512
-  XLAT(V4L2_BUF_FLAG_TSTAMP_SRC_SOE),
86f512
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+static_assert((V4L2_BUF_FLAG_NO_CACHE_CLEAN) == (0x00001000), "V4L2_BUF_FLAG_NO_CACHE_CLEAN != 0x00001000");
86f512
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+#else
86f512
+# define V4L2_BUF_FLAG_NO_CACHE_CLEAN 0x00001000
86f512
 #endif
86f512
 #if defined(V4L2_BUF_FLAG_LAST) || (defined(HAVE_DECL_V4L2_BUF_FLAG_LAST) && HAVE_DECL_V4L2_BUF_FLAG_LAST)
86f512
-  XLAT(V4L2_BUF_FLAG_LAST),
86f512
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+static_assert((V4L2_BUF_FLAG_LAST) == (0x00100000), "V4L2_BUF_FLAG_LAST != 0x00100000");
86f512
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+#else
86f512
+# define V4L2_BUF_FLAG_LAST 0x00100000
86f512
+#endif
86f512
+#if defined(V4L2_BUF_FLAG_REQUEST_FD) || (defined(HAVE_DECL_V4L2_BUF_FLAG_REQUEST_FD) && HAVE_DECL_V4L2_BUF_FLAG_REQUEST_FD)
86f512
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+static_assert((V4L2_BUF_FLAG_REQUEST_FD) == (0x00800000), "V4L2_BUF_FLAG_REQUEST_FD != 0x00800000");
86f512
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
86f512
+#else
86f512
+# define V4L2_BUF_FLAG_REQUEST_FD 0x00800000
86f512
 #endif
86f512
+
86f512
+#ifndef XLAT_MACROS_ONLY
86f512
+
86f512
+# ifdef IN_MPERS
86f512
+
86f512
+extern const struct xlat v4l2_buf_flags[];
86f512
+
86f512
+# else
86f512
+
86f512
+#  if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS)
86f512
+static
86f512
+#  endif
86f512
+const struct xlat v4l2_buf_flags[] = {
86f512
+ XLAT(V4L2_BUF_FLAG_MAPPED),
86f512
+ XLAT(V4L2_BUF_FLAG_QUEUED),
86f512
+ XLAT(V4L2_BUF_FLAG_DONE),
86f512
+ XLAT(V4L2_BUF_FLAG_KEYFRAME),
86f512
+ XLAT(V4L2_BUF_FLAG_PFRAME),
86f512
+ XLAT(V4L2_BUF_FLAG_BFRAME),
86f512
+ XLAT(V4L2_BUF_FLAG_ERROR),
86f512
+ XLAT(V4L2_BUF_FLAG_IN_REQUEST),
86f512
+ XLAT(V4L2_BUF_FLAG_TIMECODE),
86f512
+ XLAT(V4L2_BUF_FLAG_PREPARED),
86f512
+ XLAT(V4L2_BUF_FLAG_NO_CACHE_INVALIDATE),
86f512
+ XLAT(V4L2_BUF_FLAG_NO_CACHE_CLEAN),
86f512
+ XLAT(V4L2_BUF_FLAG_LAST),
86f512
+ XLAT(V4L2_BUF_FLAG_REQUEST_FD),
86f512
  XLAT_END
86f512
 };
86f512