diff options
author | Krishna Reddy <vdumpa@nvidia.com> | 2011-12-19 15:51:27 -0800 |
---|---|---|
committer | Krishna Reddy <vdumpa@nvidia.com> | 2011-12-29 12:37:04 -0800 |
commit | 8d853a5ab4f1583c1e310af57b8957b8dbdb55d5 (patch) | |
tree | 7b848a38ce73875b4a9913ae4b60419e8fd0a9e6 /drivers/video/tegra/nvmap | |
parent | 75bdff71abcced60b46bef2cbcd3eea2d9a4eaf0 (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 'drivers/video/tegra/nvmap')
-rw-r--r-- | drivers/video/tegra/nvmap/nvmap.h | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/video/tegra/nvmap/nvmap.h b/drivers/video/tegra/nvmap/nvmap.h index 2670ff99c828..63b3471ec141 100644 --- a/drivers/video/tegra/nvmap/nvmap.h +++ b/drivers/video/tegra/nvmap/nvmap.h @@ -29,13 +29,15 @@ #include <linux/rbtree.h> #include <linux/sched.h> #include <linux/wait.h> - #include <linux/atomic.h> - #include <mach/nvmap.h> - #include "nvmap_heap.h" +struct nvmap_device; +struct page; +struct tegra_iovmm_area; + +#if defined(CONFIG_TEGRA_NVMAP) #define nvmap_err(_client, _fmt, ...) \ dev_err(nvmap_client_to_device(_client), \ "%s: "_fmt, __func__, ##__VA_ARGS__) @@ -50,10 +52,6 @@ #define nvmap_ref_to_id(_ref) ((unsigned long)(_ref)->handle) -struct nvmap_device; -struct page; -struct tegra_iovmm_area; - /* handles allocated using shared system memory (either IOVMM- or high-order * page allocations */ struct nvmap_pgalloc { @@ -134,6 +132,7 @@ static inline void nvmap_ref_unlock(struct nvmap_client *priv) { mutex_unlock(&priv->ref_lock); } +#endif /* CONFIG_TEGRA_NVMAP */ struct device *nvmap_client_to_device(struct nvmap_client *client); @@ -178,7 +177,6 @@ struct nvmap_handle_ref *nvmap_create_handle(struct nvmap_client *client, struct nvmap_handle_ref *nvmap_duplicate_handle_id(struct nvmap_client *client, unsigned long id); - int nvmap_alloc_handle_id(struct nvmap_client *client, unsigned long id, unsigned int heap_mask, size_t align, unsigned int flags); @@ -197,6 +195,7 @@ int nvmap_handle_remove(struct nvmap_device *dev, struct nvmap_handle *h); void nvmap_handle_add(struct nvmap_device *dev, struct nvmap_handle *h); +#if defined(CONFIG_TEGRA_NVMAP) static inline struct nvmap_handle *nvmap_handle_get(struct nvmap_handle *h) { if (unlikely(atomic_inc_return(&h->ref) <= 1)) { @@ -229,6 +228,11 @@ static inline pgprot_t nvmap_pgprot(struct nvmap_handle *h, pgprot_t prot) return pgprot_inner_writeback(prot); return prot; } +#else /* CONFIG_TEGRA_NVMAP */ +struct nvmap_handle *nvmap_handle_get(struct nvmap_handle *h); +void nvmap_handle_put(struct nvmap_handle *h); +pgprot_t nvmap_pgprot(struct nvmap_handle *h, pgprot_t prot); +#endif /* !CONFIG_TEGRA_NVMAP */ int is_nvmap_vma(struct vm_area_struct *vma); |