|
|
86f512 |
From d35fd59ebd129d26cc7bf3180a58182e41361c2e Mon Sep 17 00:00:00 2001
|
|
|
86f512 |
From: Eugene Syromyatnikov <evgsyr@gmail.com>
|
|
|
86f512 |
Date: Wed, 29 Jan 2020 19:45:29 +0100
|
|
|
86f512 |
Subject: [PATCH 86/86] v4l2: provide V4L2_CTRL_FLAG_NEXT_CTRL in an xlat
|
|
|
86f512 |
|
|
|
86f512 |
---
|
|
|
86f512 |
tests/ioctl_v4l2.c | 9 ++++-----
|
|
|
86f512 |
v4l2.c | 3 +--
|
|
|
86f512 |
2 files changed, 5 insertions(+), 7 deletions(-)
|
|
|
86f512 |
|
|
|
86f512 |
Index: strace-5.1/tests/ioctl_v4l2.c
|
|
|
86f512 |
===================================================================
|
|
|
86f512 |
--- strace-5.1.orig/tests/ioctl_v4l2.c 2020-01-29 21:14:03.918926110 +0100
|
|
|
86f512 |
+++ strace-5.1/tests/ioctl_v4l2.c 2020-01-29 21:15:20.737200682 +0100
|
|
|
86f512 |
@@ -14,6 +14,10 @@
|
|
|
86f512 |
#include <linux/types.h>
|
|
|
86f512 |
#include <linux/videodev2.h>
|
|
|
86f512 |
|
|
|
86f512 |
+#ifndef V4L2_CTRL_FLAG_NEXT_CTRL
|
|
|
86f512 |
+# define V4L2_CTRL_FLAG_NEXT_CTRL 0x80000000
|
|
|
86f512 |
+#endif
|
|
|
86f512 |
+
|
|
|
86f512 |
#define cc0(arg) ((unsigned int) (unsigned char) (arg))
|
|
|
86f512 |
#define cc1(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 8))
|
|
|
86f512 |
#define cc2(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 16))
|
|
|
86f512 |
@@ -748,14 +752,9 @@
|
|
|
86f512 |
struct v4l2_queryctrl *const p_v4l2_queryctrl =
|
|
|
86f512 |
page_end - sizeof(*p_v4l2_queryctrl);
|
|
|
86f512 |
ioctl(-1, VIDIOC_QUERYCTRL, p_v4l2_queryctrl);
|
|
|
86f512 |
-#ifdef V4L2_CTRL_FLAG_NEXT_CTRL
|
|
|
86f512 |
printf("ioctl(-1, VIDIOC_QUERYCTRL, {id=V4L2_CTRL_FLAG_NEXT_CTRL"
|
|
|
86f512 |
"|%#x /* V4L2_CID_??? */}) = -1 EBADF (%m)\n",
|
|
|
86f512 |
p_v4l2_queryctrl->id & ~V4L2_CTRL_FLAG_NEXT_CTRL);
|
|
|
86f512 |
-#else
|
|
|
86f512 |
- printf("ioctl(-1, VIDIOC_QUERYCTRL, {id=%#x /* V4L2_CID_??? */})"
|
|
|
86f512 |
- " = -1 EBADF (%m)\n", p_v4l2_queryctrl->id);
|
|
|
86f512 |
-#endif
|
|
|
86f512 |
|
|
|
86f512 |
TAIL_ALLOC_OBJECT_CONST_PTR(struct v4l2_queryctrl, p_queryctrl);
|
|
|
86f512 |
p_queryctrl->id = V4L2_CID_SATURATION;
|
|
|
86f512 |
Index: strace-5.1/v4l2.c
|
|
|
86f512 |
===================================================================
|
|
|
86f512 |
--- strace-5.1.orig/v4l2.c 2020-01-29 21:15:19.011216936 +0100
|
|
|
86f512 |
+++ strace-5.1/v4l2.c 2020-01-29 21:15:20.738200672 +0100
|
|
|
86f512 |
@@ -954,6 +954,7 @@
|
|
|
86f512 |
|
|
|
86f512 |
#include "xlat/v4l2_control_types.h"
|
|
|
86f512 |
#include "xlat/v4l2_control_flags.h"
|
|
|
86f512 |
+#include "xlat/v4l2_control_query_flags.h"
|
|
|
86f512 |
|
|
|
86f512 |
static int
|
|
|
86f512 |
print_v4l2_queryctrl(struct tcb *const tcp, const kernel_ulong_t arg)
|
|
|
86f512 |
@@ -975,7 +976,6 @@
|
|
|
86f512 |
}
|
|
|
86f512 |
|
|
|
86f512 |
if (entering(tcp) || get_tcb_priv_ulong(tcp)) {
|
|
|
86f512 |
-#ifdef V4L2_CTRL_FLAG_NEXT_CTRL
|
|
|
86f512 |
const unsigned long next = c.id & V4L2_CTRL_FLAG_NEXT_CTRL;
|
|
|
86f512 |
set_tcb_priv_ulong(tcp, next);
|
|
|
86f512 |
if (next) {
|
|
|
86f512 |
@@ -983,7 +983,6 @@
|
|
|
86f512 |
tprints("|");
|
|
|
86f512 |
c.id &= ~V4L2_CTRL_FLAG_NEXT_CTRL;
|
|
|
86f512 |
}
|
|
|
86f512 |
-#endif
|
|
|
86f512 |
printxval(v4l2_control_ids, c.id, "V4L2_CID_???");
|
|
|
86f512 |
}
|
|
|
86f512 |
|
|
|
86f512 |
Index: strace-5.1/tests-m32/ioctl_v4l2.c
|
|
|
86f512 |
===================================================================
|
|
|
86f512 |
--- strace-5.1.orig/tests-m32/ioctl_v4l2.c 2020-01-29 21:14:03.918926110 +0100
|
|
|
86f512 |
+++ strace-5.1/tests-m32/ioctl_v4l2.c 2020-01-29 21:15:20.739200663 +0100
|
|
|
86f512 |
@@ -14,6 +14,10 @@
|
|
|
86f512 |
#include <linux/types.h>
|
|
|
86f512 |
#include <linux/videodev2.h>
|
|
|
86f512 |
|
|
|
86f512 |
+#ifndef V4L2_CTRL_FLAG_NEXT_CTRL
|
|
|
86f512 |
+# define V4L2_CTRL_FLAG_NEXT_CTRL 0x80000000
|
|
|
86f512 |
+#endif
|
|
|
86f512 |
+
|
|
|
86f512 |
#define cc0(arg) ((unsigned int) (unsigned char) (arg))
|
|
|
86f512 |
#define cc1(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 8))
|
|
|
86f512 |
#define cc2(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 16))
|
|
|
86f512 |
@@ -748,14 +752,9 @@
|
|
|
86f512 |
struct v4l2_queryctrl *const p_v4l2_queryctrl =
|
|
|
86f512 |
page_end - sizeof(*p_v4l2_queryctrl);
|
|
|
86f512 |
ioctl(-1, VIDIOC_QUERYCTRL, p_v4l2_queryctrl);
|
|
|
86f512 |
-#ifdef V4L2_CTRL_FLAG_NEXT_CTRL
|
|
|
86f512 |
printf("ioctl(-1, VIDIOC_QUERYCTRL, {id=V4L2_CTRL_FLAG_NEXT_CTRL"
|
|
|
86f512 |
"|%#x /* V4L2_CID_??? */}) = -1 EBADF (%m)\n",
|
|
|
86f512 |
p_v4l2_queryctrl->id & ~V4L2_CTRL_FLAG_NEXT_CTRL);
|
|
|
86f512 |
-#else
|
|
|
86f512 |
- printf("ioctl(-1, VIDIOC_QUERYCTRL, {id=%#x /* V4L2_CID_??? */})"
|
|
|
86f512 |
- " = -1 EBADF (%m)\n", p_v4l2_queryctrl->id);
|
|
|
86f512 |
-#endif
|
|
|
86f512 |
|
|
|
86f512 |
TAIL_ALLOC_OBJECT_CONST_PTR(struct v4l2_queryctrl, p_queryctrl);
|
|
|
86f512 |
p_queryctrl->id = V4L2_CID_SATURATION;
|
|
|
86f512 |
Index: strace-5.1/tests-mx32/ioctl_v4l2.c
|
|
|
86f512 |
===================================================================
|
|
|
86f512 |
--- strace-5.1.orig/tests-mx32/ioctl_v4l2.c 2020-01-29 21:14:03.918926110 +0100
|
|
|
86f512 |
+++ strace-5.1/tests-mx32/ioctl_v4l2.c 2020-01-29 21:15:20.740200653 +0100
|
|
|
86f512 |
@@ -14,6 +14,10 @@
|
|
|
86f512 |
#include <linux/types.h>
|
|
|
86f512 |
#include <linux/videodev2.h>
|
|
|
86f512 |
|
|
|
86f512 |
+#ifndef V4L2_CTRL_FLAG_NEXT_CTRL
|
|
|
86f512 |
+# define V4L2_CTRL_FLAG_NEXT_CTRL 0x80000000
|
|
|
86f512 |
+#endif
|
|
|
86f512 |
+
|
|
|
86f512 |
#define cc0(arg) ((unsigned int) (unsigned char) (arg))
|
|
|
86f512 |
#define cc1(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 8))
|
|
|
86f512 |
#define cc2(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 16))
|
|
|
86f512 |
@@ -748,14 +752,9 @@
|
|
|
86f512 |
struct v4l2_queryctrl *const p_v4l2_queryctrl =
|
|
|
86f512 |
page_end - sizeof(*p_v4l2_queryctrl);
|
|
|
86f512 |
ioctl(-1, VIDIOC_QUERYCTRL, p_v4l2_queryctrl);
|
|
|
86f512 |
-#ifdef V4L2_CTRL_FLAG_NEXT_CTRL
|
|
|
86f512 |
printf("ioctl(-1, VIDIOC_QUERYCTRL, {id=V4L2_CTRL_FLAG_NEXT_CTRL"
|
|
|
86f512 |
"|%#x /* V4L2_CID_??? */}) = -1 EBADF (%m)\n",
|
|
|
86f512 |
p_v4l2_queryctrl->id & ~V4L2_CTRL_FLAG_NEXT_CTRL);
|
|
|
86f512 |
-#else
|
|
|
86f512 |
- printf("ioctl(-1, VIDIOC_QUERYCTRL, {id=%#x /* V4L2_CID_??? */})"
|
|
|
86f512 |
- " = -1 EBADF (%m)\n", p_v4l2_queryctrl->id);
|
|
|
86f512 |
-#endif
|
|
|
86f512 |
|
|
|
86f512 |
TAIL_ALLOC_OBJECT_CONST_PTR(struct v4l2_queryctrl, p_queryctrl);
|
|
|
86f512 |
p_queryctrl->id = V4L2_CID_SATURATION;
|
|
|
86f512 |
Index: strace-5.1/xlat/v4l2_control_query_flags.h
|
|
|
86f512 |
===================================================================
|
|
|
86f512 |
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
|
|
86f512 |
+++ strace-5.1/xlat/v4l2_control_query_flags.h 2020-01-29 21:16:03.273800088 +0100
|
|
|
86f512 |
@@ -0,0 +1,40 @@
|
|
|
86f512 |
+/* Generated by ./xlat/gen.sh from ./xlat/v4l2_control_query_flags.in; do not edit. */
|
|
|
86f512 |
+
|
|
|
86f512 |
+#include "gcc_compat.h"
|
|
|
86f512 |
+#include "static_assert.h"
|
|
|
86f512 |
+
|
|
|
86f512 |
+#if defined(V4L2_CTRL_FLAG_NEXT_CTRL) || (defined(HAVE_DECL_V4L2_CTRL_FLAG_NEXT_CTRL) && HAVE_DECL_V4L2_CTRL_FLAG_NEXT_CTRL)
|
|
|
86f512 |
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
|
|
|
86f512 |
+static_assert((V4L2_CTRL_FLAG_NEXT_CTRL) == (0x80000000), "V4L2_CTRL_FLAG_NEXT_CTRL != 0x80000000");
|
|
|
86f512 |
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
|
|
|
86f512 |
+#else
|
|
|
86f512 |
+# define V4L2_CTRL_FLAG_NEXT_CTRL 0x80000000
|
|
|
86f512 |
+#endif
|
|
|
86f512 |
+#if defined(V4L2_CTRL_FLAG_NEXT_COMPOUND) || (defined(HAVE_DECL_V4L2_CTRL_FLAG_NEXT_COMPOUND) && HAVE_DECL_V4L2_CTRL_FLAG_NEXT_COMPOUND)
|
|
|
86f512 |
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
|
|
|
86f512 |
+static_assert((V4L2_CTRL_FLAG_NEXT_COMPOUND) == (0x40000000), "V4L2_CTRL_FLAG_NEXT_COMPOUND != 0x40000000");
|
|
|
86f512 |
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
|
|
|
86f512 |
+#else
|
|
|
86f512 |
+# define V4L2_CTRL_FLAG_NEXT_COMPOUND 0x40000000
|
|
|
86f512 |
+#endif
|
|
|
86f512 |
+
|
|
|
86f512 |
+#ifndef XLAT_MACROS_ONLY
|
|
|
86f512 |
+
|
|
|
86f512 |
+# ifdef IN_MPERS
|
|
|
86f512 |
+
|
|
|
86f512 |
+extern const struct xlat v4l2_control_query_flags[];
|
|
|
86f512 |
+
|
|
|
86f512 |
+# else
|
|
|
86f512 |
+
|
|
|
86f512 |
+# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS)
|
|
|
86f512 |
+static
|
|
|
86f512 |
+# endif
|
|
|
86f512 |
+const struct xlat v4l2_control_query_flags[] = {
|
|
|
86f512 |
+ XLAT(V4L2_CTRL_FLAG_NEXT_CTRL),
|
|
|
86f512 |
+ XLAT(V4L2_CTRL_FLAG_NEXT_COMPOUND),
|
|
|
86f512 |
+ XLAT_END
|
|
|
86f512 |
+};
|
|
|
86f512 |
+
|
|
|
86f512 |
+# endif /* !IN_MPERS */
|
|
|
86f512 |
+
|
|
|
86f512 |
+#endif /* !XLAT_MACROS_ONLY */
|