From bf7d14249c7944fa2de6efd222a0f3d55458fa3e Mon Sep 17 00:00:00 2001 From: brucex Date: Wed, 14 Jun 2023 13:37:56 +0800 Subject: [PATCH] nvidia-oot: enable hypervisor support for nvmap hypervisor macro CONFIG_TEGRA_VIRTUALIZATION is not enabled for OOT nvmap build. Bug 4121631 Change-Id: I8a1fc94335da8ca7a22d549b0e1850dd308722b8 Signed-off-by: brucex Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2921005 Reviewed-by: Tuomas Kulve Reviewed-by: Jonathan Hunter Reviewed-by: Ketan Patil Reviewed-by: Laxman Dewangan GVS: Gerrit_Virtual_Submit --- drivers/video/tegra/nvmap/Makefile | 4 ++++ drivers/video/tegra/nvmap/nvmap_init.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/drivers/video/tegra/nvmap/Makefile b/drivers/video/tegra/nvmap/Makefile index 629065f0..34ff1291 100644 --- a/drivers/video/tegra/nvmap/Makefile +++ b/drivers/video/tegra/nvmap/Makefile @@ -7,6 +7,10 @@ subdir-ccflags-y := -Werror include $(srctree.nvidia-oot)/drivers/video/tegra/nvmap/Makefile.memory.configs +ifeq ($(CONFIG_TEGRA_VIRTUALIZATION),y) +ccflags-y += -DCONFIG_TEGRA_VIRTUALIZATION +endif + ifeq ($(NVMAP_CONFIG), y) # Build NvMap only when NVMAP_CONFIG is set to y nvmap-y := nvmap_core.o \ diff --git a/drivers/video/tegra/nvmap/nvmap_init.c b/drivers/video/tegra/nvmap/nvmap_init.c index a38a239a..5a8f2f90 100644 --- a/drivers/video/tegra/nvmap/nvmap_init.c +++ b/drivers/video/tegra/nvmap/nvmap_init.c @@ -37,7 +37,11 @@ #include "nvmap_priv.h" #ifdef CONFIG_TEGRA_VIRTUALIZATION +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0) #include +#else +#include +#endif #include #endif