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

Commit 8c542b45 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: kgsl: Directly return page size of the supported pool"

parents e65c60de ce925b21
Loading
Loading
Loading
Loading
+12 −1
Original line number Original line Diff line number Diff line
@@ -280,6 +280,17 @@ static int kgsl_pool_idx_lookup(unsigned int order)
	return -ENOMEM;
	return -ENOMEM;
}
}


static int kgsl_pool_get_retry_order(unsigned int order)
{
	int i;

	for (i = kgsl_num_pools-1; i > 0; i--)
		if (order >= kgsl_pools[i].pool_order)
			return kgsl_pools[i].pool_order;

	return 0;
}

/**
/**
 * kgsl_pool_alloc_page() - Allocate a page of requested size
 * kgsl_pool_alloc_page() - Allocate a page of requested size
 * @page_size: Size of the page to be allocated
 * @page_size: Size of the page to be allocated
@@ -326,7 +337,7 @@ int kgsl_pool_alloc_page(int *page_size, struct page **pages,
	if (pool == NULL) {
	if (pool == NULL) {
		/* Retry with lower order pages */
		/* Retry with lower order pages */
		if (order > 0) {
		if (order > 0) {
			size = PAGE_SIZE << --order;
			size = PAGE_SIZE << kgsl_pool_get_retry_order(order);
			goto eagain;
			goto eagain;
		} else {
		} else {
			/*
			/*