tegra: hwpm: Add compilation flag for iosys-map.h

Determining whether the header file iosys-map.h is present in the kernel
is currently determine by kernel version. However, for Linux v5.15,
iosys-map.h has been backported in order to support simple-framebuffer
for early display. Therefore, we cannot rely on the kernel version to
indicate whether iosys-map is present. This is also true for 3rd party
Linux kernels that backport changes as well. Fix this by adding a
compile time flag, that will be set accordingly by the conftest script
if this header is present.

Bug 4119327
Bug 4228080

Change-Id: I9de07a4615a6c9da504b36750c48e73e200da301
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/2974080
(cherry picked from commit 54ce334474)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/2946966
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Jon Hunter
2023-07-28 13:39:29 +01:00
committed by mobile promotions
parent d69752c349
commit 971645b49c
2 changed files with 6 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. # Copyright (c) 2022-2023, NVIDIA CORPORATION. All rights reserved.
# #
# Tegra SOC HWPM # Tegra SOC HWPM
# #
@@ -25,6 +25,7 @@ ccflags-y += -DCONFIG_TEGRA_HWPM_OOT
CONFIG_TEGRA_FUSE_UPSTREAM := y CONFIG_TEGRA_FUSE_UPSTREAM := y
ccflags-y += -DCONFIG_TEGRA_FUSE_UPSTREAM ccflags-y += -DCONFIG_TEGRA_FUSE_UPSTREAM
LINUXINCLUDE += -I$(srctree.nvconftest)
LINUXINCLUDE += -I$(srctree.hwpm)/include LINUXINCLUDE += -I$(srctree.hwpm)/include
LINUXINCLUDE += -I$(srctree.hwpm)/drivers/tegra/hwpm/include LINUXINCLUDE += -I$(srctree.hwpm)/drivers/tegra/hwpm/include
LINUXINCLUDE += -I$(srctree.hwpm)/drivers/tegra/hwpm LINUXINCLUDE += -I$(srctree.hwpm)/drivers/tegra/hwpm

View File

@@ -17,9 +17,11 @@
#ifndef TEGRA_HWPM_OS_LINUX_MEM_MGMT_UTILS_H #ifndef TEGRA_HWPM_OS_LINUX_MEM_MGMT_UTILS_H
#define TEGRA_HWPM_OS_LINUX_MEM_MGMT_UTILS_H #define TEGRA_HWPM_OS_LINUX_MEM_MGMT_UTILS_H
#include <nvidia/conftest.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/version.h> #include <linux/version.h>
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0) #if defined(NV_LINUX_IOSYS_MAP_H_PRESENT)
#include <linux/iosys-map.h> #include <linux/iosys-map.h>
#else #else
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0) #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0)
@@ -49,7 +51,7 @@ struct tegra_hwpm_mem_mgmt {
struct dma_buf *mem_bytes_dma_buf; struct dma_buf *mem_bytes_dma_buf;
struct dma_buf_attachment *mem_bytes_attach; struct dma_buf_attachment *mem_bytes_attach;
void *mem_bytes_kernel; void *mem_bytes_kernel;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0) #if defined(NV_LINUX_IOSYS_MAP_H_PRESENT)
struct iosys_map mem_bytes_map; struct iosys_map mem_bytes_map;
#else #else
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0) #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0)