Skip to contentSkip to conversation

doc: dma-buf: sphinx conversion and cleanup

RFC Superseded Sumit Semwal 6 participants 17 messages Aug 11, 2016 – Aug 16, 2016

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Sumit Semwal

author maintainer
#0 lore raw

cover doc: dma-buf: sphinx conversion and cleanup

Convert dma-buf documentation over to sphinx; also cleanup to address sphinx warnings.

While at that, convert dma-buf-sharing.txt as well, and make it the dma-buf API guide.

There is no content change yet; only format conversion and creation of some hyperlinks.

Sumit Semwal (4):
dma-buf/fence: kerneldoc: remove unused struct members dma-buf/fence: kerneldoc: remove spurious section header
Documentation: move dma-buf documentation to rst Documentation/sphinx: link dma-buf rsts

 Documentation/DocBook/device-drivers.tmpl |  37 ---
 Documentation/dma-buf/guide.rst           | 503 ++++++++++++++++++++++++++++++
 Documentation/dma-buf/intro.rst           |  76 +++++
 Documentation/index.rst                   |   2 +
 MAINTAINERS                               |   2 +-
 include/linux/fence.h                     |   4 +-
 6 files changed, 583 insertions(+), 41 deletions(-)
 create mode 100644 Documentation/dma-buf/guide.rst
 create mode 100644 Documentation/dma-buf/intro.rst
Signature · 1 line
2.7.4
author maintainer
#1 lore raw

RFC 1/4 dma-buf/fence: kerneldoc: remove unused struct members

Commit 0431b9065f28ecf6c320fefebe0241620049984f ("staging/android: bring struct sync_pt back") removed child_list and active_list from struct fence, but left it in kernel doc. Delete them.

Fixes 0431b9065f28 ("staging/android: bring struct sync_pt back")
---
 include/linux/fence.h | 2 --
 1 file changed, 2 deletions(-)
include/linux/fence.h +0 -2
index 1de1b3f6fb76..5aa95eb886f7 100644
@@ -49,8 +49,6 @@ struct fence_cb;
  * @timestamp: Timestamp when the fence was signaled.
  * @status: Optional, only valid if < 0, must be set before calling
  * fence_signal, indicates that the fence has completed with an error.
- * @child_list: list of children fences
- * @active_list: list of active fences
  *
  * the flags member must be manipulated and read using the appropriate
  * atomic ops (bit_*), so taking the spinlock will not be needed most
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author maintainer
#2 lore raw

RFC 2/4 dma-buf/fence: kerneldoc: remove spurious section header

In reply to Sumit Semwal

Commit e941759c74a44d6ac2eed21bb0a38b21fe4559e2 ("fence: dma-buf cross-device synchronization (v18)") had a spurious kerneldoc section header that caused Sphinx to complain. Fix it.

Fixes e941759c74a4 ("fence: dma-buf cross-device synchronization (v18)")
---
 include/linux/fence.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/fence.h +1 -1
index 5aa95eb886f7..5de89dab0013 100644
@@ -60,7 +60,7 @@ struct fence_cb;
  * implementer of the fence for its own purposes. Can be used in different
  * ways by different fence implementers, so do not rely on this.
  *
- * *) Since atomic bitops are used, this is not guaranteed to be the case.
+ * Since atomic bitops are used, this is not guaranteed to be the case.
  * Particularly, if the bit was set, but fence_signal was called right
  * before this bit was set, it would have been able to set the
  * FENCE_FLAG_SIGNALED_BIT, before enable_signaling was called.
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author maintainer
#4 lore raw

RFC 3/4 Documentation: move dma-buf documentation to rst

In reply to Sumit Semwal

Branch out dma-buf related documentation into its own rst file to allow adding it to the sphinx documentation generated.

While at it, move dma-buf-sharing.txt into rst as the dma-buf guide too.

---
 Documentation/DocBook/device-drivers.tmpl |  37 ---
 Documentation/dma-buf/guide.rst           | 503 ++++++++++++++++++++++++++++++
 Documentation/dma-buf/intro.rst           |  76 +++++
 MAINTAINERS                               |   2 +-
 4 files changed, 580 insertions(+), 38 deletions(-)
 create mode 100644 Documentation/dma-buf/guide.rst
 create mode 100644 Documentation/dma-buf/intro.rst
Documentation/DocBook/device-drivers.tmpl +0 -37
index 99cdc05bbb7a..a93fbffa9742 100644
@@ -128,43 +128,6 @@ X!Edrivers/base/interface.c
 !Edrivers/base/platform.c
 !Edrivers/base/bus.c
      </sect1>
-     <sect1>
-       <title>Buffer Sharing and Synchronization</title>
-       <para>
-         The dma-buf subsystem provides the framework for sharing buffers
-         for hardware (DMA) access across multiple device drivers and
-         subsystems, and for synchronizing asynchronous hardware access.
-       </para>
-       <para>
-         This is used, for example, by drm "prime" multi-GPU support, but
-         is of course not limited to GPU use cases.
-       </para>
-       <para>
-         The three main components of this are: (1) dma-buf, representing
-         a sg_table and exposed to userspace as a file descriptor to allow
-         passing between devices, (2) fence, which provides a mechanism
-         to signal when one device as finished access, and (3) reservation,
-         which manages the shared or exclusive fence(s) associated with
-         the buffer.
-       </para>
-       <sect2><title>dma-buf</title>
-!Edrivers/dma-buf/dma-buf.c
-!Iinclude/linux/dma-buf.h
-       </sect2>
-       <sect2><title>reservation</title>
-!Pdrivers/dma-buf/reservation.c Reservation Object Overview
-!Edrivers/dma-buf/reservation.c
-!Iinclude/linux/reservation.h
-       </sect2>
-       <sect2><title>fence</title>
-!Edrivers/dma-buf/fence.c
-!Iinclude/linux/fence.h
-!Edrivers/dma-buf/seqno-fence.c
-!Iinclude/linux/seqno-fence.h
-!Edrivers/dma-buf/sync_file.c
-!Iinclude/linux/sync_file.h
-       </sect2>
-     </sect1>
      <sect1><title>Device Drivers DMA Management</title>
 !Edrivers/base/dma-coherent.c
 !Edrivers/base/dma-mapping.c
Documentation/dma-buf/guide.rst new file +503 -0

503 lines not on this page · raw message

Documentation/dma-buf/intro.rst new file +76 -0

76 lines not on this page · raw message

MAINTAINERS +1 -1
index c92defa5be2c..d58b5c4068b6 100644
@@ -3816,7 +3816,7 @@ F:	drivers/dma-buf/
 F:	include/linux/dma-buf*
 F:	include/linux/reservation.h
 F:	include/linux/*fence.h
-F:	Documentation/dma-buf-sharing.txt
+F:	Documentation/dma-buf/
 T:	git git://git.linaro.org/people/sumitsemwal/linux-dma-buf.git
 
 DMA GENERIC OFFLOAD ENGINE SUBSYSTEM
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author maintainer
#10 lore raw

RFC 4/4 Documentation/sphinx: link dma-buf rsts

In reply to Sumit Semwal

Include dma-buf sphinx documentation into top level index.

---
 Documentation/index.rst | 2 ++
 1 file changed, 2 insertions(+)
Documentation/index.rst +2 -0
index 43c722f15292..2fe8e82d7d8c 100644
@@ -14,6 +14,8 @@ Contents:
    :maxdepth: 2
 
    kernel-documentation
+   dma-buf/intro
+   dma-buf/guide
    media/media_uapi
    media/media_kapi
    media/dvb-drivers/index
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#5 lore raw

Re: [RFC 3/4] Documentation: move dma-buf documentation to rst

In reply to Sumit Semwal
Quoted 6 lines · Sumit Semwal
Documentation/dma-buf/guide.rst new file +0 -0
new file mode 100644
index 000000000000..fd3534fdccb3

Documentation/dma-buf/guide.rst line 8

Quoted 8 lines
Documentation/dma-buf/guide.rst new file +8 -0
@@ -0,0 +1,503 @@
+
+.. _dma-buf-guide:
+
+============================
+DMA Buffer Sharing API Guide
+============================
+
+Sumit Semwal - [email protected], [email protected]

Please use the format

:author: Sumit Semwal <[email protected]>

---

While on this subject, please excuse me for hijacking the thread a bit.

Personally, I believe it would be better to leave out authorship notes from documentation and source files in collaborative projects. Of course, it is only fair that people who deserve credit get the credit. Listing the authors in the file is often the natural thing to do, and superficially seems fair.

However, when do you add more names to the list? When has someone contributed enough to warrant that? Is it fair that the original authors keep getting the credit for the contributions of others? After a while, perhaps there is next to nothing left of the original contributions, but the bar is really high for removing anyone from the authors. Listing the authors gives the impression this is *their* file, while everyone should feel welcome to contribute, and everyone who contributes should feel ownership.

IMHO we would be better off using just the git history for the credits.

BR,
Jani.

PS. I am no saint here, I've got a couple of authors lines myself. I promise not to add more. I certainly won't chastise anyone for adding theirs.

Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#7 lore raw

Re: [RFC 3/4] Documentation: move dma-buf documentation to rst

In reply to Sumit Semwal

Hi Sumit,

I haven't compiled your patch yet, just my 2cent about the reStructuredText (reST) ASCII markup ...

Here are some handy links about reST and the Sphinx markup constructs, we have not yet added to the documentation (sorry):

* reST primer: http://www.sphinx-doc.org/en/stable/rest.html
* reST quickref: http://docutils.sourceforge.net/docs/user/rst/quickref.html
* Sphinx markup constructs: http://www.sphinx-doc.org/en/stable/markup/index.html
* Sphinx domains: http://www.sphinx-doc.org/en/stable/domains.html
* Sphinx cross references: http://www.sphinx-doc.org/en/stable/markup/inline.html#cross-referencing-arbitrary-locations

Am 11.08.2016 um 12:47 schrieb Sumit Semwal <[email protected]>:

Quoted 6 lines

Branch out dma-buf related documentation into its own rst file to allow adding it to the sphinx documentation generated.

While at it, move dma-buf-sharing.txt into rst as the dma-buf guide too.

...

Quoted 7 lines
Documentation/dma-buf/guide.rst new file +7 -0
+dma-buf operations for device dma only
+======================================
+
+The dma_buf buffer sharing API usage contains the following steps:
+
+1. Exporter announces that it wishes to export a buffer
+2. Userspace gets the file descriptor associated with the exported buffer, and

Documentation/dma-buf/guide.rst line 53

Quoted 10 lines
Documentation/dma-buf/guide.rst new file +10 -0
+   passes it around to potential buffer-users based on use case
+3. Each buffer-user 'connects' itself to the buffer
+4. When needed, buffer-user requests access to the buffer from exporter
+5. When finished with its use, the buffer-user notifies end-of-DMA to exporter
+6. when buffer-user is done using this buffer completely, it 'disconnects'
+   itself from the buffer.
+
+
+1. Exporter's announcement of buffer export
+-------------------------------------------

I can't recommend numbering the (sub-) sections explicit, even if you here wanted to numerate the steps. Most often section numbers are controlled by the subordinate toctree directive and this might not fit to the step numbers.

* http://www.sphinx-doc.org/en/stable/markup/toctree.html?highlight=toc#the-toc-tree

Documentation/dma-buf/guide.rst line 60

Quoted 7 lines
Documentation/dma-buf/guide.rst new file +7 -0
+
+   The buffer exporter announces its wish to export a buffer. In this, it
+   connects its own private buffer data, provides implementation for operations
+   that can be performed on the exported :c:type:`dma_buf`, and flags for the file
+   associated with this buffer. All these fields are filled in struct
+   :c:type:`dma_buf_export_info`, defined via the DEFINE_DMA_BUF_EXPORT_INFO macro.
+

In restructuredText whitespace are markups.

Do not indent if you don't want to create a (indented) block. I recommend to drop the two spaces in front of the paragraphs.

IMHO you have to decide if you like to use sectioning (drop the to spaces) or stay with the two spaces and use an enumeration list. If you wan't to stay with the enumeration write:

|1. Exporter's announcement of buffer export
|
|   The buffer exporter announces its wish to export a buffer. In this, it
|   connects its own private buffer ..
|   ...

Documentation/dma-buf/guide.rst line 62

Quoted 2 lines
Documentation/dma-buf/guide.rst new file +2 -0
+   Interface:
+      :c:type:`DEFINE_DMA_BUF_EXPORT_INFO(exp_info) <DEFINE_DMA_BUF_EXPORT_INFO>`

If haven't tested your patch, but I guess this will result in a Warning.

the markup ":c:type" is a reference to a typedef description

* http://www.sphinx-doc.org/en/stable/domains.html#role-c:type

If the description is given, you can use the short form

:c:type:DEFINE_DMA_BUF_EXPORT_INFO

but I think, this is a function, not a typedef.

Review

Quoted 2 lines
(quoted diff) +2 -0
+
+      :c:func:`struct dma_buf *dma_buf_export(struct dma_buf_export_info *exp_info)<dma_buf_export>`

short form to refer

:c:func:dma_buf_export()

Documentation/dma-buf/guide.rst line 72

Quoted 8 lines
Documentation/dma-buf/guide.rst new file +8 -0
+
+   If this succeeds, dma_buf_export allocates a dma_buf structure, and
+   returns a pointer to the same. It also associates an anonymous file with this
+   buffer, so it can be exported. On failure to allocate the dma_buf object,
+   it returns NULL.
+
+   'exp_name' in struct dma_buf_export_info is the name of exporter - to
+   facilitate information while debugging. It is set to KBUILD_MODNAME by

If you want to render a constant in a monospace font you can use the inline markup ``KBUILD_MODNAME``, but if you want.

Quoted 8 lines
Documentation/dma-buf/guide.rst new file +8 -0
+   default, so exporters don't have to provide a specific name, if they don't
+   wish to.
+
+   DEFINE_DMA_BUF_EXPORT_INFO macro defines the struct dma_buf_export_info,
+   zeroes it out and pre-populates exp_name in it.
+
+2. Userspace gets a handle to pass around to potential buffer-users
+-------------------------------------------------------------------

Documentation/dma-buf/guide.rst line 90

Quoted 10 lines
Documentation/dma-buf/guide.rst new file +10 -0
+
+   Userspace entity requests for a file-descriptor (fd) which is a handle to the
+   anonymous file associated with the buffer. It can then share the fd with other
+   drivers and/or processes.
+
+   Interface:
+      :c:func:`int dma_buf_fd(struct dma_buf *dmabuf, int flags) <dma_buf_fd>`
+
+   This API installs an fd for the anonymous file associated with this buffer;
+   returns either 'fd', or error.

I recommend to markup source code objects uniform with ``fd``.

Quoted 19 lines
Documentation/dma-buf/guide.rst new file +19 -0
+
+3. Each buffer-user 'connects' itself to the buffer
+---------------------------------------------------
+
+   Each buffer-user now gets a reference to the buffer, using the fd passed to
+   it.
+
+   Interface:
+      :c:func:`struct dma_buf *dma_buf_get(int fd) <dma_buf_get>`
+
+   This API will return a reference to the dma_buf, and increment refcount for
+   it.
+
+   After this, the buffer-user needs to attach its device with the buffer, which
+   helps the exporter to know of device buffer constraints.
+
+   Interface:
+      :c:func:`struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf, struct device *dev) <dma_buf_attach>`
+

Documentation/dma-buf/guide.rst line 119

Quoted 10 lines
Documentation/dma-buf/guide.rst new file +10 -0
+   This API returns reference to an attachment structure, which is then used
+   for scatterlist operations. It will optionally call the 'attach' dma_buf
+   operation, if provided by the exporter.
+
+   The dma-buf sharing framework does the bookkeeping bits related to managing
+   the list of all attachments to a buffer.
+
+.. note:: Until this stage, the buffer-exporter has the option to choose not to
+   actually allocate the backing storage for this buffer, but wait for the
+   first buffer-user to request use of buffer for allocation.

Use newlines ... which are markups in reST ;)

.. note::

Until this stage, the buffer-exporter has the option to choose not to actually allocate the backing storage for this buffer, but wait for the first buffer-user to request use of buffer for allocation.

Quoted 18 lines

+6. when buffer-user is done using this buffer, it 'disconnects' itself from the buffer.
+---------------------------------------------------------------------------------------

Documentation/dma-buf/guide.rst new file +16 -0
+
+   After the buffer-user has no more interest in using this buffer, it should
+   disconnect itself from the buffer:
+
+   * it first detaches itself from the buffer.
+
+   Interface:
+      :c:func:`void dma_buf_detach(struct dma_buf *dmabuf, struct dma_buf_attachment *dmabuf_attach) <dma_buf_detach>`
+
+   This API removes the attachment from the list in dmabuf, and optionally calls
+   dma_buf->ops->detach(), if provided by exporter, for any housekeeping bits.
+
+   * Then, the buffer-user returns the buffer reference to exporter.
+
+   Interface:
+     :c:func:`void dma_buf_put(struct dma_buf *dmabuf) <dma_buf_put>`

Documentation/dma-buf/guide.rst line 200

Quoted 10 lines
Documentation/dma-buf/guide.rst new file +10 -0
+
+   This API then reduces the refcount for this buffer.
+
+   If, as a result of this call, the refcount becomes 0, the 'release' file
+   operation related to this fd is called. It calls the dmabuf->ops->release()
+   operation in turn, and frees the memory allocated for dmabuf when exported.
+
+NOTES:
+------
+

I can't recommend to use colons in titles.

Documentation/dma-buf/guide.rst line 203

Quoted 3 lines
Documentation/dma-buf/guide.rst new file +3 -0
+* **Importance of attach-detach and {map,unmap}_dma_buf operation pairs**
+
+   The attach-detach calls allow the exporter to figure out backing-storage

only 2 spaces are needed here ... whitespaces are markups ;)

Documentation/dma-buf/guide.rst line 213

Quoted 11 lines
Documentation/dma-buf/guide.rst new file +10 -0
+   constraints for the currently-interested devices. This allows preferential
+   allocation, and/or migration of pages across different types of storage
+   available, if possible.
+
+   Bracketing of DMA access with {map,unmap}_dma_buf operations is essential
+   to allow just-in-time backing of storage, and migration mid-way through a
+   use-case.
 
+
+* **Migration of backing storage if needed**
+

I can't recommend this style, using a list and a first bold line to emulate something what looks like a subsection .. use subsections or leave the bold line.

Quoted 32 lines
Documentation/dma-buf/guide.rst new file +32 -0
+   If after
+
+   * at least one map_dma_buf has happened,
+   * and the backing storage has been allocated for this buffer,
+
+   another new buffer-user intends to attach itself to this buffer, it might
+   be allowed, if possible for the exporter.
+
+   In case it is allowed by the exporter:
+
+   * if the new buffer-user has stricter 'backing-storage constraints', and the
+     exporter can handle these constraints, the exporter can just stall on the
+     map_dma_buf until all outstanding access is completed (as signalled by
+     unmap_dma_buf).
+
+   * Once all users have finished accessing and have unmapped this buffer, the
+     exporter could potentially move the buffer to the stricter backing-storage,
+     and then allow further {map,unmap}_dma_buf operations from any buffer-user
+     from the migrated backing-storage.
+
+   * If the exporter cannot fulfill the backing-storage constraints of the new
+     buffer-user device as requested, dma_buf_attach() would return an error to
+     denote non-compatibility of the new buffer-sharing request with the current
+     buffer.
+
+
+   If the exporter chooses not to allow an attach() operation once a
+   map_dma_buf() API has been called, it simply returns an error.
+
+Kernel cpu access to a dma-buf buffer object
+============================================
+

Documentation/dma-buf/guide.rst line 255

Quoted 10 lines
Documentation/dma-buf/guide.rst new file +10 -0
+The motivation to allow cpu access from the kernel to a dma-buf object from the
+importers side are:
+
+* fallback operations, e.g. if the devices is connected to a usb bus and the
+  kernel needs to shuffle the data around first before sending it away.
+* full transparency for existing users on the importer side, i.e. userspace
+  should not notice the difference between a normal object from that subsystem
+  and an imported one backed by a dma-buf. This is really important for drm
+  opengl drivers that expect to still use all the existing upload/download
+  paths.

I is recommended to separate blocks (in this case the list item blocks) with a newline. E.g.

* first lorem
ipsum

* second lorem
ipsum

If you have only one-liners, it is OK to write

* first
* second

Quoted 8 lines
Documentation/dma-buf/guide.rst new file +8 -0
+
+Access to a dma_buf from the kernel context involves three steps:
+
+1. Prepare access, which invalidate any necessary caches and make the object
+   available for cpu access.
+2. Access the object page-by-page with the dma_buf map apis
+3. Finish access, which will flush any necessary cpu caches and free reserved
+   resources.

Documentation/dma-buf/guide.rst line 274

Quoted 10 lines
Documentation/dma-buf/guide.rst new file +10 -0
+:`void dma_buf_end_cpu_access(struct dma_buf *dma_buf, enum dma_data_direction dir) <dma_buf_end_cpu_access>`
+
+
+Direct Userspace Access/mmap Support
+====================================
+
+Being able to mmap an export dma-buf buffer object has 2 main use-cases:
+* CPU fallback processing in a pipeline and
+* supporting existing mmap interfaces in importers.
+

Insert a newline in front of the list.

Quoted 27 lines

+1. CPU fallback processing in a pipeline
+----------------------------------------

Documentation/dma-buf/guide.rst new file +25 -0
+
+   In many processing pipelines it is sometimes required that the cpu can access
+   the data in a dma-buf (e.g. for thumbnail creation, snapshots, ...). To avoid
+   the need to handle this specially in userspace frameworks for buffer sharing
+   it's ideal if the dma_buf fd itself can be used to access the backing storage
+   from userspace using mmap.
+
+   Furthermore Android's ION framework already supports this (and is otherwise
+   rather similar to dma-buf from a userspace consumer side with using fds as
+   handles, too). So it's beneficial to support this in a similar fashion on
+   dma-buf to have a good transition path for existing Android userspace.
+
+   No special interfaces, userspace simply calls mmap on the dma-buf fd, making
+   sure that the cache synchronization ioctl (DMA_BUF_IOCTL_SYNC) is *always*
+   used when the access happens. Note that DMA_BUF_IOCTL_SYNC can fail with
+   -EAGAIN or -EINTR, in which case it must be restarted.
+
+   Some systems might need some sort of cache coherency management e.g. when
+   CPU and GPU domains are being accessed through dma-buf at the same time. To
+   circumvent this problem there are begin/end coherency markers, that forward
+   directly to existing dma-buf device drivers vfunc hooks. Userspace can make
+   use of those markers through the DMA_BUF_IOCTL_SYNC ioctl. The sequence
+   would be used like following:
+
+     * mmap dma-buf fd

Documentation/dma-buf/guide.rst line 393

Quoted 10 lines
Documentation/dma-buf/guide.rst new file +10 -0
+     * for each drawing/upload cycle in CPU
+
+       1. SYNC_START ioctl,
+       2. read/write to mmap area
+       3. SYNC_END ioctl.
+
+       This can be repeated as often as you want (with the new data being
+       consumed by the GPU or say scanout device)
+     * munmap once you don't need the buffer any more
+

see above, use newline to separate last list item from the one before

Quoted 18 lines
(quoted diff) +17 -0
+    For correctness and optimal performance, it is always required to use
+    SYNC_START and SYNC_END before and after, respectively, when accessing the
+    mapped address. Userspace cannot rely on coherent access, even when there
+    are systems where it just works without calling these ioctls.
+
 
+Introduction
+------------
+
+The dma-buf subsystem provides the framework for sharing buffers for
+hardware (DMA) access across multiple device drivers and subsystems, and
+for synchronizing asynchronous hardware access.
+
+This is used, for example, by drm "prime" multi-GPU support, but is of
+course not limited to GPU use cases.
+
+The three main components of this are:
+

Review

Quoted 10 lines
(quoted diff) +10 -0
+* dma-buf_: represents an sg_table, and is exposed to userspace as a file
+  descriptor to allow passing between devices,
+
+* fence_: which provides a mechanism to signal when one device has finished
+  access, and
+
+* reservation_: manages the shared or exclusive fence(s) associated with the
+  buffer.
+
+Please refer to :ref:`DMA buffer sharing guide <dma-buf-guide>` for more details.

alternative you can use the short form :ref:dma-buf-guide, depends on the context from which you refer and the targets title.

But over all, I wan't say: thanks for your work :)

-- Markus --

#8 lore raw

Re: [RFC 3/4] Documentation: move dma-buf documentation to rst

Am 11.08.2016 um 13:58 schrieb Markus Heiser <[email protected]>:

Quoted 4 lines

Documentation/dma-buf/guide.rst line 119

Quoted 3 lines

+.. note:: Until this stage, the buffer-exporter has the option to choose not to

Documentation/dma-buf/guide.rst new file +2 -0
+   actually allocate the backing storage for this buffer, but wait for the
+   first buffer-user to request use of buffer for allocation.
Quoted 8 lines

Use newlines ... which are markups in reST ;)

.. note::

Until this stage, the buffer-exporter has the option to choose not to actually allocate the backing storage for this buffer, but wait for the first buffer-user to request use of buffer for allocation.

Sorry, my f... apple mail drops leading whitespaces ...

|.. note::
|
|   Until this stage, the buffer-exporter has the option to choose not to
|   actually allocate the backing storage for this buffer, but wait for the
Quoted 20 lines

Documentation/dma-buf/guide.rst line 255

Quoted 13 lines
Documentation/dma-buf/guide.rst new file +13 -0
+Kernel cpu access to a dma-buf buffer object
+============================================
+
+The motivation to allow cpu access from the kernel to a dma-buf object from the
+importers side are:
+
+* fallback operations, e.g. if the devices is connected to a usb bus and the
+  kernel needs to shuffle the data around first before sending it away.
+* full transparency for existing users on the importer side, i.e. userspace
+  should not notice the difference between a normal object from that subsystem
+  and an imported one backed by a dma-buf. This is really important for drm
+  opengl drivers that expect to still use all the existing upload/download
+  paths.

I is recommended to separate blocks (in this case the list item blocks) with a newline. E.g.

* first lorem
ipsum

Quoted 8 lines

* second lorem
ipsum

If you have only one-liners, it is OK to write

* first
* second

same here, leading whitespace are droped by the mail client.

|* first lorem
|  ipsum
|
|* second lorem
|  ipsum

Sorry for disorientation. For a snatch I forgot, that that Apple & MS have a mistaken idea of "plain text" ;)

-- Markus --

author maintainer
#6 lore raw

Re: [RFC 3/4] Documentation: move dma-buf documentation to rst

In reply to Jani Nikula

Hello Jani,

Quoted 18 lines · Jani Nikula
Quoted 6 lines · Sumit Semwal
Documentation/dma-buf/guide.rst new file +0 -0
new file mode 100644
index 000000000000..fd3534fdccb3

Documentation/dma-buf/guide.rst line 8

Quoted 8 lines
Documentation/dma-buf/guide.rst new file +8 -0
@@ -0,0 +1,503 @@
+
+.. _dma-buf-guide:
+
+============================
+DMA Buffer Sharing API Guide
+============================
+
+Sumit Semwal - [email protected], [email protected]

Please use the format

Quoted 2 lines

:author: Sumit Semwal <[email protected]>

Thanks very much for reviewing!

Quoted 19 lines

---

While on this subject, please excuse me for hijacking the thread a bit.

Personally, I believe it would be better to leave out authorship notes from documentation and source files in collaborative projects. Of course, it is only fair that people who deserve credit get the credit. Listing the authors in the file is often the natural thing to do, and superficially seems fair.

However, when do you add more names to the list? When has someone contributed enough to warrant that? Is it fair that the original authors keep getting the credit for the contributions of others? After a while, perhaps there is next to nothing left of the original contributions, but the bar is really high for removing anyone from the authors. Listing the authors gives the impression this is *their* file, while everyone should feel welcome to contribute, and everyone who contributes should feel ownership.

Quoted 2 lines

IMHO we would be better off using just the git history for the credits.

:) - I totally agree with your stand; this patch was an (almost) direct conversion from the earlier format, hence this patch.

But yes, I will remove it in the next iteration.

Quoted 5 lines

BR,
Jani.

BR,
Sumit.

Quoted 7 lines

PS. I am no saint here, I've got a couple of authors lines myself. I promise not to add more. I certainly won't chastise anyone for adding theirs.

--
Jani Nikula, Intel Open Source Technology Center

Signature · 5 lines
Thanks and regards,

Sumit Semwal
Linaro Mobile Group - Kernel Team Lead
Linaro.org │ Open source software for ARM SoCs
author maintainer
#9 lore raw

Re: [RFC 3/4] Documentation: move dma-buf documentation to rst

In reply to Markus Heiser

Hi Markus,

Quoted 5 lines · Markus Heiser

Hi Sumit,

I haven't compiled your patch yet, just my 2cent about the reStructuredText (reST) ASCII markup ...

Thanks very much for your detailed review comments - highly appreciated!

Quoted 60 lines

Here are some handy links about reST and the Sphinx markup constructs, we have not yet added to the documentation (sorry):

* reST primer: http://www.sphinx-doc.org/en/stable/rest.html
* reST quickref: http://docutils.sourceforge.net/docs/user/rst/quickref.html
* Sphinx markup constructs: http://www.sphinx-doc.org/en/stable/markup/index.html
* Sphinx domains: http://www.sphinx-doc.org/en/stable/domains.html
* Sphinx cross references: http://www.sphinx-doc.org/en/stable/markup/inline.html#cross-referencing-arbitrary-locations

Am 11.08.2016 um 12:47 schrieb Sumit Semwal <[email protected]>:

Quoted 6 lines

Branch out dma-buf related documentation into its own rst file to allow adding it to the sphinx documentation generated.

While at it, move dma-buf-sharing.txt into rst as the dma-buf guide too.

...

Quoted 7 lines
Documentation/dma-buf/guide.rst new file +7 -0
+dma-buf operations for device dma only
+======================================
+
+The dma_buf buffer sharing API usage contains the following steps:
+
+1. Exporter announces that it wishes to export a buffer
+2. Userspace gets the file descriptor associated with the exported buffer, and

Documentation/dma-buf/guide.rst line 53

Quoted 10 lines
Documentation/dma-buf/guide.rst new file +10 -0
+   passes it around to potential buffer-users based on use case
+3. Each buffer-user 'connects' itself to the buffer
+4. When needed, buffer-user requests access to the buffer from exporter
+5. When finished with its use, the buffer-user notifies end-of-DMA to exporter
+6. when buffer-user is done using this buffer completely, it 'disconnects'
+   itself from the buffer.
+
+
+1. Exporter's announcement of buffer export
+-------------------------------------------

I can't recommend numbering the (sub-) sections explicit, even if you here wanted to numerate the steps. Most often section numbers are controlled by the subordinate toctree directive and this might not fit to the step numbers.

* http://www.sphinx-doc.org/en/stable/markup/toctree.html?highlight=toc#the-toc-tree

Documentation/dma-buf/guide.rst line 60

Quoted 7 lines
Documentation/dma-buf/guide.rst new file +7 -0
+
+   The buffer exporter announces its wish to export a buffer. In this, it
+   connects its own private buffer data, provides implementation for operations
+   that can be performed on the exported :c:type:`dma_buf`, and flags for the file
+   associated with this buffer. All these fields are filled in struct
+   :c:type:`dma_buf_export_info`, defined via the DEFINE_DMA_BUF_EXPORT_INFO macro.
+

In restructuredText whitespace are markups.

Do not indent if you don't want to create a (indented) block. I recommend to drop the two spaces in front of the paragraphs.

IMHO you have to decide if you like to use sectioning (drop the to spaces) or stay with the two spaces and use an enumeration list. If you wan't to stay with the enumeration write:

Quoted 7 lines
|1. Exporter's announcement of buffer export
|
|   The buffer exporter announces its wish to export a buffer. In this, it
|   connects its own private buffer ..
|   ...

Understood; will correct.

Quoted 7 lines

Documentation/dma-buf/guide.rst line 62

Quoted 2 lines
Documentation/dma-buf/guide.rst new file +2 -0
+   Interface:
+      :c:type:`DEFINE_DMA_BUF_EXPORT_INFO(exp_info) <DEFINE_DMA_BUF_EXPORT_INFO>`

If haven't tested your patch, but I guess this will result in a Warning.

the markup ":c:type" is a reference to a typedef description

Quoted 8 lines

* http://www.sphinx-doc.org/en/stable/domains.html#role-c:type

If the description is given, you can use the short form

:c:type:DEFINE_DMA_BUF_EXPORT_INFO

but I think, this is a function, not a typedef.

I did test it before sending out the RFC, and didn't get any warnings. This, btw, is a macro, so I guess that's why no warning.

While on this topic, in my experimentation, if I just use the short form, the resultant text doesn't include the "(exp_info)" part as shown above.

Quoted 7 lines

Review

Quoted 2 lines
(quoted diff) +2 -0
+
+      :c:func:`struct dma_buf *dma_buf_export(struct dma_buf_export_info *exp_info)<dma_buf_export>`

short form to refer

:c:func:dma_buf_export()

When I last tried the short form, it only gave me a link to the full definition, and I wanted to have the arguments also shown here, so that the explanation below was easier. Though I think I tried without the (), so will try again and let you know.

Quoted 12 lines

Documentation/dma-buf/guide.rst line 72

Quoted 8 lines
Documentation/dma-buf/guide.rst new file +8 -0
+
+   If this succeeds, dma_buf_export allocates a dma_buf structure, and
+   returns a pointer to the same. It also associates an anonymous file with this
+   buffer, so it can be exported. On failure to allocate the dma_buf object,
+   it returns NULL.
+
+   'exp_name' in struct dma_buf_export_info is the name of exporter - to
+   facilitate information while debugging. It is set to KBUILD_MODNAME by

If you want to render a constant in a monospace font you can use the inline markup ``KBUILD_MODNAME``, but if you want.

Thanks, will do.

Quoted 12 lines
Quoted 12 lines
Documentation/dma-buf/guide.rst new file +12 -0
+   default, so exporters don't have to provide a specific name, if they don't
+   wish to.
+
+   DEFINE_DMA_BUF_EXPORT_INFO macro defines the struct dma_buf_export_info,
+   zeroes it out and pre-populates exp_name in it.
+
+2. Userspace gets a handle to pass around to potential buffer-users
+-------------------------------------------------------------------
+
+   Userspace entity requests for a file-descriptor (fd) which is a handle to the
+   anonymous file associated with the buffer. It can then share the fd with other
+   drivers and/or processes.
Quoted 9 lines

Documentation/dma-buf/guide.rst line 90

Quoted 6 lines
Documentation/dma-buf/guide.rst new file +6 -0
+
+   Interface:
+      :c:func:`int dma_buf_fd(struct dma_buf *dmabuf, int flags) <dma_buf_fd>`
+
+   This API installs an fd for the anonymous file associated with this buffer;
+   returns either 'fd', or error.

I recommend to markup source code objects uniform with ``fd``.

Ok.

Quoted 32 lines
Quoted 19 lines
Documentation/dma-buf/guide.rst new file +19 -0
+
+3. Each buffer-user 'connects' itself to the buffer
+---------------------------------------------------
+
+   Each buffer-user now gets a reference to the buffer, using the fd passed to
+   it.
+
+   Interface:
+      :c:func:`struct dma_buf *dma_buf_get(int fd) <dma_buf_get>`
+
+   This API will return a reference to the dma_buf, and increment refcount for
+   it.
+
+   After this, the buffer-user needs to attach its device with the buffer, which
+   helps the exporter to know of device buffer constraints.
+
+   Interface:
+      :c:func:`struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf, struct device *dev) <dma_buf_attach>`
+

Documentation/dma-buf/guide.rst line 119

Quoted 10 lines
Documentation/dma-buf/guide.rst new file +10 -0
+   This API returns reference to an attachment structure, which is then used
+   for scatterlist operations. It will optionally call the 'attach' dma_buf
+   operation, if provided by the exporter.
+
+   The dma-buf sharing framework does the bookkeeping bits related to managing
+   the list of all attachments to a buffer.
+
+.. note:: Until this stage, the buffer-exporter has the option to choose not to
+   actually allocate the backing storage for this buffer, but wait for the
+   first buffer-user to request use of buffer for allocation.

Use newlines ... which are markups in reST ;)

Quoted 7 lines

.. note::

Until this stage, the buffer-exporter has the option to choose not to actually allocate the backing storage for this buffer, but wait for the first buffer-user to request use of buffer for allocation.

Ok :), will correct.

Quoted 22 lines
Quoted 22 lines

+6. when buffer-user is done using this buffer, it 'disconnects' itself from the buffer.
+---------------------------------------------------------------------------------------

Documentation/dma-buf/guide.rst new file +20 -0
+
+   After the buffer-user has no more interest in using this buffer, it should
+   disconnect itself from the buffer:
+
+   * it first detaches itself from the buffer.
+
+   Interface:
+      :c:func:`void dma_buf_detach(struct dma_buf *dmabuf, struct dma_buf_attachment *dmabuf_attach) <dma_buf_detach>`
+
+   This API removes the attachment from the list in dmabuf, and optionally calls
+   dma_buf->ops->detach(), if provided by exporter, for any housekeeping bits.
+
+   * Then, the buffer-user returns the buffer reference to exporter.
+
+   Interface:
+     :c:func:`void dma_buf_put(struct dma_buf *dmabuf) <dma_buf_put>`
+
+   This API then reduces the refcount for this buffer.
+
+   If, as a result of this call, the refcount becomes 0, the 'release' file
Quoted 9 lines

Documentation/dma-buf/guide.rst line 200

Quoted 6 lines
Documentation/dma-buf/guide.rst new file +6 -0
+   operation related to this fd is called. It calls the dmabuf->ops->release()
+   operation in turn, and frees the memory allocated for dmabuf when exported.
+
+NOTES:
+------
+

I can't recommend to use colons in titles.

Ok, will remove them.

Quoted 6 lines

Documentation/dma-buf/guide.rst line 203

Quoted 3 lines
Documentation/dma-buf/guide.rst new file +3 -0
+* **Importance of attach-detach and {map,unmap}_dma_buf operation pairs**
+
+   The attach-detach calls allow the exporter to figure out backing-storage

only 2 spaces are needed here ... whitespaces are markups ;)

Right, got the message;)

Quoted 8 lines
Quoted 7 lines
Documentation/dma-buf/guide.rst new file +7 -0
+   constraints for the currently-interested devices. This allows preferential
+   allocation, and/or migration of pages across different types of storage
+   available, if possible.
+
+   Bracketing of DMA access with {map,unmap}_dma_buf operations is essential
+   to allow just-in-time backing of storage, and migration mid-way through a
+   use-case.
Quoted 7 lines

Documentation/dma-buf/guide.rst line 213

Quoted 3 lines
Documentation/dma-buf/guide.rst new file +3 -0
+
+* **Migration of backing storage if needed**
+

I can't recommend this style, using a list and a first bold line to emulate something what looks like a subsection .. use subsections or leave the bold line.

Yes, that's right; will correct.

Quoted 51 lines
Quoted 34 lines
Documentation/dma-buf/guide.rst new file +32 -0
+   If after
+
+   * at least one map_dma_buf has happened,
+   * and the backing storage has been allocated for this buffer,
+
+   another new buffer-user intends to attach itself to this buffer, it might
+   be allowed, if possible for the exporter.
+
+   In case it is allowed by the exporter:
+
+   * if the new buffer-user has stricter 'backing-storage constraints', and the
+     exporter can handle these constraints, the exporter can just stall on the
+     map_dma_buf until all outstanding access is completed (as signalled by
+     unmap_dma_buf).
+
+   * Once all users have finished accessing and have unmapped this buffer, the
+     exporter could potentially move the buffer to the stricter backing-storage,
+     and then allow further {map,unmap}_dma_buf operations from any buffer-user
+     from the migrated backing-storage.
+
+   * If the exporter cannot fulfill the backing-storage constraints of the new
+     buffer-user device as requested, dma_buf_attach() would return an error to
+     denote non-compatibility of the new buffer-sharing request with the current
+     buffer.
+
+
+   If the exporter chooses not to allow an attach() operation once a
+   map_dma_buf() API has been called, it simply returns an error.
+
+Kernel cpu access to a dma-buf buffer object
+============================================
+

Documentation/dma-buf/guide.rst line 255

Quoted 10 lines
Documentation/dma-buf/guide.rst new file +10 -0
+The motivation to allow cpu access from the kernel to a dma-buf object from the
+importers side are:
+
+* fallback operations, e.g. if the devices is connected to a usb bus and the
+  kernel needs to shuffle the data around first before sending it away.
+* full transparency for existing users on the importer side, i.e. userspace
+  should not notice the difference between a normal object from that subsystem
+  and an imported one backed by a dma-buf. This is really important for drm
+  opengl drivers that expect to still use all the existing upload/download
+  paths.

I is recommended to separate blocks (in this case the list item blocks) with a newline. E.g.

* first lorem
ipsum

Quoted 8 lines

* second lorem
ipsum

If you have only one-liners, it is OK to write

* first
* second

Understood, good tip for me.

Quoted 12 lines
Quoted 12 lines
Documentation/dma-buf/guide.rst new file +12 -0
+
+Access to a dma_buf from the kernel context involves three steps:
+
+1. Prepare access, which invalidate any necessary caches and make the object
+   available for cpu access.
+2. Access the object page-by-page with the dma_buf map apis
+3. Finish access, which will flush any necessary cpu caches and free reserved
+   resources.
+:`void dma_buf_end_cpu_access(struct dma_buf *dma_buf, enum dma_data_direction dir) <dma_buf_end_cpu_access>`
+
+
+Direct Userspace Access/mmap Support
Quoted 9 lines

Documentation/dma-buf/guide.rst line 356

Quoted 6 lines

+====================================

Documentation/dma-buf/guide.rst new file +5 -0
+
+Being able to mmap an export dma-buf buffer object has 2 main use-cases:
+* CPU fallback processing in a pipeline and
+* supporting existing mmap interfaces in importers.
+

Insert a newline in front of the list.

Ok.

Quoted 31 lines
Quoted 31 lines

+1. CPU fallback processing in a pipeline
+----------------------------------------

Documentation/dma-buf/guide.rst new file +29 -0
+
+   In many processing pipelines it is sometimes required that the cpu can access
+   the data in a dma-buf (e.g. for thumbnail creation, snapshots, ...). To avoid
+   the need to handle this specially in userspace frameworks for buffer sharing
+   it's ideal if the dma_buf fd itself can be used to access the backing storage
+   from userspace using mmap.
+
+   Furthermore Android's ION framework already supports this (and is otherwise
+   rather similar to dma-buf from a userspace consumer side with using fds as
+   handles, too). So it's beneficial to support this in a similar fashion on
+   dma-buf to have a good transition path for existing Android userspace.
+
+   No special interfaces, userspace simply calls mmap on the dma-buf fd, making
+   sure that the cache synchronization ioctl (DMA_BUF_IOCTL_SYNC) is *always*
+   used when the access happens. Note that DMA_BUF_IOCTL_SYNC can fail with
+   -EAGAIN or -EINTR, in which case it must be restarted.
+
+   Some systems might need some sort of cache coherency management e.g. when
+   CPU and GPU domains are being accessed through dma-buf at the same time. To
+   circumvent this problem there are begin/end coherency markers, that forward
+   directly to existing dma-buf device drivers vfunc hooks. Userspace can make
+   use of those markers through the DMA_BUF_IOCTL_SYNC ioctl. The sequence
+   would be used like following:
+
+     * mmap dma-buf fd
+     * for each drawing/upload cycle in CPU
+
+       1. SYNC_START ioctl,
+       2. read/write to mmap area
Quoted 9 lines

Documentation/dma-buf/guide.rst line 393

Quoted 6 lines
Documentation/dma-buf/guide.rst new file +6 -0
+       3. SYNC_END ioctl.
+
+       This can be repeated as often as you want (with the new data being
+       consumed by the GPU or say scanout device)
+     * munmap once you don't need the buffer any more
+

see above, use newline to separate last list item from the one before

Ok.

Quoted 23 lines
Quoted 23 lines
(quoted diff) +22 -0
+    For correctness and optimal performance, it is always required to use
+    SYNC_START and SYNC_END before and after, respectively, when accessing the
+    mapped address. Userspace cannot rely on coherent access, even when there
+    are systems where it just works without calling these ioctls.
+
 
+Introduction
+------------
+
+The dma-buf subsystem provides the framework for sharing buffers for
+hardware (DMA) access across multiple device drivers and subsystems, and
+for synchronizing asynchronous hardware access.
+
+This is used, for example, by drm "prime" multi-GPU support, but is of
+course not limited to GPU use cases.
+
+The three main components of this are:
+
+* dma-buf_: represents an sg_table, and is exposed to userspace as a file
+  descriptor to allow passing between devices,
+
+* fence_: which provides a mechanism to signal when one device has finished
+  access, and
Quoted 9 lines

Documentation/dma-buf/intro.rst line 27

Quoted 5 lines
Documentation/dma-buf/intro.rst new file +5 -0
+
+* reservation_: manages the shared or exclusive fence(s) associated with the
+  buffer.
+
+Please refer to :ref:`DMA buffer sharing guide <dma-buf-guide>` for more details.

alternative you can use the short form :ref:dma-buf-guide, depends on the context from which you refer and the targets title.

Will try that out.

Quoted 2 lines

But over all, I wan't say: thanks for your work :)

Thanks to you too, appreciate you taking time to read through this whole doc! :)

Quoted 3 lines

-- Markus --

BR,
Sumit.

Signature · 9 lines
Thanks and regards,

Sumit Semwal
Linaro Mobile Group - Kernel Team Lead
Linaro.org │ Open source software for ARM SoCs
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer
#11 lore raw
In reply to Sumit Semwal
Quoted 5 lines · On Thu, 11 Aug 2016 16:17:56 +0530 Sumit Semwal <[email protected]> wrote:

Convert dma-buf documentation over to sphinx; also cleanup to address sphinx warnings.

While at that, convert dma-buf-sharing.txt as well, and make it the dma-buf API guide.

Thanks for working to improve the documentation! I do have a few overall comments...

- The two comment fixes are a separate thing that should go straight to the dma-buf maintainer, who is ... <looks> ... evidently somebody familiar to you :) I assume you'll merge those two directly?

- It looks like you create a new RST document but leave the old one in place. Having two copies of the document around can only lead to confusion, so I think the old one should go.

- I really wonder if we want to start carving pieces out of device-drivers.tmpl in this way. I guess I would rather see the conversion of that book and the better integration of the other docs *into* it. One of the goals of this whole thing is to unify our documentation, not to reinforce the silos.

Does that make sense?

Thanks,

jon

#12 lore raw

rst htmldocs on kernel.org

Hi Jonathan,

not sure if this is already on your radar or if you're at all the right person to contact, but I just noticed that the gpu htmldocs are gone from https://www.kernel.org/doc/htmldocs/gpu/

Actually all the rst-formatted docs are missing. It would be great if they could be reinstated so as to fix all the now dangling hyperlinks out there...

Thanks,

Lukas

author maintainer
#15 lore raw
In reply to Jonathan Corbet

Hi Jon!

Quoted 12 lines · Jonathan Corbet
Quoted 5 lines · On Thu, 11 Aug 2016 16:17:56 +0530 Sumit Semwal <[email protected]> wrote:

Convert dma-buf documentation over to sphinx; also cleanup to address sphinx warnings.

While at that, convert dma-buf-sharing.txt as well, and make it the dma-buf API guide.

Thanks for working to improve the documentation! I do have a few overall comments...

Thank you for your review, and comments; my responses are inline.

Quoted 4 lines

- The two comment fixes are a separate thing that should go straight to the dma-buf maintainer, who is ... <looks> ... evidently somebody familiar to you :) I assume you'll merge those two directly?

Yes, of course :) - I will merge them directly, and will remove them from v2 of this series.

Quoted 4 lines

- It looks like you create a new RST document but leave the old one in place. Having two copies of the document around can only lead to confusion, so I think the old one should go.

Agreed on this as well; will correct it.

Quoted 6 lines

- I really wonder if we want to start carving pieces out of device-drivers.tmpl in this way. I guess I would rather see the conversion of that book and the better integration of the other docs *into* it. One of the goals of this whole thing is to unify our documentation, not to reinforce the silos.

I should've mentioned it in the cover letter - my intention of taking the dma-buf pieces out was to focus on these first while moving to sphinx.

My proposal would be, if all the device driver section owners could take the relevant pieces, convert them to sphinx (ironing out warnings etc in the process), then we can again 'bind' them together into the device drivers book in rst format.
This breaks the documentation conversion task into manageable pieces that can be handled independently, and gives everyone flexibility to work on their schedules.

This should also help in a good technical re-look at the content by subsystem developers, and make any documentation updates as required. The beauty of sphinx should allow us this, I think? Just my 2 cents.

Quoted 2 lines

Does that make sense?

I do hope that my proposal above finds some merit with everyone.

Quoted 3 lines

Thanks,

jon

BR,
Sumit.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#16 lore raw
Quoted 48 lines · Sumit Semwal

Hi Jon!

Quoted 12 lines · Jonathan Corbet
Quoted 5 lines · On Thu, 11 Aug 2016 16:17:56 +0530 Sumit Semwal <[email protected]> wrote:

Convert dma-buf documentation over to sphinx; also cleanup to address sphinx warnings.

While at that, convert dma-buf-sharing.txt as well, and make it the dma-buf API guide.

Thanks for working to improve the documentation! I do have a few overall comments...

Thank you for your review, and comments; my responses are inline.

Quoted 4 lines

- The two comment fixes are a separate thing that should go straight to the dma-buf maintainer, who is ... <looks> ... evidently somebody familiar to you :) I assume you'll merge those two directly?

Yes, of course :) - I will merge them directly, and will remove them from v2 of this series.

Quoted 4 lines

- It looks like you create a new RST document but leave the old one in place. Having two copies of the document around can only lead to confusion, so I think the old one should go.

Agreed on this as well; will correct it.

Quoted 6 lines

- I really wonder if we want to start carving pieces out of device-drivers.tmpl in this way. I guess I would rather see the conversion of that book and the better integration of the other docs *into* it. One of the goals of this whole thing is to unify our documentation, not to reinforce the silos.

I should've mentioned it in the cover letter - my intention of taking the dma-buf pieces out was to focus on these first while moving to sphinx.

My proposal would be, if all the device driver section owners could take the relevant pieces, convert them to sphinx (ironing out warnings etc in the process), then we can again 'bind' them together into the device drivers book in rst format.
This breaks the documentation conversion task into manageable pieces that can be handled independently, and gives everyone flexibility to work on their schedules.

Quoted 3 lines

This should also help in a good technical re-look at the content by subsystem developers, and make any documentation updates as required. The beauty of sphinx should allow us this, I think? Just my 2 cents.

I already tried to trick Sumit into converting the entire device-drivers.tmpl, but he didn't take the bait ;-)

I think just extracting dma-buf stuff (dma_buf, fence, reservation and all that) is ok though, it is a fairly stand-alone topic.
-Daniel

Quoted 15 lines
Quoted 3 lines

Does that make sense?

I do hope that my proposal above finds some merit with everyone.

Quoted 3 lines

Thanks,

jon

BR,
Sumit.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#3 lore raw

Re: [RFC 2/4] dma-buf/fence: kerneldoc: remove spurious section header

In reply to Sumit Semwal
Quoted 7 lines · Sumit Semwal

Commit e941759c74a44d6ac2eed21bb0a38b21fe4559e2 ("fence: dma-buf cross-device synchronization (v18)") had a spurious kerneldoc section header that caused Sphinx to complain. Fix it.

Fixes e941759c74a4 ("fence: dma-buf cross-device synchronization (v18)")

On patches 1&2 Reviewed-by: Daniel Vetter <[email protected]>

Quoted 24 lines
---
 include/linux/fence.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/fence.h +1 -1
index 5aa95eb886f7..5de89dab0013 100644
@@ -60,7 +60,7 @@ struct fence_cb;
  * implementer of the fence for its own purposes. Can be used in different
  * ways by different fence implementers, so do not rely on this.
  *
- * *) Since atomic bitops are used, this is not guaranteed to be the case.
+ * Since atomic bitops are used, this is not guaranteed to be the case.
  * Particularly, if the bit was set, but fence_signal was called right
  * before this bit was set, it would have been able to set the
  * FENCE_FLAG_SIGNALED_BIT, before enable_signaling was called.
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer
#13 lore raw

Re: rst htmldocs on kernel.org

In reply to Lukas Wunner
Quoted 7 lines · On Thu, 11 Aug 2016 21:13:29 +0200 Lukas Wunner <[email protected]> wrote:

not sure if this is already on your radar or if you're at all the right person to contact, but I just noticed that the gpu htmldocs are gone from https://www.kernel.org/doc/htmldocs/gpu/

Actually all the rst-formatted docs are missing. It would be great if they could be reinstated so as to fix all the now dangling hyperlinks out there...

I agree it would be good to get the new docs there. Doing so in a way that avoids breaking links could prove hard, though.

I've (finally) sent off a note to Konstantin to see what can be done.

Thanks,

jon

#14 lore raw

Re: rst htmldocs on kernel.org

Hi Jonathan,

[+cc Konstantin]

Quoted 5 lines · Jonathan Corbet
Quoted 4 lines · On Thu, 11 Aug 2016 21:13:29 +0200 Lukas Wunner <[email protected]> wrote:

not sure if this is already on your radar or if you're at all the right person to contact, but I just noticed that the gpu htmldocs are gone from https://www.kernel.org/doc/htmldocs/gpu/

Quoted 8 lines
Quoted 3 lines

Actually all the rst-formatted docs are missing. It would be great if they could be reinstated so as to fix all the now dangling hyperlinks out there...

I agree it would be good to get the new docs there. Doing so in a way that avoids breaking links could prove hard, though.

I've (finally) sent off a note to Konstantin to see what can be done.

It occured to me only after sending you the above e-mail that I should rather have e-mailed [email protected], apologies for bothering you with this.

As for broken links, it's probably sufficient to just make sure that the above-quoted top level URL is functioning. This may be as simple as an "apt-get install python-sphinx python-sphinx-rtd-theme" on the machine generating the docs, assuming it's Debian, and/or copying the results to the appropriate htdocs folder.

Thanks,

Lukas
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel