Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 81e31dcb authored by Rajesh Kemisetti's avatar Rajesh Kemisetti Committed by Gerrit - the friendly Code Review server
Browse files

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



Check MMU type for below operations to make NOMMU functional:

- adreno_iommu_set_pt_ctx() tries to set pagetable during context
  switch without really checking on type of MMU.
- skip tracking of gpuaddr in case of NoMMU during
  kgsl_mem_entry_track_gpuaddr().
- In case of nommu the function kgsl_allocate_global() should
  always allocate contiguous memory from CMA.

Change-Id: I8cb59e1475376167c7a8a60c54df0939597f5083
Signed-off-by: default avatarRajesh Kemisetti <rajeshk@codeaurora.org>
parent b3691075
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -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;

+3 −1
Original line number Diff line number Diff line
@@ -346,8 +346,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) ?
+2 −1
Original line number Diff line number Diff line
@@ -268,7 +268,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 {