Re: [PATCHv9 17/25] Documentation: media: description of DMABUF exporting in V4L2

2012-10-05 Thread Hans Verkuil
More stylistic comments and a suggestion for re-ordering the fields in the 
expbuf struct.

On Tue October 2 2012 16:27:28 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
 
 diff --git a/Documentation/DocBook/media/v4l/compat.xml 
 b/Documentation/DocBook/media/v4l/compat.xml
 index a46f95b..f0512aa 100644
 --- a/Documentation/DocBook/media/v4l/compat.xml
 +++ b/Documentation/DocBook/media/v4l/compat.xml
 @@ -2625,6 +2625,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 5b58657..476f448 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 a V4L2 buffers as DMABUF file descriptors./para

exporting a - exporting

 +
  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 eee6908..d8c2597 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..bf28e7d
 --- /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

method therefore - method, therefore

 +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, applicationis fill v4l2-exportbuffer;.  The

applicationis - applications

 +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
 

[PATCHv9 17/25] Documentation: media: description of DMABUF exporting in V4L2

2012-10-02 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 a46f95b..f0512aa 100644
--- a/Documentation/DocBook/media/v4l/compat.xml
+++ b/Documentation/DocBook/media/v4l/compat.xml
@@ -2625,6 +2625,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 5b58657..476f448 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 a 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 eee6908..d8c2597 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..bf28e7d
--- /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, applicationis 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 multi plane 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 currently active
+format. For single plane API, applications must set structfield plane