summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/common')
-rw-r--r--drivers/gpu/nvgpu/common/linux/driver_common.c4
-rw-r--r--drivers/gpu/nvgpu/common/mm/vm.c9
2 files changed, 8 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/driver_common.c b/drivers/gpu/nvgpu/common/linux/driver_common.c
index 0d29223f..80e7698b 100644
--- a/drivers/gpu/nvgpu/common/linux/driver_common.c
+++ b/drivers/gpu/nvgpu/common/linux/driver_common.c
@@ -20,6 +20,7 @@
20#include <nvgpu/nvgpu_common.h> 20#include <nvgpu/nvgpu_common.h>
21#include <nvgpu/soc.h> 21#include <nvgpu/soc.h>
22#include <nvgpu/bug.h> 22#include <nvgpu/bug.h>
23#include <nvgpu/enabled.h>
23 24
24#include "gk20a/gk20a_scale.h" 25#include "gk20a/gk20a_scale.h"
25#include "gk20a/gk20a.h" 26#include "gk20a/gk20a.h"
@@ -133,6 +134,9 @@ static void nvgpu_init_mm_vars(struct gk20a *g)
133 g->mm.disable_bigpage = platform->disable_bigpage; 134 g->mm.disable_bigpage = platform->disable_bigpage;
134 g->mm.vidmem_is_vidmem = platform->vidmem_is_vidmem; 135 g->mm.vidmem_is_vidmem = platform->vidmem_is_vidmem;
135 136
137 __nvgpu_set_enabled(g, NVGPU_MM_UNIFY_ADDRESS_SPACES,
138 platform->unify_address_spaces);
139
136 nvgpu_mutex_init(&g->mm.tlb_lock); 140 nvgpu_mutex_init(&g->mm.tlb_lock);
137 nvgpu_mutex_init(&g->mm.priv_lock); 141 nvgpu_mutex_init(&g->mm.priv_lock);
138} 142}
diff --git a/drivers/gpu/nvgpu/common/mm/vm.c b/drivers/gpu/nvgpu/common/mm/vm.c
index bdc8554c..904284ec 100644
--- a/drivers/gpu/nvgpu/common/mm/vm.c
+++ b/drivers/gpu/nvgpu/common/mm/vm.c
@@ -22,10 +22,10 @@
22#include <nvgpu/list.h> 22#include <nvgpu/list.h>
23#include <nvgpu/rbtree.h> 23#include <nvgpu/rbtree.h>
24#include <nvgpu/semaphore.h> 24#include <nvgpu/semaphore.h>
25#include <nvgpu/enabled.h>
25 26
26#include "gk20a/gk20a.h" 27#include "gk20a/gk20a.h"
27#include "gk20a/mm_gk20a.h" 28#include "gk20a/mm_gk20a.h"
28#include "gk20a/platform_gk20a.h"
29 29
30int vm_aspace_id(struct vm_gk20a *vm) 30int vm_aspace_id(struct vm_gk20a *vm)
31{ 31{
@@ -255,7 +255,6 @@ int nvgpu_init_vm(struct mm_gk20a *mm,
255 u64 user_lp_vma_start, user_lp_vma_limit; 255 u64 user_lp_vma_start, user_lp_vma_limit;
256 u64 kernel_vma_start, kernel_vma_limit; 256 u64 kernel_vma_start, kernel_vma_limit;
257 struct gk20a *g = mm->g; 257 struct gk20a *g = mm->g;
258 struct gk20a_platform *p = gk20a_get_platform(g->dev);
259 258
260 if (WARN_ON(kernel_reserved + low_hole > aperture_size)) 259 if (WARN_ON(kernel_reserved + low_hole > aperture_size))
261 return -ENOMEM; 260 return -ENOMEM;
@@ -275,7 +274,7 @@ int nvgpu_init_vm(struct mm_gk20a *mm,
275 vm->vma[gmmu_page_size_small] = &vm->user; 274 vm->vma[gmmu_page_size_small] = &vm->user;
276 vm->vma[gmmu_page_size_big] = &vm->user; 275 vm->vma[gmmu_page_size_big] = &vm->user;
277 vm->vma[gmmu_page_size_kernel] = &vm->kernel; 276 vm->vma[gmmu_page_size_kernel] = &vm->kernel;
278 if (!p->unify_address_spaces) 277 if (!nvgpu_is_enabled(g, NVGPU_MM_UNIFY_ADDRESS_SPACES))
279 vm->vma[gmmu_page_size_big] = &vm->user_lp; 278 vm->vma[gmmu_page_size_big] = &vm->user_lp;
280 279
281 vm->va_start = low_hole; 280 vm->va_start = low_hole;
@@ -293,7 +292,7 @@ int nvgpu_init_vm(struct mm_gk20a *mm,
293 292
294 /* Setup vma limits. */ 293 /* Setup vma limits. */
295 if (kernel_reserved + low_hole < aperture_size) { 294 if (kernel_reserved + low_hole < aperture_size) {
296 if (p->unify_address_spaces) { 295 if (nvgpu_is_enabled(g, NVGPU_MM_UNIFY_ADDRESS_SPACES)) {
297 user_vma_start = low_hole; 296 user_vma_start = low_hole;
298 user_vma_limit = vm->va_limit - kernel_reserved; 297 user_vma_limit = vm->va_limit - kernel_reserved;
299 user_lp_vma_start = user_vma_limit; 298 user_lp_vma_start = user_vma_limit;
@@ -346,7 +345,7 @@ int nvgpu_init_vm(struct mm_gk20a *mm,
346 * Determine if big pages are possible in this VM. If a split address 345 * Determine if big pages are possible in this VM. If a split address
347 * space is used then check the user_lp vma instead of the user vma. 346 * space is used then check the user_lp vma instead of the user vma.
348 */ 347 */
349 if (p->unify_address_spaces) 348 if (nvgpu_is_enabled(g, NVGPU_MM_UNIFY_ADDRESS_SPACES))
350 vm->big_pages = nvgpu_big_pages_possible(vm, user_vma_start, 349 vm->big_pages = nvgpu_big_pages_possible(vm, user_vma_start,
351 user_vma_limit - user_vma_start); 350 user_vma_limit - user_vma_start);
352 else 351 else