diff options
author | Alex Waterman <alexw@nvidia.com> | 2017-09-07 18:27:55 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-10-18 19:00:37 -0400 |
commit | b3446bc0b6fca6cb992667f80a95f8503b6a652a (patch) | |
tree | 9882c36bfaef83da9d0a6eefec5e8c3564b93cea /drivers/gpu/nvgpu/gk20a/mm_gk20a.h | |
parent | bee9c830c7898ceebf8c396b40598350229a7203 (diff) |
gpu: nvgpu: Move dma_buf usage from mm_gk20a.c
Move most of the dma_buf usage present in the mm_gk20a.c code
out to Linux specific code and some commom/mm code. There's
two primary groups of code:
1. dma_buf priv field code (for holding comptag data)
2. Comptag usage that relies on dma_buf pointers
For (1) the dma_buf code was simply moved to common/linux/dmabuf.c
since most of this code is clearly Linux specific.
The comptag code was a bit more complicated since there is two
parts to the comptag code. Firstly there's the code that manages
the comptag memory. This is essentially a simple allocator. This
was moved to common/mm/comptags.c since it can be shared across
all chips. The second set of code is moved to
common/linux/comptags.c since it is the interface between dma_bufs
and the comptag memory.
Two other fixes were done as well:
- Add struct gk20a to the comptag allocator init so that
the proper nvgpu_vzalloc() function could be used.
- Add necessary includes to common/linux/vm_priv.h.
JIRA NVGPU-30
JIRA NVGPU-138
Change-Id: I96c57f2763e5ebe18a2f2ee4b33e0e1a2597848c
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1566628
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/mm_gk20a.h')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/mm_gk20a.h | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h index 448496f5..04034d84 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h | |||
@@ -117,13 +117,6 @@ gk20a_buffer_state_from_list(struct nvgpu_list_node *node) | |||
117 | ((uintptr_t)node - offsetof(struct gk20a_buffer_state, list)); | 117 | ((uintptr_t)node - offsetof(struct gk20a_buffer_state, list)); |
118 | }; | 118 | }; |
119 | 119 | ||
120 | struct gk20a_comptags { | ||
121 | u32 offset; | ||
122 | u32 lines; | ||
123 | u32 allocated_lines; | ||
124 | bool user_mappable; | ||
125 | }; | ||
126 | |||
127 | struct priv_cmd_queue { | 120 | struct priv_cmd_queue { |
128 | struct nvgpu_mem mem; | 121 | struct nvgpu_mem mem; |
129 | u32 size; /* num of entries in words */ | 122 | u32 size; /* num of entries in words */ |
@@ -369,10 +362,6 @@ void gk20a_locked_gmmu_unmap(struct vm_gk20a *vm, | |||
369 | bool sparse, | 362 | bool sparse, |
370 | struct vm_gk20a_mapping_batch *batch); | 363 | struct vm_gk20a_mapping_batch *batch); |
371 | 364 | ||
372 | struct sg_table *gk20a_mm_pin(struct device *dev, struct dma_buf *dmabuf); | ||
373 | void gk20a_mm_unpin(struct device *dev, struct dma_buf *dmabuf, | ||
374 | struct sg_table *sgt); | ||
375 | |||
376 | /* vm-as interface */ | 365 | /* vm-as interface */ |
377 | struct nvgpu_as_alloc_space_args; | 366 | struct nvgpu_as_alloc_space_args; |
378 | struct nvgpu_as_free_space_args; | 367 | struct nvgpu_as_free_space_args; |
@@ -381,14 +370,6 @@ int gk20a_vm_bind_channel(struct gk20a_as_share *as_share, | |||
381 | struct channel_gk20a *ch); | 370 | struct channel_gk20a *ch); |
382 | int __gk20a_vm_bind_channel(struct vm_gk20a *vm, struct channel_gk20a *ch); | 371 | int __gk20a_vm_bind_channel(struct vm_gk20a *vm, struct channel_gk20a *ch); |
383 | 372 | ||
384 | void gk20a_get_comptags(struct device *dev, struct dma_buf *dmabuf, | ||
385 | struct gk20a_comptags *comptags); | ||
386 | |||
387 | int gk20a_dmabuf_alloc_drvdata(struct dma_buf *dmabuf, struct device *dev); | ||
388 | |||
389 | int gk20a_dmabuf_get_state(struct dma_buf *dmabuf, struct gk20a *g, | ||
390 | u64 offset, struct gk20a_buffer_state **state); | ||
391 | |||
392 | void pde_range_from_vaddr_range(struct vm_gk20a *vm, | 373 | void pde_range_from_vaddr_range(struct vm_gk20a *vm, |
393 | u64 addr_lo, u64 addr_hi, | 374 | u64 addr_lo, u64 addr_hi, |
394 | u32 *pde_lo, u32 *pde_hi); | 375 | u32 *pde_lo, u32 *pde_hi); |