summaryrefslogtreecommitdiff
path: root/drivers/gpu/msm/kgsl_sharedmem.c
diff options
context:
space:
mode:
authorJordan Crouse <jcrouse@codeaurora.org>2016-02-01 08:22:09 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 21:19:19 -0700
commitd4a7e95db83b778529d1cdcaa124f0be903e494c (patch)
tree5183dc9111689c92e18c82897773c773d6297837 /drivers/gpu/msm/kgsl_sharedmem.c
parent9c8d55382c2f454be420df38a745cbbf774c2677 (diff)
msm: kgsl: Refactor MMU/IOMMU support
The current MMU code assumes a binary state - either there is a IOMMU or there isn't. This precludes other memory models and makes for a lot of inherent IOMMU knowledge in the generic MMU code and the rest of the driver. Reorganize and cleanup the MMU and IOMMU code: * Add a Kconfig boolean dependent on ARM and/or MSM SMMU support. * Make "nommu" mode an actual MMU subtype and figure out available MMU subtypes at probe time. * Move IOMMU device tree parsing to the IOMMU code. * Move the MMU subtype private structures into struct kgsl_mmu. * Move adreno_iommu specific functions out of other generic adreno code. * Move A4XX specific preemption code out of the ringbuffer code. CRs-Fixed: 970264 Change-Id: Ic0dedbad1293a1d129b7c4ed1105d684ca84d97f Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Diffstat (limited to 'drivers/gpu/msm/kgsl_sharedmem.c')
-rw-r--r--drivers/gpu/msm/kgsl_sharedmem.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/msm/kgsl_sharedmem.c b/drivers/gpu/msm/kgsl_sharedmem.c
index bc955ae66285..893e31852ccb 100644
--- a/drivers/gpu/msm/kgsl_sharedmem.c
+++ b/drivers/gpu/msm/kgsl_sharedmem.c
@@ -342,7 +342,7 @@ int kgsl_allocate_user(struct kgsl_device *device,
memdesc->flags = flags;
- if (kgsl_mmu_get_mmutype() == KGSL_MMU_TYPE_NONE)
+ if (kgsl_mmu_get_mmutype(device) == KGSL_MMU_TYPE_NONE)
ret = kgsl_sharedmem_alloc_contig(device, memdesc,
pagetable, size);
else if (flags & KGSL_MEMFLAGS_SECURE)
@@ -1098,7 +1098,7 @@ int kgsl_sharedmem_alloc_contig(struct kgsl_device *device,
/* Record statistics */
- if (kgsl_mmu_get_mmutype() == KGSL_MMU_TYPE_NONE)
+ if (kgsl_mmu_get_mmutype(device) == KGSL_MMU_TYPE_NONE)
memdesc->gpuaddr = memdesc->physaddr;
KGSL_STATS_ADD(size, &kgsl_driver.stats.coherent,
@@ -1169,7 +1169,7 @@ static int scm_lock_chunk(struct kgsl_memdesc *memdesc, int lock)
static int kgsl_cma_alloc_secure(struct kgsl_device *device,
struct kgsl_memdesc *memdesc, uint64_t size)
{
- struct kgsl_iommu *iommu = device->mmu.priv;
+ struct kgsl_iommu *iommu = KGSL_IOMMU_PRIV(device);
int result = 0;
struct kgsl_pagetable *pagetable = device->mmu.securepagetable;
size_t aligned;