Files
linux-nv-oot/drivers/video/tegra/nvmap/nvmap_dmabuf.h
Ketan Patil 44a095795e video: tegra: nvmap: Move relevant code to respective units
- Move the code from nvmap_priv.h to relevant units.
- Delete nvmap_priv.h

JIRA TMM-5751

Change-Id: Ic0df459fb9db0714a1b2a65b463fae8adbbc49f1
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Signed-off-by: Pritesh Raithatha <praithatha@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3232636
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-07-24 10:19:10 +00:00

66 lines
1.6 KiB
C

/* SPDX-License-Identifier: GPL-2.0-only */
/* SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. */
#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);
bool dmabuf_is_nvmap(struct dma_buf *dmabuf);
struct dma_buf *__nvmap_make_dmabuf(struct nvmap_client *client,
struct nvmap_handle *handle,
bool ro_buf);
int nvmap_get_dmabuf_fd(struct nvmap_client *client,
struct nvmap_handle *h,
bool is_ro);
struct nvmap_handle *nvmap_handle_get_from_dmabuf_fd(
struct nvmap_client *client,
int fd);
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;
};
struct nvmap_vma_priv {
struct nvmap_handle *handle;
size_t offs;
atomic_t count; /* number of processes cloning the VMA */
};
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 */