mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 10:34:43 +03:00
gpu: nvgpu: add mm gops to get default va size
Currently, default va aperture size, user size and kernel size are defined as fixed macros. However, max va bits can be chip specific. Add below mm gops API to obtain default aperture, user and/or kernel virtual memory size. void (*get_default_va_sizes)(u64 *aperture_size, u64 *user_size, u64 *kernel_size); JIRA NVGPU-5302 Change-Id: Ie0c60ca08ecff6613ce44184153bda066803d7d9 Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2414840 Reviewed-by: automaticguardword <automaticguardword@nvidia.com> Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com> Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: Gerrit_Virtual_Submit Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
Alex Waterman
parent
6be1d64a59
commit
673cd507a8
@@ -81,11 +81,13 @@ int nvgpu_perfbuf_init_vm(struct gk20a *g)
|
||||
struct mm_gk20a *mm = &g->mm;
|
||||
u32 big_page_size = g->ops.mm.gmmu.get_default_big_page_size();
|
||||
int err;
|
||||
u64 user_size, kernel_size;
|
||||
|
||||
g->ops.mm.get_default_va_sizes(NULL, &user_size, &kernel_size);
|
||||
|
||||
mm->perfbuf.vm = nvgpu_vm_init(g, big_page_size, SZ_4K,
|
||||
nvgpu_safe_sub_u64(NV_MM_DEFAULT_USER_SIZE, SZ_4K),
|
||||
NV_MM_DEFAULT_KERNEL_SIZE,
|
||||
false, false, false, "perfbuf");
|
||||
nvgpu_safe_sub_u64(user_size, SZ_4K),
|
||||
kernel_size, false, false, false, "perfbuf");
|
||||
if (mm->perfbuf.vm == NULL) {
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user