search for: use_dma_api

Displaying 20 results from an estimated 84 matches for "use_dma_api".

2020 Sep 08
2
[PATCH] drm/virtio: drop quirks handling
...x 729f98ad7c02..9c35ce64ff9e 100644 --- a/drivers/gpu/drm/virtio/virtgpu_object.c +++ b/drivers/gpu/drm/virtio/virtgpu_object.c @@ -141,7 +141,6 @@ static int virtio_gpu_object_shmem_init(struct virtio_gpu_device *vgdev, struct virtio_gpu_mem_entry **ents, unsigned int *nents) { - bool use_dma_api = !virtio_has_dma_quirk(vgdev->vdev); struct virtio_gpu_object_shmem *shmem = to_virtio_gpu_shmem(bo); struct scatterlist *sg; int si, ret; @@ -162,15 +161,11 @@ static int virtio_gpu_object_shmem_init(struct virtio_gpu_device *vgdev, return -EINVAL; } - if (use_dma_api) { - shmem-...
2020 Sep 08
2
[PATCH] drm/virtio: drop quirks handling
...x 729f98ad7c02..9c35ce64ff9e 100644 --- a/drivers/gpu/drm/virtio/virtgpu_object.c +++ b/drivers/gpu/drm/virtio/virtgpu_object.c @@ -141,7 +141,6 @@ static int virtio_gpu_object_shmem_init(struct virtio_gpu_device *vgdev, struct virtio_gpu_mem_entry **ents, unsigned int *nents) { - bool use_dma_api = !virtio_has_dma_quirk(vgdev->vdev); struct virtio_gpu_object_shmem *shmem = to_virtio_gpu_shmem(bo); struct scatterlist *sg; int si, ret; @@ -162,15 +161,11 @@ static int virtio_gpu_object_shmem_init(struct virtio_gpu_device *vgdev, return -EINVAL; } - if (use_dma_api) { - shmem-...
2020 Jun 24
0
[PATCH v2 2/2] virtio: virtio_has_iommu_quirk -> virtio_has_dma_quirk
...x 6ccbd01cd888..e8799ab0c753 100644 --- a/drivers/gpu/drm/virtio/virtgpu_object.c +++ b/drivers/gpu/drm/virtio/virtgpu_object.c @@ -141,7 +141,7 @@ static int virtio_gpu_object_shmem_init(struct virtio_gpu_device *vgdev, struct virtio_gpu_mem_entry **ents, unsigned int *nents) { - bool use_dma_api = !virtio_has_iommu_quirk(vgdev->vdev); + bool use_dma_api = !virtio_has_dma_quirk(vgdev->vdev); struct virtio_gpu_object_shmem *shmem = to_virtio_gpu_shmem(bo); struct scatterlist *sg; int si, ret; diff --git a/drivers/gpu/drm/virtio/virtgpu_vq.c b/drivers/gpu/drm/virtio/virtgpu_vq.c i...
2023 Jul 10
10
[PATCH vhost v11 00/10] virtio core prepares for AF_XDP
...ment to do unmap for no-indirect desc 3. based on indir_desc to judgment to do unmap for indirect desc 4. rename virtqueue_get_dma_dev to virtqueue_dma_dev v1: 1. expose dma device. NO introduce the api for dma and sync 2. split some commit for review. Xuan Zhuo (10): virtio_ring: check use_dma_api before unmap desc for indirect virtio_ring: put mapping error check in vring_map_one_sg virtio_ring: introduce virtqueue_set_premapped() virtio_ring: support add premapped buf virtio_ring: introduce virtqueue_dma_dev() virtio_ring: skip unmap for premapped virtio_ring: correct the expre...
2020 Feb 05
2
[PATCH 4/4] drm/virtio: move virtio_gpu_mem_entry initialization to new function
...t.c +++ b/drivers/gpu/drm/virtio/virtgpu_object.c @@ -121,6 +121,49 @@ struct drm_gem_object *virtio_gpu_create_object(struct drm_device *dev, return &bo->base.base; } +static int virtio_gpu_object_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(&am...
2020 Feb 05
2
[PATCH 4/4] drm/virtio: move virtio_gpu_mem_entry initialization to new function
...t.c +++ b/drivers/gpu/drm/virtio/virtgpu_object.c @@ -121,6 +121,49 @@ struct drm_gem_object *virtio_gpu_create_object(struct drm_device *dev, return &bo->base.base; } +static int virtio_gpu_object_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(&am...
2020 Feb 07
1
[PATCH v2 4/4] drm/virtio: move virtio_gpu_mem_entry initialization to new function
...@ struct drm_gem_object *virtio_gpu_create_object(struct drm_device *dev, return &bo->base.base; } +static int virtio_gpu_object_shmem_init(struct virtio_gpu_device *vgdev, + struct virtio_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-&g...
2020 Sep 08
0
[PATCH] drm/virtio: drop quirks handling
On Tue, Sep 08, 2020 at 08:47:41AM +0200, Gerd Hoffmann wrote: > These days dma ops can be overridden per device, and the virtio core "can be overridden" or "are"? The comment above vring_use_dma_api() suggests that's not yet done. If that's wrong then I think updating the comment would be really good. -Daniel > uses that to handle the dma quirks transparently for the rest of the > kernel. So we can drop the virtio_has_dma_quirk() checks, just use > the dma api unconditionall...
2014 Sep 17
4
[PATCH v5 2/3] virtio_pci: Use the DMA API for virtqueues when possible
...ct virtio_pci_vq_info > /* the number of entries in the queue */ > int num; > > - /* the virtual address of the ring queue */ > - void *queue; > + /* the ring queue */ > + void *queue; /* virtual address */ > + dma_addr_t queue_dma_addr; /* bus address */ > + bool use_dma_api; /* are we using the DMA API? */ > > /* the list node for the virtqueues list */ > struct list_head node; > @@ -388,6 +390,50 @@ static int vp_request_intx(struct virtio_device *vdev) > return err; > } > > +static bool vp_use_dma_api(void) > +{ > + /* >...
2014 Sep 17
4
[PATCH v5 2/3] virtio_pci: Use the DMA API for virtqueues when possible
...ct virtio_pci_vq_info > /* the number of entries in the queue */ > int num; > > - /* the virtual address of the ring queue */ > - void *queue; > + /* the ring queue */ > + void *queue; /* virtual address */ > + dma_addr_t queue_dma_addr; /* bus address */ > + bool use_dma_api; /* are we using the DMA API? */ > > /* the list node for the virtqueues list */ > struct list_head node; > @@ -388,6 +390,50 @@ static int vp_request_intx(struct virtio_device *vdev) > return err; > } > > +static bool vp_use_dma_api(void) > +{ > + /* >...
2014 Sep 17
1
[PATCH v5 2/3] virtio_pci: Use the DMA API for virtqueues when possible
...ct virtio_pci_vq_info > /* the number of entries in the queue */ > int num; > > - /* the virtual address of the ring queue */ > - void *queue; > + /* the ring queue */ > + void *queue; /* virtual address */ > + dma_addr_t queue_dma_addr; /* bus address */ > + bool use_dma_api; /* are we using the DMA API? */ > > /* the list node for the virtqueues list */ > struct list_head node; > @@ -388,6 +390,50 @@ static int vp_request_intx(struct virtio_device *vdev) > return err; > } > > +static bool vp_use_dma_api(void) > +{ > + /* >...
2014 Sep 17
1
[PATCH v5 2/3] virtio_pci: Use the DMA API for virtqueues when possible
...ct virtio_pci_vq_info > /* the number of entries in the queue */ > int num; > > - /* the virtual address of the ring queue */ > - void *queue; > + /* the ring queue */ > + void *queue; /* virtual address */ > + dma_addr_t queue_dma_addr; /* bus address */ > + bool use_dma_api; /* are we using the DMA API? */ > > /* the list node for the virtqueues list */ > struct list_head node; > @@ -388,6 +390,50 @@ static int vp_request_intx(struct virtio_device *vdev) > return err; > } > > +static bool vp_use_dma_api(void) > +{ > + /* >...
2020 Jun 24
4
[PATCH v2 0/2] virtio: modernize DMA quirks
Use generic names for the quirks to make it clear it is not just about the IOMMU, it's about DMA access in general. changes from v1: added patch 2 Michael S. Tsirkin (2): virtio: VIRTIO_F_IOMMU_PLATFORM -> VIRTIO_F_ACCESS_PLATFORM virtio: virtio_has_iommu_quirk -> virtio_has_dma_quirk arch/um/drivers/virtio_uml.c | 2 +- drivers/gpu/drm/virtio/virtgpu_object.c | 2
2014 Sep 17
6
[PATCH v5 0/3] virtio: Use the DMA API when appropriate
This fixes virtio on Xen guests as well as on any other platform that uses virtio_pci on which physical addresses don't match bus addresses. This can be tested with: virtme-run --xen xen --kimg arch/x86/boot/bzImage --console using virtme from here: https://git.kernel.org/cgit/utils/kernel/virtme/virtme.git Without these patches, the guest hangs forever. With these patches,
2014 Sep 17
6
[PATCH v5 0/3] virtio: Use the DMA API when appropriate
This fixes virtio on Xen guests as well as on any other platform that uses virtio_pci on which physical addresses don't match bus addresses. This can be tested with: virtme-run --xen xen --kimg arch/x86/boot/bzImage --console using virtme from here: https://git.kernel.org/cgit/utils/kernel/virtme/virtme.git Without these patches, the guest hangs forever. With these patches,
2020 Feb 05
0
[PATCH 4/4] drm/virtio: move virtio_gpu_mem_entry initialization to new function
...rm_gem_object *virtio_gpu_create_object(struct drm_device *dev, > return &bo->base.base; > } > > +static int virtio_gpu_object_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_tab...
2014 Sep 17
0
[PATCH v5 2/3] virtio_pci: Use the DMA API for virtqueues when possible
...s/virtio/virtio_pci.c @@ -80,8 +80,10 @@ struct virtio_pci_vq_info /* the number of entries in the queue */ int num; - /* the virtual address of the ring queue */ - void *queue; + /* the ring queue */ + void *queue; /* virtual address */ + dma_addr_t queue_dma_addr; /* bus address */ + bool use_dma_api; /* are we using the DMA API? */ /* the list node for the virtqueues list */ struct list_head node; @@ -388,6 +390,50 @@ static int vp_request_intx(struct virtio_device *vdev) return err; } +static bool vp_use_dma_api(void) +{ + /* + * Due to limitations of the DMA API, we only have tw...
2014 Sep 17
0
[PATCH v5 2/3] virtio_pci: Use the DMA API for virtqueues when possible
...int num; >> >> - /* the virtual address of the ring queue */ >> - void *queue; >> + /* the ring queue */ >> + void *queue; /* virtual address */ >> + dma_addr_t queue_dma_addr; /* bus address */ >> + bool use_dma_api; /* are we using the DMA API? */ >> >> /* the list node for the virtqueues list */ >> struct list_head node; >> @@ -388,6 +390,50 @@ static int vp_request_intx(struct virtio_device *vdev) >> return err; >> } >> >> +sta...
2018 Sep 03
0
[virtio-dev] [PATCH 2/2] drm/virtio: add iommu support.
...id virtio_gpu_cmd_set_scanout(struct virtio_gpu_device *vgdev, > @@ -848,9 +849,10 @@ int virtio_gpu_object_attach(struct virtio_gpu_device *vgdev, > uint32_t resource_id, > struct virtio_gpu_fence **fence) > { > + bool use_dma_api = !virtio_has_iommu_quirk(vgdev->vdev); > struct virtio_gpu_mem_entry *ents; > struct scatterlist *sg; > - int si; > + int si, nents; > > if (!obj->pages) { > int ret; > @@ -860,23 +862,33 @@ int virtio_gpu_object_att...
2014 Sep 17
0
[PATCH v5 2/3] virtio_pci: Use the DMA API for virtqueues when possible
...er of entries in the queue */ > > int num; > > > > - /* the virtual address of the ring queue */ > > - void *queue; > > + /* the ring queue */ > > + void *queue; /* virtual address */ > > + dma_addr_t queue_dma_addr; /* bus address */ > > + bool use_dma_api; /* are we using the DMA API? */ > > > > /* the list node for the virtqueues list */ > > struct list_head node; > > @@ -388,6 +390,50 @@ static int vp_request_intx(struct virtio_device *vdev) > > return err; > > } > > > > +static bool vp_u...