[PATCH/RFC v1 0/2] app_offset field for plane format

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
At the Media Workshop during the Linux Kernel Summit we discussed the need for an additional field in the plane format struct, which we named the 'app_offset'.
This field is intended to allow userspace to reserve a piece of memory at the very beginning of the plane that would be guaranteed not to be touched by kernel or hardware (apart from zeroing it out on allocation, if done by the kernel). This field could be used to store information that would be useful after the buffer has been processed, for example if the buffer were to be passed to another thread/process/module or to different hardware (in pipelines).
There already exists a similar field in the plane format struct - data_offset, which should not be confused with this field. Memory reserved using data_offset can be filled by both userspace (for OUTPUT buffers) and driver/hardware (for CAPTURE buffers) and is intended to contain metadata related to the image data stored in the buffer and generated together with it, such as headers, etc. Memory reserved using app_offset, on the other hand, is intended for use solely by userspace and is a way to attach additional information to be read/passed along after the buffer is dequeued and there is no difference in its handling for OUTPUT and CAPTURE types (i.e. just passing it to the driver so it can skip enough memory at the beginning of the buffer).
app_offset is to be added to the data_offset, i.e. each plane looks like this:

|<-- app_offset -->|<-- data_offset -->|<-- image data -->|

Regards,
Pawel Osciak

Pawel Osciak (2):
  media: Add app_offset field to the v4l2_plane structure
  vb2: add support for app_offset field of the v4l2_plane struct

 Documentation/DocBook/media/v4l/io.xml    |   21 ++++++++++++++++++++-
 drivers/media/video/v4l2-compat-ioctl32.c |   11 ++++++++---
 drivers/media/video/v4l2-ioctl.c          |   10 ++++++----
 drivers/media/video/videobuf2-core.c      |    5 +++++
 include/linux/videodev2.h                 |   18 ++++++++++++++++--
 5 files changed, 55 insertions(+), 10 deletions(-)

-- 
1.7.7.3

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux