search for: dma_buf

Displaying 20 results from an estimated 107 matches for "dma_buf".

2020 Jun 04
2
[PATCH v4 1/3] virtio: add dma-buf support for exported objects
...f-by: David Stevens <stevensd at chromium.org> Is this just for graphics? If yes I'd rather we put it in the graphics driver. We can always move it later ... > --- > drivers/virtio/Makefile | 2 +- > drivers/virtio/virtio.c | 6 +++ > drivers/virtio/virtio_dma_buf.c | 89 +++++++++++++++++++++++++++++++++ > include/linux/virtio.h | 1 + > include/linux/virtio_dma_buf.h | 58 +++++++++++++++++++++ > 5 files changed, 155 insertions(+), 1 deletion(-) > create mode 100644 drivers/virtio/virtio_dma_buf.c > create mode 100644 include/li...
2020 Jun 04
2
[PATCH v4 1/3] virtio: add dma-buf support for exported objects
...f-by: David Stevens <stevensd at chromium.org> Is this just for graphics? If yes I'd rather we put it in the graphics driver. We can always move it later ... > --- > drivers/virtio/Makefile | 2 +- > drivers/virtio/virtio.c | 6 +++ > drivers/virtio/virtio_dma_buf.c | 89 +++++++++++++++++++++++++++++++++ > include/linux/virtio.h | 1 + > include/linux/virtio_dma_buf.h | 58 +++++++++++++++++++++ > 5 files changed, 155 insertions(+), 1 deletion(-) > create mode 100644 drivers/virtio/virtio_dma_buf.c > create mode 100644 include/li...
2018 Jan 11
5
[PATCH 1/5] drm/prime: Remove duplicate forward declaration
...file changed, 2 deletions(-) diff --git a/include/drm/drm_prime.h b/include/drm/drm_prime.h index 9cd9e36f77b5..59ccab402e85 100644 --- a/include/drm/drm_prime.h +++ b/include/drm/drm_prime.h @@ -59,8 +59,6 @@ struct drm_device; struct drm_gem_object; struct drm_file; -struct device; - struct dma_buf *drm_gem_prime_export(struct drm_device *dev, struct drm_gem_object *obj, int flags); -- 2.15.1
2018 Jan 11
0
[PATCH 2/5] drm/prime: Export more helpers for drivers
...dia.com> Export some more of the helpers in order to allow drivers to more fine- grainedly select which helpers to use. This gives drivers an easy way to reuse a lot of the code in the helpers while at the same time allowing them to provide their own implementation for other functions in struct dma_buf_ops. Signed-off-by: Thierry Reding <treding at nvidia.com> --- drivers/gpu/drm/drm_prime.c | 23 +++++++++++++---------- include/drm/drm_prime.h | 12 ++++++++++++ 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c...
2020 Sep 10
0
[PATCH v7 1/3] virtio: add dma-buf support for exported objects
....org> This makes VIRTIO dependent on DMA_SHARED_BUFFER. That means "select DMA_SHARED_BUFFER" will have to be added to "config VIRTIO". Guenter > --- > drivers/virtio/Makefile | 2 +- > drivers/virtio/virtio.c | 6 +++ > drivers/virtio/virtio_dma_buf.c | 85 +++++++++++++++++++++++++++++++++ > include/linux/virtio.h | 1 + > include/linux/virtio_dma_buf.h | 37 ++++++++++++++ > 5 files changed, 130 insertions(+), 1 deletion(-) > create mode 100644 drivers/virtio/virtio_dma_buf.c > create mode 100644 include/linux/vir...
2020 Jun 19
0
[PATCH v4 1/3] virtio: add dma-buf support for exported objects
...we're only talking > about a single virtio subsystem. Thanks for the explanation! Regards Guennadi > > > > --- > > > > drivers/virtio/Makefile | 2 +- > > > > drivers/virtio/virtio.c | 6 +++ > > > > drivers/virtio/virtio_dma_buf.c | 89 +++++++++++++++++++++++++++++++++ > > > > include/linux/virtio.h | 1 + > > > > include/linux/virtio_dma_buf.h | 58 +++++++++++++++++++++ > > > > 5 files changed, 155 insertions(+), 1 deletion(-) > > > > create mode 100644 drivers...
2020 May 13
2
[PATCH v3 1/4] dma-buf: add support for virtio exported objects
...s: - obviously we need the users of this in a few drivers, can't really review anything stand-alone - adding very specific ops to the generic interface is rather awkward, eventually everyone wants that and we end up in a mess. I think the best solution here would be if we create a struct virtio_dma_buf which subclasses dma-buf, add a (hopefully safe) runtime upcasting functions, and then a virtio_dma_buf_get_uuid() function. Just storing the uuid should be doable (assuming this doesn't change during the lifetime of the buffer), so no need for a callback. - for the runtime upcasting the usual...
2020 May 13
2
[PATCH v3 1/4] dma-buf: add support for virtio exported objects
...s: - obviously we need the users of this in a few drivers, can't really review anything stand-alone - adding very specific ops to the generic interface is rather awkward, eventually everyone wants that and we end up in a mess. I think the best solution here would be if we create a struct virtio_dma_buf which subclasses dma-buf, add a (hopefully safe) runtime upcasting functions, and then a virtio_dma_buf_get_uuid() function. Just storing the uuid should be doable (assuming this doesn't change during the lifetime of the buffer), so no need for a callback. - for the runtime upcasting the usual...
2012 Nov 22
0
[resend PATCH] drm/nouveau: unpin buffers before releasing to prevent lockdep warnings
...unpin(nvbo); } diff --git a/drivers/gpu/drm/nouveau/nouveau_prime.c b/drivers/gpu/drm/nouveau/nouveau_prime.c index 366462c..bd785dd 100644 --- a/drivers/gpu/drm/nouveau/nouveau_prime.c +++ b/drivers/gpu/drm/nouveau/nouveau_prime.c @@ -57,10 +57,11 @@ static void nouveau_gem_dmabuf_release(struct dma_buf *dma_buf) { struct nouveau_bo *nvbo = dma_buf->priv; - if (nvbo->gem->export_dma_buf == dma_buf) { + if (nvbo->gem->export_dma_buf == dma_buf) nvbo->gem->export_dma_buf = NULL; - drm_gem_object_unreference_unlocked(nvbo->gem); - } + + nouveau_bo_unpin(nvbo); + drm_g...
2012 Oct 12
0
[PATCH 3/3, resend with fixed to field] drm/nouveau: unpin buffers before releasing to prevent lockdep warnings
...unpin(nvbo); } diff --git a/drivers/gpu/drm/nouveau/nouveau_prime.c b/drivers/gpu/drm/nouveau/nouveau_prime.c index 366462c..bd785dd 100644 --- a/drivers/gpu/drm/nouveau/nouveau_prime.c +++ b/drivers/gpu/drm/nouveau/nouveau_prime.c @@ -57,10 +57,11 @@ static void nouveau_gem_dmabuf_release(struct dma_buf *dma_buf) { struct nouveau_bo *nvbo = dma_buf->priv; - if (nvbo->gem->export_dma_buf == dma_buf) { + if (nvbo->gem->export_dma_buf == dma_buf) nvbo->gem->export_dma_buf = NULL; - drm_gem_object_unreference_unlocked(nvbo->gem); - } + + nouveau_bo_unpin(nvbo); + drm_g...
2019 Sep 17
0
[RFC PATCH] drm/virtio: Export resource handles via DMA-buf API
...A virtio driver that does memory management fully on its own would have > code similar to following. The code is identical to what a regular > driver for real hardware would do to import a DMA-buf. > > static int virtio_foo_get_resource_handle(struct virtio_foo *foo, > struct dma_buf *dma_buf, u32 *id) > { > struct dma_buf_attachment *attach; > struct sg_table *sgt; > int ret = 0; > > attach = dma_buf_attach(dma_buf, foo->dev); > if (IS_ERR(attach)) > return PTR_ERR(attach); > > sgt = dma_buf_map_attachment(attach, DMA_BIDIRECTIONAL);...
2019 Oct 08
0
[RFC PATCH] drm/virtio: Export resource handles via DMA-buf API
...> code similar to following. The code is identical to what a regular > > > driver for real hardware would do to import a DMA-buf. > > > > > > static int virtio_foo_get_resource_handle(struct virtio_foo *foo, > > > struct dma_buf *dma_buf, u32 *id) > > > { > > > struct dma_buf_attachment *attach; > > > struct sg_table *sgt; > > > int ret = 0; > > > > > > attach = dma_buf_attach(dma_buf, foo->dev); > > > if (IS_ERR(attach)) > &...
2019 Oct 08
0
[RFC PATCH] drm/virtio: Export resource handles via DMA-buf API
...is identical to what a regular > > > > > driver for real hardware would do to import a DMA-buf. > > > > > > > > > > static int virtio_foo_get_resource_handle(struct virtio_foo *foo, > > > > > struct dma_buf *dma_buf, u32 *id) > > > > > { > > > > > struct dma_buf_attachment *attach; > > > > > struct sg_table *sgt; > > > > > int ret = 0; > > > > > > > > > > attach = dma_buf_attach(dma_buf, f...
2019 Oct 16
0
[RFC PATCH] drm/virtio: Export resource handles via DMA-buf API
...; > > > > > driver for real hardware would do to import a DMA-buf. > > > > > > > > > > > > > > static int virtio_foo_get_resource_handle(struct virtio_foo *foo, > > > > > > > struct dma_buf *dma_buf, u32 *id) > > > > > > > { > > > > > > > struct dma_buf_attachment *attach; > > > > > > > struct sg_table *sgt; > > > > > > > int ret = 0; > > > > > > > > > >...
2020 Sep 29
0
[PATCH v3 4/7] drm/gem: Update internal GEM vmap/vunmap interfaces to use struct dma_buf_map
GEM's vmap and vunmap interfaces now wrap memory pointers in struct dma_buf_map. Signed-off-by: Thomas Zimmermann <tzimmermann at suse.de> --- drivers/gpu/drm/drm_client.c | 18 +++++++++++------- drivers/gpu/drm/drm_gem.c | 28 ++++++++++++++-------------- drivers/gpu/drm/drm_internal.h | 5 +++-- drivers/gpu/drm/drm_prime.c | 14 ++++---------- 4 files...
2019 Jul 16
1
[PATCH v3 2/3] drm: plumb attaching dev thru to prime_pin/unpin
...obj); void drm_gem_vunmap(struct drm_gem_object *obj, void *vaddr); diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c index 189d980402ad..126860432ff9 100644 --- a/drivers/gpu/drm/drm_prime.c +++ b/drivers/gpu/drm/drm_prime.c @@ -575,7 +575,7 @@ int drm_gem_map_attach(struct dma_buf *dma_buf, { struct drm_gem_object *obj = dma_buf->priv; - return drm_gem_pin(obj); + return drm_gem_pin(obj, attach->dev); } EXPORT_SYMBOL(drm_gem_map_attach); @@ -593,7 +593,7 @@ void drm_gem_map_detach(struct dma_buf *dma_buf, { struct drm_gem_object *obj = dma_buf->priv; -...
2019 Jul 16
1
[PATCH v3 2/3] drm: plumb attaching dev thru to prime_pin/unpin
...obj); void drm_gem_vunmap(struct drm_gem_object *obj, void *vaddr); diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c index 189d980402ad..126860432ff9 100644 --- a/drivers/gpu/drm/drm_prime.c +++ b/drivers/gpu/drm/drm_prime.c @@ -575,7 +575,7 @@ int drm_gem_map_attach(struct dma_buf *dma_buf, { struct drm_gem_object *obj = dma_buf->priv; - return drm_gem_pin(obj); + return drm_gem_pin(obj, attach->dev); } EXPORT_SYMBOL(drm_gem_map_attach); @@ -593,7 +593,7 @@ void drm_gem_map_detach(struct dma_buf *dma_buf, { struct drm_gem_object *obj = dma_buf->priv; -...
2019 Jul 16
1
[PATCH v3 2/3] drm: plumb attaching dev thru to prime_pin/unpin
...obj); void drm_gem_vunmap(struct drm_gem_object *obj, void *vaddr); diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c index 189d980402ad..126860432ff9 100644 --- a/drivers/gpu/drm/drm_prime.c +++ b/drivers/gpu/drm/drm_prime.c @@ -575,7 +575,7 @@ int drm_gem_map_attach(struct dma_buf *dma_buf, { struct drm_gem_object *obj = dma_buf->priv; - return drm_gem_pin(obj); + return drm_gem_pin(obj, attach->dev); } EXPORT_SYMBOL(drm_gem_map_attach); @@ -593,7 +593,7 @@ void drm_gem_map_detach(struct dma_buf *dma_buf, { struct drm_gem_object *obj = dma_buf->priv; -...
2014 Sep 29
1
[RFC PATCH 7/7] drm/prime: Support explicit fence on export
...en wrote: > Allow user space to provide an explicit sync fence fd when exporting > a dma-buf from gem handle. The fence will be stored as the explicit > fence to the reservation object. > > Signed-off-by: Lauri Peltonen <lpeltonen at nvidia.com> All existing userspace treats dma_bufs as long-lived objects. Well, all the userspace that expects implicit syncing, afaik Android shovels lots of dma-bufs around all the time (since ion is using them as it's native buffer handles). So adding an exclusive fence once at export time isn't going to be terribly useful. So I think...
2023 May 26
1
[PATCH] drm: Remove unnecessary (void*) conversions
...ivers/gpu/drm/vmwgfx/ttm_object.c index ddf8373c1d77..e9e3cc8f5b49 100644 --- a/drivers/gpu/drm/vmwgfx/ttm_object.c +++ b/drivers/gpu/drm/vmwgfx/ttm_object.c @@ -513,8 +513,7 @@ static void ttm_prime_refcount_release(struct ttm_base_object **p_base) */ static void ttm_prime_dmabuf_release(struct dma_buf *dma_buf) { - struct ttm_prime_object *prime = - (struct ttm_prime_object *) dma_buf->priv; + struct ttm_prime_object *prime = dma_buf->priv; struct ttm_base_object *base = &prime->base; struct ttm_object_device *tdev = base->tfile->tdev; @@ -554,7 +553,7 @@ int ttm_prime...