Re: [PATCHv10 17/26] Documentation: media: description of DMABUF exporting in V4L2

2012-10-15 Thread Hans Verkuil
On Wed October 10 2012 16:46:36 Tomasz Stanislawski wrote:
 This patch adds description and usage examples for exporting
 DMABUF file descriptor in V4L2.
 
 Signed-off-by: Tomasz Stanislawski t.stanisl...@samsung.com
 Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
 CC: linux-...@vger.kernel.org
 ---
  Documentation/DocBook/media/v4l/compat.xml|3 +
  Documentation/DocBook/media/v4l/io.xml|3 +
  Documentation/DocBook/media/v4l/v4l2.xml  |1 +
  Documentation/DocBook/media/v4l/vidioc-expbuf.xml |  212 
 +
  4 files changed, 219 insertions(+)
  create mode 100644 Documentation/DocBook/media/v4l/vidioc-expbuf.xml
 

Acked-by: Hans Verkuil hans.verk...@cisco.com
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCHv10 17/26] Documentation: media: description of DMABUF exporting in V4L2

2012-10-10 Thread Tomasz Stanislawski
This patch adds description and usage examples for exporting
DMABUF file descriptor in V4L2.

Signed-off-by: Tomasz Stanislawski t.stanisl...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
CC: linux-...@vger.kernel.org
---
 Documentation/DocBook/media/v4l/compat.xml|3 +
 Documentation/DocBook/media/v4l/io.xml|3 +
 Documentation/DocBook/media/v4l/v4l2.xml  |1 +
 Documentation/DocBook/media/v4l/vidioc-expbuf.xml |  212 +
 4 files changed, 219 insertions(+)
 create mode 100644 Documentation/DocBook/media/v4l/vidioc-expbuf.xml

diff --git a/Documentation/DocBook/media/v4l/compat.xml 
b/Documentation/DocBook/media/v4l/compat.xml
index 50eb630..3dd9e78 100644
--- a/Documentation/DocBook/media/v4l/compat.xml
+++ b/Documentation/DocBook/media/v4l/compat.xml
@@ -2590,6 +2590,9 @@ ioctls./para
  paraImporting DMABUF file descriptors as a new IO method described
  in xref linkend=dmabuf /./para
 /listitem
+listitem
+ paraExporting DMABUF files using VIDIOC-EXPBUF; ioctl./para
+/listitem
   /itemizedlist
 /section
 
diff --git a/Documentation/DocBook/media/v4l/io.xml 
b/Documentation/DocBook/media/v4l/io.xml
index 0abb5cb..81d0ed4 100644
--- a/Documentation/DocBook/media/v4l/io.xml
+++ b/Documentation/DocBook/media/v4l/io.xml
@@ -488,6 +488,9 @@ DMA buffer from userspace using a file descriptor 
previously exported for a
 different or the same device (known as the importer role), or both. This
 section describes the DMABUF importer role API in V4L2./para
 
+paraRefer to link linked=vidioc-expbuf DMABUF exporting /link for
+details about exporting V4L2 buffers as DMABUF file descriptors./para
+
 paraInput and output devices support the streaming I/O method when the
 constantV4L2_CAP_STREAMING/constant flag in the
 structfieldcapabilities/structfield field of v4l2-capability; returned by
diff --git a/Documentation/DocBook/media/v4l/v4l2.xml 
b/Documentation/DocBook/media/v4l/v4l2.xml
index 10ccde9..4d110b1 100644
--- a/Documentation/DocBook/media/v4l/v4l2.xml
+++ b/Documentation/DocBook/media/v4l/v4l2.xml
@@ -543,6 +543,7 @@ and discussions on the V4L mailing list./revremark
 sub-enuminput;
 sub-enumoutput;
 sub-enumstd;
+sub-expbuf;
 sub-g-audio;
 sub-g-audioout;
 sub-g-crop;
diff --git a/Documentation/DocBook/media/v4l/vidioc-expbuf.xml 
b/Documentation/DocBook/media/v4l/vidioc-expbuf.xml
new file mode 100644
index 000..72dfbd2
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/vidioc-expbuf.xml
@@ -0,0 +1,212 @@
+refentry id=vidioc-expbuf
+
+  refmeta
+refentrytitleioctl VIDIOC_EXPBUF/refentrytitle
+manvol;
+  /refmeta
+
+  refnamediv
+refnameVIDIOC_EXPBUF/refname
+refpurposeExport a buffer as a DMABUF file descriptor./refpurpose
+  /refnamediv
+
+  refsynopsisdiv
+funcsynopsis
+  funcprototype
+   funcdefint functionioctl/function/funcdef
+   paramdefint parameterfd/parameter/paramdef
+   paramdefint parameterrequest/parameter/paramdef
+   paramdefstruct v4l2_exportbuffer 
*parameterargp/parameter/paramdef
+  /funcprototype
+/funcsynopsis
+  /refsynopsisdiv
+
+  refsect1
+titleArguments/title
+
+variablelist
+  varlistentry
+   termparameterfd/parameter/term
+   listitem
+ parafd;/para
+   /listitem
+  /varlistentry
+  varlistentry
+   termparameterrequest/parameter/term
+   listitem
+ paraVIDIOC_EXPBUF/para
+   /listitem
+  /varlistentry
+  varlistentry
+   termparameterargp/parameter/term
+   listitem
+ para/para
+   /listitem
+  /varlistentry
+/variablelist
+  /refsect1
+
+  refsect1
+titleDescription/title
+
+note
+  titleExperimental/title
+  paraThis is an link linkend=experimental experimental /link
+  interface and may change in the future./para
+/note
+
+paraThis ioctl is an extension to the link linkend=mmapmemory
+mapping/link I/O method, therefore it is available only for
+constantV4L2_MEMORY_MMAP/constant buffers.  It can be used to export a
+buffer as a DMABUF file at any time after buffers have been allocated with the
+VIDIOC-REQBUFS; ioctl./para
+
+para To export a buffer, applications fill v4l2-exportbuffer;.  The
+structfield type /structfield field is set to the same buffer type as was
+previously used with  v4l2-requestbuffers;structfield type /structfield.
+Applications must also set the structfield index /structfield field. Valid
+index numbers range from zero to the number of buffers allocated with
+VIDIOC-REQBUFS; (v4l2-requestbuffers;structfield count /structfield)
+minus one.  For the multi-planar API, applications set the structfield plane
+/structfield field to the index of the plane to be exported. Valid planes
+range from zero to the maximal number of valid planes for the currently active
+format. For the single-planar API, applications must set