From patchwork Tue Apr 16 10:51:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 2448951 Return-Path: X-Original-To: patchwork-davinci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by patchwork1.kernel.org (Postfix) with ESMTP id B81B53FD8C for ; Tue, 16 Apr 2013 10:55:50 +0000 (UTC) Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id r3GApowP004513; Tue, 16 Apr 2013 05:51:50 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id r3GApoa9011177; Tue, 16 Apr 2013 05:51:50 -0500 Received: from dlelxv24.itg.ti.com (172.17.1.199) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.2.342.3; Tue, 16 Apr 2013 05:51:49 -0500 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dlelxv24.itg.ti.com (8.13.8/8.13.8) with ESMTP id r3GApnu8007588; Tue, 16 Apr 2013 05:51:50 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 592A880627; Tue, 16 Apr 2013 05:51:49 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp53.itg.ti.com (dflp53.itg.ti.com [128.247.5.6]) by linux.omap.com (Postfix) with ESMTP id E7F9B80626 for ; Tue, 16 Apr 2013 05:51:47 -0500 (CDT) Received: from medina.ext.ti.com (medina.ext.ti.com [192.91.81.31]) by dflp53.itg.ti.com (8.13.8/8.13.8) with ESMTP id r3GAplf3011069 for ; Tue, 16 Apr 2013 05:51:47 -0500 (CDT) Received: from mail6.bemta7.messagelabs.com (mail6.bemta7.messagelabs.com [216.82.255.55]) by medina.ext.ti.com (8.13.7/8.13.7) with ESMTP id r3GAplwV009557 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 16 Apr 2013 05:51:47 -0500 Received: from [216.82.253.163:34229] by server-3.bemta-7.messagelabs.com id 88/90-12019-34D2D615; Tue, 16 Apr 2013 10:51:47 +0000 X-Env-Sender: prabhakar.csengg@gmail.com X-Msg-Ref: server-13.tower-166.messagelabs.com!1366109505!12292059!1 X-Originating-IP: [209.85.220.48] X-SpamReason: No, hits=0.0 required=7.0 tests=ML_RADAR_SPEW_LINKS_14, spamassassin: X-StarScan-Received: X-StarScan-Version: 6.8.6.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 10728 invoked from network); 16 Apr 2013 10:51:45 -0000 Received: from mail-pa0-f48.google.com (HELO mail-pa0-f48.google.com) (209.85.220.48) by server-13.tower-166.messagelabs.com with RC4-SHA encrypted SMTP; 16 Apr 2013 10:51:45 -0000 Received: by mail-pa0-f48.google.com with SMTP id lj1so279406pab.21 for ; Tue, 16 Apr 2013 03:51:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=fFufT7dc6Eai7hba8JQSFUFexuJaAcrejjILpj1sVRA=; b=hpUMhIN32Hic2OdKWV0GqlTK//+aZ+3IWpZYVvYNO6J2r7VSoHYmlj4EGk8tUmBf/X 9dJxinuSTYrkKwKeyrfVNknXFI12C+qTt7UqgFk4GiL/ghjw+Ar2vH7leBdpWDtJiHSu 3bXDGecgSn+aGntFbzULWNCYy1S2QfhmIMS/MTSqn7AbjXM4PbocKnQZ3+huIg8qbEK1 SerjqWybFPGwNaYfx6b3/k9VGLwq1fAna8VNbrNNf0Lk2BlH4FQ9PNV9GEM8cef/bmyz 3wWC4V0ysJGzQDiHTk+PBtAAi3XvGOkhsSUepLxEenmnexTX532t5RyG2VJs7p2WnAma /76w== X-Received: by 10.66.9.7 with SMTP id v7mr2948245paa.216.1366109504615; Tue, 16 Apr 2013 03:51:44 -0700 (PDT) Received: from localhost.localdomain ([59.98.242.34]) by mx.google.com with ESMTPS id j13sm2200516pat.17.2013.04.16.03.51.40 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 16 Apr 2013 03:51:43 -0700 (PDT) From: Prabhakar lad To: LMML Subject: [PATCH] media: davinci: vpif: allign the buffers size to page page size boundary Date: Tue, 16 Apr 2013 16:21:33 +0530 Message-ID: <1366109493-27874-1-git-send-email-prabhakar.csengg@gmail.com> X-Mailer: git-send-email 1.7.4.1 CC: DLOS , Mauro Carvalho Chehab , LKML , Hans Verkuil , Laurent Pinchart X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com From: Lad, Prabhakar with recent commit with id 068a0df76023926af958a336a78bef60468d2033 which adds add length check for mmap, the application were failing to mmap the buffers. This patch aligns the the buffer size to page size boundary for both capture and display driver so the it pass the check. Signed-off-by: Lad, Prabhakar Cc: Laurent Pinchart Cc: Hans Verkuil Cc: Mauro Carvalho Chehab --- drivers/media/platform/davinci/vpif_capture.c | 1 + drivers/media/platform/davinci/vpif_display.c | 1 + 2 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c index 5f98df1..25981d6 100644 --- a/drivers/media/platform/davinci/vpif_capture.c +++ b/drivers/media/platform/davinci/vpif_capture.c @@ -183,6 +183,7 @@ static int vpif_buffer_queue_setup(struct vb2_queue *vq, *nbuffers = config_params.min_numbuffers; *nplanes = 1; + size = PAGE_ALIGN(size); sizes[0] = size; alloc_ctxs[0] = common->alloc_ctx; diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c index 1b3fb5c..3414715 100644 --- a/drivers/media/platform/davinci/vpif_display.c +++ b/drivers/media/platform/davinci/vpif_display.c @@ -162,6 +162,7 @@ static int vpif_buffer_queue_setup(struct vb2_queue *vq, *nbuffers = config_params.min_numbuffers; *nplanes = 1; + size = PAGE_ALIGN(size); sizes[0] = size; alloc_ctxs[0] = common->alloc_ctx; return 0;