summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2017-04-17 19:26:28 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-05-19 18:34:01 -0400
commitd37e8f7dcf190f31f9c0c12583db2bb0c0d313c0 (patch)
tree4807c89bf40954c54804c3a8dd88c16849181f29 /drivers/gpu/nvgpu/vgpu/mm_vgpu.c
parentdcb744acfbbc11e66cac2d0a674a42e62d908b9d (diff)
gpu: nvgpu: Split VM interface out
This patch begins the major rework of the GPU's virtual memory manager (VMM). The VMM is the piece of code that handles the userspace interface to buffers and their mappings into the GMMU. The core data structure is the VM - for now still known as 'struct vm_gk20a'. Each one of these structs represents one addres space to which channels or TSGs may bind themselves to. The VMM splits the interface up into two broad categories. First there's the common, OS independent interfaces; and second there's the OS specific interfaces. OS independent -------------- This is the code that manages the lifetime of VMs, the buffers inside VMs (search, batch mapping) creation, destruction, etc. OS Specific ----------- This handles mapping of buffers represented as they are represented by the OS (dma_buf's for example on Linux). This patch is by no means complete. There's still Linux specific functions scattered in ostensibly OS independent code. This is the first step. A patch that rewrites everything in one go would simply be too big to effectively review. Instead the goal of this change is to simply separate out the basic OS specific and OS agnostic interfaces into their own header files. The next series of patches will start to pull the relevant implementations into OS specific C files and common C files. JIRA NVGPU-12 JIRA NVGPU-30 Change-Id: I242c7206047b6c769296226d855b7e44d5c4bfa8 Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: http://git-master/r/1464939 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/vgpu/mm_vgpu.c')
-rw-r--r--drivers/gpu/nvgpu/vgpu/mm_vgpu.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
index 7e42c198..cfa9e428 100644
--- a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
+++ b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
@@ -22,6 +22,8 @@
22#include "vgpu/vgpu.h" 22#include "vgpu/vgpu.h"
23#include "gk20a/mm_gk20a.h" 23#include "gk20a/mm_gk20a.h"
24 24
25#include "common/linux/vm_priv.h"
26
25static int vgpu_init_mm_setup_sw(struct gk20a *g) 27static int vgpu_init_mm_setup_sw(struct gk20a *g)
26{ 28{
27 struct mm_gk20a *mm = &g->mm; 29 struct mm_gk20a *mm = &g->mm;
@@ -216,7 +218,7 @@ static void vgpu_vm_remove_support(struct vm_gk20a *vm)
216 nvgpu_rbtree_enum_start(0, &node, vm->mapped_buffers); 218 nvgpu_rbtree_enum_start(0, &node, vm->mapped_buffers);
217 while (node) { 219 while (node) {
218 mapped_buffer = mapped_buffer_from_rbtree_node(node); 220 mapped_buffer = mapped_buffer_from_rbtree_node(node);
219 gk20a_vm_unmap_locked(mapped_buffer, NULL); 221 nvgpu_vm_unmap_locked(mapped_buffer, NULL);
220 nvgpu_rbtree_enum_start(0, &node, vm->mapped_buffers); 222 nvgpu_rbtree_enum_start(0, &node, vm->mapped_buffers);
221 } 223 }
222 224
@@ -454,7 +456,7 @@ static int vgpu_vm_bind_channel(struct gk20a_as_share *as_share,
454 } 456 }
455 457
456 if (ch->vm) 458 if (ch->vm)
457 gk20a_vm_get(ch->vm); 459 nvgpu_vm_get(ch->vm);
458 460
459 return err; 461 return err;
460} 462}