gpu: nvgpu: API updates for newer kernel

access_ok, totalram_pages and zap_vma_ptes are updated in the newer
kernel. Update accordingly.

Bug 2834141

Change-Id: I3097308740f1af3092ac0a5ac2f0146db8148e12
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2294097
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Debarshi Dutta <ddutta@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Sagar Kamble
2020-02-13 15:46:21 +05:30
committed by Alex Waterman
parent d0d8ef79d1
commit 6c4a0bb6cd
4 changed files with 25 additions and 2 deletions

View File

@@ -21,6 +21,7 @@
#include <linux/iommu.h>
#include <linux/hashtable.h>
#include <linux/notifier.h>
#include <linux/version.h>
#include <nvgpu/gk20a.h>
@@ -188,6 +189,10 @@ static inline struct device *dev_from_gk20a(struct gk20a *g)
#define INTERFACE_NAME "nvhost%s-gpu"
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)
#define totalram_size_in_mb (totalram_pages() >> (10 - (PAGE_SHIFT - 10)))
#else
#define totalram_size_in_mb (totalram_pages >> (10 - (PAGE_SHIFT - 10)))
#endif
#endif