summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/linux/vm_priv.h
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2017-04-24 18:26:00 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-05-19 18:34:06 -0400
commit014ace5a85f274de7debb4c6168d69c803445e19 (patch)
tree4028be3294b95e38659f1ebba4a14457748e59f1 /drivers/gpu/nvgpu/common/linux/vm_priv.h
parentd37e8f7dcf190f31f9c0c12583db2bb0c0d313c0 (diff)
gpu: nvgpu: Split VM implementation out
This patch begins splitting out the VM implementation from mm_gk20a.c and moves it to common/linux/vm.c and common/mm/vm.c. This split is necessary because the VM code has two portions: first, an interface for the OS specific code to use (i.e userspace mappings), and second, a set of APIs for the driver to use (init, cleanup, etc) which are not OS specific. This is only the beginning of the split - there's still a lot of things that need to be carefully moved around. JIRA NVGPU-12 JIRA NVGPU-30 Change-Id: I3b57cba245d7daf9e4326a143b9c6217e0f28c96 Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: http://git-master/r/1477743 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/vm_priv.h')
-rw-r--r--drivers/gpu/nvgpu/common/linux/vm_priv.h36
1 files changed, 34 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/vm_priv.h b/drivers/gpu/nvgpu/common/linux/vm_priv.h
index c0fb0ffe..9e064d76 100644
--- a/drivers/gpu/nvgpu/common/linux/vm_priv.h
+++ b/drivers/gpu/nvgpu/common/linux/vm_priv.h
@@ -25,12 +25,24 @@ struct dma_buf;
25struct vm_gk20a; 25struct vm_gk20a;
26struct vm_gk20a_mapping_batch; 26struct vm_gk20a_mapping_batch;
27 27
28struct 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 u8 uc_kind_v;
38 bool ctag_user_mappable;
39};
40
28u64 nvgpu_vm_map(struct vm_gk20a *vm, 41u64 nvgpu_vm_map(struct vm_gk20a *vm,
29 struct dma_buf *dmabuf, 42 struct dma_buf *dmabuf,
30 u64 offset_align, 43 u64 offset_align,
31 u32 flags /*NVGPU_AS_MAP_BUFFER_FLAGS_*/, 44 u32 flags,
32 int kind, 45 int kind,
33 struct sg_table **sgt,
34 bool user_mapped, 46 bool user_mapped,
35 int rw_flag, 47 int rw_flag,
36 u64 buffer_offset, 48 u64 buffer_offset,
@@ -59,4 +71,24 @@ void nvgpu_vm_unmap(struct vm_gk20a *vm, u64 offset);
59int nvgpu_vm_find_buffer(struct vm_gk20a *vm, u64 gpu_va, 71int nvgpu_vm_find_buffer(struct vm_gk20a *vm, u64 gpu_va,
60 struct dma_buf **dmabuf, 72 struct dma_buf **dmabuf,
61 u64 *offset); 73 u64 *offset);
74
75enum nvgpu_aperture gk20a_dmabuf_aperture(struct gk20a *g,
76 struct dma_buf *dmabuf);
77int validate_fixed_buffer(struct vm_gk20a *vm,
78 struct buffer_attrs *bfr,
79 u64 map_offset, u64 map_size,
80 struct vm_reserved_va_node **pva_node);
81int setup_buffer_kind_and_compression(struct vm_gk20a *vm,
82 u32 flags,
83 struct buffer_attrs *bfr,
84 enum gmmu_pgsz_gk20a pgsz_idx);
85int gk20a_alloc_comptags(struct gk20a *g,
86 struct device *dev,
87 struct dma_buf *dmabuf,
88 struct gk20a_comptag_allocator *allocator,
89 u32 lines, bool user_mappable,
90 u64 *ctag_map_win_size,
91 u32 *ctag_map_win_ctagline);
92void gk20a_vm_unmap_locked_kref(struct kref *ref);
93
62#endif 94#endif