gpu: nvgpu: Carveout support for the page allocator

Implement carveout support by just calling through to the buddy
allocator's carveout support.

Jira DNVGPU-84

Change-Id: I1940873394a4cbff0152f1b6c9c4fd659e0076e1
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: http://git-master/r/1203392
(cherry picked from commit 499ee0407bf525e161a14cfb8bbbc101ac934329)
Reviewed-on: http://git-master/r/1223454
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
This commit is contained in:
Alex Waterman
2016-08-16 17:10:31 -07:00
committed by mobile promotions
parent d16415ac26
commit aa14efa2b4

View File

@@ -57,6 +57,22 @@ static u64 gk20a_page_alloc_end(struct gk20a_allocator *a)
return gk20a_alloc_end(&va->source_allocator);
}
static int gk20a_page_reserve_co(struct gk20a_allocator *a,
struct gk20a_alloc_carveout *co)
{
struct gk20a_page_allocator *va = a->priv;
return gk20a_alloc_reserve_carveout(&va->source_allocator, co);
}
static void gk20a_page_release_co(struct gk20a_allocator *a,
struct gk20a_alloc_carveout *co)
{
struct gk20a_page_allocator *va = a->priv;
gk20a_alloc_release_carveout(&va->source_allocator, co);
}
static int __insert_page_alloc(struct gk20a_page_allocator *a,
struct gk20a_page_alloc *alloc)
{
@@ -469,6 +485,9 @@ static const struct gk20a_allocator_ops page_ops = {
.alloc_fixed = gk20a_page_alloc_fixed,
.free_fixed = gk20a_page_free_fixed,
.reserve_carveout = gk20a_page_reserve_co,
.release_carveout = gk20a_page_release_co,
.base = gk20a_page_alloc_base,
.length = gk20a_page_alloc_length,
.end = gk20a_page_alloc_end,