Blame SOURCES/strace-b89a69dec27cf638df0e17db80ed937c3e1abf77.patch

Pablo Greco 47646a
diff -Naurp a/xlat/v4l2_control_id_bases.h b/xlat/v4l2_control_id_bases.h
Pablo Greco 47646a
--- a/xlat/v4l2_control_id_bases.h	2018-08-14 00:44:25.000000000 +0000
Pablo Greco 47646a
+++ b/xlat/v4l2_control_id_bases.h	2019-05-23 12:21:15.396137688 +0000
Pablo Greco 47646a
@@ -31,12 +31,16 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
Pablo Greco 47646a
 #else
Pablo Greco 47646a
 # define V4L2_CID_USER_TI_VPE_BASE (V4L2_CID_BASE + 0x1050)
Pablo Greco 47646a
 #endif
Pablo Greco 47646a
+#ifndef STRACE_WORKAROUND_FOR_V4L2_CID_USER_IMX_BASE
Pablo Greco 47646a
+# define STRACE_WORKAROUND_FOR_V4L2_CID_USER_IMX_BASE
Pablo Greco 47646a
+# undef V4L2_CID_USER_IMX_BASE
Pablo Greco 47646a
+#endif
Pablo Greco 47646a
 #if defined(V4L2_CID_USER_IMX_BASE) || (defined(HAVE_DECL_V4L2_CID_USER_IMX_BASE) && HAVE_DECL_V4L2_CID_USER_IMX_BASE)
Pablo Greco 47646a
 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
Pablo Greco 47646a
-static_assert((V4L2_CID_USER_IMX_BASE) == ((V4L2_CID_BASE + 0x1090)), "V4L2_CID_USER_IMX_BASE != (V4L2_CID_BASE + 0x1090)");
Pablo Greco 47646a
+static_assert((V4L2_CID_USER_IMX_BASE) == ((V4L2_CID_BASE + 0x10b0)), "V4L2_CID_USER_IMX_BASE != (V4L2_CID_BASE + 0x10b0)");
Pablo Greco 47646a
 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
Pablo Greco 47646a
 #else
Pablo Greco 47646a
-# define V4L2_CID_USER_IMX_BASE (V4L2_CID_BASE + 0x1090)
Pablo Greco 47646a
+# define V4L2_CID_USER_IMX_BASE (V4L2_CID_BASE + 0x10b0)
Pablo Greco 47646a
 #endif
Pablo Greco 47646a
 #if defined(V4L2_CID_MPEG_BASE) || (defined(HAVE_DECL_V4L2_CID_MPEG_BASE) && HAVE_DECL_V4L2_CID_MPEG_BASE)
Pablo Greco 47646a
 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
Pablo Greco 47646a
@@ -146,6 +150,21 @@ const struct xlat v4l2_control_id_bases[
Pablo Greco 47646a
  XLAT(V4L2_CID_USER_MEYE_BASE),
Pablo Greco 47646a
  XLAT(V4L2_CID_USER_BTTV_BASE),
Pablo Greco 47646a
  XLAT(V4L2_CID_USER_TI_VPE_BASE),
Pablo Greco 47646a
+#ifndef STRACE_WORKAROUND_FOR_V4L2_CID_USER_IMX_BASE
Pablo Greco 47646a
+# define STRACE_WORKAROUND_FOR_V4L2_CID_USER_IMX_BASE
Pablo Greco 47646a
+/*
Pablo Greco 47646a
+* Linux kernel commit v4.18-rc2-106-g421860b9d47053badce4b247576fa48df9ab4c48
Pablo Greco 47646a
+* has changed the value of V4L2_CID_USER_IMX_BASE constant introduced
Pablo Greco 47646a
+* by commit v4.13-rc1~141^2~121 because the old value was already used
Pablo Greco 47646a
+* by V4L2_CID_USER_MAX217X_BASE.
Pablo Greco 47646a
+* This is of course an ABI breakage that affects Linux kernels starting
Pablo Greco 47646a
+* with 4.13 and up to 4.18, as well as their LTS derivatives.
Pablo Greco 47646a
+* Since the imx driver didn't provide any public control ID definitions,
Pablo Greco 47646a
+* it looks like the best way to handle this situation is to pretend that
Pablo Greco 47646a
+* the old value of V4L2_CID_USER_IMX_BASE didn't exist.
Pablo Greco 47646a
+*/
Pablo Greco 47646a
+# undef V4L2_CID_USER_IMX_BASE
Pablo Greco 47646a
+#endif
Pablo Greco 47646a
  XLAT(V4L2_CID_USER_IMX_BASE),
Pablo Greco 47646a
  XLAT(V4L2_CID_MPEG_BASE),
Pablo Greco 47646a
  XLAT(V4L2_CID_MPEG_CX2341X_BASE),
Pablo Greco 47646a
diff -Naurp a/xlat/v4l2_control_id_bases.in b/xlat/v4l2_control_id_bases.in
Pablo Greco 47646a
--- a/xlat/v4l2_control_id_bases.in	2018-05-06 15:34:41.000000000 +0000
Pablo Greco 47646a
+++ b/xlat/v4l2_control_id_bases.in	2019-05-23 12:21:01.146061843 +0000
Pablo Greco 47646a
@@ -2,7 +2,22 @@ V4L2_CID_BASE				(V4L2_CTRL_CLASS_USER |
Pablo Greco 47646a
 V4L2_CID_USER_MEYE_BASE			(V4L2_CID_BASE + 0x1000)
Pablo Greco 47646a
 V4L2_CID_USER_BTTV_BASE			(V4L2_CID_BASE + 0x1010)
Pablo Greco 47646a
 V4L2_CID_USER_TI_VPE_BASE		(V4L2_CID_BASE + 0x1050)
Pablo Greco 47646a
-V4L2_CID_USER_IMX_BASE			(V4L2_CID_BASE + 0x1090)
Pablo Greco 47646a
+#ifndef STRACE_WORKAROUND_FOR_V4L2_CID_USER_IMX_BASE
Pablo Greco 47646a
+# define STRACE_WORKAROUND_FOR_V4L2_CID_USER_IMX_BASE
Pablo Greco 47646a
+/*
Pablo Greco 47646a
+ * Linux kernel commit v4.18-rc2-106-g421860b9d47053badce4b247576fa48df9ab4c48
Pablo Greco 47646a
+ * has changed the value of V4L2_CID_USER_IMX_BASE constant introduced
Pablo Greco 47646a
+ * by commit v4.13-rc1~141^2~121 because the old value was already used
Pablo Greco 47646a
+ * by V4L2_CID_USER_MAX217X_BASE.
Pablo Greco 47646a
+ * This is of course an ABI breakage that affects Linux kernels starting
Pablo Greco 47646a
+ * with 4.13 and up to 4.18, as well as their LTS derivatives.
Pablo Greco 47646a
+ * Since the imx driver didn't provide any public control ID definitions,
Pablo Greco 47646a
+ * it looks like the best way to handle this situation is to pretend that
Pablo Greco 47646a
+ * the old value of V4L2_CID_USER_IMX_BASE didn't exist.
Pablo Greco 47646a
+ */
Pablo Greco 47646a
+# undef V4L2_CID_USER_IMX_BASE
Pablo Greco 47646a
+#endif
Pablo Greco 47646a
+V4L2_CID_USER_IMX_BASE			(V4L2_CID_BASE + 0x10b0)
Pablo Greco 47646a
 V4L2_CID_MPEG_BASE			(V4L2_CTRL_CLASS_MPEG | 0x900)
Pablo Greco 47646a
 V4L2_CID_MPEG_CX2341X_BASE		(V4L2_CTRL_CLASS_MPEG | 0x1000)
Pablo Greco 47646a
 V4L2_CID_MPEG_MFC51_BASE		(V4L2_CTRL_CLASS_MPEG | 0x1100)