From 14cc4f1ba2dfed4c943f7634490931f13c24c210 Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Fri, 12 Nov 2021 18:40:57 +0100 Subject: [PATCH] d/v4l2: fix building with older linux kernel like 4.15 Older linux kernels like 4.15 don't have V4L2_CID_DIGITAL_GAIN or V4L2_CTRL_FLAG_MODIFY_LAYOUT, add conditional guards to build successfully on systems with such kernels. --- src/xrt/drivers/v4l2/v4l2_driver.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/xrt/drivers/v4l2/v4l2_driver.c b/src/xrt/drivers/v4l2/v4l2_driver.c index b92abffc1..1ab06b0f2 100644 --- a/src/xrt/drivers/v4l2/v4l2_driver.c +++ b/src/xrt/drivers/v4l2/v4l2_driver.c @@ -1015,7 +1015,9 @@ dump_contron_name(uint32_t id) CASE(EXPOSURE); CASE(AUTOGAIN); CASE(GAIN); +#ifdef V4L2_CID_DIGITAL_GAIN CASE(DIGITAL_GAIN); +#endif CASE(ANALOGUE_GAIN); CASE(HFLIP); CASE(VFLIP); @@ -1096,7 +1098,9 @@ dump_controls(struct v4l2_fs *vid) V_CHECK(VOLATILE); V_CHECK(HAS_PAYLOAD); V_CHECK(EXECUTE_ON_WRITE); +#ifdef V4L2_CTRL_FLAG_MODIFY_LAYOUT V_CHECK(MODIFY_LAYOUT); +#endif #undef V_CHECK U_LOG_E(" ");