diff options
| author | Sandor Yu <R01008@freescale.com> | 2015-01-23 14:18:01 +0800 |
|---|---|---|
| committer | Sandor Yu <R01008@freescale.com> | 2015-01-30 11:04:13 +0800 |
| commit | 293cb8fac7d79f7f075396a56a6b2edc52a9b76a (patch) | |
| tree | ffead5c4ffbf6952d08c5765a2a3f1ab57c9458d | |
| parent | d13600a32614ce3008c75aebceb3d0253b461e31 (diff) | |
MLK-10137:csi: Return physical address in querybuffer call
GST application want to use physical address even video buffer
allocated with type of V4L2_MEMORY_MMAP.
So add a trick in querybuffer function, if video buffer flags
is setting to V4L2_BUF_FLAG_MAPPED, overwirte m.offset with
physical address.
Signed-off-by: Sandor Yu <R01008@freescale.com>
| -rw-r--r-- | drivers/media/platform/mxc/subdev/mx6s_capture.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/media/platform/mxc/subdev/mx6s_capture.c b/drivers/media/platform/mxc/subdev/mx6s_capture.c index 1f6d74d2a929..8cb1c1d14cf5 100644 --- a/drivers/media/platform/mxc/subdev/mx6s_capture.c +++ b/drivers/media/platform/mxc/subdev/mx6s_capture.c @@ -1210,10 +1210,19 @@ static int mx6s_vidioc_querybuf(struct file *file, void *priv, struct v4l2_buffer *p) { struct mx6s_csi_dev *csi_dev = video_drvdata(file); + int ret; WARN_ON(priv != file->private_data); - return vb2_querybuf(&csi_dev->vb2_vidq, p); + ret = vb2_querybuf(&csi_dev->vb2_vidq, p); + + if (!ret) { + /* return physical address */ + struct vb2_buffer *vb = csi_dev->vb2_vidq.bufs[p->index]; + if (p->flags & V4L2_BUF_FLAG_MAPPED) + p->m.offset = vb2_dma_contig_plane_dma_addr(vb, 0); + } + return ret; } static int mx6s_vidioc_qbuf(struct file *file, void *priv, |
