From e30e21ebd14a925931d70ee77a7488712a3a86d9 Mon Sep 17 00:00:00 2001 From: Laxman Dewangan Date: Sat, 30 Dec 2023 07:23:00 +0000 Subject: [PATCH] v4l2: Add conftest for v4l2 API changes in Linux 6.6 Add conftest to determine the API changes/deprecation for V4L2 in Linux6.6. The changes are: The device argument is added in the API v4l2_async_nf_init() with commit b8ec754ae4c5 ("media: v4l: async: Set v4l2_device and subdev in async notifier init") in Linux 6.6. The API is removed with commit bda8953e8c3e ("media: v4l: async: Drop v4l2_async_nf_parse_fwnode_endpoints()") in Linux 6.6 Bug 4346767 Change-Id: Ia225be8b4fb17003ec2899e872573dc05e9fde87 Signed-off-by: Laxman Dewangan Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3042900 (cherry picked from commit 8df8cfc8e66e923ca7e5d119a893f5e54e449975) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3055495 Tested-by: Jonathan Hunter Reviewed-by: Paritosh Dixit Reviewed-by: Jonathan Hunter GVS: Gerrit_Virtual_Submit --- scripts/conftest/Makefile | 2 ++ scripts/conftest/conftest.sh | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/scripts/conftest/Makefile b/scripts/conftest/Makefile index 5c9763ae..3ba8e506 100644 --- a/scripts/conftest/Makefile +++ b/scripts/conftest/Makefile @@ -159,6 +159,8 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += v4l2_async_connection_struct_present NV_CONFTEST_FUNCTION_COMPILE_TESTS += v4l2_async_match_type_enum_present NV_CONFTEST_FUNCTION_COMPILE_TESTS += v4l2_async_subdev_nf_init NV_CONFTEST_FUNCTION_COMPILE_TESTS += v4l2_async_notifier_init +NV_CONFTEST_FUNCTION_COMPILE_TESTS += v4l2_async_nf_init_has_v4l2_dev_arg +NV_CONFTEST_FUNCTION_COMPILE_TESTS += __v4l2_async_nf_add_subdev NV_CONFTEST_FUNCTION_COMPILE_TESTS += v4l2_subdev_pad_ops_struct_has_get_frame_interval NV_CONFTEST_FUNCTION_COMPILE_TESTS += vm_area_struct_has_const_vm_flags NV_CONFTEST_GENERIC_COMPILE_TESTS += is_export_symbol_present_drm_gem_prime_fd_to_handle diff --git a/scripts/conftest/conftest.sh b/scripts/conftest/conftest.sh index ebd6637c..90437ade 100755 --- a/scripts/conftest/conftest.sh +++ b/scripts/conftest/conftest.sh @@ -7638,6 +7638,39 @@ compile_test() { compile_check_conftest "$CODE" "NV_V4L2_ASYNC_NOTIFIER_INIT_PRESENT" "" "functions" ;; + v4l2_async_nf_init_has_v4l2_dev_arg) + # + # Determine if the function v4l2_async_nf_init() has v4l2_dev argument or not. + # + # The device argument is added in the API v4l2_async_nf_init() with commit + # b8ec754ae4c5 ("media: v4l: async: Set v4l2_device and subdev in async notifier init") + # in Linux 6.6. + # + CODE=" + #include + void conftest_v4l2_async_nf_init_has_v4l2_dev_arg(void) { + v4l2_async_nf_init(NULL, NULL); + }" + + compile_check_conftest "$CODE" "NV_V4L2_ASYNC_NF_INIT_HAS_V4L2_DEV_ARG" "" "types" + ;; + + __v4l2_async_nf_add_subdev) + # + # Determine if the function __v4l2_async_nf_add_subdev() present or not. + # + # The API is removed with commit bda8953e8c3e ("media: v4l: async: Drop + # v4l2_async_nf_parse_fwnode_endpoints()") in Linux 6.6 + # + CODE=" + #include + void conftest_v4l2_async_nf_add_subdev_present(void) { + __v4l2_async_nf_add_subdev(); + }" + + compile_check_conftest "$CODE" "NV_V4L2_ASYNC_NF_ADD_SUBDEV_PRESENT" "" "functions" + ;; + v4l2_subdev_pad_ops_struct_has_get_frame_interval) # # Determine if struct v4l2_subdev_pad_ops has the 'get_frame_interval'