summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2017-10-12 19:19:55 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-10-24 18:16:50 -0400
commit0c5d0c6a9ef0e33f01ce1485674bb2271e4bb580 (patch)
tree15ce6b6d41decce809e62c996be94492263daede /drivers/gpu/nvgpu/vgpu/mm_vgpu.c
parent2a285d0607a20694476399f5719e74dbc26fcd58 (diff)
gpu: nvgpu: Begin reorganizing VM mapping/unmapping
Move vm_priv.h to <nvgpu/linux/vm.h> and rename nvgpu_vm_map() to nvgpu_vm_map_linux(). Also remove a redundant unmap function from the unmap path. These changes are the beginning of reworking the nvgpu Linux mapping and unmapping code. The rest of this patch is just the necessary changes to use the new map function naming and the new path to the Linux vm header. Patch Series Goal ----------------- There's two major goals for this patch series. Note that these goals are not achieved in this patch. There will be subsequent patches. 1. Remove all last vestiges of Linux code from common/mm/vm.c 2. Implement map caching in the common/mm/vm.c code To accomplish this firstly the VM mapping code needs to have the struct nvgpu_mapped_buf data struct be completely Linux free. That means implementing an abstraction for this to hold the Linux stuff that mapped buffers carry about (SGT, dma_buf). This is why the vm_priv.h code has been moved: it will need to be included by the <nvgpu/vm.h> header so that the OS specific struct can be pulled into struct nvgpu_mapped_buf. Next renaming the nvgpu_vm_map() to nvgpu_vm_map_linux() is in preparation for adding a new nvgpu_vm_map() that handles the map caching with nvgpu_mapped_buf. The mapping code is fairly straight forward: nvgpu_vm_map does OS generic stuff; each OS then calls this function from an nvgpu_vm_map_<OS>() or the like that does any OS specific adjustments/management. Freeing buffers is much more tricky however. The maps are all reference counted since userspace does not track buffers and expects us to handle this instead. Ugh! Since there's ref-counts the free code will require a callback into the OS specific code since the OS specific code cannot free a buffer directly. THis make's the path for freeing a buffer quite convoluted. JIRA NVGPU-30 JIRA NVGPU-71 Change-Id: I5e0975f60663a0d6cf0a6bd90e099f51e02c2395 Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1578896 GVS: Gerrit_Virtual_Submit Reviewed-by: David Martinez Nieto <dmartineznie@nvidia.com> Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/vgpu/mm_vgpu.c')
-rw-r--r--drivers/gpu/nvgpu/vgpu/mm_vgpu.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
index 8dcca0a1..c4256afb 100644
--- a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
+++ b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
@@ -32,6 +32,7 @@
32 32
33#include <nvgpu/vgpu/vm.h> 33#include <nvgpu/vgpu/vm.h>
34 34
35#include <nvgpu/linux/vm.h>
35#include <nvgpu/linux/nvgpu_mem.h> 36#include <nvgpu/linux/nvgpu_mem.h>
36 37
37#include "vgpu/vgpu.h" 38#include "vgpu/vgpu.h"
@@ -39,8 +40,6 @@
39#include "gk20a/mm_gk20a.h" 40#include "gk20a/mm_gk20a.h"
40#include "gm20b/mm_gm20b.h" 41#include "gm20b/mm_gm20b.h"
41 42
42#include "common/linux/vm_priv.h"
43
44static int vgpu_init_mm_setup_sw(struct gk20a *g) 43static int vgpu_init_mm_setup_sw(struct gk20a *g)
45{ 44{
46 struct mm_gk20a *mm = &g->mm; 45 struct mm_gk20a *mm = &g->mm;