platform: tegra: dce: Use conftest

Instead of relying on kernel version to determine if the 'tegra_ivc'
structure has a member that is of type 'struct iosys_map', add a compile
time test to the conftest.sh script to determine this at compile time
for the kernel being used. This is beneficial for working with 3rd party
Linux kernels that may have back-ported upstream changes into their
kernel and so the kernel version checks do not work.

Bug 4119327

Change-Id: Ia993ca9df7694347252a795c7dee1e95f2f9fa2f
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2985743
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Jon Hunter
2023-09-26 11:13:28 +01:00
committed by mobile promotions
parent 02d724565b
commit 19fb93666d
4 changed files with 32 additions and 11 deletions

View File

@@ -6544,6 +6544,25 @@ compile_test() {
compile_check_conftest "$CODE" "NV_REGISTER_SHRINKER_HAS_FMT_ARG" "" "types"
;;
tegra_ivc_struct_has_iosys_map)
#
# Determine if the 'tegra_ivc' structure has the 'map' argument.
#
# Commit 4c1e0a97351a ("firmware: tegra: bpmp: Use iosys-map
# helpers") update the Tegra IVC driver to use iosys-map in Linux v6.2.
#
CODE="
#if defined(NV_LINUX_IOSYS_MAP_H_PRESENT)
#include <linux/iosys-map.h>
#endif
#include <soc/tegra/ivc.h>
struct iosys_map *conftest_tegra_ivc_struct_has_iosys_map(struct tegra_ivc *ivc) {
return &ivc->rx.map;
}"
compile_check_conftest "$CODE" "NV_TEGRA_IVC_STRUCT_HAS_IOSYS_MAP" "" "types"
;;
# When adding a new conftest entry, please use the correct format for
# specifying the relevant upstream Linux kernel commit.
#