Displaying 20 results from an estimated 88 matches for "dma_buf_attachment".
2018 Jan 11
0
[PATCH 2/5] drm/prime: Export more helpers for drivers
...- a/drivers/gpu/drm/drm_prime.c
+++ b/drivers/gpu/drm/drm_prime.c
@@ -180,9 +180,8 @@ static int drm_prime_lookup_buf_handle(struct drm_prime_file_private *prime_fpri
return -ENOENT;
}
-static int drm_gem_map_attach(struct dma_buf *dma_buf,
- struct device *target_dev,
- struct dma_buf_attachment *attach)
+int drm_gem_map_attach(struct dma_buf *dma_buf, struct device *target_dev,
+ struct dma_buf_attachment *attach)
{
struct drm_prime_attachment *prime_attach;
struct drm_gem_object *obj = dma_buf->priv;
@@ -200,9 +199,10 @@ static int drm_gem_map_attach(struct dma_buf *dma_b...
2018 Jan 11
5
[PATCH 1/5] drm/prime: Remove duplicate forward declaration
From: Thierry Reding <treding at nvidia.com>
struct device is forward-declared twice. Remove the second instance.
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
Signed-off-by: Thierry Reding <treding at nvidia.com>
---
include/drm/drm_prime.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/include/drm/drm_prime.h b/include/drm/drm_prime.h
index
2019 Sep 17
0
[RFC PATCH] drm/virtio: Export resource handles via DMA-buf API
...ly 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);
> if (IS_ERR(sgt)) {
> ret = PTR_ERR(sgt);
>...
2020 Jun 04
2
[PATCH v4 1/3] virtio: add dma-buf support for exported objects
...tainer_off?
> +
> + return dma_buf_export(&exp_info);
> +}
> +EXPORT_SYMBOL(virtio_dma_buf_export);
> +
> +/**
> + * virtio_dma_buf_attach - mandatory attach callback for virtio dma-bufs
> + */
> +int virtio_dma_buf_attach(struct dma_buf *dma_buf,
> + struct dma_buf_attachment *attach)
> +{
> + int ret;
> + const struct virtio_dma_buf_ops *ops = container_of(
> + dma_buf->ops, const struct virtio_dma_buf_ops, ops);
> +
> + if (ops->device_attach) {
> + ret = ops->device_attach(dma_buf, attach);
> + if (ret)
> + return ret;
> +...
2020 Jun 04
2
[PATCH v4 1/3] virtio: add dma-buf support for exported objects
...tainer_off?
> +
> + return dma_buf_export(&exp_info);
> +}
> +EXPORT_SYMBOL(virtio_dma_buf_export);
> +
> +/**
> + * virtio_dma_buf_attach - mandatory attach callback for virtio dma-bufs
> + */
> +int virtio_dma_buf_attach(struct dma_buf *dma_buf,
> + struct dma_buf_attachment *attach)
> +{
> + int ret;
> + const struct virtio_dma_buf_ops *ops = container_of(
> + dma_buf->ops, const struct virtio_dma_buf_ops, ops);
> +
> + if (ops->device_attach) {
> + ret = ops->device_attach(dma_buf, attach);
> + if (ret)
> + return ret;
> +...
2019 Oct 08
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;
> > >
> > > attach = dma_buf_attach(dma_buf, foo->dev);
> > > if (IS_ERR(attach))
> > > return PTR_ERR(attach);
> > >
> > >...
2019 Oct 08
0
[RFC PATCH] drm/virtio: Export resource handles via DMA-buf API
...o 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 16
0
[RFC PATCH] drm/virtio: Export resource handles via DMA-buf API
...>
> > > > > > > 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_ER...
2020 Sep 10
0
[PATCH v7 1/3] virtio: add dma-buf support for exported objects
...(-EINVAL);
> + }
> +
> + return dma_buf_export(exp_info);
> +}
> +EXPORT_SYMBOL(virtio_dma_buf_export);
> +
> +/**
> + * virtio_dma_buf_attach - mandatory attach callback for virtio dma-bufs
> + */
> +int virtio_dma_buf_attach(struct dma_buf *dma_buf,
> + struct dma_buf_attachment *attach)
> +{
> + int ret;
> + const struct virtio_dma_buf_ops *ops =
> + container_of(dma_buf->ops,
> + const struct virtio_dma_buf_ops, ops);
> +
> + if (ops->device_attach) {
> + ret = ops->device_attach(dma_buf, attach);
> + if (ret)
> + return...
2015 Sep 21
2
[PATCH v2 5/6] virtio-gpu: add basic prime support
...me.c */
+int virtgpu_gem_prime_pin(struct drm_gem_object *obj);
+void virtgpu_gem_prime_unpin(struct drm_gem_object *obj);
+struct sg_table *virtgpu_gem_prime_get_sg_table(struct drm_gem_object *obj);
+struct drm_gem_object *virtgpu_gem_prime_import_sg_table(
+ struct drm_device *dev, struct dma_buf_attachment *attach,
+ struct sg_table *sgt);
+void *virtgpu_gem_prime_vmap(struct drm_gem_object *obj);
+void virtgpu_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr);
+int virtgpu_gem_prime_mmap(struct drm_gem_object *obj,
+ struct vm_area_struct *vma);
+
stati...
2015 Sep 21
2
[PATCH v2 5/6] virtio-gpu: add basic prime support
...me.c */
+int virtgpu_gem_prime_pin(struct drm_gem_object *obj);
+void virtgpu_gem_prime_unpin(struct drm_gem_object *obj);
+struct sg_table *virtgpu_gem_prime_get_sg_table(struct drm_gem_object *obj);
+struct drm_gem_object *virtgpu_gem_prime_import_sg_table(
+ struct drm_device *dev, struct dma_buf_attachment *attach,
+ struct sg_table *sgt);
+void *virtgpu_gem_prime_vmap(struct drm_gem_object *obj);
+void virtgpu_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr);
+int virtgpu_gem_prime_mmap(struct drm_gem_object *obj,
+ struct vm_area_struct *vma);
+
stati...
2019 Apr 26
3
[PATCH] Revert "drm/qxl: drop prime import/export callbacks"
...rime.c
@@ -42,6 +42,18 @@ void qxl_gem_prime_unpin(struct drm_gem_object *obj)
qxl_bo_unpin(bo);
}
+struct sg_table *qxl_gem_prime_get_sg_table(struct drm_gem_object *obj)
+{
+ return ERR_PTR(-ENOSYS);
+}
+
+struct drm_gem_object *qxl_gem_prime_import_sg_table(
+ struct drm_device *dev, struct dma_buf_attachment *attach,
+ struct sg_table *table)
+{
+ return ERR_PTR(-ENOSYS);
+}
+
void *qxl_gem_prime_vmap(struct drm_gem_object *obj)
{
struct qxl_bo *bo = gem_to_qxl_bo(obj);
--
2.18.1
2019 Apr 26
3
[PATCH] Revert "drm/qxl: drop prime import/export callbacks"
...rime.c
@@ -42,6 +42,18 @@ void qxl_gem_prime_unpin(struct drm_gem_object *obj)
qxl_bo_unpin(bo);
}
+struct sg_table *qxl_gem_prime_get_sg_table(struct drm_gem_object *obj)
+{
+ return ERR_PTR(-ENOSYS);
+}
+
+struct drm_gem_object *qxl_gem_prime_import_sg_table(
+ struct drm_device *dev, struct dma_buf_attachment *attach,
+ struct sg_table *table)
+{
+ return ERR_PTR(-ENOSYS);
+}
+
void *qxl_gem_prime_vmap(struct drm_gem_object *obj)
{
struct qxl_bo *bo = gem_to_qxl_bo(obj);
--
2.18.1
2020 Jun 19
0
[PATCH v4 1/3] virtio: add dma-buf support for exported objects
...buf_export);
> > > > +
> > > > +/**
> > > > + * virtio_dma_buf_attach - mandatory attach callback for virtio dma-bufs
> > > > + */
> > > > +int virtio_dma_buf_attach(struct dma_buf *dma_buf,
> > > > + struct dma_buf_attachment *attach)
> > > > +{
> > > > + int ret;
> > > > + const struct virtio_dma_buf_ops *ops = container_of(
> > > > + dma_buf->ops, const struct virtio_dma_buf_ops, ops);
> > > > +
> > > > + if (ops->dev...
2019 May 07
0
[PATCH AUTOSEL 5.0 85/99] Revert "drm/virtio: drop prime import/export callbacks"
...gpu_prime.c */
int virtgpu_gem_prime_pin(struct drm_gem_object *obj);
void virtgpu_gem_prime_unpin(struct drm_gem_object *obj);
+struct sg_table *virtgpu_gem_prime_get_sg_table(struct drm_gem_object *obj);
+struct drm_gem_object *virtgpu_gem_prime_import_sg_table(
+ struct drm_device *dev, struct dma_buf_attachment *attach,
+ struct sg_table *sgt);
void *virtgpu_gem_prime_vmap(struct drm_gem_object *obj);
void virtgpu_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr);
int virtgpu_gem_prime_mmap(struct drm_gem_object *obj,
diff --git a/drivers/gpu/drm/virtio/virtgpu_prime.c b/drivers/gpu/drm/virtio/...
2020 Aug 13
1
[PATCH 20/20] drm: Remove obsolete GEM and PRIME callbacks from struct drm_driver
...drm_driver.gem_prime_export driver callback.
> + * &drm_gem_object_funcs.export callback.
> */
> int drm_gem_prime_handle_to_fd(struct drm_device *dev,
> struct drm_file *file_priv, uint32_t handle,
> @@ -616,15 +612,18 @@ struct sg_table *drm_gem_map_dma_buf(struct dma_buf_attachment *attach,
> enum dma_data_direction dir)
> {
> struct drm_gem_object *obj = attach->dmabuf->priv;
> - struct sg_table *sgt;
> + struct sg_table *sgt = NULL;
>
> if (WARN_ON(dir == DMA_NONE))
> return ERR_PTR(-EINVAL);
>
> - if (obj->funcs)...
2018 Dec 19
0
[PATCH 11/14] drm/bochs: add basic prime support
...ochs_bo *bo);
+int bochs_gem_prime_pin(struct drm_gem_object *obj);
+void bochs_gem_prime_unpin(struct drm_gem_object *obj);
+struct sg_table *bochs_gem_prime_get_sg_table(struct drm_gem_object *obj);
+struct drm_gem_object *bochs_gem_prime_import_sg_table(
+ struct drm_device *dev, struct dma_buf_attachment *attach,
+ struct sg_table *sgt);
+void *bochs_gem_prime_vmap(struct drm_gem_object *obj);
+void bochs_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr);
+int bochs_gem_prime_mmap(struct drm_gem_object *obj,
+ struct vm_area_struct *vma);
+
/* bochs_kms.c */
int bochs_kms_init(s...
2019 Apr 26
1
[PATCH] Revert "drm/qxl: drop prime import/export callbacks"
...n(bo);
>> }
>>
>> +struct sg_table *qxl_gem_prime_get_sg_table(struct drm_gem_object *obj)
>> +{
>> + return ERR_PTR(-ENOSYS);
>> +}
>> +
>> +struct drm_gem_object *qxl_gem_prime_import_sg_table(
>> + struct drm_device *dev, struct dma_buf_attachment *attach,
>> + struct sg_table *table)
>> +{
>> + return ERR_PTR(-ENOSYS);
>> +}
>> +
>> void *qxl_gem_prime_vmap(struct drm_gem_object *obj)
>> {
>> struct qxl_bo *bo = gem_to_qxl_bo(obj);
>> --
>> 2.18.1
>>...
2019 Apr 26
1
[PATCH] Revert "drm/qxl: drop prime import/export callbacks"
...n(bo);
>> }
>>
>> +struct sg_table *qxl_gem_prime_get_sg_table(struct drm_gem_object *obj)
>> +{
>> + return ERR_PTR(-ENOSYS);
>> +}
>> +
>> +struct drm_gem_object *qxl_gem_prime_import_sg_table(
>> + struct drm_device *dev, struct dma_buf_attachment *attach,
>> + struct sg_table *table)
>> +{
>> + return ERR_PTR(-ENOSYS);
>> +}
>> +
>> void *qxl_gem_prime_vmap(struct drm_gem_object *obj)
>> {
>> struct qxl_bo *bo = gem_to_qxl_bo(obj);
>> --
>> 2.18.1
>>...
2015 Sep 09
0
[PATCH 4/5] virtio_gpu: add basic prime support
...me.c */
+int virtgpu_gem_prime_pin(struct drm_gem_object *obj);
+void virtgpu_gem_prime_unpin(struct drm_gem_object *obj);
+struct sg_table *virtgpu_gem_prime_get_sg_table(struct drm_gem_object *obj);
+struct drm_gem_object *virtgpu_gem_prime_import_sg_table(
+ struct drm_device *dev, struct dma_buf_attachment *attach,
+ struct sg_table *sgt);
+void *virtgpu_gem_prime_vmap(struct drm_gem_object *obj);
+void virtgpu_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr);
+int virtgpu_gem_prime_mmap(struct drm_gem_object *obj,
+ struct vm_area_struct *vma);
+
stati...