All of lore.kernel.org
 help / color / mirror / Atom feed
From: <asheeshb@ti.com>
To: <linux-media@vger.kernel.org>
Cc: Asheesh Bhardwaj <asheesh@lab1.dmlab>
Subject: [PATCH 4/7] Patch for vpif capture driver to get the right size image for the MMAP buffers
Date: Wed, 19 May 2010 10:56:48 -0500	[thread overview]
Message-ID: <1274284611-13432-4-git-send-email-asheeshb@ti.com> (raw)
In-Reply-To: <1274284611-13432-3-git-send-email-asheeshb@ti.com>

From: Asheesh Bhardwaj <asheesh@lab1.dmlab>

---
 drivers/media/video/davinci/vpif_capture.c |   13 ++++---------
 1 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/media/video/davinci/vpif_capture.c b/drivers/media/video/davinci/vpif_capture.c
index 9ba015d..d18a378 100644
--- a/drivers/media/video/davinci/vpif_capture.c
+++ b/drivers/media/video/davinci/vpif_capture.c
@@ -142,7 +142,7 @@ static int vpif_buffer_prepare(struct videobuf_queue *q,
 	if (VIDEOBUF_NEEDS_INIT == vb->state) {
 		vb->width = common->width;
 		vb->height = common->height;
-		vb->size = vb->width * vb->height;
+		vb->size = common->fmt.fmt.pix.sizeimage;
 		vb->field = field;
 
 		ret = videobuf_iolock(q, vb, NULL);
@@ -469,10 +469,8 @@ static void vpif_calculate_offsets(struct channel_obj *ch)
 	} else
 		vid_ch->buf_field = common->fmt.fmt.pix.field;
 
-	if (V4L2_MEMORY_USERPTR == common->memory)
-		sizeimage = common->fmt.fmt.pix.sizeimage;
-	else
-		sizeimage = config_params.channel_bufsize[ch->channel_id];
+	/*sizeimage is same for both user and MMAP allocated buffers*/
+        sizeimage = common->fmt.fmt.pix.sizeimage;
 
 	hpitch = common->fmt.fmt.pix.bytesperline;
 	vpitch = sizeimage / (hpitch * 2);
@@ -630,10 +628,7 @@ static int vpif_check_format(struct channel_obj *ch,
 		goto exit;
 	}
 
-	if (V4L2_MEMORY_USERPTR == common->memory)
-		sizeimage = pixfmt->sizeimage;
-	else
-		sizeimage = config_params.channel_bufsize[ch->channel_id];
+	sizeimage = pixfmt->sizeimage;
 
 	vpitch = sizeimage / (hpitch * 2);
 
-- 
1.6.3.3


  reply	other threads:[~2010-05-19 15:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-19 15:56 [PATCH 1/7] changed driver for MMAP buffer asheeshb
2010-05-19 15:56 ` [PATCH 2/7] Patch for adding imagesize corrected for MMAP buffers and behave the same as user allocated buffers. The sizeimage parameter is giving the wrong size from the driver and it has to be corrected in S_FMT and TRY_FMT ioctls asheeshb
2010-05-19 15:56   ` [PATCH 3/7] Patch for capture driver MMAP buffer allocation. The user can specify the size of the buffers with an offset from the kernel images asheeshb
2010-05-19 15:56     ` asheeshb [this message]
2010-05-19 15:56       ` [PATCH 5/7] DM365 MMAP buffer allocation for display driver asheeshb
2010-05-19 15:56         ` [PATCH 6/7] DM365 capture MMAP buffer allocation asheeshb
2010-05-19 15:56           ` [PATCH 7/7] Patch MMAP buffer bufsize support upto 1080p resolution on capture driver DM365 asheeshb

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1274284611-13432-4-git-send-email-asheeshb@ti.com \
    --to=asheeshb@ti.com \
    --cc=asheesh@lab1.dmlab \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.