<div dir="auto"><div>Hi Christian,<br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 31 Mar 2020, 14:16 Daniel Vetter, <<a href="mailto:daniel@ffwll.ch">daniel@ffwll.ch</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Mon, Mar 30, 2020 at 03:55:31PM +0200, Christian König wrote:<br>
> Add a peer2peer flag noting that the importer can deal with device<br>
> resources which are not backed by pages.<br>
> <br>
> Signed-off-by: Christian König <<a href="mailto:christian.koenig@amd.com" target="_blank" rel="noreferrer">christian.koenig@amd.com</a>><br>
<br>
On the series:<br>
<br>
Acked-by: Daniel Vetter <<a href="mailto:daniel.vetter@ffwll.ch" target="_blank" rel="noreferrer">daniel.vetter@ffwll.ch</a>><br></blockquote></div></div><div dir="auto">Fwiw, for the series,</div><div dir="auto">Acked-by: Sumit Semwal <<a href="mailto:sumit.semwal@linaro.org">sumit.semwal@linaro.org</a>></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
> ---<br>
>  drivers/dma-buf/dma-buf.c |  2 ++<br>
>  include/linux/dma-buf.h   | 10 ++++++++++<br>
>  2 files changed, 12 insertions(+)<br>
> <br>
> diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c<br>
> index ccc9eda1bc28..570c923023e6 100644<br>
> --- a/drivers/dma-buf/dma-buf.c<br>
> +++ b/drivers/dma-buf/dma-buf.c<br>
> @@ -690,6 +690,8 @@ dma_buf_dynamic_attach(struct dma_buf *dmabuf, struct device *dev,<br>
>  <br>
>       attach->dev = dev;<br>
>       attach->dmabuf = dmabuf;<br>
> +     if (importer_ops)<br>
> +             attach->peer2peer = importer_ops->allow_peer2peer;<br>
>       attach->importer_ops = importer_ops;<br>
>       attach->importer_priv = importer_priv;<br>
>  <br>
> diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h<br>
> index 1ade486fc2bb..82e0a4a64601 100644<br>
> --- a/include/linux/dma-buf.h<br>
> +++ b/include/linux/dma-buf.h<br>
> @@ -334,6 +334,14 @@ struct dma_buf {<br>
>   * Attachment operations implemented by the importer.<br>
>   */<br>
>  struct dma_buf_attach_ops {<br>
> +     /**<br>
> +      * @allow_peer2peer:<br>
> +      *<br>
> +      * If this is set to true the importer must be able to handle peer<br>
> +      * resources without struct pages.<br>
> +      */<br>
> +     bool allow_peer2peer;<br>
> +<br>
>       /**<br>
>        * @move_notify<br>
>        *<br>
> @@ -362,6 +370,7 @@ struct dma_buf_attach_ops {<br>
>   * @node: list of dma_buf_attachment, protected by dma_resv lock of the dmabuf.<br>
>   * @sgt: cached mapping.<br>
>   * @dir: direction of cached mapping.<br>
> + * @peer2peer: true if the importer can handle peer resources without pages.<br>
>   * @priv: exporter specific attachment data.<br>
>   * @importer_ops: importer operations for this attachment, if provided<br>
>   * dma_buf_map/unmap_attachment() must be called with the dma_resv lock held.<br>
> @@ -382,6 +391,7 @@ struct dma_buf_attachment {<br>
>       struct list_head node;<br>
>       struct sg_table *sgt;<br>
>       enum dma_data_direction dir;<br>
> +     bool peer2peer;<br>
>       const struct dma_buf_attach_ops *importer_ops;<br>
>       void *importer_priv;<br>
>       void *priv;<br>
> -- <br>
> 2.17.1<br>
> <br>
<br>
-- <br>
Daniel Vetter<br>
Software Engineer, Intel Corporation<br>
<a href="http://blog.ffwll.ch" rel="noreferrer noreferrer" target="_blank">http://blog.ffwll.ch</a><br>
_______________________________________________<br>
dri-devel mailing list<br>
<a href="mailto:dri-devel@lists.freedesktop.org" target="_blank" rel="noreferrer">dri-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/dri-devel" rel="noreferrer noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/dri-devel</a><br>
</blockquote></div></div></div>