mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-24 10:11:26 +03:00
video: tegra: nvmap: Protect dma memory code
nvmap_dma_mark_declared_memory_occupied/unoccupied functions are only getting called when CONFIG_TEGRA_VIRTUALIZATION is defined. So protect the functions under the respective flag. Bug 4479027 Change-Id: If4c00084fde5079778f47fc09c91dccde36fe4d4 Signed-off-by: Yash Bhatt <ybhatt@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3103557 GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com> Reviewed-by: Ketan Patil <ketanp@nvidia.com> Reviewed-by: Pritesh Raithatha <praithatha@nvidia.com> Reviewed-by: Sachin Nikam <snikam@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
4f69d815e6
commit
7acc8a556a
@@ -580,6 +580,7 @@ void nvmap_dma_free_attrs(struct device *dev, size_t size, void *cpu_addr,
|
||||
}
|
||||
EXPORT_SYMBOL(nvmap_dma_free_attrs);
|
||||
|
||||
#ifdef CONFIG_TEGRA_VIRTUALIZATION
|
||||
void *nvmap_dma_mark_declared_memory_occupied(struct device *dev,
|
||||
dma_addr_t device_addr, size_t size)
|
||||
{
|
||||
@@ -631,6 +632,7 @@ void nvmap_dma_mark_declared_memory_unoccupied(struct device *dev,
|
||||
bitmap_clear(mem->bitmap, pos, alloc_size);
|
||||
spin_unlock_irqrestore(&mem->spinlock, flags);
|
||||
}
|
||||
#endif /* CONFIG_TEGRA_VIRTUALIZATION */
|
||||
|
||||
void nvmap_dma_release_coherent_memory(struct dma_coherent_mem_replica *mem)
|
||||
{
|
||||
|
||||
@@ -881,10 +881,13 @@ void nvmap_remove_device_name(char *device_name, u32 heap_type);
|
||||
bool dmabuf_is_nvmap(struct dma_buf *dmabuf);
|
||||
struct nvmap_handle *nvmap_handle_get_from_id(struct nvmap_client *client,
|
||||
u32 id);
|
||||
|
||||
#ifdef CONFIG_TEGRA_VIRTUALIZATION
|
||||
void *nvmap_dma_mark_declared_memory_occupied(struct device *dev,
|
||||
dma_addr_t device_addr, size_t size);
|
||||
void nvmap_dma_mark_declared_memory_unoccupied(struct device *dev,
|
||||
dma_addr_t device_addr, size_t size);
|
||||
#endif /* CONFIG_TEGRA_VIRTUALIZATION */
|
||||
|
||||
extern void __dma_flush_area(const void *cpu_va, size_t size);
|
||||
extern void __dma_map_area(const void *cpu_va, size_t size, int dir);
|
||||
|
||||
Reference in New Issue
Block a user