search for: drm_gem_shmem_get_sg_t

Displaying 20 results from an estimated 30 matches for "drm_gem_shmem_get_sg_t".

2020 May 11
1
[PATCH 4/9] drm/virtio: Call the right shmem helpers
drm_gem_shmem_get_sg_table is meant to implement obj->funcs->get_sg_table, for prime exporting. The one we want is drm_gem_shmem_get_pages_sgt, which also handles imported dma-buf, not just native objects. v2: Rebase, this stuff moved around in commit 2f2aa13724d56829d910b2fa8e80c502d388f106 Author: Gerd Hoffmann...
2019 Sep 13
0
[PATCH 2/8] drm/shmem: switch shmem helper to &drm_gem_object_funcs.mmap
.../drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c index f5918707672f..a104140154bb 100644 --- a/drivers/gpu/drm/drm_gem_shmem_helper.c +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c @@ -32,7 +32,7 @@ static const struct drm_gem_object_funcs drm_gem_shmem_funcs = { .get_sg_table = drm_gem_shmem_get_sg_table, .vmap = drm_gem_shmem_vmap, .vunmap = drm_gem_shmem_vunmap, - .vm_ops = &drm_gem_shmem_vm_ops, + .mmap = drm_gem_shmem_mmap, }; /** @@ -505,39 +505,30 @@ static void drm_gem_shmem_vm_close(struct vm_area_struct *vma) drm_gem_vm_close(vma); } -const struct vm_operations_struct...
2019 Sep 17
0
[PATCH v2 02/11] drm/shmem: switch shmem helper to &drm_gem_object_funcs.mmap
.../drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c index f5918707672f..a9a586630517 100644 --- a/drivers/gpu/drm/drm_gem_shmem_helper.c +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c @@ -32,7 +32,7 @@ static const struct drm_gem_object_funcs drm_gem_shmem_funcs = { .get_sg_table = drm_gem_shmem_get_sg_table, .vmap = drm_gem_shmem_vmap, .vunmap = drm_gem_shmem_vunmap, - .vm_ops = &drm_gem_shmem_vm_ops, + .mmap = drm_gem_shmem_mmap, }; /** @@ -505,39 +505,30 @@ static void drm_gem_shmem_vm_close(struct vm_area_struct *vma) drm_gem_vm_close(vma); } -const struct vm_operations_struct...
2019 Sep 19
0
[PATCH v3 02/11] drm/shmem: switch shmem helper to &drm_gem_object_funcs.mmap
.../drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c index f5918707672f..a9a586630517 100644 --- a/drivers/gpu/drm/drm_gem_shmem_helper.c +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c @@ -32,7 +32,7 @@ static const struct drm_gem_object_funcs drm_gem_shmem_funcs = { .get_sg_table = drm_gem_shmem_get_sg_table, .vmap = drm_gem_shmem_vmap, .vunmap = drm_gem_shmem_vunmap, - .vm_ops = &drm_gem_shmem_vm_ops, + .mmap = drm_gem_shmem_mmap, }; /** @@ -505,39 +505,30 @@ static void drm_gem_shmem_vm_close(struct vm_area_struct *vma) drm_gem_vm_close(vma); } -const struct vm_operations_struct...
2019 Oct 16
0
[PATCH v4 02/11] drm/shmem: switch shmem helper to &drm_gem_object_funcs.mmap
.../drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c index f5918707672f..a9a586630517 100644 --- a/drivers/gpu/drm/drm_gem_shmem_helper.c +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c @@ -32,7 +32,7 @@ static const struct drm_gem_object_funcs drm_gem_shmem_funcs = { .get_sg_table = drm_gem_shmem_get_sg_table, .vmap = drm_gem_shmem_vmap, .vunmap = drm_gem_shmem_vunmap, - .vm_ops = &drm_gem_shmem_vm_ops, + .mmap = drm_gem_shmem_mmap, }; /** @@ -505,39 +505,30 @@ static void drm_gem_shmem_vm_close(struct vm_area_struct *vma) drm_gem_vm_close(vma); } -const struct vm_operations_struct...
2020 Feb 05
2
[PATCH 4/4] drm/virtio: move virtio_gpu_mem_entry initialization to new function
...bject_shmem_init(struct virtio_gpu_device *vgdev, + struct virtio_gpu_object *bo) +{ + bool use_dma_api = !virtio_has_iommu_quirk(vgdev->vdev); + struct scatterlist *sg; + int si, ret; + + ret = drm_gem_shmem_pin(&bo->base.base); + if (ret < 0) + return -EINVAL; + + bo->pages = drm_gem_shmem_get_sg_table(&bo->base.base); + if (bo->pages == NULL) { + drm_gem_shmem_unpin(&bo->base.base); + return -EINVAL; + } + + if (use_dma_api) { + bo->mapped = dma_map_sg(vgdev->vdev->dev.parent, + bo->pages->sgl, bo->pages->nents, + DMA_TO_DEVICE); + bo->n...
2020 Feb 05
2
[PATCH 4/4] drm/virtio: move virtio_gpu_mem_entry initialization to new function
...bject_shmem_init(struct virtio_gpu_device *vgdev, + struct virtio_gpu_object *bo) +{ + bool use_dma_api = !virtio_has_iommu_quirk(vgdev->vdev); + struct scatterlist *sg; + int si, ret; + + ret = drm_gem_shmem_pin(&bo->base.base); + if (ret < 0) + return -EINVAL; + + bo->pages = drm_gem_shmem_get_sg_table(&bo->base.base); + if (bo->pages == NULL) { + drm_gem_shmem_unpin(&bo->base.base); + return -EINVAL; + } + + if (use_dma_api) { + bo->mapped = dma_map_sg(vgdev->vdev->dev.parent, + bo->pages->sgl, bo->pages->nents, + DMA_TO_DEVICE); + bo->n...
2020 Feb 07
1
[PATCH v2 4/4] drm/virtio: move virtio_gpu_mem_entry initialization to new function
..._gpu_object *bo, + struct virtio_gpu_mem_entry **ents, + unsigned int *nents) +{ + bool use_dma_api = !virtio_has_iommu_quirk(vgdev->vdev); + struct scatterlist *sg; + int si, ret; + + ret = drm_gem_shmem_pin(&bo->base.base); + if (ret < 0) + return -EINVAL; + + bo->pages = drm_gem_shmem_get_sg_table(&bo->base.base); + if (!bo->pages) { + drm_gem_shmem_unpin(&bo->base.base); + return -EINVAL; + } + + if (use_dma_api) { + bo->mapped = dma_map_sg(vgdev->vdev->dev.parent, + bo->pages->sgl, bo->pages->nents, + DMA_TO_DEVICE); + *nents = bo->m...
2019 Dec 10
3
[PATCH] drm/virtio: fix mmap page attributes
...ed(prot); + vma->vm_page_prot = prot; + return 0; +} + static const struct drm_gem_object_funcs virtio_gpu_gem_funcs = { .free = virtio_gpu_free_object, .open = virtio_gpu_gem_object_open, @@ -86,7 +102,7 @@ static const struct drm_gem_object_funcs virtio_gpu_gem_funcs = { .get_sg_table = drm_gem_shmem_get_sg_table, .vmap = drm_gem_shmem_vmap, .vunmap = drm_gem_shmem_vunmap, - .mmap = &drm_gem_shmem_mmap, + .mmap = &virtio_gpu_gem_mmap, }; struct drm_gem_object *virtio_gpu_create_object(struct drm_device *dev, -- 2.18.1
2019 Dec 10
3
[PATCH] drm/virtio: fix mmap page attributes
...ed(prot); + vma->vm_page_prot = prot; + return 0; +} + static const struct drm_gem_object_funcs virtio_gpu_gem_funcs = { .free = virtio_gpu_free_object, .open = virtio_gpu_gem_object_open, @@ -86,7 +102,7 @@ static const struct drm_gem_object_funcs virtio_gpu_gem_funcs = { .get_sg_table = drm_gem_shmem_get_sg_table, .vmap = drm_gem_shmem_vmap, .vunmap = drm_gem_shmem_vunmap, - .mmap = &drm_gem_shmem_mmap, + .mmap = &virtio_gpu_gem_mmap, }; struct drm_gem_object *virtio_gpu_create_object(struct drm_device *dev, -- 2.18.1
2020 Feb 05
0
[PATCH 4/4] drm/virtio: move virtio_gpu_mem_entry initialization to new function
...+ bool use_dma_api = !virtio_has_iommu_quirk(vgdev->vdev); > + struct scatterlist *sg; > + int si, ret; > + > + ret = drm_gem_shmem_pin(&bo->base.base); > + if (ret < 0) > + return -EINVAL; > + > + bo->pages = drm_gem_shmem_get_sg_table(&bo->base.base); > + if (bo->pages == NULL) { > + drm_gem_shmem_unpin(&bo->base.base); > + return -EINVAL; > + } > + > + if (use_dma_api) { > + bo->mapped = dma_map_sg(vgdev->vdev->dev.par...
2020 Aug 18
2
[PATCH 1/2] drm: allow limiting the scatter list size.
...; if (IS_ERR(sgt)) return sgt; diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c index 4b7cfbac4daa..cfb979d808fd 100644 --- a/drivers/gpu/drm/drm_gem_shmem_helper.c +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c @@ -656,7 +656,8 @@ struct sg_table *drm_gem_shmem_get_sg_table(struct drm_gem_object *obj) WARN_ON(shmem->base.import_attach); - return drm_prime_pages_to_sg(shmem->pages, obj->size >> PAGE_SHIFT); + return drm_prime_pages_to_sg(shmem->pages, obj->size >> PAGE_SHIFT, + obj->max_segment); } EXPORT_SYMBOL_GPL(drm...
2020 Sep 07
2
[PATCH v4 1/1] drm: allow limiting the scatter list size.
...s); if (IS_ERR(sgt)) return sgt; diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c index 4b7cfbac4daa..0a952f27c184 100644 --- a/drivers/gpu/drm/drm_gem_shmem_helper.c +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c @@ -656,7 +656,7 @@ struct sg_table *drm_gem_shmem_get_sg_table(struct drm_gem_object *obj) WARN_ON(shmem->base.import_attach); - return drm_prime_pages_to_sg(shmem->pages, obj->size >> PAGE_SHIFT); + return drm_prime_pages_to_sg(obj->dev, shmem->pages, obj->size >> PAGE_SHIFT); } EXPORT_SYMBOL_GPL(drm_gem_shmem_get_sg_...
2020 Aug 18
2
[PATCH v2 1/2] drm: allow limiting the scatter list size.
...; if (IS_ERR(sgt)) return sgt; diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c index 4b7cfbac4daa..8f47b41b0b2f 100644 --- a/drivers/gpu/drm/drm_gem_shmem_helper.c +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c @@ -656,7 +656,8 @@ struct sg_table *drm_gem_shmem_get_sg_table(struct drm_gem_object *obj) WARN_ON(shmem->base.import_attach); - return drm_prime_pages_to_sg(shmem->pages, obj->size >> PAGE_SHIFT); + return drm_prime_pages_to_sg(shmem->pages, obj->size >> PAGE_SHIFT, + obj->dev->max_segment); } EXPORT_SYMBOL...
2020 Aug 18
0
[PATCH 1/2] drm: allow limiting the scatter list size.
...n sgt; > > diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c > index 4b7cfbac4daa..cfb979d808fd 100644 > --- a/drivers/gpu/drm/drm_gem_shmem_helper.c > +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c > @@ -656,7 +656,8 @@ struct sg_table *drm_gem_shmem_get_sg_table(struct drm_gem_object *obj) > > WARN_ON(shmem->base.import_attach); > > - return drm_prime_pages_to_sg(shmem->pages, obj->size >> PAGE_SHIFT); > + return drm_prime_pages_to_sg(shmem->pages, obj->size >> PAGE_SHIFT, > + obj->max_se...
2020 Sep 07
0
[PATCH v3 1/2] drm: allow limiting the scatter list size.
...; if (IS_ERR(sgt)) return sgt; diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c index 4b7cfbac4daa..8f47b41b0b2f 100644 --- a/drivers/gpu/drm/drm_gem_shmem_helper.c +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c @@ -656,7 +656,8 @@ struct sg_table *drm_gem_shmem_get_sg_table(struct drm_gem_object *obj) WARN_ON(shmem->base.import_attach); - return drm_prime_pages_to_sg(shmem->pages, obj->size >> PAGE_SHIFT); + return drm_prime_pages_to_sg(shmem->pages, obj->size >> PAGE_SHIFT, + obj->dev->max_segment); } EXPORT_SYMBOL...
2020 Sep 07
0
[PATCH v4 1/1] drm: allow limiting the scatter list size.
...return sgt; > diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c > index 4b7cfbac4daa..0a952f27c184 100644 > --- a/drivers/gpu/drm/drm_gem_shmem_helper.c > +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c > @@ -656,7 +656,7 @@ struct sg_table *drm_gem_shmem_get_sg_table(struct drm_gem_object *obj) > > WARN_ON(shmem->base.import_attach); > > - return drm_prime_pages_to_sg(shmem->pages, obj->size >> PAGE_SHIFT); > + return drm_prime_pages_to_sg(obj->dev, shmem->pages, obj->size >> PAGE_SHIFT); >...
2020 Sep 01
0
[PATCH v2 1/2] drm: allow limiting the scatter list size.
...rn sgt; > > diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c > index 4b7cfbac4daa..8f47b41b0b2f 100644 > --- a/drivers/gpu/drm/drm_gem_shmem_helper.c > +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c > @@ -656,7 +656,8 @@ struct sg_table *drm_gem_shmem_get_sg_table(struct drm_gem_object *obj) > > WARN_ON(shmem->base.import_attach); > > - return drm_prime_pages_to_sg(shmem->pages, obj->size >> PAGE_SHIFT); > + return drm_prime_pages_to_sg(shmem->pages, obj->size >> PAGE_SHIFT, > + obj->dev->m...
2020 Sep 15
0
[PATCH v2 17/21] drm/virtgpu: Set PRIME export function in struct drm_gem_object_funcs
...pu_object.c @@ -108,6 +108,7 @@ static const struct drm_gem_object_funcs virtio_gpu_shmem_funcs = { .close = virtio_gpu_gem_object_close, .print_info = drm_gem_shmem_print_info, + .export = virtgpu_gem_prime_export, .pin = drm_gem_shmem_pin, .unpin = drm_gem_shmem_unpin, .get_sg_table = drm_gem_shmem_get_sg_table, -- 2.28.0
2019 Dec 10
0
[PATCH] drm/virtio: fix mmap page attributes
...c06f5b3d267297125b37#n20 > + > static const struct drm_gem_object_funcs virtio_gpu_gem_funcs = { > .free = virtio_gpu_free_object, > .open = virtio_gpu_gem_object_open, > @@ -86,7 +102,7 @@ static const struct drm_gem_object_funcs virtio_gpu_gem_funcs = { > .get_sg_table = drm_gem_shmem_get_sg_table, > .vmap = drm_gem_shmem_vmap, > .vunmap = drm_gem_shmem_vunmap, > - .mmap = &drm_gem_shmem_mmap, > + .mmap = &virtio_gpu_gem_mmap, > }; > > struct drm_gem_object *virtio_gpu_create_object(struct drm_device *dev, > -- Thomas Zimmermann Graphics Driver...