summaryrefslogtreecommitdiff
path: root/drivers/media/video
diff options
context:
space:
mode:
authorLiu Ying <Ying.Liu@freescale.com>2013-04-23 12:24:17 +0800
committerLiu Ying <Ying.Liu@freescale.com>2013-05-02 17:03:36 +0800
commit1e00529f451b20de9633eb1ea1a9b9f3121dbdd3 (patch)
tree5015a0988e3b99a14b3aeaca204bb67660e9b406 /drivers/media/video
parent73c759092a5fc07fff18120bb8103b2e3b3949cf (diff)
ENGR00259949 mxc vout:fix screen tearing issue in ic bypass case
In ic bypass case, we put video buffers at a framebuffer display channel directly. The display channel works at triple buffer mode. To make sure a video buffer(buf N) has been shown on display device, we at least need to wait for the second video buffer(buf N+2) after the current buffer(buf N) is put on the display channel. Then, the current buffer(buf N) can be added to the dequeue list, otherwise, the user may get the buffer too early so that the buffer being shown can be overwritten - screen tearing issue happens. Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/mxc/output/mxc_vout.c33
1 files changed, 19 insertions, 14 deletions
diff --git a/drivers/media/video/mxc/output/mxc_vout.c b/drivers/media/video/mxc/output/mxc_vout.c
index 719936bd516b..677a7b011989 100644
--- a/drivers/media/video/mxc/output/mxc_vout.c
+++ b/drivers/media/video/mxc/output/mxc_vout.c
@@ -129,7 +129,8 @@ struct mxc_vout_output {
dma_addr_t disp_bufs[FB_BUFS];
- struct videobuf_buffer *pre_vb;
+ struct videobuf_buffer *pre1_vb;
+ struct videobuf_buffer *pre2_vb;
};
struct mxc_vout_dev {
@@ -727,21 +728,24 @@ vdi_frame_rate_double:
list_del(&vb->queue);
/*
- * previous videobuf finish show, set VIDEOBUF_DONE state here
- * to avoid tearing issue in pp bypass case, which make sure
- * showing buffer will not be dequeue to write new data. It also
- * bring side-effect that the last buffer can not be dequeue
- * correctly, app need take care about it.
+ * The videobuf before the last one has been shown. Set
+ * VIDEOBUF_DONE state here to avoid tearing issue in ic bypass
+ * case, which makes sure a buffer being shown will not be
+ * dequeued to be overwritten. It also brings side-effect that
+ * the last 2 buffers can not be dequeued correctly, apps need
+ * to take care of it.
*/
- if (vout->pre_vb) {
- vout->pre_vb->state = VIDEOBUF_DONE;
- wake_up_interruptible(&vout->pre_vb->done);
+ if (vout->pre2_vb) {
+ vout->pre2_vb->state = VIDEOBUF_DONE;
+ wake_up_interruptible(&vout->pre2_vb->done);
}
- if (vout->linear_bypass_pp)
- vout->pre_vb = vb;
- else {
- vout->pre_vb = NULL;
+ if (vout->linear_bypass_pp) {
+ vout->pre2_vb = vout->pre1_vb;
+ vout->pre1_vb = vb;
+ } else {
+ vout->pre1_vb = NULL;
+ vout->pre2_vb = NULL;
vb->state = VIDEOBUF_DONE;
wake_up_interruptible(&vb->done);
}
@@ -1897,7 +1901,8 @@ static int mxc_vidioc_streamon(struct file *file, void *fh,
vout->start_jiffies = jiffies;
- vout->pre_vb = NULL;
+ vout->pre1_vb = NULL;
+ vout->pre2_vb = NULL;
ret = videobuf_streamon(q);
done: