All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel-/w4YWyX8dFk@public.gmane.org>
To: "Christian König"
	<ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH 3/6] dma-buf: add peer2peer flag
Date: Tue, 23 Apr 2019 10:16:50 +0200	[thread overview]
Message-ID: <20190423081650.GA30926@phenom.ffwll.local> (raw)
In-Reply-To: <20190418120928.2699-4-christian.koenig-5C7GfCeVMHo@public.gmane.org>

On Thu, Apr 18, 2019 at 02:09:25PM +0200, Christian König wrote:
> 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>

Should we add something like "Such importers should also support dynamic
dma_buf attachments." to the kerneldoc?

Either way lgtm

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
>  drivers/dma-buf/dma-buf.c | 1 +
>  include/linux/dma-buf.h   | 4 ++++
>  2 files changed, 5 insertions(+)
> 
> diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
> index f23ff8355505..3ab49b492017 100644
> --- a/drivers/dma-buf/dma-buf.c
> +++ b/drivers/dma-buf/dma-buf.c
> @@ -563,6 +563,7 @@ struct dma_buf_attachment *dma_buf_attach(const struct dma_buf_attach_info *info
>  
>  	attach->dev = info->dev;
>  	attach->dmabuf = dmabuf;
> +	attach->peer2peer = info->peer2peer;
>  	attach->importer_priv = info->importer_priv;
>  	attach->invalidate = info->invalidate;
>  
> diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h
> index a615b74e5894..d2746bdfe92c 100644
> --- a/include/linux/dma-buf.h
> +++ b/include/linux/dma-buf.h
> @@ -346,6 +346,7 @@ struct dma_buf {
>   * @dmabuf: buffer for this attachment.
>   * @dev: device attached to the buffer.
>   * @node: list of dma_buf_attachment.
> + * @peer2peer: true if the importer can handle peer resources without pages.
>   * @priv: exporter specific attachment data.
>   * @importer_priv: importer specific attachment data.
>   *
> @@ -362,6 +363,7 @@ struct dma_buf_attachment {
>  	struct dma_buf *dmabuf;
>  	struct device *dev;
>  	struct list_head node;
> +	bool peer2peer;
>  	void *priv;
>  	struct sg_table *sgt;
>  	void *importer_priv;
> @@ -427,6 +429,7 @@ struct dma_buf_export_info {
>   * struct dma_buf_attach_info - holds information needed to attach to a dma_buf
>   * @dmabuf:		the exported dma_buf
>   * @dev:		the device which wants to import the attachment
> + * @peer2peer:		true if the importer can handle peer resources without pages
>   * @importer_priv:	private data of importer to this attachment
>   * @invalidate:		callback to use for invalidating mappings
>   *
> @@ -436,6 +439,7 @@ struct dma_buf_export_info {
>  struct dma_buf_attach_info {
>  	struct dma_buf *dmabuf;
>  	struct device *dev;
> +	bool peer2peer;
>  	void *importer_priv;
>  	void (*invalidate)(struct dma_buf_attachment *attach);
>  };
> -- 
> 2.17.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2019-04-23  8:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-18 12:09 DMA-buf P2P Christian König
2019-04-18 12:09 ` [PATCH 6/6] drm/amdgpu: add support for exporting VRAM using DMA-buf v2 Christian König
     [not found]   ` <20190418120928.2699-7-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2019-04-19 19:18     ` Alex Deucher
     [not found] ` <20190418120928.2699-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2019-04-18 12:09   ` [PATCH 1/6] lib/scatterlist: add sg_set_dma_addr() helper Christian König
2019-04-18 12:09   ` [PATCH 2/6] PCI/P2PDMA: start with a whitelist for root complexes Christian König
     [not found]     ` <20190418120928.2699-3-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2019-04-19 17:13       ` Alex Deucher
     [not found]         ` <CADnq5_OD+oW4uT0i6ZkW1w5AG4i=G+WW2uSB6BiUuArV_bCtHw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-04-23 12:45           ` Christian König
2019-04-18 12:09   ` [PATCH 3/6] dma-buf: add peer2peer flag Christian König
     [not found]     ` <20190418120928.2699-4-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2019-04-23  8:16       ` Daniel Vetter [this message]
     [not found]         ` <20190423081650.GA30926-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2019-04-23  8:18           ` Daniel Vetter
2019-04-18 12:09   ` [PATCH 4/6] drm/amdgpu: note that we can handle peer2peer DMA-buf Christian König
2019-04-18 12:09   ` [PATCH 5/6] drm/amdgpu: add checks if DMA-buf P2P is supported Christian König
2019-04-19  9:43   ` DMA-buf P2P Zhou, David(ChunMing)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190423081650.GA30926@phenom.ffwll.local \
    --to=daniel-/w4ywyx8dfk@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.