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>
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);
}