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

@@ -439,8 +439,7 @@ int vgpu_probe(struct platform_device *pdev)
gk20a_init_gr(gk20a);
nvgpu_log_info(gk20a, "total ram pages : %lu", totalram_pages);
gk20a->gr.max_comptag_mem = totalram_pages
>> (10 - (PAGE_SHIFT - 10));
gk20a->gr.max_comptag_mem = totalram_size_in_mb;
nvgpu_ref_init(&gk20a->refcount);