msm: kgsl: Create a separate pool for mapping kgsl allocations
Create a separate kgsl pool to map global allocations made in kgsl
when IOMMU is used. Also, set the ttbr1 to point to defaultpagetable.
This allows us to map the kgsl allocations only once to the
defaultpagetable instead of having to map it to every pagetable
created.
Change-Id: I70fc051e852bf6820e09a1113a63ac93f7e0a51b
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
diff --git a/drivers/gpu/msm/kgsl_mmu.h b/drivers/gpu/msm/kgsl_mmu.h
index 0ff5881..bff41bf 100644
--- a/drivers/gpu/msm/kgsl_mmu.h
+++ b/drivers/gpu/msm/kgsl_mmu.h
@@ -13,6 +13,14 @@
#ifndef __KGSL_MMU_H
#define __KGSL_MMU_H
+/*
+ * These defines control the split between ttbr1 and ttbr0 pagetables of IOMMU
+ * and what ranges of memory we map to them
+ */
+#define KGSL_IOMMU_GLOBAL_MEM_BASE 0xC0000000
+#define KGSL_IOMMU_GLOBAL_MEM_SIZE SZ_4M
+#define KGSL_IOMMU_TTBR1_SPLIT 2
+
#define KGSL_MMU_ALIGN_SHIFT 13
#define KGSL_MMU_ALIGN_MASK (~((1 << KGSL_MMU_ALIGN_SHIFT) - 1))
@@ -92,6 +100,7 @@
struct kref refcount;
unsigned int max_entries;
struct gen_pool *pool;
+ struct gen_pool *kgsl_pool;
struct list_head list;
unsigned int name;
struct kobject *kobj;