Files
linux-nv-oot/drivers/video/tegra/nvmap/nvmap_dmabuf.h
Pritesh Raithatha cfda55996f 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>
2025-07-24 10:19:10 +00:00

60 lines
1.5 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;
};
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 */