msm: kgsl: Introduce Iommu Code

kgsl now supports the use of 2 types of MMU. One is
the GPU's internal MMU and the other is IOMMU. Both
MMU cannot be active at the same time. The MMU type
can be selected at compile time via config option.
A boot command line parameter can be used to override
the type of MMU selected at compile time.

Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
diff --git a/drivers/gpu/msm/Kconfig b/drivers/gpu/msm/Kconfig
index 64cbc30..5852e26 100644
--- a/drivers/gpu/msm/Kconfig
+++ b/drivers/gpu/msm/Kconfig
@@ -64,22 +64,30 @@
 	bool "Build a DRM interface for the MSM_KGSL driver"
 	depends on MSM_KGSL && DRM
 
-config MSM_KGSL_MMU
+config MSM_KGSL_GPUMMU
 	bool "Enable the GPU MMU in the MSM_KGSL driver"
-	depends on MSM_KGSL && MMU && !MSM_KGSL_CFF_DUMP
+	depends on MSM_KGSL && !MSM_KGSL_CFF_DUMP
+	default y
+
+config MSM_KGSL_IOMMU
+	bool "Enable the use of IOMMU in the MSM_KGSL driver"
+	depends on MSM_KGSL && MSM_IOMMU && !MSM_KGSL_GPUMMU && !MSM_KGSL_CFF_DUMP
+
+config MSM_KGSL_MMU
+	bool
+	depends on MSM_KGSL_GPUMMU || MSM_KGSL_IOMMU
 	default y
 
 config KGSL_PER_PROCESS_PAGE_TABLE
 	bool "Enable Per Process page tables for the KGSL driver"
 	default n
-	depends on MSM_KGSL_MMU && !MSM_KGSL_DRM
+	depends on MSM_KGSL_GPUMMU && !MSM_KGSL_DRM
 	---help---
 	  The MMU will use per process pagetables when enabled.
 
 config MSM_KGSL_PAGE_TABLE_SIZE
 	hex "Size of pagetables"
 	default 0xFFF0000
-	depends on MSM_KGSL_MMU
 	---help---
 	  Sets the pagetable size used by the MMU.  The max value
 	  is 0xFFF0000 or (256M - 64K).
@@ -97,7 +105,7 @@
 config MSM_KGSL_MMU_PAGE_FAULT
 	bool "Force the GPU MMU to page fault for unmapped regions"
 	default y
-	depends on MSM_KGSL_MMU
+	depends on MSM_KGSL_GPUMMU
 
 config MSM_KGSL_DISABLE_SHADOW_WRITES
 	bool "Disable register shadow writes for context switches"