diff options
author | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2021-06-08 14:19:48 +0200 |
---|---|---|
committer | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2021-06-08 14:23:41 +0200 |
commit | 1d13fccac5bf57cc9d54c5f61a32c0c1a2b62399 (patch) | |
tree | d503448ceef97de79ec448487078619a0cecdff2 | |
parent | f5859e9de50fe3cbf6b2c54b8635aa89be4a88b2 (diff) | |
download | v4l-utils-1d13fccac5bf57cc9d54c5f61a32c0c1a2b62399.tar.gz |
v4l-utils: patch v4l2-controls.h
Very old kernels do not have the _BITUL define. Test for this.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rwxr-xr-x | sync-with-kernel.sh | 2 | ||||
-rw-r--r-- | utils/common/v4l2-controls.patch | 15 |
2 files changed, 17 insertions, 0 deletions
diff --git a/sync-with-kernel.sh b/sync-with-kernel.sh index fa881949..e3a70a0b 100755 --- a/sync-with-kernel.sh +++ b/sync-with-kernel.sh @@ -29,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/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 cp -a ${KERNEL_DIR}/usr/include/linux/v4l2-subdev.h ${TOPSRCDIR}/include/linux cp -a ${KERNEL_DIR}/usr/include/linux/v4l2-mediabus.h ${TOPSRCDIR}/include/linux @@ -103,6 +104,7 @@ function freebsd { mkdir -p include/linux/$(dirname $i) cp ${KERNEL_DIR}/usr/include/linux/$i include/linux/$i done + patch -d ${SRCDIR} --no-backup-if-mismatch -p1 <${TOPSRCDIR}/utils/common/v4l2-controls.patch for i in ivtv.h uinput.h videodev2.h v4l2-common.h; do sed -e 's/__u8/uint8_t/g' -e 's/__u16/uint16_t/g' -e 's/__u32/uint32_t/g' -e 's/__u64/uint64_t/g' -e 's/__s8/int8_t/g' -e 's/__s16/int16_t/g' -e 's/__s32/int32_t/g' -e 's/__s64/int64_t/g' -e 's/__le32/uint32_t/g' -e 's/__user//g' -i include/linux/$i diff --git a/utils/common/v4l2-controls.patch b/utils/common/v4l2-controls.patch new file mode 100644 index 00000000..cf290e0b --- /dev/null +++ b/utils/common/v4l2-controls.patch @@ -0,0 +1,15 @@ +diff --git a/include/linux/v4l2-controls.h b/include/linux/v4l2-controls.h +index e329974..9db08be 100644 +--- a/include/linux/v4l2-controls.h ++++ b/include/linux/v4l2-controls.h +@@ -53,6 +53,10 @@ + #include <linux/const.h> + #include <linux/types.h> + ++#ifndef _BITUL ++#define _BITUL(x) (1U << (x)) ++#endif ++ + /* Control classes */ + #define V4L2_CTRL_CLASS_USER 0x00980000 /* Old-style 'user' controls */ + #define V4L2_CTRL_CLASS_CODEC 0x00990000 /* Stateful codec controls */ |