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: Prabhakar X-Patchwork-Id: 2448941 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 21F07DF230 for ; Tue, 16 Apr 2013 10:55:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752876Ab3DPKy6 (ORCPT ); Tue, 16 Apr 2013 06:54:58 -0400 Received: from mail-da0-f46.google.com ([209.85.210.46]:45871 "EHLO mail-da0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751493Ab3DPKy5 (ORCPT ); Tue, 16 Apr 2013 06:54:57 -0400 Received: by mail-da0-f46.google.com with SMTP id y19so199373dan.19 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 Cc: Mauro Carvalho Chehab , DLOS , LKML , "Lad, Prabhakar" , Laurent Pinchart , Hans Verkuil 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 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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;