From 4630f1b6d9db120d5833eccfdeccd02830a4b0c3 Mon Sep 17 00:00:00 2001 From: Jon Hunter Date: Tue, 21 Feb 2023 14:16:08 +0000 Subject: [PATCH] rtcpu: capture-ivc: Disable for Linux v6.2+ Upstream Linux commit 4c1e0a97351a ("firmware: tegra: bpmp: Use iosys-map helpers") updated the Tegra IVC driver to use the iosys-map helpers for Linux v6.2. This causes the Tegra capture-ivc driver build to fail. Temporarily disable the building of this driver while this build issue is fixed. Stub functions are added to permit other drivers that use this driver to build. Bug 3936429 Bug 3974855 Change-Id: I7a381fa90d92f11ee01d37f0ee7ab230162c5a62 Signed-off-by: Jon Hunter Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2861312 Reviewed-by: Rohit Khanna Tested-by: Rohit Khanna GVS: Gerrit_Virtual_Submit --- drivers/platform/tegra/rtcpu/Makefile | 8 +++- include/linux/tegra-capture-ivc.h | 58 ++++++++++++++++++++++++++- 2 files changed, 64 insertions(+), 2 deletions(-) diff --git a/drivers/platform/tegra/rtcpu/Makefile b/drivers/platform/tegra/rtcpu/Makefile index f7364070..6bf5cc98 100644 --- a/drivers/platform/tegra/rtcpu/Makefile +++ b/drivers/platform/tegra/rtcpu/Makefile @@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. LINUXINCLUDE += -I$(srctree.nvidia)/drivers/gpu/host1x/hw/ LINUXINCLUDE += -I$(srctree.nvidia)/drivers/gpu/host1x/include @@ -9,7 +9,13 @@ LINUXINCLUDE += -I$(srctree)/include LINUXINCLUDE += -I$(srctree.nvidia-oot)/drivers/platform/tegra/rtcpu LINUXINCLUDE += -I$(srctree.nvidia-oot)/drivers/platform/tegra +LINUX_VERSION := $(shell expr $(VERSION) \* 256 + $(PATCHLEVEL)) +LINUX_VERSION_6_2 := $(shell expr 6 \* 256 + 2) + +# capture-ivc is currently broken for Linux v6.2 and so skip for Linux v6.2+ +ifeq ($(shell test $(LINUX_VERSION) -lt $(LINUX_VERSION_6_2); echo $$?),0) obj-m += capture-ivc.o +endif obj-m += ivc-bus.o obj-m += camchar.o obj-m += camera-diagnostics.o diff --git a/include/linux/tegra-capture-ivc.h b/include/linux/tegra-capture-ivc.h index ac0c04b5..1c76c582 100644 --- a/include/linux/tegra-capture-ivc.h +++ b/include/linux/tegra-capture-ivc.h @@ -1,13 +1,15 @@ /* SPDX-License-Identifier: GPL-2.0-only */ /* - * Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. */ #ifndef INCLUDE_CAPTURE_IVC_H #define INCLUDE_CAPTURE_IVC_H #include +#include +#if (KERNEL_VERSION(6, 2, 0) > LINUX_VERSION_CODE) /** * @brief Submit the control message binary blob to capture-IVC driver, * which is to be transferred over control IVC channel to RTCPU. @@ -132,5 +134,59 @@ int tegra_capture_ivc_unregister_control_cb( */ int tegra_capture_ivc_unregister_capture_cb( uint32_t chan_id); +#else +typedef void (*tegra_capture_ivc_cb_func)( + const void *resp_desc, + const void *priv_context); + +static inline int tegra_capture_ivc_control_submit( + const void *control_desc, + size_t len) +{ + return -ENOTSUPP; +}; + +static inline int tegra_capture_ivc_capture_submit( + const void *capture_desc, + size_t len) +{ + return -ENOTSUPP; +}; + +static inline int tegra_capture_ivc_register_control_cb( + tegra_capture_ivc_cb_func control_resp_cb, + uint32_t *trans_id, + const void *priv_context) +{ + return -ENOTSUPP; +}; + +static inline int tegra_capture_ivc_notify_chan_id( + uint32_t chan_id, + uint32_t trans_id) +{ + return -ENOTSUPP; +}; + +static inline int tegra_capture_ivc_register_capture_cb( + tegra_capture_ivc_cb_func capture_status_ind_cb, + uint32_t chan_id, + const void *priv_context) +{ + return -ENOTSUPP; +}; + +static inline int tegra_capture_ivc_unregister_control_cb( + uint32_t id) +{ + return -ENOTSUPP; +}; + +static inline int tegra_capture_ivc_unregister_capture_cb( + uint32_t chan_id) +{ + return -ENOTSUPP; +}; +#endif /* (KERNEL_VERSION(6, 2, 0) > LINUX_VERSION_CODE) */ #endif /* INCLUDE_CAPTURE_IVC_H */