]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ENGR00227472 MXC V4L2 capture:Improve resource lock
authorLiu Ying <Ying.Liu@freescale.com>
Mon, 8 Oct 2012 07:55:04 +0000 (15:55 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:35:32 +0000 (08:35 +0200)
commitc0566de0a29e09d450b8232c483aea3fae82bd06
tree039311d2c4c359d40e70bd3ee1ae360d50b6a66f
parent3c9215f78d852dc4f4e7abe69fd398bff5832c41
ENGR00227472 MXC V4L2 capture:Improve resource lock

1) We get busy_lock semaphore before we get a dqueue event, so, when user
is blocked at DQBUF ioctrl, the user will also be blocked at QBUF ioctrl,
then the video performance will drop. This patch changes to get busy_lock
semaphore to protect DQBUF ioctrl until we successfully get a dqueue event.
2) Use queue_int_lock and dqueue_int_lock spinlocks to protect working_q/
ready_q/done_q in the end of frame interrupt handler camera_callback(), in
case, the handler and VIDIOC_QBUF/VIDIOC_DQBUF ioctrls are called on diff-
erent cores at the same time.
3) Protect ready_q with queue_int_lock spinlock in mxc_streamon(), in case,
VIDIOC_STREAMON and VIDIOC_QBUF ioctrls are called on different cores at
the same time.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
(cherry picked from commit e92c2307ebcf66badc5db8d4449218e3489a9e78)
drivers/media/video/mxc/capture/mxc_v4l2_capture.c