video: tegra: nvmap: move dmabuf code to dmabuf unit

Move dmabuf code to dmabuf unit. This will help to deprecate
nvmap_priv.h.

JIRA TMM-5721

Change-Id: I5fc2a6e0d8ff1939df5e5623fc9d12fa3592e3bd
Signed-off-by: Pritesh Raithatha <praithatha@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3234588
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Pritesh Raithatha
2024-10-22 06:52:33 +00:00
committed by Jon Hunter
parent c79fe58101
commit cfda55996f
7 changed files with 38 additions and 39 deletions

View File

@@ -3,6 +3,23 @@
#ifndef __NVMAP_DMABUF_H
#define __NVMAP_DMABUF_H
#define __DMA_ATTR(attrs) attrs
#define DEFINE_DMA_ATTRS(attrs) unsigned long attrs = 0
/**
* dma_set_attr - set a specific attribute
* @attr: attribute to set
* @attrs: struct dma_attrs (may be NULL)
*/
#define dma_set_attr(attr, attrs) (attrs |= attr)
/**
* dma_get_attr - check for a specific attribute
* @attr: attribute to set
* @attrs: struct dma_attrs (may be NULL)
*/
#define dma_get_attr(attr, attrs) (attrs & attr)
int nvmap_dmabuf_stash_init(void);
void nvmap_dmabuf_stash_deinit(void);
@@ -25,4 +42,18 @@ int is_nvmap_dmabuf_fd_ro(int fd, bool *is_ro);
int nvmap_dmabuf_duplicate_gen_fd(struct nvmap_client *client,
struct dma_buf *dmabuf);
struct nvmap_vma_list {
struct list_head list;
struct vm_area_struct *vma;
unsigned long save_vm_flags;
pid_t pid;
atomic_t ref;
};
int is_nvmap_vma(struct vm_area_struct *vma);
void nvmap_vma_open(struct vm_area_struct *vma);
extern struct vm_operations_struct nvmap_vma_ops;
#endif /* __NVMAP_DMABUF_H */