diff options
author | Liu Xiaowen <b37945@freescale.com> | 2014-12-02 14:34:44 +0800 |
---|---|---|
committer | Robby Cai <r63905@freescale.com> | 2014-12-10 17:27:31 +0800 |
commit | 39283bfa752053b1d62484c42aa2239d6aafe2ae (patch) | |
tree | 84407a6a4d254275a3b6ab468b14d6bd28a99e0c /drivers | |
parent | 155d2bd892cda6f595719739f7c892015a23aaf9 (diff) |
MA-5918 pxp: v4l2: output: stream off should be called after stream on.
stream off should be called by pxp_close when stream is on.
Signed-off-by: Liu Xiaowen <b37945@freescale.com>
(cherry picked from commit 481208f831519db30b3e33ddabefdd1fc66417d9)
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/platform/mxc/output/mxc_pxp_v4l2.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/media/platform/mxc/output/mxc_pxp_v4l2.c b/drivers/media/platform/mxc/output/mxc_pxp_v4l2.c index e2098cb2d7e5..5d5dfd338e4c 100644 --- a/drivers/media/platform/mxc/output/mxc_pxp_v4l2.c +++ b/drivers/media/platform/mxc/output/mxc_pxp_v4l2.c @@ -690,6 +690,11 @@ static int pxp_streamon(struct file *file, void *priv, if (t != V4L2_BUF_TYPE_VIDEO_OUTPUT) return -EINVAL; + if (pxp->s0_vbq.streaming) { + dev_err(&pxp->pdev->dev, "v4l2 output already run!"); + return -EBUSY; + } + _get_cur_fb_blank(pxp); set_fb_blank(FB_BLANK_UNBLANK); @@ -710,12 +715,14 @@ static int pxp_streamoff(struct file *file, void *priv, if ((t != V4L2_BUF_TYPE_VIDEO_OUTPUT)) return -EINVAL; - ret = videobuf_streamoff(&pxp->s0_vbq); + if (pxp->s0_vbq.streaming) { + ret = videobuf_streamoff(&pxp->s0_vbq); - pxp_show_buf(pxp, (unsigned long)pxp->fb.base); + pxp_show_buf(pxp, (unsigned long)pxp->fb.base); - if (pxp->fb_blank) - set_fb_blank(FB_BLANK_POWERDOWN); + if (pxp->fb_blank) + set_fb_blank(FB_BLANK_POWERDOWN); + } return ret; } @@ -1144,8 +1151,8 @@ out: static int pxp_close(struct file *file) { struct pxps *pxp = video_get_drvdata(video_devdata(file)); - - pxp_streamoff(file, NULL, V4L2_BUF_TYPE_VIDEO_OUTPUT); + if (pxp->s0_vbq.streaming) + pxp_streamoff(file, NULL, V4L2_BUF_TYPE_VIDEO_OUTPUT); videobuf_stop(&pxp->s0_vbq); videobuf_mmap_free(&pxp->s0_vbq); pxp->active = NULL; |