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

Commit fff80f3c authored by Neeraja P's avatar Neeraja P
Browse files

msm: kgsl: Add additional pools of 256k and 128k



Adding additional pools for commonly used power of 2 sizes,
256k and 128k. This will allow higher order requests to be
satisfied with these pools instead of going to lower order
pools and improves the performance.

Change-Id: I448a2b169a281b3d77767ca5c5d3872fd83ac759
Signed-off-by: default avatarNeeraja P <neerp@codeaurora.org>
parent e9f29fe9
Loading
Loading
Loading
Loading
+7 −10
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ struct kgsl_page_pool {
	struct list_head page_list;
};

static struct kgsl_page_pool kgsl_pools[4];
static struct kgsl_page_pool kgsl_pools[6];
static int kgsl_num_pools;
static int kgsl_pool_max_pages;

@@ -308,15 +308,12 @@ static bool kgsl_pool_available(unsigned int page_size)

static int kgsl_get_page_size(size_t size, unsigned int align)
{
	if (align >= ilog2(SZ_1M) && size >= SZ_1M &&
		kgsl_pool_available(SZ_1M))
		return SZ_1M;
	else if (align >= ilog2(SZ_64K) && size >= SZ_64K &&
		kgsl_pool_available(SZ_64K))
		return SZ_64K;
	else if (align >= ilog2(SZ_8K) && size >= SZ_8K &&
		kgsl_pool_available(SZ_8K))
		return SZ_8K;
	size_t pool;

	for (pool = SZ_1M; pool > PAGE_SIZE; pool >>= 1)
		if ((align >= ilog2(pool)) && (size >= pool) &&
			kgsl_pool_available(pool))
			return pool;

	return PAGE_SIZE;
}