gpu: nvgpu: fix allocator_init() calls

Change for new VA space allocator is being reverted with
http://git-master/r/#/c/749291/ but only for Kernel3.18

In Kernel3.10, we support the new VA allocator

Since we support both the kernel versions as of now,
use a KERNEL_VERSION based mechanism to select
appropriate call

Define new macro NVGPU_USE_NEW_ALLOCATOR for Kernel3.10
where we want to use new allocator

Bug 200106514

Change-Id: I9af26d555278c40e03fe82b0912961a862c8bf55
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/751353
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
This commit is contained in:
Deepak Nibade
2015-06-02 16:13:01 +05:30
parent 65ef5bc238
commit 021748b782
2 changed files with 15 additions and 0 deletions

View File

@@ -15,6 +15,7 @@
#include <linux/types.h>
#include "gp10b/mm_gp10b.h"
#include "gk20a/gk20a.h"
#include "gk20a/gk20a_allocator.h"
#include "gm20b/ltc_gm20b.h"
@@ -112,8 +113,14 @@ static int gp10b_ltc_init_comptags(struct gk20a *g, struct gr_gk20a *gr)
if (err)
return err;
#if NVGPU_USE_NEW_ALLOCATOR
__gk20a_allocator_init(&gr->comp_tags, NULL, "comptag",
1, max_comptag_lines - 1, 1, 10, 0);
#else
gk20a_allocator_init(&gr->comp_tags, "comptag",
1, /* start */
max_comptag_lines - 1); /* length*/
#endif
gr->comptags_per_cacheline = comptags_per_cacheline;
gr->slices_per_ltc = slices_per_ltc;

View File

@@ -14,8 +14,16 @@
#ifndef MM_GP10B_H
#define MM_GP10B_H
#include <linux/version.h>
#define NVGPU_MM_GET_IO_COHERENCE_BIT 35
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0)
#define NVGPU_USE_NEW_ALLOCATOR 1
#else
#define NVGPU_USE_NEW_ALLOCATOR 0
#endif
struct gpu_ops;
void gp10b_init_mm(struct gpu_ops *gops);