diff options
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/vm_priv.h')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/vm_priv.h | 102 |
1 files changed, 0 insertions, 102 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/vm_priv.h b/drivers/gpu/nvgpu/common/linux/vm_priv.h deleted file mode 100644 index be7efa8b..00000000 --- a/drivers/gpu/nvgpu/common/linux/vm_priv.h +++ /dev/null | |||
@@ -1,102 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms and conditions of the GNU General Public License, | ||
6 | * version 2, as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | * more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | |||
17 | #ifndef __COMMON_LINUX_VM_PRIV_H__ | ||
18 | #define __COMMON_LINUX_VM_PRIV_H__ | ||
19 | |||
20 | #include <nvgpu/types.h> | ||
21 | |||
22 | struct sg_table; | ||
23 | struct dma_buf; | ||
24 | |||
25 | struct vm_gk20a; | ||
26 | struct vm_gk20a_mapping_batch; | ||
27 | |||
28 | struct buffer_attrs { | ||
29 | struct sg_table *sgt; | ||
30 | u64 size; | ||
31 | u64 align; | ||
32 | u32 ctag_offset; | ||
33 | u32 ctag_lines; | ||
34 | u32 ctag_allocated_lines; | ||
35 | int pgsz_idx; | ||
36 | u8 kind_v; | ||
37 | bool use_kind_v; | ||
38 | u8 uc_kind_v; | ||
39 | bool use_uc_kind_v; | ||
40 | bool ctag_user_mappable; | ||
41 | }; | ||
42 | |||
43 | u64 nvgpu_vm_map(struct vm_gk20a *vm, | ||
44 | struct dma_buf *dmabuf, | ||
45 | u64 offset_align, | ||
46 | u32 flags, | ||
47 | |||
48 | /* | ||
49 | * compressible kind if | ||
50 | * NVGPU_AS_MAP_BUFFER_FLAGS_DIRECT_KIND_CTRL is | ||
51 | * specified, otherwise just the kind | ||
52 | */ | ||
53 | s16 compr_kind, | ||
54 | |||
55 | /* | ||
56 | * incompressible kind if | ||
57 | * NVGPU_AS_MAP_BUFFER_FLAGS_DIRECT_KIND_CTRL is | ||
58 | * specified, otherwise ignored | ||
59 | */ | ||
60 | s16 incompr_kind, | ||
61 | |||
62 | bool user_mapped, | ||
63 | int rw_flag, | ||
64 | u64 buffer_offset, | ||
65 | u64 mapping_size, | ||
66 | struct vm_gk20a_mapping_batch *mapping_batch); | ||
67 | |||
68 | /* | ||
69 | * Notes: | ||
70 | * - Batch may be NULL if map op is not part of a batch. | ||
71 | * - If NVGPU_AS_MAP_BUFFER_FLAGS_DIRECT_KIND_CTRL is set, | ||
72 | * compr_kind and incompr_kind work as explained in nvgpu.h. | ||
73 | * - If NVGPU_AS_MAP_BUFFER_FLAGS_DIRECT_KIND_CTRL is NOT set, | ||
74 | * compr_kind holds the kind and kernel will figure out whether | ||
75 | * it is a compressible or incompressible kind. If compressible, kernel will | ||
76 | * also figure out the incompressible counterpart or return an error. | ||
77 | */ | ||
78 | int nvgpu_vm_map_buffer(struct vm_gk20a *vm, | ||
79 | int dmabuf_fd, | ||
80 | u64 *offset_align, | ||
81 | u32 flags, /* NVGPU_AS_MAP_BUFFER_FLAGS_ */ | ||
82 | s16 compr_kind, | ||
83 | s16 incompr_kind, | ||
84 | u64 buffer_offset, | ||
85 | u64 mapping_size, | ||
86 | struct vm_gk20a_mapping_batch *batch); | ||
87 | |||
88 | void nvgpu_vm_unmap(struct vm_gk20a *vm, u64 offset); | ||
89 | |||
90 | /* find buffer corresponding to va */ | ||
91 | int nvgpu_vm_find_buf(struct vm_gk20a *vm, u64 gpu_va, | ||
92 | struct dma_buf **dmabuf, | ||
93 | u64 *offset); | ||
94 | |||
95 | enum nvgpu_aperture gk20a_dmabuf_aperture(struct gk20a *g, | ||
96 | struct dma_buf *dmabuf); | ||
97 | int validate_fixed_buffer(struct vm_gk20a *vm, | ||
98 | struct buffer_attrs *bfr, | ||
99 | u64 map_offset, u64 map_size, | ||
100 | struct nvgpu_vm_area **pva_node); | ||
101 | |||
102 | #endif | ||