]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ENGR00266873 mxc vout:Release or invalidate previous buffers correctly
authorLiu Ying <Ying.Liu@freescale.com>
Thu, 13 Jun 2013 03:49:56 +0000 (11:49 +0800)
committerOliver Wendt <ow@karo-electronics.de>
Mon, 30 Sep 2013 12:14:05 +0000 (14:14 +0200)
Users may call VIDIOC_S_CTRL ioctrl to do rotation, such as 90 degree
rotation, when a video is streaming in IC bypass mode. The runtime
rotation setting may make the vout driver lose the track for a previous
video buffer and finally cause the streaming hang. This patch releases
that video buffer in this case and invalidates previous video buffers
when necessary.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
drivers/media/video/mxc/output/mxc_vout.c

index 17df16c0ca9f2cbc3db76b5da1e40d9464c3a121..27a52e6372849446e45e5491f9250e34ef08b5af 100644 (file)
@@ -737,14 +737,18 @@ vdi_frame_rate_double:
        if (vout->pre2_vb) {
                vout->pre2_vb->state = VIDEOBUF_DONE;
                wake_up_interruptible(&vout->pre2_vb->done);
+               vout->pre2_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;
+               if (vout->pre1_vb) {
+                       vout->pre1_vb->state = VIDEOBUF_DONE;
+                       wake_up_interruptible(&vout->pre1_vb->done);
+                       vout->pre1_vb = NULL;
+               }
                vb->state = VIDEOBUF_DONE;
                wake_up_interruptible(&vb->done);
        }