summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/include
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2018-06-15 13:12:02 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-06-22 13:04:26 -0400
commitf2f03582fda04c4e09df1a349876c435a5ef52e0 (patch)
treeb1722c56917aaa40e67719949f03619fc10b4ff5 /drivers/gpu/nvgpu/include
parent840e039d57d4acfb2be2a82c4b95a6d25c7aacd4 (diff)
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 <tbergstrom@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1753710 Reviewed-by: Richard Zhao <rizhao@nvidia.com> Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/include')
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/dma.h18
1 files changed, 18 insertions, 0 deletions
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);
167int nvgpu_dma_alloc_flags_vid(struct gk20a *g, unsigned long flags, 167int nvgpu_dma_alloc_flags_vid(struct gk20a *g, unsigned long flags,
168 size_t size, struct nvgpu_mem *mem); 168 size_t size, struct nvgpu_mem *mem);
169 169
170
171/**
172 * nvgpu_dma_alloc_flags_vid_at - Allocate DMA memory
173 *
174 * @g - The GPU.
175 * @size - Size of the allocation in bytes.
176 * @mem - Struct for storing the allocation information.
177 * @at - A specific location to attempt to allocate memory from or 0 if the
178 * caller does not care what the address is.
179 *
180 * Allocate memory suitable for doing DMA. Store the allocation info in @mem.
181 * Returns 0 on success and a suitable error code when there's an error. This
182 * allocates memory specifically in VIDMEM.
183 *
184 */
185int nvgpu_dma_alloc_vid_at(struct gk20a *g,
186 size_t size, struct nvgpu_mem *mem, u64 at);
187
170/** 188/**
171 * nvgpu_dma_alloc_flags_vid_at - Allocate DMA memory 189 * nvgpu_dma_alloc_flags_vid_at - Allocate DMA memory
172 * 190 *