gpu: nvgpu: Reduce usage of nvgpu_vidmem_get_page_alloc

Reduce the usage of nvgpu_vidmem_get_page_alloc() and friends as much
as possible. This reduces the dependency of nvgpu on Linux SGLs. SGLs
still need to be used, however, since sharing buffers in userspace is
done by dma_buf FD. The best way to pass the vidmem buf through the
dma_buf is by SGL pointer.

JIRA NVGPU-30
JIRA NVGPU-138

Change-Id: Ide0e9e5a557f00aa63b063be085042101a5b34ee
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1540709
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Alex Waterman
2017-08-17 16:51:03 -07:00
committed by mobile promotions
parent 59e4089278
commit ff9c3fc20a
7 changed files with 29 additions and 20 deletions

View File

@@ -25,6 +25,7 @@
#include <nvgpu/vidmem.h>
#include <nvgpu/linux/dma.h>
#include <nvgpu/linux/vidmem.h>
#include "os_linux.h"
@@ -355,7 +356,7 @@ u64 nvgpu_mem_get_addr(struct gk20a *g, struct nvgpu_mem *mem)
/*
* Otherwise get the vidmem address.
*/
alloc = nvgpu_vidmem_get_page_alloc(mem->priv.sgt->sgl);
alloc = mem->vidmem_alloc;
/* This API should not be used with > 1 chunks */
WARN_ON(alloc->nr_chunks != 1);