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

Commit 1cb4185e authored by Deepak Kumar's avatar Deepak Kumar Committed by Gerrit - the friendly Code Review server
Browse files

msm: kgsl: Use alignment corresponding to max supported page size



As 1MB is the max page size supported by kgsl, use the alignment
corresponding to 1MB page while selecting the page size for a
memory request. This will make sure that higher order pages are
used if possible for a given memory size and will also improve
the usage of higher order kgsl memory pools and general performance.

Change-Id: Ib4a5885a2e2c27c4a9e3f1589ede8290f9edbc9a
Signed-off-by: default avatarDeepak Kumar <dkumar@codeaurora.org>
parent f0a4ec7d
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -716,6 +716,18 @@ kgsl_sharedmem_page_alloc_user(struct kgsl_memdesc *memdesc,

	align = (memdesc->flags & KGSL_MEMALIGN_MASK) >> KGSL_MEMALIGN_SHIFT;

	/*
	 * As 1MB is the max supported page size, use the alignment
	 * corresponding to 1MB page to make sure higher order pages
	 * are used if possible for a given memory size. Also, we
	 * don't need to update alignment in memdesc flags in case
	 * higher order page is used, as memdesc flags represent the
	 * virtual alignment specified by the user which is anyways
	 * getting satisfied.
	 */
	if (align < ilog2(SZ_1M))
		align = ilog2(SZ_1M);

	page_size = kgsl_get_page_size(size, align);

	/*