aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Chen <b02280@freescale.com>2011-11-08 14:07:14 +0800
committerEric Miao <eric.miao@linaro.org>2011-12-19 11:25:14 +0800
commit0448d2ed094d3c796c0d122876b0b571ef11bc5a (patch)
treeea02aff78afd7d7be5be48e53cf1ad2fbd32c31f
parent3c889e24c88b46cfb5dbf0f181b310ee6ca9c129 (diff)
ENGR00161607 mxc v4l2 output: return real phys offset after mmap
vpu unit test failed because it need phys offset of each buffer allocated by v4l2 output driver. videobuf dma contig method only allocate real dma buffer when user call mmap. Fix this issue by adding code to querybuf ioctl, return real phys after buffer mmaped. Signed-off-by: Jason Chen <b02280@freescale.com>
-rw-r--r--drivers/media/video/mxc/output/mxc_vout.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/media/video/mxc/output/mxc_vout.c b/drivers/media/video/mxc/output/mxc_vout.c
index 14d0aba97ff..58e60eba814 100644
--- a/drivers/media/video/mxc/output/mxc_vout.c
+++ b/drivers/media/video/mxc/output/mxc_vout.c
@@ -1106,9 +1106,18 @@ static int mxc_vidioc_reqbufs(struct file *file, void *fh,
static int mxc_vidioc_querybuf(struct file *file, void *fh,
struct v4l2_buffer *b)
{
+ int ret;
struct mxc_vout_output *vout = fh;
- return videobuf_querybuf(&vout->vbq, b);
+ ret = videobuf_querybuf(&vout->vbq, b);
+ if (!ret) {
+ /* return physical address */
+ struct videobuf_buffer *vb = vout->vbq.bufs[b->index];
+ if (b->flags & V4L2_BUF_FLAG_MAPPED)
+ b->m.offset = videobuf_to_dma_contig(vb);
+ }
+
+ return ret;
}
static int mxc_vidioc_qbuf(struct file *file, void *fh,