From df1ff34809756aba22957e19cb39c205f271f856 Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Wed, 22 Jun 2016 15:53:35 -0700 Subject: gpu: nvgpu: Compute reasonable max order for allocator Compute a reasonable maximum order for buddy allocators that are created with a max_order of 0. Previously the max_order was just left as 0. Change-Id: I5c2f878fcd390610a4c02ac65189138ec7db30c8 Signed-off-by: Alex Waterman Reviewed-on: http://git-master/r/1169763 Reviewed-by: Terje Bergstrom Tested-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/gk20a_allocator.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_allocator.c b/drivers/gpu/nvgpu/gk20a/gk20a_allocator.c index 2b351492..fd721709 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a_allocator.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a_allocator.c @@ -90,6 +90,11 @@ static void balloc_compute_max_order(struct gk20a_allocator *a) { u64 true_max_order = ilog2(a->blks); + if (a->max_order == 0) { + a->max_order = true_max_order; + return; + } + if (a->max_order > true_max_order) a->max_order = true_max_order; if (a->max_order > GPU_BALLOC_MAX_ORDER) -- cgit v1.2.2