From patchwork Wed Oct 10 14:46:42 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Stanislawski X-Patchwork-Id: 12132 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id C173423EFB for ; Wed, 10 Oct 2012 15:02:44 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 334E1A190C8 for ; Wed, 10 Oct 2012 15:02:44 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so1025394iej.11 for ; Wed, 10 Oct 2012 08:02:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:x-auditid :from:to:date:message-id:x-mailer:in-reply-to:references :x-brightmail-tracker:cc:subject:x-beenthere:x-mailman-version :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:sender:errors-to:x-gm-message-state; bh=RYIGSpJ6mBo0j+mGBxLqNtHYWJTeZMjQXUSN5ilylnE=; b=NhiihQLyMimUzqD0DwS8MKLYdBnIubEZKZukrOTztRKGn3d7eHKFumdeGqVGtx5xbe l6IMzuXhOIi7OYX0DxQFb/ApwR3e7hyq7KeeptwkqD/0GjjMTxWA7AHePWCcLwQFWy5q RpBqkVJ+HrtouFPvYidppx/HAUY6lMt3mcBjIYXhSVKfXPsWkIemhM6vgd2hv9oPVEFB hLWHxtwKrCz6mW6pqncSOtjUkPc+VCPQl4gmpdFZVFbCn38a1HJtE0HbkbjNtM80RoZ0 wGsWD2n8Sw9B1TU/hIjz5mv+KlSBoCeFcQ36bxM87fNHK30vmjYLmNLeVAaEtqgOqP86 4bmA== Received: by 10.50.152.137 with SMTP id uy9mr5474595igb.62.1349881363639; Wed, 10 Oct 2012 08:02:43 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp237458igt; Wed, 10 Oct 2012 08:02:42 -0700 (PDT) Received: by 10.152.105.68 with SMTP id gk4mr10252486lab.48.1349881362116; Wed, 10 Oct 2012 08:02:42 -0700 (PDT) Received: from mombin.canonical.com (mombin.canonical.com. [91.189.95.16]) by mx.google.com with ESMTP id tp6si1228168lab.3.2012.10.10.08.02.40; Wed, 10 Oct 2012 08:02:42 -0700 (PDT) Received-SPF: neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) client-ip=91.189.95.16; Authentication-Results: mx.google.com; spf=neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) smtp.mail=linaro-mm-sig-bounces@lists.linaro.org Received: from localhost ([127.0.0.1] helo=mombin.canonical.com) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TLxnz-0002zZ-Il; Wed, 10 Oct 2012 15:02:39 +0000 Received: from mailout2.samsung.com ([203.254.224.25]) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TLxnx-0002zQ-Mk for linaro-mm-sig@lists.linaro.org; Wed, 10 Oct 2012 15:02:38 +0000 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MBO00KJ7N4BQ870@mailout2.samsung.com> for linaro-mm-sig@lists.linaro.org; Thu, 11 Oct 2012 00:02:36 +0900 (KST) X-AuditID: cbfee61a-b7f726d000000ec7-8e-50758e0bf093 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id B6.2B.03783.B0E85705; Thu, 11 Oct 2012 00:02:36 +0900 (KST) Received: from mcdsrvbld02.digital.local ([106.116.37.23]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MBO002YDME0EC70@mmp1.samsung.com> for linaro-mm-sig@lists.linaro.org; Thu, 11 Oct 2012 00:02:35 +0900 (KST) From: Tomasz Stanislawski To: linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org Date: Wed, 10 Oct 2012 16:46:42 +0200 Message-id: <1349880405-26049-24-git-send-email-t.stanislaws@samsung.com> X-Mailer: git-send-email 1.7.10 In-reply-to: <1349880405-26049-1-git-send-email-t.stanislaws@samsung.com> References: <1349880405-26049-1-git-send-email-t.stanislaws@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrCJMWRmVeSWpSXmKPExsVy+t9jAV2evtIAg4NfWSy+XHnI5MDocfvf Y+YAxigum5TUnMyy1CJ9uwSujL9Ns9gLlrJXtJ9dyNrAOIuti5GTQ0LAROLZzwssELaYxIV7 64HiXBxCAosYJXpv9zBDOGuZJKY9PwxWxQbUcWzJZ0YQW0TAQeL03VlgRcwCa5glXqy8ATZW WMBXoufJerAiFgFViTvNa9lBbF4BT4kHb6YyQqyTl3h6vw+snhMofmHedGYQW0jAQ+L/+s1M Exh5FzAyrGIUTS1ILihOSs811CtOzC0uzUvXS87P3cQI9vszqR2MKxssDjEKcDAq8fBmRJUE CLEmlhVX5h5ilOBgVhLhNfUpDRDiTUmsrEotyo8vKs1JLT7EKM3BoiTO2+yREiAkkJ5Ykpqd mlqQWgSTZeLglGpgnJiwZOYK5mL9ZvVbZhv9Dm3l+uj0wfufWdGU9T4sclKLJl92FuC+m78w 5KbpqfKl3efF98p3K+7les79ofn8m8iA4j13/j9V/HHfhzNexKh7WnheR0TtE/UVr2cq2180 2nzRrkHUxPfK2zsrPl2d2trMveDrlY1bOzdEvwh7Nd/gR8oP09SDc5VYijMSDbWYi4oTAW48 B2b3AQAA Cc: k.debski@samsung.com, s.nawrocki@samsung.com, pawel@osciak.com, sumit.semwal@ti.com, mchehab@redhat.com, robdclark@gmail.com, linaro-mm-sig@lists.linaro.org, kyungmin.park@samsung.com, laurent.pinchart@ideasonboard.com, airlied@redhat.com, remi@remlab.net Subject: [Linaro-mm-sig] [PATCHv10 23/26] v4l: vb2-dma-contig: align buffer size to PAGE_SIZE X-BeenThere: linaro-mm-sig@lists.linaro.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Unified memory management interest group." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linaro-mm-sig-bounces@lists.linaro.org Errors-To: linaro-mm-sig-bounces@lists.linaro.org X-Gm-Message-State: ALoCoQmVoBjapGU/6fG/9lg/GiBKbhRD2yikmCkmmrzozLi3xuJr4WgpaBDqLcmf3zGXpHIlS0G9 Most operations on DMA and DMABUF framework need page aligned buffers. This fix guarantees this requirement for vb2-dma-contig buffers. Signed-off-by: Tomasz Stanislawski --- drivers/media/v4l2-core/videobuf2-dma-contig.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/media/v4l2-core/videobuf2-dma-contig.c b/drivers/media/v4l2-core/videobuf2-dma-contig.c index 571a919..002ee50 100644 --- a/drivers/media/v4l2-core/videobuf2-dma-contig.c +++ b/drivers/media/v4l2-core/videobuf2-dma-contig.c @@ -162,6 +162,9 @@ static void *vb2_dc_alloc(void *alloc_ctx, unsigned long size) if (!buf) return ERR_PTR(-ENOMEM); + /* align image size to PAGE_SIZE */ + size = PAGE_ALIGN(size); + buf->vaddr = dma_alloc_coherent(dev, size, &buf->dma_addr, GFP_KERNEL); if (!buf->vaddr) { dev_err(dev, "dma_alloc_coherent of size %ld failed\n", size);