summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/include
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/include')
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/comptags.h12
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/linux/vm.h6
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/vm.h6
3 files changed, 24 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/include/nvgpu/comptags.h b/drivers/gpu/nvgpu/include/nvgpu/comptags.h
index 6e3062ec..5482d0ce 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/comptags.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/comptags.h
@@ -20,6 +20,7 @@
20#include <nvgpu/lock.h> 20#include <nvgpu/lock.h>
21 21
22struct gk20a; 22struct gk20a;
23struct nvgpu_os_buffer;
23 24
24struct gk20a_comptags { 25struct gk20a_comptags {
25 u32 offset; 26 u32 offset;
@@ -52,6 +53,17 @@ int gk20a_comptaglines_alloc(struct gk20a_comptag_allocator *allocator,
52void gk20a_comptaglines_free(struct gk20a_comptag_allocator *allocator, 53void gk20a_comptaglines_free(struct gk20a_comptag_allocator *allocator,
53 u32 offset, u32 len); 54 u32 offset, u32 len);
54 55
56/*
57 * Defined by OS specific code since comptags are stored in a highly OS specific
58 * way.
59 */
60int gk20a_alloc_comptags(struct gk20a *g,
61 struct nvgpu_os_buffer *buf,
62 struct gk20a_comptag_allocator *allocator,
63 u32 lines);
64void gk20a_get_comptags(struct nvgpu_os_buffer *buf,
65 struct gk20a_comptags *comptags);
66
55 67
56 68
57#endif 69#endif
diff --git a/drivers/gpu/nvgpu/include/nvgpu/linux/vm.h b/drivers/gpu/nvgpu/include/nvgpu/linux/vm.h
index dee8fa09..39deeb69 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/linux/vm.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/linux/vm.h
@@ -33,11 +33,17 @@
33 33
34struct sg_table; 34struct sg_table;
35struct dma_buf; 35struct dma_buf;
36struct device;
36 37
37struct vm_gk20a; 38struct vm_gk20a;
38struct vm_gk20a_mapping_batch; 39struct vm_gk20a_mapping_batch;
39struct nvgpu_vm_area; 40struct nvgpu_vm_area;
40 41
42struct nvgpu_os_buffer {
43 struct dma_buf *dmabuf;
44 struct device *dev;
45};
46
41/* NVGPU_AS_MAP_BUFFER_FLAGS_DIRECT_KIND_CTRL must be set */ 47/* NVGPU_AS_MAP_BUFFER_FLAGS_DIRECT_KIND_CTRL must be set */
42int nvgpu_vm_map_linux(struct vm_gk20a *vm, 48int nvgpu_vm_map_linux(struct vm_gk20a *vm,
43 struct dma_buf *dmabuf, 49 struct dma_buf *dmabuf,
diff --git a/drivers/gpu/nvgpu/include/nvgpu/vm.h b/drivers/gpu/nvgpu/include/nvgpu/vm.h
index 10a7f7ce..b91b41e4 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/vm.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/vm.h
@@ -107,6 +107,12 @@ struct nvgpu_mapped_buf {
107 bool va_allocated; 107 bool va_allocated;
108}; 108};
109 109
110/*
111 * Defined by each OS. Allows the common VM code do things to the OS specific
112 * buffer structures.
113 */
114struct nvgpu_os_buffer;
115
110static inline struct nvgpu_mapped_buf * 116static inline struct nvgpu_mapped_buf *
111nvgpu_mapped_buf_from_buffer_list(struct nvgpu_list_node *node) 117nvgpu_mapped_buf_from_buffer_list(struct nvgpu_list_node *node)
112{ 118{