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

Commit daf81b8e authored by Shubhraprakash Das's avatar Shubhraprakash Das Committed by Stephen Boyd
Browse files

msm: kgsl: Use the correct length when looking for address collision



Use the right length of allocation from the aligned base address of
CPU virtual map to look for collision in the GPU vitual map. This
prevents discarding of usable address ranges due to false collision
hits.

CRs-Fixed: 492041
Change-Id: I370e6a31f98803e8ca6858a5562f47afeeaa157e
Signed-off-by: default avatarShubhraprakash Das <sadas@codeaurora.org>
parent 5629bf35
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -2793,16 +2793,17 @@ kgsl_get_unmapped_area(struct file *file, unsigned long addr,
			ret = ALIGN(ret, (1 << align));

		/*make sure there isn't a GPU only mapping at this address */
		if (kgsl_sharedmem_region_empty(private, ret, len))
		if (kgsl_sharedmem_region_empty(private, ret, orig_len))
			break;

		trace_kgsl_mem_unmapped_area_collision(entry, addr, len, ret);
		trace_kgsl_mem_unmapped_area_collision(entry, addr, orig_len,
							ret);

		/*
		 * If we collided, bump the hint address so that
		 * get_umapped_area knows to look somewhere else.
		 */
		addr = (addr == 0) ? ret + len : addr + len;
		addr = (addr == 0) ? ret + orig_len : addr + orig_len;

		/*
		 * The addr hint can be set by userspace to be near