From beeeb1786b69a9250dac5551103dbe7be2d9c60c Mon Sep 17 00:00:00 2001 From: Nicolas Benech Date: Fri, 29 Mar 2019 11:24:57 -0400 Subject: [PATCH] gpu: nvgpu: unit: use verbose_lvl in gmmu tests Using the new verbose_lvl function, the gmmu tests can now enable the proper log mask for debugging purposes. JIRA NVGPU-2975 Change-Id: I666f14f1e49f1d1e5c213a96eb745a11ed44ba33 Signed-off-by: Nicolas Benech Reviewed-on: https://git-master.nvidia.com/r/2085059 Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-misra GVS: Gerrit_Virtual_Submit Reviewed-by: Philip Elcan Reviewed-by: Alex Waterman Reviewed-by: mobile promotions Tested-by: mobile promotions --- userspace/units/mm/gmmu/page_table/page_table.c | 3 ++- userspace/units/mm/gmmu/pd_cache/pd_cache.c | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/userspace/units/mm/gmmu/page_table/page_table.c b/userspace/units/mm/gmmu/page_table/page_table.c index fc2e1bd28..d889b70d3 100644 --- a/userspace/units/mm/gmmu/page_table/page_table.c +++ b/userspace/units/mm/gmmu/page_table/page_table.c @@ -21,6 +21,7 @@ */ #include +#include #include #include @@ -344,7 +345,7 @@ static int init_mm(struct unit_module *m, struct gk20a *g) static int test_nvgpu_gmmu_init(struct unit_module *m, struct gk20a *g, void *args) { - u64 debug_level = (u64) args; + int debug_level = verbose_lvl(m); g->log_mask = 0; if (debug_level >= 1) { diff --git a/userspace/units/mm/gmmu/pd_cache/pd_cache.c b/userspace/units/mm/gmmu/pd_cache/pd_cache.c index d67de53d8..13d516af1 100644 --- a/userspace/units/mm/gmmu/pd_cache/pd_cache.c +++ b/userspace/units/mm/gmmu/pd_cache/pd_cache.c @@ -21,6 +21,7 @@ */ #include +#include #include #include @@ -1027,6 +1028,11 @@ static int test_pd_cache_env_init(struct unit_module *m, { nvgpu_set_enabled(g, NVGPU_MM_UNIFIED_MEMORY, true); + g->log_mask = 0; + if (verbose_lvl(m) >= 1) { + g->log_mask = gpu_dbg_pd_cache; + } + return UNIT_SUCCESS; }