/linux-6.3-rc2/drivers/media/common/videobuf2/ |
A D | videobuf2-dma-contig.c | 332 sgt = &attach->sgt; in vb2_dc_dmabuf_ops_attach() 365 sgt = &attach->sgt; in vb2_dc_dmabuf_ops_detach() 388 sgt = &attach->sgt; in vb2_dc_dmabuf_ops_map() 412 return sgt; in vb2_dc_dmabuf_ops_map() 484 sgt = kmalloc(sizeof(*sgt), GFP_KERNEL); in vb2_dc_get_base_sgt() 485 if (!sgt) { in vb2_dc_get_base_sgt() 498 return sgt; in vb2_dc_get_base_sgt() 541 if (sgt) { in vb2_dc_put_userptr() 628 sgt = kzalloc(sizeof(*sgt), GFP_KERNEL); in vb2_dc_get_userptr() 629 if (!sgt) { in vb2_dc_get_userptr() [all …]
|
A D | videobuf2-dma-sg.c | 106 struct sg_table *sgt; in vb2_dma_sg_alloc() local 146 sgt = &buf->sg_table; in vb2_dma_sg_alloc() 383 sgt = &attach->sgt; in vb2_dma_sg_dmabuf_ops_attach() 394 wr = sgt->sgl; in vb2_dma_sg_dmabuf_ops_attach() 416 sgt = &attach->sgt; in vb2_dma_sg_dmabuf_ops_detach() 421 sg_free_table(sgt); in vb2_dma_sg_dmabuf_ops_detach() 432 sgt = &attach->sgt; in vb2_dma_sg_dmabuf_ops_map() 435 return sgt; in vb2_dma_sg_dmabuf_ops_map() 451 return sgt; in vb2_dma_sg_dmabuf_ops_map() 473 dma_sync_sg_for_cpu(buf->dev, sgt->sgl, sgt->nents, buf->dma_dir); in vb2_dma_sg_dmabuf_ops_begin_cpu_access() [all …]
|
A D | videobuf2-vmalloc.c | 207 struct sg_table sgt; member 217 struct sg_table *sgt; in vb2_vmalloc_dmabuf_ops_attach() local 227 sgt = &attach->sgt; in vb2_vmalloc_dmabuf_ops_attach() 237 sg_free_table(sgt); in vb2_vmalloc_dmabuf_ops_attach() 254 struct sg_table *sgt; in vb2_vmalloc_dmabuf_ops_detach() local 259 sgt = &attach->sgt; in vb2_vmalloc_dmabuf_ops_detach() 264 sg_free_table(sgt); in vb2_vmalloc_dmabuf_ops_detach() 273 struct sg_table *sgt; in vb2_vmalloc_dmabuf_ops_map() local 275 sgt = &attach->sgt; in vb2_vmalloc_dmabuf_ops_map() 278 return sgt; in vb2_vmalloc_dmabuf_ops_map() [all …]
|
/linux-6.3-rc2/drivers/gpu/drm/tegra/ |
A D | gem.c | 48 return sg_dma_count_chunks(sgt->sgl, sgt->nents); in sgt_dma_count_chunks() 91 map->sgt = NULL; in tegra_bo_pin() 105 map->sgt = kzalloc(sizeof(*map->sgt), GFP_KERNEL); in tegra_bo_pin() 106 if (!map->sgt) { in tegra_bo_pin() 155 kfree(map->sgt); in tegra_bo_pin() 356 kfree(bo->sgt); in tegra_bo_get_pages() 621 sgt = kmalloc(sizeof(*sgt), GFP_KERNEL); in tegra_gem_prime_map_dma_buf() 622 if (!sgt) in tegra_gem_prime_map_dma_buf() 638 return sgt; in tegra_gem_prime_map_dma_buf() 642 kfree(sgt); in tegra_gem_prime_map_dma_buf() [all …]
|
/linux-6.3-rc2/drivers/gpu/drm/armada/ |
A D | armada_gem.c | 68 if (dobj->sgt) in armada_gem_free_object() 392 struct sg_table *sgt; in armada_gem_prime_map_dma_buf() local 395 sgt = kmalloc(sizeof(*sgt), GFP_KERNEL); in armada_gem_prime_map_dma_buf() 396 if (!sgt) in armada_gem_prime_map_dma_buf() 439 return sgt; in armada_gem_prime_map_dma_buf() 446 sg_free_table(sgt); in armada_gem_prime_map_dma_buf() 448 kfree(sgt); in armada_gem_prime_map_dma_buf() 469 sg_free_table(sgt); in armada_gem_prime_unmap_dma_buf() 470 kfree(sgt); in armada_gem_prime_unmap_dma_buf() 544 if (IS_ERR(dobj->sgt)) { in armada_gem_map_import() [all …]
|
/linux-6.3-rc2/drivers/gpu/drm/virtio/ |
A D | virtgpu_vram.c | 75 struct sg_table *sgt; in virtio_gpu_vram_map_dma_buf() local 79 sgt = kzalloc(sizeof(*sgt), GFP_KERNEL); in virtio_gpu_vram_map_dma_buf() 80 if (!sgt) in virtio_gpu_vram_map_dma_buf() 90 return sgt; in virtio_gpu_vram_map_dma_buf() 108 return sgt; in virtio_gpu_vram_map_dma_buf() 110 sg_free_table(sgt); in virtio_gpu_vram_map_dma_buf() 111 kfree(sgt); in virtio_gpu_vram_map_dma_buf() 116 struct sg_table *sgt, in virtio_gpu_vram_unmap_dma_buf() argument 119 if (sgt->nents) { in virtio_gpu_vram_unmap_dma_buf() 124 sg_free_table(sgt); in virtio_gpu_vram_unmap_dma_buf() [all …]
|
/linux-6.3-rc2/drivers/gpu/drm/i915/ |
A D | i915_mm.c | 37 struct sgt_iter sgt; member 46 return (r->sgt.dma + r->sgt.curr + r->iobase) >> PAGE_SHIFT; in sgt_pfn() 48 return r->sgt.pfn + (r->sgt.curr >> PAGE_SHIFT); in sgt_pfn() 55 if (GEM_WARN_ON(!r->sgt.sgp)) in remap_sg() 63 r->sgt.curr += PAGE_SIZE; in remap_sg() 64 if (r->sgt.curr >= r->sgt.max) in remap_sg() 65 r->sgt = __sgt_iter(__sg_next(r->sgt.sgp), use_dma(r->iobase)); in remap_sg() 136 .sgt = __sgt_iter(sgl, use_dma(iobase)), in remap_io_sg()
|
/linux-6.3-rc2/drivers/hwtracing/intel_th/ |
A D | msu-sink.c | 51 static int msu_sink_alloc_window(void *data, struct sg_table **sgt, size_t size) in msu_sink_alloc_window() argument 64 ret = sg_alloc_table(*sgt, nents, GFP_KERNEL); in msu_sink_alloc_window() 68 priv->sgts[priv->nr_sgts++] = *sgt; in msu_sink_alloc_window() 70 for_each_sg((*sgt)->sgl, sg_ptr, nents, i) { in msu_sink_alloc_window() 84 static void msu_sink_free_window(void *data, struct sg_table *sgt) in msu_sink_free_window() argument 90 for_each_sg(sgt->sgl, sg_ptr, sgt->nents, i) { in msu_sink_free_window() 95 sg_free_table(sgt); in msu_sink_free_window() 99 static int msu_sink_ready(void *data, struct sg_table *sgt, size_t bytes) in msu_sink_ready() argument 103 intel_th_msc_window_unlock(priv->dev, sgt); in msu_sink_ready()
|
/linux-6.3-rc2/drivers/xen/ |
A D | gntdev-dmabuf.c | 200 sgt = kmalloc(sizeof(*sgt), GFP_KERNEL); in dmabuf_pages_to_sgt() 201 if (!sgt) { in dmabuf_pages_to_sgt() 212 return sgt; in dmabuf_pages_to_sgt() 215 kfree(sgt); in dmabuf_pages_to_sgt() 240 struct sg_table *sgt = gntdev_dmabuf_attach->sgt; in dmabuf_exp_ops_detach() local 242 if (sgt) { in dmabuf_exp_ops_detach() 250 kfree(sgt); in dmabuf_exp_ops_detach() 287 kfree(sgt); in dmabuf_exp_ops_map_dma_buf() 290 gntdev_dmabuf_attach->sgt = sgt; in dmabuf_exp_ops_map_dma_buf() 296 return sgt; in dmabuf_exp_ops_map_dma_buf() [all …]
|
/linux-6.3-rc2/kernel/dma/ |
A D | mapping.c | 624 sgt = kmalloc(sizeof(*sgt), gfp); in alloc_single_sgt() 625 if (!sgt) in alloc_single_sgt() 633 sg_dma_len(sgt->sgl) = sgt->sgl->length; in alloc_single_sgt() 634 return sgt; in alloc_single_sgt() 638 kfree(sgt); in alloc_single_sgt() 658 if (sgt) { in dma_alloc_noncontiguous() 659 sgt->nents = 1; in dma_alloc_noncontiguous() 660 debug_dma_map_sg(dev, sgt->sgl, sgt->orig_nents, 1, dir, attrs); in dma_alloc_noncontiguous() 662 return sgt; in dma_alloc_noncontiguous() 672 kfree(sgt); in free_single_sgt() [all …]
|
/linux-6.3-rc2/include/linux/ |
A D | scatterlist.h | 46 struct sg_table sgt; /* The scatter list table */ member 177 #define for_each_sgtable_sg(sgt, sg, i) \ argument 178 for_each_sg((sgt)->sgl, sg, (sgt)->orig_nents, i) 185 #define for_each_sgtable_dma_sg(sgt, sg, i) \ argument 186 for_each_sg((sgt)->sgl, sg, (sgt)->nents, i) 377 void sg_free_append_table(struct sg_append_table *sgt); 381 int sg_alloc_append_table_from_pages(struct sg_append_table *sgt, 577 #define for_each_sgtable_page(sgt, piter, pgoffset) \ argument 578 for_each_sg_page((sgt)->sgl, piter, (sgt)->orig_nents, pgoffset) 591 #define for_each_sgtable_dma_page(sgt, dma_iter, pgoffset) \ argument [all …]
|
/linux-6.3-rc2/drivers/gpu/drm/ |
A D | drm_gem_shmem_helper.c | 149 if (shmem->sgt) { in drm_gem_shmem_free() 153 kfree(shmem->sgt); in drm_gem_shmem_free() 468 kfree(shmem->sgt); in drm_gem_shmem_purge_locked() 469 shmem->sgt = NULL; in drm_gem_shmem_purge_locked() 687 if (shmem->sgt) in drm_gem_shmem_get_pages_sgt_locked() 697 if (IS_ERR(sgt)) { in drm_gem_shmem_get_pages_sgt_locked() 706 shmem->sgt = sgt; in drm_gem_shmem_get_pages_sgt_locked() 708 return sgt; in drm_gem_shmem_get_pages_sgt_locked() 712 kfree(sgt); in drm_gem_shmem_get_pages_sgt_locked() 745 return sgt; in drm_gem_shmem_get_pages_sgt() [all …]
|
A D | drm_prime.c | 634 if (IS_ERR(sgt)) in drm_gem_map_dma_buf() 635 return sgt; in drm_gem_map_dma_buf() 640 sg_free_table(sgt); in drm_gem_map_dma_buf() 641 kfree(sgt); in drm_gem_map_dma_buf() 642 sgt = ERR_PTR(ret); in drm_gem_map_dma_buf() 645 return sgt; in drm_gem_map_dma_buf() 661 if (!sgt) in drm_gem_unmap_dma_buf() 665 sg_free_table(sgt); in drm_gem_unmap_dma_buf() 666 kfree(sgt); in drm_gem_unmap_dma_buf() 946 if (IS_ERR(sgt)) { in drm_gem_prime_import_dev() [all …]
|
A D | drm_gem_dma_helper.c | 234 drm_prime_gem_destroy(gem_obj, dma_obj->sgt); in drm_gem_dma_free() 424 struct sg_table *sgt; in drm_gem_dma_get_sg_table() local 427 sgt = kzalloc(sizeof(*sgt), GFP_KERNEL); in drm_gem_dma_get_sg_table() 428 if (!sgt) in drm_gem_dma_get_sg_table() 431 ret = dma_get_sgtable(obj->dev->dev, sgt, dma_obj->vaddr, in drm_gem_dma_get_sg_table() 436 return sgt; in drm_gem_dma_get_sg_table() 439 kfree(sgt); in drm_gem_dma_get_sg_table() 464 struct sg_table *sgt) in drm_gem_dma_prime_import_sg_table() argument 477 dma_obj->dma_addr = sg_dma_address(sgt->sgl); in drm_gem_dma_prime_import_sg_table() 478 dma_obj->sgt = sgt; in drm_gem_dma_prime_import_sg_table() [all …]
|
/linux-6.3-rc2/drivers/gpu/drm/i915/gem/ |
A D | i915_gem_dmabuf.c | 32 struct sg_table *sgt; in i915_gem_map_dma_buf() local 40 sgt = kmalloc(sizeof(*sgt), GFP_KERNEL); in i915_gem_map_dma_buf() 41 if (!sgt) { in i915_gem_map_dma_buf() 50 dst = sgt->sgl; in i915_gem_map_dma_buf() 60 return sgt; in i915_gem_map_dma_buf() 63 sg_free_table(sgt); in i915_gem_map_dma_buf() 65 kfree(sgt); in i915_gem_map_dma_buf() 242 struct sg_table *sgt; in i915_gem_object_get_pages_dmabuf() local 248 if (IS_ERR(sgt)) in i915_gem_object_get_pages_dmabuf() 249 return PTR_ERR(sgt); in i915_gem_object_get_pages_dmabuf() [all …]
|
/linux-6.3-rc2/drivers/accel/ivpu/ |
A D | ivpu_gem.c | 46 if (IS_ERR(sgt)) { in prime_map_pages_locked() 51 bo->sgt = sgt; in prime_map_pages_locked() 58 bo->sgt = NULL; in prime_unmap_pages_locked() 116 bo->sgt = sgt; in ivpu_bo_map_pages_locked() 120 kfree(sgt); in ivpu_bo_map_pages_locked() 130 kfree(bo->sgt); in ivpu_bo_unmap_pages_locked() 131 bo->sgt = NULL; in ivpu_bo_unmap_pages_locked() 252 if (!bo->sgt) { in ivpu_bo_pin() 418 if (bo->sgt) in ivpu_bo_free() 459 if (!bo->sgt) in ivpu_bo_get_sg_table() [all …]
|
/linux-6.3-rc2/drivers/media/platform/nvidia/tegra-vde/ |
A D | dmabuf-cache.c | 27 struct sg_table *sgt; member 72 struct sg_table *sgt; in tegra_vde_dmabuf_cache_map() local 93 *addrp = sg_dma_address(entry->sgt->sgl); in tegra_vde_dmabuf_cache_map() 105 sgt = dma_buf_map_attachment_unlocked(attachment, dma_dir); in tegra_vde_dmabuf_cache_map() 106 if (IS_ERR(sgt)) { in tegra_vde_dmabuf_cache_map() 108 err = PTR_ERR(sgt); in tegra_vde_dmabuf_cache_map() 112 if (!vde->domain && sgt->nents > 1) { in tegra_vde_dmabuf_cache_map() 125 err = tegra_vde_iommu_map(vde, sgt, &iova, dmabuf->size); in tegra_vde_dmabuf_cache_map() 131 *addrp = sg_dma_address(sgt->sgl); in tegra_vde_dmabuf_cache_map() 141 entry->sgt = sgt; in tegra_vde_dmabuf_cache_map() [all …]
|
/linux-6.3-rc2/net/ceph/ |
A D | crypto.c | 173 memset(sgt, 0, sizeof(*sgt)); in setup_sgtable() 183 ret = sg_alloc_table(sgt, chunk_cnt, GFP_NOFS); in setup_sgtable() 189 sgt->sgl = prealloc_sg; in setup_sgtable() 190 sgt->nents = sgt->orig_nents = 1; in setup_sgtable() 193 for_each_sg(sgt->sgl, sg, sgt->orig_nents, i) { in setup_sgtable() 213 static void teardown_sgtable(struct sg_table *sgt) in teardown_sgtable() argument 215 if (sgt->orig_nents > 1) in teardown_sgtable() 216 sg_free_table(sgt); in teardown_sgtable() 223 struct sg_table sgt; in ceph_aes_crypt() local 240 skcipher_request_set_crypt(req, sgt.sgl, sgt.sgl, crypt_len, iv); in ceph_aes_crypt() [all …]
|
/linux-6.3-rc2/drivers/gpu/drm/mediatek/ |
A D | mtk_drm_gem.c | 186 struct sg_table *sgt; in mtk_gem_prime_get_sg_table() local 189 sgt = kzalloc(sizeof(*sgt), GFP_KERNEL); in mtk_gem_prime_get_sg_table() 190 if (!sgt) in mtk_gem_prime_get_sg_table() 198 kfree(sgt); in mtk_gem_prime_get_sg_table() 202 return sgt; in mtk_gem_prime_get_sg_table() 229 struct sg_table *sgt = NULL; in mtk_drm_gem_prime_vmap() local 235 sgt = mtk_gem_prime_get_sg_table(obj); in mtk_drm_gem_prime_vmap() 236 if (IS_ERR(sgt)) in mtk_drm_gem_prime_vmap() 237 return PTR_ERR(sgt); in mtk_drm_gem_prime_vmap() 242 kfree(sgt); in mtk_drm_gem_prime_vmap() [all …]
|
/linux-6.3-rc2/drivers/infiniband/core/ |
A D | umem_dmabuf.c | 17 struct sg_table *sgt; in ib_umem_dmabuf_map_pages() local 26 if (umem_dmabuf->sgt) in ib_umem_dmabuf_map_pages() 29 sgt = dma_buf_map_attachment(umem_dmabuf->attach, in ib_umem_dmabuf_map_pages() 31 if (IS_ERR(sgt)) in ib_umem_dmabuf_map_pages() 32 return PTR_ERR(sgt); in ib_umem_dmabuf_map_pages() 39 for_each_sgtable_dma_sg(sgt, sg, i) { in ib_umem_dmabuf_map_pages() 62 umem_dmabuf->umem.sgt_append.sgt.sgl = umem_dmabuf->first_sg; in ib_umem_dmabuf_map_pages() 63 umem_dmabuf->umem.sgt_append.sgt.nents = nmap; in ib_umem_dmabuf_map_pages() 64 umem_dmabuf->sgt = sgt; in ib_umem_dmabuf_map_pages() 87 if (!umem_dmabuf->sgt) in ib_umem_dmabuf_unmap_pages() [all …]
|
/linux-6.3-rc2/drivers/gpu/drm/lima/ |
A D | lima_gem.c | 29 struct sg_table sgt; in lima_heap_alloc() local 72 if (bo->base.sgt) { in lima_heap_alloc() 76 bo->base.sgt = kmalloc(sizeof(*bo->base.sgt), GFP_KERNEL); in lima_heap_alloc() 77 if (!bo->base.sgt) { in lima_heap_alloc() 78 sg_free_table(&sgt); in lima_heap_alloc() 85 sg_free_table(&sgt); in lima_heap_alloc() 86 kfree(bo->base.sgt); in lima_heap_alloc() 87 bo->base.sgt = NULL; in lima_heap_alloc() 91 *bo->base.sgt = sgt; in lima_heap_alloc() 133 if (IS_ERR(sgt)) { in lima_gem_create_handle() [all …]
|
/linux-6.3-rc2/drivers/gpu/drm/etnaviv/ |
A D | etnaviv_gem.c | 23 struct sg_table *sgt = etnaviv_obj->sgt; in etnaviv_gem_scatter_map() local 36 struct sg_table *sgt = etnaviv_obj->sgt; in etnaviv_gem_scatterlist_unmap() local 75 if (etnaviv_obj->sgt) { in put_pages() 78 kfree(etnaviv_obj->sgt); in put_pages() 79 etnaviv_obj->sgt = NULL; in put_pages() 101 if (!etnaviv_obj->sgt) { in etnaviv_gem_get_pages() 104 struct sg_table *sgt; in etnaviv_gem_get_pages() local 108 if (IS_ERR(sgt)) { in etnaviv_gem_get_pages() 110 PTR_ERR(sgt)); in etnaviv_gem_get_pages() 111 return ERR_CAST(sgt); in etnaviv_gem_get_pages() [all …]
|
/linux-6.3-rc2/drivers/gpu/drm/rockchip/ |
A D | rockchip_drm_gem.c | 92 if (IS_ERR(rk_obj->sgt)) { in rockchip_gem_get_pages() 93 ret = PTR_ERR(rk_obj->sgt); in rockchip_gem_get_pages() 118 sg_free_table(rk_obj->sgt); in rockchip_gem_put_pages() 119 kfree(rk_obj->sgt); in rockchip_gem_put_pages() 433 struct sg_table *sgt; in rockchip_gem_prime_get_sg_table() local 439 sgt = kzalloc(sizeof(*sgt), GFP_KERNEL); in rockchip_gem_prime_get_sg_table() 440 if (!sgt) in rockchip_gem_prime_get_sg_table() 448 kfree(sgt); in rockchip_gem_prime_get_sg_table() 452 return sgt; in rockchip_gem_prime_get_sg_table() 461 rk_obj->sgt = sg; in rockchip_gem_iommu_map_sg() [all …]
|
/linux-6.3-rc2/drivers/gpu/drm/amd/amdgpu/ |
A D | amdgpu_dma_buf.c | 146 struct sg_table *sgt; in amdgpu_dma_buf_map() local 174 if (IS_ERR(sgt)) in amdgpu_dma_buf_map() 175 return sgt; in amdgpu_dma_buf_map() 185 dir, &sgt); in amdgpu_dma_buf_map() 193 return sgt; in amdgpu_dma_buf_map() 196 sg_free_table(sgt); in amdgpu_dma_buf_map() 197 kfree(sgt); in amdgpu_dma_buf_map() 211 struct sg_table *sgt, in amdgpu_dma_buf_unmap() argument 214 if (sgt->sgl->page_link) { in amdgpu_dma_buf_unmap() 216 sg_free_table(sgt); in amdgpu_dma_buf_unmap() [all …]
|
/linux-6.3-rc2/drivers/fpga/ |
A D | fpga-mgr.c | 96 struct sg_table *sgt) in fpga_mgr_write_sg() argument 182 struct sg_table *sgt) in fpga_mgr_parse_header_sg_first() argument 189 sg_miter_start(&miter, sgt->sgl, sgt->nents, SG_MITER_FROM_SG); in fpga_mgr_parse_header_sg_first() 236 len = sg_pcopy_to_buffer(sgt->sgl, sgt->nents, in fpga_mgr_parse_header_sg() 295 struct sg_table *sgt) in fpga_mgr_prepare_sg() argument 313 sg_miter_start(&miter, sgt->sgl, sgt->nents, SG_MITER_FROM_SG); in fpga_mgr_prepare_sg() 363 struct sg_table *sgt) in fpga_mgr_buf_load_sg() argument 379 sg_miter_start(&miter, sgt->sgl, sgt->nents, SG_MITER_FROM_SG); in fpga_mgr_buf_load_sg() 469 struct sg_table sgt; in fpga_mgr_buf_load() local 517 sg_free_table(&sgt); in fpga_mgr_buf_load() [all …]
|