From patchwork Thu Apr 13 15:09:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 9679587 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 38B7E60386 for ; Thu, 13 Apr 2017 15:10:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2B70628663 for ; Thu, 13 Apr 2017 15:10:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2013528676; Thu, 13 Apr 2017 15:10:04 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B9A1828666 for ; Thu, 13 Apr 2017 15:10:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3DDE76E89B; Thu, 13 Apr 2017 15:10:02 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 038976E89B for ; Thu, 13 Apr 2017 15:10:00 +0000 (UTC) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Apr 2017 08:10:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,194,1488873600"; d="scan'208";a="248278341" Received: from paasikivi.fi.intel.com ([10.237.72.42]) by fmsmga004.fm.intel.com with ESMTP; 13 Apr 2017 08:09:57 -0700 Received: from nauris.fi.intel.com (nauris.localdomain [192.168.240.2]) by paasikivi.fi.intel.com (Postfix) with ESMTP id DD0A8200BE; Thu, 13 Apr 2017 18:09:56 +0300 (EEST) Received: by nauris.fi.intel.com (Postfix, from userid 1000) id E3371201A8; Thu, 13 Apr 2017 18:09:21 +0300 (EEST) From: Sakari Ailus To: linux-media@vger.kernel.org Subject: [RFC v3.1 05/14] vb2: Anticipate queue specific DMA attributes for USERPTR buffers Date: Thu, 13 Apr 2017 18:09:21 +0300 Message-Id: <1492096161-18018-1-git-send-email-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1492070239-21532-6-git-send-email-sakari.ailus@linux.intel.com> References: <1492070239-21532-6-git-send-email-sakari.ailus@linux.intel.com> Cc: daniel.vetter@ffwll.ch, dri-devel@lists.freedesktop.org, hverkuil@xs4all.nl, kyungmin.park@samsung.com, posciak@chromium.org, m.szyprowski@samsung.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The DMA attributes were available for the memop implementation for MMAP buffers but not for USERPTR buffers. Do the same for USERPTR. This patch makes no functional changes. Signed-off-by: Sakari Ailus --- since RFC v1: - Add missing q->dma_attrs argument to call_ptr_memop(vb, get_userptr... drivers/media/v4l2-core/videobuf2-core.c | 2 +- drivers/media/v4l2-core/videobuf2-dma-contig.c | 3 ++- drivers/media/v4l2-core/videobuf2-dma-sg.c | 3 ++- drivers/media/v4l2-core/videobuf2-vmalloc.c | 3 ++- include/media/videobuf2-core.h | 3 ++- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c index e866115..c659b64 100644 --- a/drivers/media/v4l2-core/videobuf2-core.c +++ b/drivers/media/v4l2-core/videobuf2-core.c @@ -1025,7 +1025,7 @@ static int __prepare_userptr(struct vb2_buffer *vb, const void *pb) mem_priv = call_ptr_memop(vb, get_userptr, q->alloc_devs[plane] ? : q->dev, planes[plane].m.userptr, - planes[plane].length, dma_dir); + planes[plane].length, dma_dir, q->dma_attrs); if (IS_ERR(mem_priv)) { dprintk(1, "failed acquiring userspace memory for plane %d\n", plane); diff --git a/drivers/media/v4l2-core/videobuf2-dma-contig.c b/drivers/media/v4l2-core/videobuf2-dma-contig.c index d29a07f..30082a4 100644 --- a/drivers/media/v4l2-core/videobuf2-dma-contig.c +++ b/drivers/media/v4l2-core/videobuf2-dma-contig.c @@ -475,7 +475,8 @@ static inline dma_addr_t vb2_dc_pfn_to_dma(struct device *dev, unsigned long pfn #endif static void *vb2_dc_get_userptr(struct device *dev, unsigned long vaddr, - unsigned long size, enum dma_data_direction dma_dir) + unsigned long size, enum dma_data_direction dma_dir, + unsigned long attrs) { struct vb2_dc_buf *buf; struct frame_vector *vec; diff --git a/drivers/media/v4l2-core/videobuf2-dma-sg.c b/drivers/media/v4l2-core/videobuf2-dma-sg.c index 29fde1a..102ddb2 100644 --- a/drivers/media/v4l2-core/videobuf2-dma-sg.c +++ b/drivers/media/v4l2-core/videobuf2-dma-sg.c @@ -220,7 +220,8 @@ static void vb2_dma_sg_finish(void *buf_priv) static void *vb2_dma_sg_get_userptr(struct device *dev, unsigned long vaddr, unsigned long size, - enum dma_data_direction dma_dir) + enum dma_data_direction dma_dir, + unsigned long dma_attrs) { struct vb2_dma_sg_buf *buf; struct sg_table *sgt; diff --git a/drivers/media/v4l2-core/videobuf2-vmalloc.c b/drivers/media/v4l2-core/videobuf2-vmalloc.c index f83253a..a4914fc 100644 --- a/drivers/media/v4l2-core/videobuf2-vmalloc.c +++ b/drivers/media/v4l2-core/videobuf2-vmalloc.c @@ -73,7 +73,8 @@ static void vb2_vmalloc_put(void *buf_priv) static void *vb2_vmalloc_get_userptr(struct device *dev, unsigned long vaddr, unsigned long size, - enum dma_data_direction dma_dir) + enum dma_data_direction dma_dir, + unsigned long dma_attrs) { struct vb2_vmalloc_buf *buf; struct frame_vector *vec; diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h index cb97c22..4172f6e 100644 --- a/include/media/videobuf2-core.h +++ b/include/media/videobuf2-core.h @@ -122,7 +122,8 @@ struct vb2_mem_ops { void *(*get_userptr)(struct device *dev, unsigned long vaddr, unsigned long size, - enum dma_data_direction dma_dir); + enum dma_data_direction dma_dir, + unsigned long dma_attrs); void (*put_userptr)(void *buf_priv); void (*prepare)(void *buf_priv);