diff options
author | Harshdeep Dhatt <hdhatt@codeaurora.org> | 2016-05-11 09:47:08 -0600 |
---|---|---|
committer | Carter Cooper <ccooper@codeaurora.org> | 2016-08-03 10:34:03 -0600 |
commit | 3dd8da5917d63f88e4b0ba6f2ab1e56b0177f66f (patch) | |
tree | ced098c06b894523c1e595a2755cfa981f0fcd64 /drivers/gpu/msm/kgsl_pool.c | |
parent | 8e3020fadb2a19eac5557b91f95353e0ab87356b (diff) |
msm: kgsl: Add array of page pointers to memdesc
This is done to improve the kgsl vmfault routine. Currently,
it traverses the sglist to find the faulted page, which takes
linear time. By having an array of all the page pointers,
this operation will be completed in constant time.
Also, allocate sgt only for mapping this memory to the GPU.
Since this optimization is not needed for secure/global or
imported memory, we will not keep this array but keep
the sgt instead.
CRs-Fixed: 1006012
Change-Id: I221fce9082da0bdd59842455221b896a33a6ce42
Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org>
Diffstat (limited to 'drivers/gpu/msm/kgsl_pool.c')
-rw-r--r-- | drivers/gpu/msm/kgsl_pool.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/gpu/msm/kgsl_pool.c b/drivers/gpu/msm/kgsl_pool.c index 7fb3b37ac191..7967b19779db 100644 --- a/drivers/gpu/msm/kgsl_pool.c +++ b/drivers/gpu/msm/kgsl_pool.c @@ -263,6 +263,31 @@ void kgsl_pool_free_sgt(struct sg_table *sgt) } } +/** + * kgsl_pool_free_pages() - Free pages in the pages array + * @pages: pointer of the pages array + * + * Free the pages by collapsing any physical adjacent pages. + * Pages are added back to the pool, if pool has sufficient space + * otherwise they are given back to system. + */ +void kgsl_pool_free_pages(struct page **pages, unsigned int pcount) +{ + int i; + + if (pages == NULL || pcount == 0) + return; + + for (i = 0; i < pcount;) { + /* + * Free each page or compound page group individually. + */ + struct page *p = pages[i]; + + i += 1 << compound_order(p); + kgsl_pool_free_page(p); + } +} static int kgsl_pool_idx_lookup(unsigned int order) { int i; |