From f2f03582fda04c4e09df1a349876c435a5ef52e0 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Fri, 15 Jun 2018 10:12:02 -0700 Subject: gpu: nvgpu: Add nvgpu_dma_alloc_vid_at() Add a wrapper function nvgpu_dma_alloc_vid_at() for performing vidmem allocation at a specific address without needing to pass any flags. Change-Id: Ib7a21a4fd33120749cf7b79750c3a382ba08b470 Signed-off-by: Terje Bergstrom Reviewed-on: https://git-master.nvidia.com/r/1753710 Reviewed-by: Richard Zhao Reviewed-by: Alex Waterman Reviewed-by: Vinod Gopalakrishnakurup Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/include/nvgpu/dma.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'drivers/gpu/nvgpu/include') diff --git a/drivers/gpu/nvgpu/include/nvgpu/dma.h b/drivers/gpu/nvgpu/include/nvgpu/dma.h index c0397b58..d83346a3 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/dma.h +++ b/drivers/gpu/nvgpu/include/nvgpu/dma.h @@ -167,6 +167,24 @@ int nvgpu_dma_alloc_vid(struct gk20a *g, size_t size, struct nvgpu_mem *mem); int nvgpu_dma_alloc_flags_vid(struct gk20a *g, unsigned long flags, size_t size, struct nvgpu_mem *mem); + +/** + * nvgpu_dma_alloc_flags_vid_at - Allocate DMA memory + * + * @g - The GPU. + * @size - Size of the allocation in bytes. + * @mem - Struct for storing the allocation information. + * @at - A specific location to attempt to allocate memory from or 0 if the + * caller does not care what the address is. + * + * Allocate memory suitable for doing DMA. Store the allocation info in @mem. + * Returns 0 on success and a suitable error code when there's an error. This + * allocates memory specifically in VIDMEM. + * + */ +int nvgpu_dma_alloc_vid_at(struct gk20a *g, + size_t size, struct nvgpu_mem *mem, u64 at); + /** * nvgpu_dma_alloc_flags_vid_at - Allocate DMA memory * -- cgit v1.2.2