media: videobuf2: handle V4L2_MEMORY_FLAG_NON_COHERENT flag
authorSergey Senozhatsky <senozhatsky@chromium.org>
Thu, 9 Sep 2021 11:24:29 +0000 (13:24 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 30 Sep 2021 08:07:57 +0000 (10:07 +0200)
commitc0acf9cfeee061f041fab778dbdcb34b6ca5e2e7
treee30af680eb9ce6bfaa6bdae802905f7ab5ffe963
parentb00a9e59c539684d9e105feafaeee36df11ee493
media: videobuf2: handle V4L2_MEMORY_FLAG_NON_COHERENT flag

This patch lets user-space request a non-coherent memory
allocation during CREATE_BUFS and REQBUFS ioctl calls.

= CREATE_BUFS

  struct v4l2_create_buffers has seven 4-byte reserved areas,
  so reserved[0] is renamed to ->flags. The struct, thus, now
  has six reserved 4-byte regions.

= CREATE_BUFS32

  struct v4l2_create_buffers32 has seven 4-byte reserved areas,
  so reserved[0] is renamed to ->flags. The struct, thus, now
  has six reserved 4-byte regions.

= REQBUFS

 We use one byte of a 4 byte ->reserved[1] member of struct
 v4l2_requestbuffers. The struct, thus, now has reserved 3 bytes.

Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Documentation/userspace-api/media/v4l/vidioc-create-bufs.rst
Documentation/userspace-api/media/v4l/vidioc-reqbufs.rst
drivers/media/common/videobuf2/videobuf2-core.c
drivers/media/common/videobuf2/videobuf2-v4l2.c
drivers/media/v4l2-core/v4l2-compat-ioctl32.c
drivers/media/v4l2-core/v4l2-ioctl.c
include/uapi/linux/videodev2.h