diff options
author | Jason Chen <b02280@freescale.com> | 2010-05-18 14:58:01 +0800 |
---|---|---|
committer | Alejandro Gonzalez <alex.gonzalez@digi.com> | 2010-06-30 15:57:45 +0200 |
commit | cf90e349e206bf52e57e65f534ee8f11b2fbfd1c (patch) | |
tree | 2e33db7f98101a9c158b45da62ca8f9a4a707147 /drivers/media | |
parent | f186276d2aa0e8f478ef32ffa5ea76bbdad9ec2e (diff) |
ENGR00123558 v4l2 output: add own workqueue for v4l output
During v4l2 output playback, there is performance issue after below
commit:
UBUNTU: SAUCE: (upstream) netdev/fec: fix performance impact from
mdio poll operation
Use common workqueue cause this issue, so create an own workqueue for
v4l2 output.
Signed-off-by: Jason Chen <b02280@freescale.com>
Signed-off-by: Alejandro Gonzalez <alex.gonzalez@digi.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/mxc/output/mxc_v4l2_output.c | 18 | ||||
-rw-r--r-- | drivers/media/video/mxc/output/mxc_v4l2_output.h | 1 |
2 files changed, 15 insertions, 4 deletions
diff --git a/drivers/media/video/mxc/output/mxc_v4l2_output.c b/drivers/media/video/mxc/output/mxc_v4l2_output.c index 6a91440f6fbe..408f9b7871a8 100644 --- a/drivers/media/video/mxc/output/mxc_v4l2_output.c +++ b/drivers/media/video/mxc/output/mxc_v4l2_output.c @@ -521,9 +521,8 @@ static void mxc_v4l2out_timer_handler(unsigned long arg) } /* set next buffer ready */ - if (schedule_work(&vout->timer_work) == 0) { - dev_err(&vout->video_dev->dev, - "timer work already in queue\n"); + if (queue_work(vout->v4l_wq, &vout->timer_work) == 0) { + dev_err(&vout->video_dev->dev, "work was in queue already!\n "); vout->state = STATE_STREAM_PAUSED; } @@ -1489,7 +1488,7 @@ static int mxc_v4l2out_streamon(vout_data * vout) 1, vout->v4l2_bufs[vout->ipu_buf[1]].m.offset); ipu_select_buffer(vout->display_ch, IPU_INPUT_BUFFER, 0); ipu_select_buffer(vout->display_ch, IPU_INPUT_BUFFER, 1); - schedule_work(&vout->timer_work); + queue_work(vout->v4l_wq, &vout->timer_work); } } else { ipu_select_buffer(vout->post_proc_ch, IPU_INPUT_BUFFER, 0); @@ -1891,6 +1890,14 @@ static int mxc_v4l2out_open(struct file *file) vout->state = STATE_STREAM_OFF; vout->rotate = IPU_ROTATE_NONE; + vout->v4l_wq = create_singlethread_workqueue("v4l2q"); + if (!vout->v4l_wq) { + dev_dbg(&dev->dev, + "Could not create work queue\n"); + err = -ENOMEM; + goto oops; + } + INIT_WORK(&vout->timer_work, timer_work_func); } @@ -1931,6 +1938,9 @@ static int mxc_v4l2out_close(struct file *file) /* capture off */ wake_up_interruptible(&vout->v4l_bufq); + + flush_workqueue(vout->v4l_wq); + destroy_workqueue(vout->v4l_wq); } return 0; diff --git a/drivers/media/video/mxc/output/mxc_v4l2_output.h b/drivers/media/video/mxc/output/mxc_v4l2_output.h index 64076a001c60..0dd8eb0076a9 100644 --- a/drivers/media/video/mxc/output/mxc_v4l2_output.h +++ b/drivers/media/video/mxc/output/mxc_v4l2_output.h @@ -79,6 +79,7 @@ typedef struct _vout_data { struct semaphore param_lock; struct timer_list output_timer; + struct workqueue_struct *v4l_wq; struct work_struct timer_work; unsigned long start_jiffies; u32 frame_count; |