History

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.

Hans Verkuil committed 1 year ago

Commit d0730001 parent cbb5cd43 files · +4 −36Browse files

Unified · Split

3 files
  1. Documentation/driver-api/media/v4l2-dev.rst +4 −4
  2. drivers/media/common/videobuf2/videobuf2-v4l2.c +0 −14
  3. include/media/videobuf2-v4l2.h +0 −18
Documentation/driver-api/media/v4l2-dev.rst+4−4
@@ -157,10 +157,10 @@ changing the e.g. exposure of the webcam. · 156 unmodified lines
157Of course, you can always do all the locking yourself by leaving both lock157Of course, you can always do all the locking yourself by leaving both lock
158pointers at ``NULL``.158pointers at ``NULL``.
159 159
160In the case of :ref:`videobuf2 <vb2_framework>` you will need to implement the160In the case of :ref:`videobuf2 <vb2_framework>` you must set the ``queue->lock``
161``wait_prepare()`` and ``wait_finish()`` callbacks to unlock/lock if applicable.161pointer to the lock you use to serialize the queuing ioctls. This ensures that
162If you use the ``queue->lock`` pointer, then you can use the helper functions162that lock is released while waiting in ``VIDIOC_DQBUF`` for a buffer to arrive,
163:c:func:`vb2_ops_wait_prepare` and :c:func:`vb2_ops_wait_finish`.163and it is retaken afterwards.
164 164
165The implementation of a hotplug disconnect should also take the lock from165The implementation of a hotplug disconnect should also take the lock from
166:c:type:`video_device` before calling v4l2_device_disconnect. If you are also166:c:type:`video_device` before calling v4l2_device_disconnect. If you are also
drivers/media/common/videobuf2/videobuf2-v4l2.c+0−14
@@ -1302,20 +1302,6 @@ void vb2_video_unregister_device(struct video_device *vdev) · 1301 unmodified lines
1302}1302}
1303EXPORT_SYMBOL_GPL(vb2_video_unregister_device);1303EXPORT_SYMBOL_GPL(vb2_video_unregister_device);
1304 1304
1305/* vb2_ops helpers. Only use if vq->lock is non-NULL. */
1306
1307void vb2_ops_wait_prepare(struct vb2_queue *vq)
1308{
1309 mutex_unlock(vq->lock);
1310}
1311EXPORT_SYMBOL_GPL(vb2_ops_wait_prepare);
1312
1313void vb2_ops_wait_finish(struct vb2_queue *vq)
1314{
1315 mutex_lock(vq->lock);
1316}
1317EXPORT_SYMBOL_GPL(vb2_ops_wait_finish);
1318
1319/*1305/*
1320 * Note that this function is called during validation time and1306 * Note that this function is called during validation time and
1321 * thus the req_queue_mutex is held to ensure no request objects1307 * thus the req_queue_mutex is held to ensure no request objects
include/media/videobuf2-v4l2.h+0−18
@@ -367,24 +367,6 @@ unsigned long vb2_fop_get_unmapped_area(struct file *file, unsigned long addr, · 366 unmodified lines
367 */367 */
368void vb2_video_unregister_device(struct video_device *vdev);368void 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 */
377void 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 */
386void vb2_ops_wait_finish(struct vb2_queue *vq);
387
388struct media_request;370struct media_request;
389int vb2_request_validate(struct media_request *req);371int vb2_request_validate(struct media_request *req);
390void vb2_request_queue(struct media_request *req);372void vb2_request_queue(struct media_request *req);