linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] media: davinci: vpif: align the buffers size to page page size boundary
@ 2013-04-16 10:54 Prabhakar lad
  2013-04-16 10:56 ` Prabhakar Lad
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Prabhakar lad @ 2013-04-16 10:54 UTC (permalink / raw)
  To: LMML
  Cc: Mauro Carvalho Chehab, DLOS, LKML, Lad, Prabhakar,
	Laurent Pinchart, Hans Verkuil

From: Lad, Prabhakar <prabhakar.csengg@gmail.com>

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 <prabhakar.csengg@gmail.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
---
 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;
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-04-18 14:18 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-16 10:54 [PATCH v2] media: davinci: vpif: align the buffers size to page page size boundary Prabhakar lad
2013-04-16 10:56 ` Prabhakar Lad
2013-04-16 11:18 ` Laurent Pinchart
2013-04-18  4:47   ` Prabhakar Lad
2013-04-18 11:21     ` Mauro Carvalho Chehab
2013-04-18 11:35       ` Mauro Carvalho Chehab
2013-04-18 13:22         ` Laurent Pinchart
2013-04-18 14:08           ` Mauro Carvalho Chehab
2013-04-18 14:18             ` Laurent Pinchart
2013-04-16 11:39 ` Sergei Shtylyov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).