Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

media: vb2: remove vb2_ops_wait_prepare/finish helpers

Since vb2 now relies on the presence of the vb2_queue lock
field and there are no more drivers that use these helpers, it is safe
to drop them.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

authored by

Hans Verkuil and committed by
Mauro Carvalho Chehab
d0730006 cbb5cd44

+4 -36
+4 -4
Documentation/driver-api/media/v4l2-dev.rst
··· 157 157 Of course, you can always do all the locking yourself by leaving both lock 158 158 pointers at ``NULL``. 159 159 160 - In the case of :ref:`videobuf2 <vb2_framework>` you will need to implement the 161 - ``wait_prepare()`` and ``wait_finish()`` callbacks to unlock/lock if applicable. 162 - If you use the ``queue->lock`` pointer, then you can use the helper functions 163 - :c:func:`vb2_ops_wait_prepare` and :c:func:`vb2_ops_wait_finish`. 160 + In the case of :ref:`videobuf2 <vb2_framework>` you must set the ``queue->lock`` 161 + pointer to the lock you use to serialize the queuing ioctls. This ensures that 162 + that lock is released while waiting in ``VIDIOC_DQBUF`` for a buffer to arrive, 163 + and it is retaken afterwards. 164 164 165 165 The implementation of a hotplug disconnect should also take the lock from 166 166 :c:type:`video_device` before calling v4l2_device_disconnect. If you are also
-14
drivers/media/common/videobuf2/videobuf2-v4l2.c
··· 1302 1302 } 1303 1303 EXPORT_SYMBOL_GPL(vb2_video_unregister_device); 1304 1304 1305 - /* vb2_ops helpers. Only use if vq->lock is non-NULL. */ 1306 - 1307 - void vb2_ops_wait_prepare(struct vb2_queue *vq) 1308 - { 1309 - mutex_unlock(vq->lock); 1310 - } 1311 - EXPORT_SYMBOL_GPL(vb2_ops_wait_prepare); 1312 - 1313 - void vb2_ops_wait_finish(struct vb2_queue *vq) 1314 - { 1315 - mutex_lock(vq->lock); 1316 - } 1317 - EXPORT_SYMBOL_GPL(vb2_ops_wait_finish); 1318 - 1319 1305 /* 1320 1306 * Note that this function is called during validation time and 1321 1307 * thus the req_queue_mutex is held to ensure no request objects
-18
include/media/videobuf2-v4l2.h
··· 367 367 */ 368 368 void vb2_video_unregister_device(struct video_device *vdev); 369 369 370 - /** 371 - * vb2_ops_wait_prepare - helper function to lock a struct &vb2_queue 372 - * 373 - * @vq: pointer to &struct vb2_queue 374 - * 375 - * ..note:: only use if vq->lock is non-NULL. 376 - */ 377 - void vb2_ops_wait_prepare(struct vb2_queue *vq); 378 - 379 - /** 380 - * vb2_ops_wait_finish - helper function to unlock a struct &vb2_queue 381 - * 382 - * @vq: pointer to &struct vb2_queue 383 - * 384 - * ..note:: only use if vq->lock is non-NULL. 385 - */ 386 - void vb2_ops_wait_finish(struct vb2_queue *vq); 387 - 388 370 struct media_request; 389 371 int vb2_request_validate(struct media_request *req); 390 372 void vb2_request_queue(struct media_request *req);