From 855d8f2379f3a157977c17ba125a422b9f74c365 Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Tue, 27 Feb 2018 09:34:21 -0800 Subject: gpu: nvgpu: Check for all sysmem apertures in GMMU Allow a potential IOMMU'ed GMMU mapping for all SYSMEM buffers inlcuding coherent sysmem. Typically this won't actually happen since IO coherent mappings will also often be accessed over NVLINK which is physically addressed. Also update the comments surrounding this code to take into account the new NVLINK nuances. Since NVLINK buffers are directly mapped even when the IOMMU is enabled this is very deserving of a comment explaining what's going on. Lastly add some simple functions for checking if an nvgpu_mem (or a particular aperture field) is a sysmem aperture. Currently this includes SYSMEM and SYSMEM_COH. JIRA EVLR-2333 Change-Id: I992d3c25d433778eaad9eef338aa5aa42afe597e Signed-off-by: Alex Waterman Reviewed-on: https://git-master.nvidia.com/r/1665185 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svc-mobile-coverity GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/include/nvgpu/nvgpu_mem.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/gpu/nvgpu/include') diff --git a/drivers/gpu/nvgpu/include/nvgpu/nvgpu_mem.h b/drivers/gpu/nvgpu/include/nvgpu/nvgpu_mem.h index 302f7287..c5e3e752 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/nvgpu_mem.h +++ b/drivers/gpu/nvgpu/include/nvgpu/nvgpu_mem.h @@ -217,6 +217,9 @@ static inline const char *nvgpu_aperture_str(struct gk20a *g, return "UNKNOWN"; } +bool nvgpu_aperture_is_sysmem(enum nvgpu_aperture ap); +bool nvgpu_mem_is_sysmem(struct nvgpu_mem *mem); + /* * Returns true if the passed nvgpu_mem has been allocated (i.e it's valid for * subsequent use). -- cgit v1.2.2