summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/include/mach
diff options
context:
space:
mode:
authorKrishna Reddy <vdumpa@nvidia.com>2011-12-19 15:51:27 -0800
committerKrishna Reddy <vdumpa@nvidia.com>2011-12-29 12:37:04 -0800
commit8d853a5ab4f1583c1e310af57b8957b8dbdb55d5 (patch)
tree7b848a38ce73875b4a9913ae4b60419e8fd0a9e6 /arch/arm/mach-tegra/include/mach
parent75bdff71abcced60b46bef2cbcd3eea2d9a4eaf0 (diff)
arm: tegra: nvmap: Prepare nvmap api's to support Ion.
Prepare nvmap api's to be able to use Ion Memory Manger. Change-Id: Ie7de2c4afc491290d61e8545667ffa477af32d8b Signed-off-by: Krishna Reddy <vdumpa@nvidia.com> Reviewed-on: http://git-master/r/71112 Reviewed-by: Aleksandr Frid <afrid@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User
Diffstat (limited to 'arch/arm/mach-tegra/include/mach')
-rw-r--r--arch/arm/mach-tegra/include/mach/nvmap.h22
1 files changed, 19 insertions, 3 deletions
diff --git a/arch/arm/mach-tegra/include/mach/nvmap.h b/arch/arm/mach-tegra/include/mach/nvmap.h
index 5d0985c2a94c..79f5a881681f 100644
--- a/arch/arm/mach-tegra/include/mach/nvmap.h
+++ b/arch/arm/mach-tegra/include/mach/nvmap.h
@@ -53,14 +53,28 @@
#if defined(__KERNEL__)
+#if defined(CONFIG_TEGRA_NVMAP)
struct nvmap_handle;
struct nvmap_client;
struct nvmap_device;
-
#define nvmap_ref_to_handle(_ref) (*(struct nvmap_handle **)(_ref))
-#define nvmap_id_to_handle(_id) ((struct nvmap_handle *)(_id))
/* Convert User space handle to Kernel. */
-#define nvmap_convert_handle_u2k(h) h
+#define nvmap_convert_handle_u2k(h) (h)
+#elif defined(CONFIG_ION_TEGRA)
+/* For Ion Mem Manager support through nvmap_* API's. */
+#include "../../../../../drivers/gpu/ion/ion_priv.h"
+
+#define nvmap_client ion_client
+#define nvmap_device ion_device
+#define nvmap_handle ion_handle
+#define nvmap_handle_ref ion_handle
+#define nvmap_ref_to_handle(_ref) (struct ion_handle *)_ref
+/* Convert User space handle to Kernel. */
+#define nvmap_convert_handle_u2k(h) (*((u32 *)h))
+#endif
+
+#define nvmap_id_to_handle(_id) ((struct nvmap_handle *)(_id))
+
struct nvmap_pinarray_elem {
__u32 patch_mem;
@@ -70,6 +84,7 @@ struct nvmap_pinarray_elem {
__u32 reloc_shift;
};
+#if defined(CONFIG_TEGRA_NVMAP)
/* handle_ref objects are client-local references to an nvmap_handle;
* they are distinct objects so that handles can be unpinned and
* unreferenced the correct number of times when a client abnormally
@@ -80,6 +95,7 @@ struct nvmap_handle_ref {
atomic_t dupes; /* number of times to free on file close */
atomic_t pin; /* number of times to unpin on free */
};
+#endif
struct nvmap_client *nvmap_create_client(struct nvmap_device *dev,
const char *name);