gpu: nvgpu: Add a macro of totalram_size_in_mb

There are two (would be more) places calculating the ram size in MB from
page numbers, so this patch just simply adds a macro for simplification.

Bug 2327574
Bug 2284925

Change-Id: Ie5dc387d547e1b8ce98946f0637dc17a6897e5a6
Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1810333
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Nicolin Chen
2018-08-30 14:34:52 -07:00
committed by mobile promotions
parent 471be33718
commit bd47d00ce7
3 changed files with 4 additions and 4 deletions

View File

@@ -98,8 +98,7 @@ static void nvgpu_init_gr_vars(struct gk20a *g)
gk20a_init_gr(g);
nvgpu_log_info(g, "total ram pages : %lu", totalram_pages);
g->gr.max_comptag_mem = totalram_pages
>> (10 - (PAGE_SHIFT - 10));
g->gr.max_comptag_mem = totalram_size_in_mb;
/* Deduct the part taken by the running system */
if (platform->comptag_mem_deduct &&