From patchwork Sun Dec 24 11:43:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jasmin J." X-Patchwork-Id: 10131937 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 621DE6037D for ; Sun, 24 Dec 2017 10:43:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6E4C428D6B for ; Sun, 24 Dec 2017 10:43:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6230B28E46; Sun, 24 Dec 2017 10:43:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_WEB autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7561228D6B for ; Sun, 24 Dec 2017 10:43:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751550AbdLXKnY (ORCPT ); Sun, 24 Dec 2017 05:43:24 -0500 Received: from mail.anw.at ([195.234.101.228]:42253 "EHLO mail.anw.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751323AbdLXKnY (ORCPT ); Sun, 24 Dec 2017 05:43:24 -0500 Received: from localhost.localdomain (node-19ev.pool-180-180.dynamic.totbb.net [180.180.229.231]) by mail.anw.at (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id vBOAhJcB012686; Sun, 24 Dec 2017 11:43:20 +0100 From: "Jasmin J." To: linux-media@vger.kernel.org Cc: hverkuil@xs4all.nl, d.scheller@gmx.net, jasmin@anw.at Subject: [PATCH] build: Added missing get_user_pages_longterm Date: Sun, 24 Dec 2017 11:43:03 +0000 Message-Id: <1514115783-12306-1-git-send-email-jasmin@anw.at> X-Mailer: git-send-email 2.7.4 X-Antivirus: checked in 0.017sec at mail.anw.at ([195.234.102.72]) by smf-clamd v1.2.1 - http://smfs.sf.net/ Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jasmin Jessich Also fixed v4.8_user_pages_flag.patch. Signed-off-by: Jasmin Jessich --- backports/v4.8_user_pages_flag.patch | 5 +++-- v4l/compat.h | 13 +++++++++++++ v4l/scripts/make_config_compat.pl | 1 + 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/backports/v4.8_user_pages_flag.patch b/backports/v4.8_user_pages_flag.patch index 82ecea2..7216626 100644 --- a/backports/v4.8_user_pages_flag.patch +++ b/backports/v4.8_user_pages_flag.patch @@ -33,7 +33,7 @@ index 44936d6..a61f632 100644 if (y_pages != y_dma.page_count || uv_pages != uv_dma.page_count) { diff --git a/drivers/media/v4l2-core/videobuf-dma-sg.c b/drivers/media/v4l2-core/videobuf-dma-sg.c -index 1db0af6..f300f06 100644 +index f412429..323ae3a 100644 --- a/drivers/media/v4l2-core/videobuf-dma-sg.c +++ b/drivers/media/v4l2-core/videobuf-dma-sg.c @@ -156,7 +156,6 @@ static int videobuf_dma_init_user_locked(struct videobuf_dmabuf *dma, @@ -54,8 +54,9 @@ index 1db0af6..f300f06 100644 dprintk(1, "init user [0x%lx+0x%lx => %d pages]\n", data, size, dma->nr_pages); - err = get_user_pages(data & PAGE_MASK, dma->nr_pages, +- err = get_user_pages_longterm(data & PAGE_MASK, dma->nr_pages, - flags, dma->pages, NULL); ++ err = get_user_pages(data & PAGE_MASK, dma->nr_pages, + rw == READ, 1, /* force */ + dma->pages, NULL); diff --git a/v4l/compat.h b/v4l/compat.h index c50e74d..c5680c3 100644 --- a/v4l/compat.h +++ b/v4l/compat.h @@ -2301,4 +2301,17 @@ static inline int usb_urb_ep_type_check(void *urb) } #endif +/* prototype of get_user_pages changed in Kernel 4.6. For older Kernels + * this will not compile */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0) +#ifdef NEED_GET_USER_PAGES_LONGTERM +static inline long get_user_pages_longterm(unsigned long start, + unsigned long nr_pages, unsigned int gup_flags, + struct page **pages, struct vm_area_struct **vmas) +{ + return get_user_pages(start, nr_pages, gup_flags, pages, vmas); +} +#endif +#endif + #endif /* _COMPAT_H */ diff --git a/v4l/scripts/make_config_compat.pl b/v4l/scripts/make_config_compat.pl index 9e2055a..5be868a 100644 --- a/v4l/scripts/make_config_compat.pl +++ b/v4l/scripts/make_config_compat.pl @@ -715,6 +715,7 @@ sub check_other_dependencies() check_files_for_func("time64_to_tm", "NEED_TIME64_TO_TM", "include/linux/time.h"); check_files_for_func("READ_ONCE", "NEED_READ_ONCE", "include/linux/compiler.h"); check_files_for_func("usb_urb_ep_type_check", "NEED_USB_EP_CHECK", "include/linux/usb.h"); + check_files_for_func("get_user_pages_longterm", "NEED_GET_USER_PAGES_LONGTERM", "include/linux/mm.h"); # For tests for uapi-dependent logic check_files_for_func_uapi("usb_endpoint_maxp", "NEED_USB_ENDPOINT_MAXP", "usb/ch9.h");