summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/mm
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2017-11-07 12:56:40 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2017-11-08 01:24:14 -0500
commit58dd20f86b3b9faef89b24f2b4ec6b62a183fe9d (patch)
treebd90f82d117597fe44b004861056e50c175f5700 /drivers/gpu/nvgpu/common/mm
parenta51219e526cca5fdee33faf25268662bdd9453cb (diff)
gpu: nvgpu: Introduce queries for big page sizes
Introduce query functions for default big page size and available big page sizes. Move initialization of GPU characteristics big page sizes to the GPU characteristics query function. JIRA NVGPU-259 Change-Id: Ie66cc2fbfcd88205593056f8d5010ac2539c8bc2 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1593685 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/mm')
-rw-r--r--drivers/gpu/nvgpu/common/mm/mm.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/common/mm/mm.c b/drivers/gpu/nvgpu/common/mm/mm.c
index 73af31c9..86dc46c5 100644
--- a/drivers/gpu/nvgpu/common/mm/mm.c
+++ b/drivers/gpu/nvgpu/common/mm/mm.c
@@ -423,3 +423,29 @@ int nvgpu_init_mm_support(struct gk20a *g)
423 423
424 return err; 424 return err;
425} 425}
426
427u32 nvgpu_mm_get_default_big_page_size(struct gk20a *g)
428{
429 u32 big_page_size;
430
431 big_page_size = g->ops.mm.get_default_big_page_size();
432
433 if (g->mm.disable_bigpage)
434 big_page_size = 0;
435
436 return big_page_size;
437}
438
439u32 nvgpu_mm_get_available_big_page_sizes(struct gk20a *g)
440{
441 u32 available_big_page_sizes = 0;
442
443 if (!g->mm.disable_bigpage) {
444 available_big_page_sizes =
445 g->ops.mm.get_default_big_page_size();
446 if (g->ops.mm.get_big_page_sizes)
447 available_big_page_sizes |= g->ops.mm.get_big_page_sizes();
448 }
449
450 return available_big_page_sizes;
451}