MGS-2664-2 [#imx-403] fix gpu build failure with get_user_pages
authorXianzhong <xianzhong.li@nxp.com>
Thu, 16 Feb 2017 08:03:48 +0000 (16:03 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:10:45 +0000 (15:10 -0500)
get_user_pages function has interface change in 4.9 kernel,
update the gpu driver to fix the build problem.

Date: Feb 16, 2017
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
drivers/mxc/gpu-viv/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_user_memory.c

index f25f3b8..71e2fb5 100644 (file)
@@ -175,12 +175,23 @@ _Import(
         /* Get the user pages. */
         down_read(&current->mm->mmap_sem);
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
         result = get_user_pages(memory & PAGE_MASK,
                 pageCount,
                 FOLL_WRITE,
                 pages,
                 gcvNULL
                 );
+#else
+        result = get_user_pages(current,
+                current->mm,
+                memory & PAGE_MASK,
+                pageCount,
+                FOLL_WRITE,
+                pages,
+                gcvNULL
+                );
+#endif
 
         up_read(&current->mm->mmap_sem);