diff options
author | Sylwester Nawrocki <s.nawrocki@samsung.com> | 2012-03-16 10:47:51 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-04-10 14:22:47 -0400 |
commit | aa333122c9c7d11d7d8486db09869517995af0a8 (patch) | |
tree | d0e6e1f0e2d0113d8b2f68bf8d1fbb181ccd0ffa /drivers/media/video/s5p-fimc/fimc-capture.c | |
parent | 20676a4c9503dbcbb283c4c6565426dc63b81775 (diff) |
[media] s5p-fimc: Reinitialize the pipeline properly after VIDIOC_STREAMOFF
This patch prevents blocking on DQBUF at a video capture node in some
conditions, after STREAOMOFF/STREAMON sequence. The ST_CAPT_SUSPEND
flag should not be set during normal stream off, otherwise the
capture engine is not properly enabled at stream on.
Reported-by: Bernard Debbasch <b.debbasch@ssi.samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/s5p-fimc/fimc-capture.c')
-rw-r--r-- | drivers/media/video/s5p-fimc/fimc-capture.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/media/video/s5p-fimc/fimc-capture.c b/drivers/media/video/s5p-fimc/fimc-capture.c index b06efd208328..a080f0c91e35 100644 --- a/drivers/media/video/s5p-fimc/fimc-capture.c +++ b/drivers/media/video/s5p-fimc/fimc-capture.c | |||
@@ -83,7 +83,9 @@ static int fimc_capture_state_cleanup(struct fimc_dev *fimc, bool suspend) | |||
83 | 83 | ||
84 | fimc->state &= ~(1 << ST_CAPT_RUN | 1 << ST_CAPT_SHUT | | 84 | fimc->state &= ~(1 << ST_CAPT_RUN | 1 << ST_CAPT_SHUT | |
85 | 1 << ST_CAPT_STREAM | 1 << ST_CAPT_ISP_STREAM); | 85 | 1 << ST_CAPT_STREAM | 1 << ST_CAPT_ISP_STREAM); |
86 | if (!suspend) | 86 | if (suspend) |
87 | fimc->state |= (1 << ST_CAPT_SUSPENDED); | ||
88 | else | ||
87 | fimc->state &= ~(1 << ST_CAPT_PEND | 1 << ST_CAPT_SUSPENDED); | 89 | fimc->state &= ~(1 << ST_CAPT_PEND | 1 << ST_CAPT_SUSPENDED); |
88 | 90 | ||
89 | /* Release unused buffers */ | 91 | /* Release unused buffers */ |
@@ -99,7 +101,6 @@ static int fimc_capture_state_cleanup(struct fimc_dev *fimc, bool suspend) | |||
99 | else | 101 | else |
100 | vb2_buffer_done(&buf->vb, VB2_BUF_STATE_ERROR); | 102 | vb2_buffer_done(&buf->vb, VB2_BUF_STATE_ERROR); |
101 | } | 103 | } |
102 | set_bit(ST_CAPT_SUSPENDED, &fimc->state); | ||
103 | 104 | ||
104 | fimc_hw_reset(fimc); | 105 | fimc_hw_reset(fimc); |
105 | cap->buf_index = 0; | 106 | cap->buf_index = 0; |