aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/dma-buf.h
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2018-03-22 17:09:42 +0100
committerChristian König <christian.koenig@amd.com>2020-04-01 09:02:45 +0200
commit09606b5446c25b2c3b16c5bd2977eca730e3a570 (patch)
tree51a5d6be165f26e8e7ffd28b7e496faf3b10f847 /include/linux/dma-buf.h
parentdrm/dp_mst: make build_clear_payload_id_table return void (diff)
downloadlinux-dev-09606b5446c25b2c3b16c5bd2977eca730e3a570.tar.xz
linux-dev-09606b5446c25b2c3b16c5bd2977eca730e3a570.zip
dma-buf: add peer2peer flag
Add a peer2peer flag noting that the importer can deal with device resources which are not backed by pages. Signed-off-by: Christian König <christian.koenig@amd.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Acked-by: Sumit Semwal <sumit.semwal@linaro.org> Link: https://patchwork.freedesktop.org/patch/359286/
Diffstat (limited to 'include/linux/dma-buf.h')
-rw-r--r--include/linux/dma-buf.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h
index 1ade486fc2bb..82e0a4a64601 100644
--- a/include/linux/dma-buf.h
+++ b/include/linux/dma-buf.h
@@ -335,6 +335,14 @@ struct dma_buf {
*/
struct dma_buf_attach_ops {
/**
+ * @allow_peer2peer:
+ *
+ * If this is set to true the importer must be able to handle peer
+ * resources without struct pages.
+ */
+ bool allow_peer2peer;
+
+ /**
* @move_notify
*
* If this callback is provided the framework can avoid pinning the
@@ -362,6 +370,7 @@ struct dma_buf_attach_ops {
* @node: list of dma_buf_attachment, protected by dma_resv lock of the dmabuf.
* @sgt: cached mapping.
* @dir: direction of cached mapping.
+ * @peer2peer: true if the importer can handle peer resources without pages.
* @priv: exporter specific attachment data.
* @importer_ops: importer operations for this attachment, if provided
* dma_buf_map/unmap_attachment() must be called with the dma_resv lock held.
@@ -382,6 +391,7 @@ struct dma_buf_attachment {
struct list_head node;
struct sg_table *sgt;
enum dma_data_direction dir;
+ bool peer2peer;
const struct dma_buf_attach_ops *importer_ops;
void *importer_priv;
void *priv;