]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
media: videobuf2-core.h: Document the alloc memop size argument as page aligned
authorSakari Ailus <sakari.ailus@linux.intel.com>
Wed, 12 Dec 2018 12:40:48 +0000 (07:40 -0500)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Thu, 23 May 2019 14:18:19 +0000 (10:18 -0400)
The size argument of the alloc memop, which allocates buffer memory, is
page aligned. Document it as such in the only caller as well as ops
documentation.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/common/videobuf2/videobuf2-core.c
include/media/videobuf2-core.h

index cfccee87909a9ad72db5e0aeec6a9d965177ccfd..4489744fbbd954eecb0e171eba5fac8eb6798dd3 100644 (file)
@@ -205,6 +205,7 @@ static int __vb2_buf_mem_alloc(struct vb2_buffer *vb)
         * NOTE: mmapped areas should be page aligned
         */
        for (plane = 0; plane < vb->num_planes; ++plane) {
+               /* Memops alloc requires size to be page aligned. */
                unsigned long size = PAGE_ALIGN(vb->planes[plane].length);
 
                /* Did it wrap around? */
index 22f3ff76a8b5027c2ea2697863ae54b30e5a848f..c03ef7cc5071fd1c4bc48616802f7bbc6d4a0f0d 100644 (file)
@@ -54,7 +54,8 @@ struct vb2_threadio_data;
  *             will then be passed as @buf_priv argument to other ops in this
  *             structure. Additional gfp_flags to use when allocating the
  *             are also passed to this operation. These flags are from the
- *             gfp_flags field of vb2_queue.
+ *             gfp_flags field of vb2_queue. The size argument to this function
+ *             shall be *page aligned*.
  * @put:       inform the allocator that the buffer will no longer be used;
  *             usually will result in the allocator freeing the buffer (if
  *             no other users of this buffer are present); the @buf_priv