From patchwork Tue Apr 16 10:54:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 2448931 Return-Path: X-Original-To: patchwork-davinci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from bear.ext.ti.com (bear.ext.ti.com [192.94.94.41]) by patchwork1.kernel.org (Postfix) with ESMTP id D640F3FD8C for ; Tue, 16 Apr 2013 10:55:10 +0000 (UTC) Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id r3GAtAHv022240 for ; Tue, 16 Apr 2013 05:55:10 -0500 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id r3GAtAsR014544 for ; Tue, 16 Apr 2013 05:55:10 -0500 Received: from dlelxv23.itg.ti.com (172.17.1.198) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.2.342.3; Tue, 16 Apr 2013 05:55:09 -0500 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dlelxv23.itg.ti.com (8.13.8/8.13.8) with ESMTP id r3GAtAoC016202 for ; Tue, 16 Apr 2013 05:55:10 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id D87B58062B for ; Tue, 16 Apr 2013 05:55:09 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp52.itg.ti.com (dflp52.itg.ti.com [128.247.22.96]) by linux.omap.com (Postfix) with ESMTP id 82E2780626 for ; Tue, 16 Apr 2013 05:55:00 -0500 (CDT) Received: from red.ext.ti.com (red.ext.ti.com [192.94.93.37]) by dflp52.itg.ti.com (8.13.7/8.13.8) with ESMTP id r3GAt0ou022463 for ; Tue, 16 Apr 2013 05:55:00 -0500 (CDT) Received: from mail6.bemta7.messagelabs.com (mail6.bemta7.messagelabs.com [216.82.255.55]) by red.ext.ti.com (8.13.7/8.13.7) with ESMTP id r3GAswdE021279 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 16 Apr 2013 05:55:00 -0500 Received: from [216.82.253.67:56810] by server-13.bemta-7.messagelabs.com id DD/4D-22723-20E2D615; Tue, 16 Apr 2013 10:54:58 +0000 X-Env-Sender: prabhakar.csengg@gmail.com X-Msg-Ref: server-5.tower-158.messagelabs.com!1366109697!4336621!1 X-Originating-IP: [209.85.210.45] 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 10224 invoked from network); 16 Apr 2013 10:54:57 -0000 Received: from mail-da0-f45.google.com (HELO mail-da0-f45.google.com) (209.85.210.45) by server-5.tower-158.messagelabs.com with RC4-SHA encrypted SMTP; 16 Apr 2013 10:54:57 -0000 Received: by mail-da0-f45.google.com with SMTP id v40so197495dad.32 for ; Tue, 16 Apr 2013 03:54:57 -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=6K+mfsS1WERwNRl5ok82RfKNDDDuEY2yspfoOPRNNzY=; b=skKub+vj87pM6Le3JUrGMLbouCw59dsR8liC019dpIqT/LqmcDmgXbNDcCY+P68V6o p7qDfGMAnNgnnGptvMfXZm/PgdLpsNiqLOkr5pfSX7PzzyQGOs9gehaxM0Lyr2+n9d4R bddmfzXX8FgR8SVFZgSS83mNUNM6tUGkO0Gq2cMsfFOEsLOaFZS+/37fumuWHj7a6oUY CuBc2wx0PnMC1dHnzse5Yxll9KdqhVVx1FtkOYyvh3iP0e9J2vpCbMXMPE01+18oXI+W p+u+Z41zochxL+qD/PI2Ana/XL+olAdVk51CCdd5DYRXPPwJ3MbXJhxi2aNs6CcjU3dD aySw== X-Received: by 10.66.255.99 with SMTP id ap3mr3060247pad.102.1366109696981; Tue, 16 Apr 2013 03:54:56 -0700 (PDT) Received: from localhost.localdomain ([59.98.242.34]) by mx.google.com with ESMTPS id ak1sm1669597pbc.10.2013.04.16.03.54.52 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 16 Apr 2013 03:54:56 -0700 (PDT) From: Prabhakar lad To: LMML Subject: [PATCH v2] media: davinci: vpif: align the buffers size to page page size boundary Date: Tue, 16 Apr 2013 16:24:30 +0530 Message-ID: <1366109670-28030-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+patchwork-davinci=patchwork.kernel.org@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 --- Changes for v2: 1: Fixed a typo in commit message. 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;