diff options
author | Andy Green <andy.green@linaro.org> | 2011-12-19 11:57:50 +0800 |
---|---|---|
committer | Andy Green <andy.green@linaro.org> | 2011-12-19 11:57:50 +0800 |
commit | e297e893aa15126dafa690fc1c252ed35e1b140c (patch) | |
tree | 6830c2878eaf3e6199042563435daeee6f7616fb | |
parent | 7ae295b3bc7f809b22f8d077faae5a1e8276b716 (diff) |
omap4iss backport change vb2 dma api
Signed-off-by: Andy Green <andy.green@linaro.org>
-rw-r--r-- | drivers/media/video/omap4iss/iss_video.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/media/video/omap4iss/iss_video.c b/drivers/media/video/omap4iss/iss_video.c index 324871196f6..e55e31d28b5 100644 --- a/drivers/media/video/omap4iss/iss_video.c +++ b/drivers/media/video/omap4iss/iss_video.c @@ -350,11 +350,17 @@ iss_video_check_format(struct iss_video *video, struct iss_video_fh *vfh) * Video queue operations */ +static int iss_video_queue_setup(struct vb2_queue *q, unsigned int *num_buffers, + unsigned int *num_planes, unsigned long sizes[], + void *alloc_ctxs[]) +/* static int iss_video_queue_setup(struct vb2_queue *vq, const struct v4l2_format *fmt, unsigned int *count, unsigned int *num_planes, unsigned int sizes[], void *alloc_ctxs[]) +*/ { - struct iss_video_fh *vfh = vb2_get_drv_priv(vq); + + struct iss_video_fh *vfh = vb2_get_drv_priv(q); struct iss_video *video = vfh->video; /* Revisit multi-planar support for NV12 */ @@ -366,7 +372,11 @@ static int iss_video_queue_setup(struct vb2_queue *vq, const struct v4l2_format alloc_ctxs[0] = video->alloc_ctx; - *count = min(*count, (unsigned int)(video->capture_mem / PAGE_ALIGN(sizes[0]))); + if (!*num_buffers) + *num_buffers = 32; + + *num_buffers = (unsigned int)min(*num_buffers, (unsigned int) + (video->capture_mem / PAGE_ALIGN(sizes[0]))); return 0; } @@ -390,7 +400,7 @@ static int iss_video_buf_prepare(struct vb2_buffer *vb) if (vb2_plane_size(vb, 0) < size) return -ENOBUFS; - addr = vb2_dma_contig_plane_dma_addr(vb, 0); + addr = vb2_dma_contig_plane_paddr(vb, 0); if (!IS_ALIGNED(addr, 32)) { dev_dbg(video->iss->dev, "Buffer address must be " "aligned to 32 bytes boundary.\n"); |