KGSL_GPUMEM_ALLOC_ID now takes a flag, KGSL_MEMFLAGS_USE_CPU_MAP. When set, the GPU mapping will be set up to match the CPU mapping during mmap(). This feature is only supported when using per process pagetables with the IOMMU. The flags field of KGSL_GPUMEM_ALLOC_ID is copied back to userspace and KGSL_MEMFLAGS_USE_CPU_MAP will be cleared when this feature is not supported. The IOMMU virtual address space has been adjusted when perprocess pagetables is enabled so that the entire userpace address range (0 to TASK_SIZE) can have equivalent mappings on the IOMMU. For buffers that do not have equivalent mappings, the address range from PAGE_OFFSET to KGSL_IOMMU_GLOBAL_MEM_BASE is used. Change-Id: Ib61c03aa7453c3dd901c41e8fd297f66d402ae1a Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org> Signed-off-by: Sakshi Agrawal <sakshia@codeaurora.org>