Merge "msm: kgsl: Check MMU type for memory and pagetable operations"

This commit is contained in:
Linux Build Service Account 2016-12-02 09:02:12 -08:00 committed by Gerrit - the friendly Code Review server
commit 1209c96d7b
3 changed files with 16 additions and 2 deletions

View file

@ -856,6 +856,17 @@ int adreno_iommu_set_pt_ctx(struct adreno_ringbuffer *rb,
int result = 0;
int cpu_path = 0;
/* Just do the context switch incase of NOMMU */
if (kgsl_mmu_get_mmutype(device) == KGSL_MMU_TYPE_NONE) {
if ((!(flags & ADRENO_CONTEXT_SWITCH_FORCE_GPU)) &&
adreno_isidle(device))
_set_ctxt_cpu(rb, drawctxt);
else
result = _set_ctxt_gpu(rb, drawctxt);
return result;
}
if (rb->drawctxt_active)
cur_pt = rb->drawctxt_active->base.proc_priv->pagetable;

View file

@ -353,8 +353,10 @@ static int kgsl_mem_entry_track_gpuaddr(struct kgsl_device *device,
/*
* If SVM is enabled for this object then the address needs to be
* assigned elsewhere
* Also do not proceed further in case of NoMMU.
*/
if (kgsl_memdesc_use_cpu_map(&entry->memdesc))
if (kgsl_memdesc_use_cpu_map(&entry->memdesc) ||
(kgsl_mmu_get_mmutype(device) == KGSL_MMU_TYPE_NONE))
return 0;
pagetable = kgsl_memdesc_is_secured(&entry->memdesc) ?

View file

@ -284,7 +284,8 @@ static inline int kgsl_allocate_global(struct kgsl_device *device,
memdesc->flags = flags;
memdesc->priv = priv;
if ((memdesc->priv & KGSL_MEMDESC_CONTIG) != 0)
if (((memdesc->priv & KGSL_MEMDESC_CONTIG) != 0) ||
(kgsl_mmu_get_mmutype(device) == KGSL_MMU_TYPE_NONE))
ret = kgsl_sharedmem_alloc_contig(device, memdesc,
(size_t) size);
else {