media: videobuf2-core: add error handling for fence
authorJanghyuck Kim <janghyuck.kim@samsung.com>
Wed, 20 Jun 2018 07:46:08 +0000 (16:46 +0900)
committerJanghyuck Kim <janghyuck.kim@samsung.com>
Mon, 23 Jul 2018 05:39:50 +0000 (14:39 +0900)
commit5978dd0bca5a71652c7991e2fb852a66c63a968f
tree63d187fb96876923f25197a968acf3d64ff25e69
parent3b15874906b317eb1ed6e9e47df1486674e676ee
media: videobuf2-core: add error handling for fence

Vb2-core supports in-fence and out-fence for buffer synchronization.
However, in-fence might not be signaled by unexpected situation. Current
logic is waiting for fence signaling infinitely.

This patch added timer when in-fence without signaled is coming, and it
will be expired if callback for in-fence would not be called, which
means in-fence was not signaled during 1000 ms. This case is timeout and
buffer is passed into driver by buf_queue callback, however, it would be
marked with error status.

To support this error handling, vb2-core logic is changed to use
workqueue to avoid calling buf_queue callback in interrupt context.

Change-Id: Icd533c355fa83605e958c8058a676256a6940f14
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
drivers/media/v4l2-core/videobuf2-core.c
include/media/videobuf2-core.h