mirror of
git://nv-tegra.nvidia.com/linux-hwpm.git
synced 2025-12-22 09:12:05 +03:00
tegra: hwpm: add missing ref to iosys-map.h
dma_bf_map is renamed to iosys_map for kernels > 5.18. - Update mem_bytes map function to use iosys_map for kernel versions greater than 5.18. - Add missing reference to iosys-map.h to include iosys_map definition. Bug 3733730 Change-Id: I37f981dd8b2aa0154d783c35a645ab8d3d9faa3b Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2784481 Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com> Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com> Reviewed-by: Rohit Khanna <rokhanna@nvidia.com> Reviewed-by: Shanker Donthineni <sdonthineni@nvidia.com> Reviewed-by: Seema Khowala <seemaj@nvidia.com> GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
66d57599b1
commit
fb84554a97
@@ -128,28 +128,26 @@ static int tegra_hwpm_dma_map_mem_bytes_buffer(struct tegra_soc_hwpm *hwpm,
|
|||||||
sg_dma_address(hwpm->mem_mgmt->mem_bytes_sgt->sgl);
|
sg_dma_address(hwpm->mem_mgmt->mem_bytes_sgt->sgl);
|
||||||
|
|
||||||
#if defined(CONFIG_TEGRA_HWPM_OOT)
|
#if defined(CONFIG_TEGRA_HWPM_OOT)
|
||||||
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
|
||||||
|
hwpm->mem_mgmt->mem_bytes_kernel =
|
||||||
|
(struct iosys_map *) &hwpm->mem_mgmt->mem_bytes_map;
|
||||||
|
err = dma_buf_vmap(hwpm->mem_mgmt->mem_bytes_dma_buf,
|
||||||
|
(struct iosys_map *)hwpm->mem_mgmt->mem_bytes_kernel);
|
||||||
|
#else
|
||||||
hwpm->mem_mgmt->mem_bytes_kernel =
|
hwpm->mem_mgmt->mem_bytes_kernel =
|
||||||
(struct dma_buf_map *) &hwpm->mem_mgmt->mem_bytes_map;
|
(struct dma_buf_map *) &hwpm->mem_mgmt->mem_bytes_map;
|
||||||
err = dma_buf_vmap(hwpm->mem_mgmt->mem_bytes_dma_buf,
|
err = dma_buf_vmap(hwpm->mem_mgmt->mem_bytes_dma_buf,
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
|
|
||||||
(struct iosys_map *)hwpm->mem_mgmt->mem_bytes_kernel);
|
|
||||||
#else
|
|
||||||
(struct dma_buf_map *)hwpm->mem_mgmt->mem_bytes_kernel);
|
(struct dma_buf_map *)hwpm->mem_mgmt->mem_bytes_kernel);
|
||||||
#endif
|
#endif
|
||||||
if (err != 0) {
|
#else /* !CONFIG_TEGRA_HWPM_OOT */
|
||||||
tegra_hwpm_err(hwpm,
|
|
||||||
"Unable to map mem_bytes buffer into kernel VA space");
|
|
||||||
return -ENOMEM;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
hwpm->mem_mgmt->mem_bytes_kernel =
|
hwpm->mem_mgmt->mem_bytes_kernel =
|
||||||
dma_buf_vmap(hwpm->mem_mgmt->mem_bytes_dma_buf);
|
dma_buf_vmap(hwpm->mem_mgmt->mem_bytes_dma_buf);
|
||||||
|
#endif
|
||||||
if (!hwpm->mem_mgmt->mem_bytes_kernel) {
|
if (!hwpm->mem_mgmt->mem_bytes_kernel) {
|
||||||
tegra_hwpm_err(hwpm,
|
tegra_hwpm_err(hwpm,
|
||||||
"Unable to map mem_bytes buffer into kernel VA space");
|
"Unable to map mem_bytes buffer into kernel VA space");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
memset(hwpm->mem_mgmt->mem_bytes_kernel, 0, 32);
|
memset(hwpm->mem_mgmt->mem_bytes_kernel, 0, 32);
|
||||||
|
|
||||||
|
|||||||
@@ -16,8 +16,13 @@
|
|||||||
|
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
#if defined(CONFIG_TEGRA_HWPM_OOT)
|
#if defined(CONFIG_TEGRA_HWPM_OOT)
|
||||||
|
#include <linux/version.h>
|
||||||
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
|
||||||
|
#include <linux/iosys-map.h>
|
||||||
|
#else
|
||||||
#include <linux/dma-buf-map.h>
|
#include <linux/dma-buf-map.h>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/* This macro is copy of TEGRA_SOC_HWPM_MEM_BYTES_INVALID */
|
/* This macro is copy of TEGRA_SOC_HWPM_MEM_BYTES_INVALID */
|
||||||
#define TEGRA_HWPM_MEM_BYTES_INVALID 0xffffffff
|
#define TEGRA_HWPM_MEM_BYTES_INVALID 0xffffffff
|
||||||
@@ -42,8 +47,12 @@ struct tegra_hwpm_mem_mgmt {
|
|||||||
u64 mem_bytes_buf_va;
|
u64 mem_bytes_buf_va;
|
||||||
void *mem_bytes_kernel;
|
void *mem_bytes_kernel;
|
||||||
#if defined(CONFIG_TEGRA_HWPM_OOT)
|
#if defined(CONFIG_TEGRA_HWPM_OOT)
|
||||||
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
|
||||||
|
struct iosys_map mem_bytes_map;
|
||||||
|
#else
|
||||||
struct dma_buf_map mem_bytes_map;
|
struct dma_buf_map mem_bytes_map;
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct tegra_hwpm_allowlist_map {
|
struct tegra_hwpm_allowlist_map {
|
||||||
|
|||||||
Reference in New Issue
Block a user