video: tegra: nvmap: Fix build failure

Linux v6.10 and v6.11 are failing as follow_pfn was removed since kernel
v6.10 Use conftest to detect if follow_pfn, follow_pfnmap_start
functions are present or not and based upon this result, call the
appropriate functions in nvmap code.

Bug 5007238

Change-Id: Ie7e0c9bde652fd89158a5778aa8254fc86bf4696
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3311535
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
This commit is contained in:
Ketan Patil
2025-02-28 04:54:26 +00:00
committed by Jon Hunter
parent f985bb9f00
commit 1e83ec96df
3 changed files with 65 additions and 2 deletions

View File

@@ -7480,6 +7480,40 @@ compile_test() {
compile_check_conftest "$CODE" "NV_FOLIO_ENTIRE_MAPCOUNT_PRESENT" "" "functions"
;;
follow_pfn)
#
# Determine if function follow_pfn() is present.
#
# Commit cb10c28ac82c9 ("mm: remove follow_pfn")
# remove follow_pfn() in Linux v6.10.
#
CODE="
#include <linux/mm.h>
int conftest(void)
{
return follow_pfn();
}"
compile_check_conftest "$CODE" "NV_FOLLOW_PFN_PRESENT" "" "functions"
;;
follow_pfnmap_start)
#
# Determine if function follow_pfnmap_start() is present.
#
# Commit 6da8e9634bb7e3 ("mm: new follow_pfnmap API")
# add follow_pfnmap_start() in Linux v6.12.
#
CODE="
#include <linux/mm.h>
int conftest(void)
{
return follow_pfnmap_start();
}"
compile_check_conftest "$CODE" "NV_FOLLOW_PFNMAP_START_PRESENT" "" "functions"
;;
fop_unsigned_offset)
#
# Determine if definition FOP_UNSIGNED_OFFSET is present.