aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Chen <b02280@freescale.com>2011-11-16 17:33:15 +0800
committerEric Miao <eric.miao@linaro.org>2011-11-29 16:43:14 +0800
commitfa81b694aeb9e539ee7996a78db0e69c675f9a05 (patch)
treebe6df54133454092c524dc70c344ed86b36c1dab
parent926fccab1c55440de15e6d7b3dec714699e38996 (diff)
downloadlinux-linaro-fa81b694aeb9e539ee7996a78db0e69c675f9a05.tar.gz
ENGR00162360 mxc_vout: fix STREAMOFF and G_CROP issues
1. move videobuf_mmap_free to mxc_vout_release. 2. call videobuf_queue_cancel in mxc_vout_release if no streamon called. 3. correct return value of G_CROP for support_window case. Signed-off-by: Jason Chen <b02280@freescale.com>
-rw-r--r--drivers/media/video/mxc/output/mxc_vout.c47
1 files changed, 27 insertions, 20 deletions
diff --git a/drivers/media/video/mxc/output/mxc_vout.c b/drivers/media/video/mxc/output/mxc_vout.c
index 2d110032032..a99e24d1858 100644
--- a/drivers/media/video/mxc/output/mxc_vout.c
+++ b/drivers/media/video/mxc/output/mxc_vout.c
@@ -650,8 +650,11 @@ static int mxc_vout_release(struct file *file)
if (--vout->open_cnt == 0) {
q = &vout->vbq;
if (q->streaming)
- ret = mxc_vidioc_streamoff(file, vout, vout->type);
+ mxc_vidioc_streamoff(file, vout, vout->type);
+ else
+ videobuf_queue_cancel(q);
destroy_workqueue(vout->v4l_wq);
+ ret = videobuf_mmap_free(q);
}
return ret;
@@ -917,16 +920,23 @@ static int mxc_vidioc_g_crop(struct file *file, void *fh, struct v4l2_crop *crop
if (crop->type != V4L2_BUF_TYPE_VIDEO_OUTPUT)
return -EINVAL;
- if (vout->task.output.crop.w && vout->task.output.crop.h) {
- crop->c.left = vout->task.output.crop.pos.x;
- crop->c.top = vout->task.output.crop.pos.y;
- crop->c.width = vout->task.output.crop.w;
- crop->c.height = vout->task.output.crop.h;
- } else {
- crop->c.left = 0;
- crop->c.top = 0;
+ if (vout->disp_support_windows) {
+ crop->c.left = vout->win_pos.x;
+ crop->c.top = vout->win_pos.y;
crop->c.width = vout->task.output.width;
crop->c.height = vout->task.output.height;
+ } else {
+ if (vout->task.output.crop.w && vout->task.output.crop.h) {
+ crop->c.left = vout->task.output.crop.pos.x;
+ crop->c.top = vout->task.output.crop.pos.y;
+ crop->c.width = vout->task.output.crop.w;
+ crop->c.height = vout->task.output.crop.h;
+ } else {
+ crop->c.left = 0;
+ crop->c.top = 0;
+ crop->c.width = vout->task.output.width;
+ crop->c.height = vout->task.output.height;
+ }
}
return 0;
@@ -1349,22 +1359,19 @@ static int mxc_vidioc_streamoff(struct file *file, void *fh, enum v4l2_buf_type
{
struct mxc_vout_output *vout = fh;
struct videobuf_queue *q = &vout->vbq;
- int ret;
-
- del_timer(&vout->timer);
+ int ret = 0;
- cancel_work_sync(&vout->disp_work);
- flush_workqueue(vout->v4l_wq);
+ if (q->streaming) {
+ del_timer(&vout->timer);
- release_disp_output(vout);
+ cancel_work_sync(&vout->disp_work);
+ flush_workqueue(vout->v4l_wq);
- ret = videobuf_streamoff(&vout->vbq);
- if (ret < 0)
- goto err;
+ release_disp_output(vout);
- ret = videobuf_mmap_free(q);
+ ret = videobuf_streamoff(&vout->vbq);
+ }
-err:
return ret;
}