From b8915ab5aabb02866019221c51d96f304658207f Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Fri, 17 Jun 2016 15:56:07 +0300 Subject: gpu: nvgpu: support in-kernel vidmem mappings Propagate the buffer aperture flag in gk20a_locked_gmmu_map up so that buffers represented as a mem_desc and present in vidmem can be mapped to gpu. JIRA DNVGPU-18 JIRA DNVGPU-76 Change-Id: I46cf87e27229123016727339b9349d5e2c835b3e Signed-off-by: Konsta Holtta Reviewed-on: http://git-master/r/1169308 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/mm_gk20a.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/mm_gk20a.h') diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h index a697e520..f87ba605 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h @@ -40,8 +40,13 @@ outer_flush_range(pa, pa + (size_t)(size)); \ } while (0) +/* + * Real location of a buffer - gk20a_aperture_mask() will deduce what will be + * told to the gpu about the aperture, but this flag designates where the + * memory actually was allocated from. + */ enum gk20a_aperture { - APERTURE_INVALID, /* e.g., unallocated */ + APERTURE_INVALID, /* unallocated or N/A */ APERTURE_SYSMEM, APERTURE_VIDMEM }; @@ -520,14 +525,16 @@ u64 gk20a_gmmu_map(struct vm_gk20a *vm, u64 size, u32 flags, int rw_flag, - bool priv); + bool priv, + enum gk20a_aperture aperture); u64 gk20a_gmmu_fixed_map(struct vm_gk20a *vm, struct sg_table **sgt, u64 addr, u64 size, u32 flags, int rw_flag, - bool priv); + bool priv, + enum gk20a_aperture aperture); int gk20a_gmmu_alloc_map(struct vm_gk20a *vm, size_t size, @@ -619,7 +626,8 @@ u64 gk20a_locked_gmmu_map(struct vm_gk20a *vm, bool clear_ctags, bool sparse, bool priv, - struct vm_gk20a_mapping_batch *batch); + struct vm_gk20a_mapping_batch *batch, + enum gk20a_aperture aperture); void gk20a_gmmu_unmap(struct vm_gk20a *vm, u64 vaddr, -- cgit v1.2.2