Merge remote-tracking branches 'asoc/topic/rt5514', 'asoc/topic/rt5640', 'asoc/topic...
[linux-2.6-block.git] / Documentation / driver-api / dma-buf.rst
1 Buffer Sharing and Synchronization
2 ==================================
3
4 The dma-buf subsystem provides the framework for sharing buffers for
5 hardware (DMA) access across multiple device drivers and subsystems, and
6 for synchronizing asynchronous hardware access.
7
8 This is used, for example, by drm "prime" multi-GPU support, but is of
9 course not limited to GPU use cases.
10
11 The three main components of this are: (1) dma-buf, representing a
12 sg_table and exposed to userspace as a file descriptor to allow passing
13 between devices, (2) fence, which provides a mechanism to signal when
14 one device as finished access, and (3) reservation, which manages the
15 shared or exclusive fence(s) associated with the buffer.
16
17 Shared DMA Buffers
18 ------------------
19
20 .. kernel-doc:: drivers/dma-buf/dma-buf.c
21    :export:
22
23 .. kernel-doc:: include/linux/dma-buf.h
24    :internal:
25
26 Reservation Objects
27 -------------------
28
29 .. kernel-doc:: drivers/dma-buf/reservation.c
30    :doc: Reservation Object Overview
31
32 .. kernel-doc:: drivers/dma-buf/reservation.c
33    :export:
34
35 .. kernel-doc:: include/linux/reservation.h
36    :internal:
37
38 DMA Fences
39 ----------
40
41 .. kernel-doc:: drivers/dma-buf/dma-fence.c
42    :export:
43
44 .. kernel-doc:: include/linux/dma-fence.h
45    :internal:
46
47 Seqno Hardware Fences
48 ~~~~~~~~~~~~~~~~~~~~~
49
50 .. kernel-doc:: drivers/dma-buf/seqno-fence.c
51    :export:
52
53 .. kernel-doc:: include/linux/seqno-fence.h
54    :internal:
55
56 DMA Fence Array
57 ~~~~~~~~~~~~~~~
58
59 .. kernel-doc:: drivers/dma-buf/dma-fence-array.c
60    :export:
61
62 .. kernel-doc:: include/linux/dma-fence-array.h
63    :internal:
64
65 DMA Fence uABI/Sync File
66 ~~~~~~~~~~~~~~~~~~~~~~~~
67
68 .. kernel-doc:: drivers/dma-buf/sync_file.c
69    :export:
70
71 .. kernel-doc:: include/linux/sync_file.h
72    :internal:
73