Home
last modified time | relevance | path

Searched refs:dmabuf (Results 1 – 25 of 83) sorted by relevance

1234

/Linux-v4.19/drivers/dma-buf/
Ddma-buf.c51 struct dma_buf *dmabuf; in dma_buf_release() local
56 dmabuf = file->private_data; in dma_buf_release()
58 BUG_ON(dmabuf->vmapping_counter); in dma_buf_release()
68 BUG_ON(dmabuf->cb_shared.active || dmabuf->cb_excl.active); in dma_buf_release()
70 dmabuf->ops->release(dmabuf); in dma_buf_release()
73 list_del(&dmabuf->list_node); in dma_buf_release()
76 if (dmabuf->resv == (struct reservation_object *)&dmabuf[1]) in dma_buf_release()
77 reservation_object_fini(dmabuf->resv); in dma_buf_release()
79 module_put(dmabuf->owner); in dma_buf_release()
80 kfree(dmabuf); in dma_buf_release()
[all …]
/Linux-v4.19/drivers/gpu/drm/i915/selftests/
Di915_gem_dmabuf.c34 struct dma_buf *dmabuf; in igt_dmabuf_export() local
40 dmabuf = i915_gem_prime_export(&i915->drm, &obj->base, 0); in igt_dmabuf_export()
42 if (IS_ERR(dmabuf)) { in igt_dmabuf_export()
44 (int)PTR_ERR(dmabuf)); in igt_dmabuf_export()
45 return PTR_ERR(dmabuf); in igt_dmabuf_export()
48 dma_buf_put(dmabuf); in igt_dmabuf_export()
57 struct dma_buf *dmabuf; in igt_dmabuf_import_self() local
64 dmabuf = i915_gem_prime_export(&i915->drm, &obj->base, 0); in igt_dmabuf_import_self()
65 if (IS_ERR(dmabuf)) { in igt_dmabuf_import_self()
67 (int)PTR_ERR(dmabuf)); in igt_dmabuf_import_self()
[all …]
Dmock_dmabuf.c30 struct mock_dmabuf *mock = to_mock(attachment->dmabuf); in mock_map_dma_buf()
131 struct dma_buf *dmabuf; in mock_dmabuf() local
151 dmabuf = dma_buf_export(&exp_info); in mock_dmabuf()
152 if (IS_ERR(dmabuf)) in mock_dmabuf()
155 return dmabuf; in mock_dmabuf()
/Linux-v4.19/samples/vfio-mdev/
Dmbochs.c703 struct mbochs_dmabuf *dmabuf = vma->vm_private_data; in mbochs_dmabuf_vm_fault() local
705 if (WARN_ON(vmf->pgoff >= dmabuf->pagecount)) in mbochs_dmabuf_vm_fault()
708 vmf->page = dmabuf->pages[vmf->pgoff]; in mbochs_dmabuf_vm_fault()
719 struct mbochs_dmabuf *dmabuf = buf->priv; in mbochs_mmap_dmabuf() local
720 struct device *dev = mdev_dev(dmabuf->mdev_state->mdev); in mbochs_mmap_dmabuf()
722 dev_dbg(dev, "%s: %d\n", __func__, dmabuf->id); in mbochs_mmap_dmabuf()
728 vma->vm_private_data = dmabuf; in mbochs_mmap_dmabuf()
732 static void mbochs_print_dmabuf(struct mbochs_dmabuf *dmabuf, in mbochs_print_dmabuf() argument
735 struct device *dev = mdev_dev(dmabuf->mdev_state->mdev); in mbochs_print_dmabuf()
736 u32 fourcc = dmabuf->mode.drm_format; in mbochs_print_dmabuf()
[all …]
/Linux-v4.19/drivers/hid/
Dhid-elan.c84 unsigned char *dmabuf, unsigned char param) in elan_get_device_param() argument
88 dmabuf[0] = ELAN_FEATURE_REPORT; in elan_get_device_param()
89 dmabuf[1] = 0x05; in elan_get_device_param()
90 dmabuf[2] = 0x03; in elan_get_device_param()
91 dmabuf[3] = param; in elan_get_device_param()
92 dmabuf[4] = 0x01; in elan_get_device_param()
94 ret = hid_hw_raw_request(hdev, ELAN_FEATURE_REPORT, dmabuf, in elan_get_device_param()
102 ret = hid_hw_raw_request(hdev, ELAN_FEATURE_REPORT, dmabuf, in elan_get_device_param()
125 unsigned char *dmabuf; in elan_get_device_params() local
128 dmabuf = kmalloc(ELAN_FEATURE_SIZE, GFP_KERNEL); in elan_get_device_params()
[all …]
Dhid-asus.c256 unsigned char *dmabuf; in asus_kbd_set_report() local
259 dmabuf = kmemdup(buf, buf_size, GFP_KERNEL); in asus_kbd_set_report()
260 if (!dmabuf) in asus_kbd_set_report()
263 ret = hid_hw_raw_request(hdev, FEATURE_KBD_REPORT_ID, dmabuf, in asus_kbd_set_report()
266 kfree(dmabuf); in asus_kbd_set_report()
576 unsigned char *dmabuf = kmemdup(buf, sizeof(buf), GFP_KERNEL); in asus_start_multitouch() local
578 if (!dmabuf) { in asus_start_multitouch()
584 ret = hid_hw_raw_request(hdev, dmabuf[0], dmabuf, sizeof(buf), in asus_start_multitouch()
587 kfree(dmabuf); in asus_start_multitouch()
/Linux-v4.19/drivers/gpu/drm/
Ddrm_prime.c296 struct drm_gem_object *obj = attach->dmabuf->priv; in drm_gem_map_dma_buf()
554 struct dma_buf *dmabuf; in export_and_register_object() local
558 dmabuf = ERR_PTR(-ENOENT); in export_and_register_object()
559 return dmabuf; in export_and_register_object()
562 dmabuf = dev->driver->gem_prime_export(dev, obj, flags); in export_and_register_object()
563 if (IS_ERR(dmabuf)) { in export_and_register_object()
567 return dmabuf; in export_and_register_object()
575 obj->dma_buf = dmabuf; in export_and_register_object()
578 return dmabuf; in export_and_register_object()
601 struct dma_buf *dmabuf; in drm_gem_prime_handle_to_fd() local
[all …]
/Linux-v4.19/include/linux/
Ddma-buf.h322 struct dma_buf *dmabuf; member
371 static inline void get_dma_buf(struct dma_buf *dmabuf) in get_dma_buf() argument
373 get_file(dmabuf->file); in get_dma_buf()
376 struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf,
378 void dma_buf_detach(struct dma_buf *dmabuf,
383 int dma_buf_fd(struct dma_buf *dmabuf, int flags);
385 void dma_buf_put(struct dma_buf *dmabuf);
/Linux-v4.19/drivers/staging/android/ion/
Dion.c204 static int ion_dma_buf_attach(struct dma_buf *dmabuf, in ion_dma_buf_attach() argument
209 struct ion_buffer *buffer = dmabuf->priv; in ion_dma_buf_attach()
234 static void ion_dma_buf_detatch(struct dma_buf *dmabuf, in ion_dma_buf_detatch() argument
238 struct ion_buffer *buffer = dmabuf->priv; in ion_dma_buf_detatch()
270 static int ion_mmap(struct dma_buf *dmabuf, struct vm_area_struct *vma) in ion_mmap() argument
272 struct ion_buffer *buffer = dmabuf->priv; in ion_mmap()
296 static void ion_dma_buf_release(struct dma_buf *dmabuf) in ion_dma_buf_release() argument
298 struct ion_buffer *buffer = dmabuf->priv; in ion_dma_buf_release()
303 static void *ion_dma_buf_kmap(struct dma_buf *dmabuf, unsigned long offset) in ion_dma_buf_kmap() argument
305 struct ion_buffer *buffer = dmabuf->priv; in ion_dma_buf_kmap()
[all …]
/Linux-v4.19/drivers/tee/
Dtee_shm.c76 static void tee_shm_op_release(struct dma_buf *dmabuf) in tee_shm_op_release() argument
78 struct tee_shm *shm = dmabuf->priv; in tee_shm_op_release()
83 static void *tee_shm_op_map(struct dma_buf *dmabuf, unsigned long pgnum) in tee_shm_op_map() argument
88 static int tee_shm_op_mmap(struct dma_buf *dmabuf, struct vm_area_struct *vma) in tee_shm_op_mmap() argument
90 struct tee_shm *shm = dmabuf->priv; in tee_shm_op_mmap()
179 shm->dmabuf = dma_buf_export(&exp_info); in __tee_shm_alloc()
180 if (IS_ERR(shm->dmabuf)) { in __tee_shm_alloc()
181 ret = ERR_CAST(shm->dmabuf); in __tee_shm_alloc()
310 shm->dmabuf = dma_buf_export(&exp_info); in tee_shm_register()
311 if (IS_ERR(shm->dmabuf)) { in tee_shm_register()
[all …]
/Linux-v4.19/drivers/staging/comedi/drivers/
Daddi_apci_3120.c150 struct apci3120_dmabuf dmabuf[2]; member
172 struct apci3120_dmabuf *dmabuf) in apci3120_init_dma() argument
189 apci3120_addon_write(dev, dmabuf->hw, AMCC_OP_REG_AMWAR); in apci3120_init_dma()
192 apci3120_addon_write(dev, dmabuf->use_size, AMCC_OP_REG_AMWTC); in apci3120_init_dma()
208 struct apci3120_dmabuf *dmabuf0 = &devpriv->dmabuf[0]; in apci3120_setup_dma()
209 struct apci3120_dmabuf *dmabuf1 = &devpriv->dmabuf[1]; in apci3120_setup_dma()
430 struct apci3120_dmabuf *dmabuf; in apci3120_interrupt_dma() local
434 dmabuf = &devpriv->dmabuf[devpriv->cur_dmabuf]; in apci3120_interrupt_dma()
436 nbytes = dmabuf->use_size - inl(devpriv->amcc + AMCC_OP_REG_MWTC); in apci3120_interrupt_dma()
438 if (nbytes < dmabuf->use_size) in apci3120_interrupt_dma()
[all …]
Dadl_pci9118.c228 struct pci9118_dmabuf dmabuf[2]; member
247 struct pci9118_dmabuf *dmabuf = &devpriv->dmabuf[buf]; in pci9118_amcc_setup_dma() local
250 outl(dmabuf->hw, devpriv->iobase_a + AMCC_OP_REG_MWAR); in pci9118_amcc_setup_dma()
251 outl(dmabuf->use_size, devpriv->iobase_a + AMCC_OP_REG_MWTC); in pci9118_amcc_setup_dma()
394 struct pci9118_dmabuf *dmabuf = &devpriv->dmabuf[next_buf]; in pci9118_ai_mode4_switch() local
399 comedi_8254_load(dev->pacer, 0, dmabuf->hw >> 1, in pci9118_ai_mode4_switch()
641 struct pci9118_dmabuf *dmabuf = &devpriv->dmabuf[devpriv->dma_actbuf]; in pci9118_ai_get_dma() local
642 unsigned int n_all = comedi_bytes_to_samples(s, dmabuf->use_size); in pci9118_ai_get_dma()
659 pci9118_ai_dma_xfer(dev, s, dmabuf->virt, n_all); in pci9118_ai_get_dma()
804 struct pci9118_dmabuf *dmabuf0 = &devpriv->dmabuf[0]; in pci9118_ai_setup_dma()
[all …]
/Linux-v4.19/drivers/gpu/drm/savage/
Dsavage_state.c280 const struct drm_buf * dmabuf) in savage_dispatch_dma_prim() argument
290 if (!dmabuf) { in savage_dispatch_dma_prim()
342 if (start + n > dmabuf->total / 32) { in savage_dispatch_dma_prim()
344 start, start + n - 1, dmabuf->total / 32); in savage_dispatch_dma_prim()
353 if (dmabuf->bus_address != dev_priv->state.common.vbaddr) { in savage_dispatch_dma_prim()
356 BCI_WRITE(dmabuf->bus_address | dev_priv->dma_type); in savage_dispatch_dma_prim()
357 dev_priv->state.common.vbaddr = dmabuf->bus_address; in savage_dispatch_dma_prim()
539 const struct drm_buf * dmabuf) in savage_dispatch_dma_idx() argument
548 if (!dmabuf) { in savage_dispatch_dma_idx()
603 if (dmabuf->bus_address != dev_priv->state.common.vbaddr) { in savage_dispatch_dma_idx()
[all …]
/Linux-v4.19/drivers/scsi/lpfc/
Dlpfc_bsg.c919 struct lpfc_dmabuf *dmabuf = NULL; in lpfc_bsg_ct_unsol_event() local
950 dmabuf = bdeBuf1; in lpfc_bsg_ct_unsol_event()
954 dmabuf = lpfc_sli_ringpostbuf_get(phba, pring, dma_addr); in lpfc_bsg_ct_unsol_event()
956 if (dmabuf == NULL) in lpfc_bsg_ct_unsol_event()
958 ct_req = (struct lpfc_sli_ct_request *)dmabuf->virt; in lpfc_bsg_ct_unsol_event()
962 lpfc_sli_ringpostbuf_put(phba, pring, dmabuf); in lpfc_bsg_ct_unsol_event()
1020 dmabuf = bdeBuf1; in lpfc_bsg_ct_unsol_event()
1026 dmabuf = bdeBuf2; in lpfc_bsg_ct_unsol_event()
1036 dmabuf = lpfc_sli_ringpostbuf_get(phba, in lpfc_bsg_ct_unsol_event()
1039 if (!dmabuf) { in lpfc_bsg_ct_unsol_event()
[all …]
Dlpfc_sli.c80 struct hbq_dmabuf *dmabuf);
1987 struct lpfc_dmabuf *dmabuf, *next_dmabuf; in lpfc_sli_hbqbuf_free_all() local
1996 list_for_each_entry_safe(dmabuf, next_dmabuf, in lpfc_sli_hbqbuf_free_all()
1998 hbq_buf = container_of(dmabuf, struct hbq_dmabuf, dbuf); in lpfc_sli_hbqbuf_free_all()
3797 struct hbq_dmabuf *dmabuf; in lpfc_sli_handle_slow_ring_event_s4() local
3824 dmabuf = container_of(cq_event, struct hbq_dmabuf, in lpfc_sli_handle_slow_ring_event_s4()
3826 lpfc_sli4_handle_received_buffer(phba, dmabuf); in lpfc_sli_handle_slow_ring_event_s4()
5298 struct lpfc_dmabuf *dmabuf; in lpfc_sli4_read_rev() local
5301 dmabuf = kzalloc(sizeof(struct lpfc_dmabuf), GFP_KERNEL); in lpfc_sli4_read_rev()
5302 if (!dmabuf) in lpfc_sli4_read_rev()
[all …]
/Linux-v4.19/drivers/gpu/drm/udl/
Dudl_dmabuf.c31 static int udl_attach_dma_buf(struct dma_buf *dmabuf, in udl_attach_dma_buf() argument
37 attach->dmabuf->size); in udl_attach_dma_buf()
49 static void udl_detach_dma_buf(struct dma_buf *dmabuf, in udl_detach_dma_buf() argument
59 attach->dmabuf->size); in udl_detach_dma_buf()
76 struct udl_gem_object *obj = to_udl_bo(attach->dmabuf->priv); in udl_map_dma_buf()
86 attach->dmabuf->size, dir); in udl_map_dma_buf()
150 attach->dmabuf->size, dir); in udl_unmap_dma_buf()
/Linux-v4.19/sound/ppc/
Dbeep.c223 void *dmabuf; in snd_pmac_attach_beep() local
229 dmabuf = dma_alloc_coherent(&chip->pdev->dev, BEEP_BUFLEN * 4, in snd_pmac_attach_beep()
232 if (! dmabuf || ! input_dev) in snd_pmac_attach_beep()
250 beep->buf = dmabuf; in snd_pmac_attach_beep()
269 if (dmabuf) in snd_pmac_attach_beep()
271 dmabuf, beep->addr); in snd_pmac_attach_beep()
/Linux-v4.19/drivers/usb/serial/
Dcp210x.c505 void *dmabuf; in cp210x_read_reg_block() local
508 dmabuf = kmalloc(bufsize, GFP_KERNEL); in cp210x_read_reg_block()
509 if (!dmabuf) { in cp210x_read_reg_block()
520 port_priv->bInterfaceNumber, dmabuf, bufsize, in cp210x_read_reg_block()
523 memcpy(buf, dmabuf, bufsize); in cp210x_read_reg_block()
538 kfree(dmabuf); in cp210x_read_reg_block()
598 void *dmabuf; in cp210x_read_vendor_block() local
601 dmabuf = kmalloc(bufsize, GFP_KERNEL); in cp210x_read_vendor_block()
602 if (!dmabuf) in cp210x_read_vendor_block()
607 cp210x_interface_num(serial), dmabuf, bufsize, in cp210x_read_vendor_block()
[all …]
/Linux-v4.19/drivers/gpu/drm/vgem/
Dvgem_fence.c119 struct dma_buf *dmabuf; in attach_dmabuf() local
124 dmabuf = dev->driver->gem_prime_export(dev, obj, 0); in attach_dmabuf()
125 if (IS_ERR(dmabuf)) in attach_dmabuf()
126 return PTR_ERR(dmabuf); in attach_dmabuf()
128 obj->dma_buf = dmabuf; in attach_dmabuf()
/Linux-v4.19/drivers/gpu/drm/etnaviv/
Detnaviv_gem_prime.c72 dma_buf_vunmap(etnaviv_obj->base.import_attach->dmabuf, in etnaviv_gem_prime_release()
88 return dma_buf_vmap(etnaviv_obj->base.import_attach->dmabuf); in etnaviv_gem_prime_vmap_impl()
108 size_t size = PAGE_ALIGN(attach->dmabuf->size); in etnaviv_gem_prime_import_sg_table()
112 attach->dmabuf->resv, in etnaviv_gem_prime_import_sg_table()
/Linux-v4.19/drivers/xen/
Dgntdev-dmabuf.c35 struct dma_buf *dmabuf; member
262 struct gntdev_dmabuf *gntdev_dmabuf = attach->dmabuf->priv; in dmabuf_exp_ops_map_dma_buf()
407 gntdev_dmabuf->dmabuf = dma_buf_export(&exp_info); in dmabuf_exp_from_pages()
408 if (IS_ERR(gntdev_dmabuf->dmabuf)) { in dmabuf_exp_from_pages()
409 ret = PTR_ERR(gntdev_dmabuf->dmabuf); in dmabuf_exp_from_pages()
410 gntdev_dmabuf->dmabuf = NULL; in dmabuf_exp_from_pages()
414 ret = dma_buf_fd(gntdev_dmabuf->dmabuf, O_CLOEXEC); in dmabuf_exp_from_pages()
429 if (gntdev_dmabuf->dmabuf) in dmabuf_exp_from_pages()
430 dma_buf_put(gntdev_dmabuf->dmabuf); in dmabuf_exp_from_pages()
637 if (attach->dmabuf->size != gntdev_dmabuf->nr_pages << PAGE_SHIFT) { in dmabuf_imp_to_refs()
[all …]
/Linux-v4.19/drivers/staging/media/tegra-vde/
Dtegra-vde.c521 struct dma_buf *dmabuf = a->dmabuf; in tegra_vde_detach_and_put_dmabuf() local
524 dma_buf_detach(dmabuf, a); in tegra_vde_detach_and_put_dmabuf()
525 dma_buf_put(dmabuf); in tegra_vde_detach_and_put_dmabuf()
540 struct dma_buf *dmabuf; in tegra_vde_attach_dmabuf() local
544 dmabuf = dma_buf_get(fd); in tegra_vde_attach_dmabuf()
545 if (IS_ERR(dmabuf)) { in tegra_vde_attach_dmabuf()
547 return PTR_ERR(dmabuf); in tegra_vde_attach_dmabuf()
550 if (dmabuf->size & (align_size - 1)) { in tegra_vde_attach_dmabuf()
552 dmabuf->size, align_size); in tegra_vde_attach_dmabuf()
556 if ((u64)offset + min_size > dmabuf->size) { in tegra_vde_attach_dmabuf()
[all …]
/Linux-v4.19/drivers/gpu/drm/tinydrm/core/
Dtinydrm-core.c66 vaddr = dma_buf_vmap(attach->dmabuf); in tinydrm_gem_cma_prime_import_sg_table()
74 dma_buf_vunmap(attach->dmabuf, vaddr); in tinydrm_gem_cma_prime_import_sg_table()
102 dma_buf_vunmap(gem_obj->import_attach->dmabuf, cma_obj->vaddr); in tinydrm_gem_cma_free_object()
/Linux-v4.19/drivers/gpu/drm/i915/gvt/
Ddmabuf.c479 struct dma_buf *dmabuf; in intel_vgpu_get_dmabuf() local
501 dmabuf = i915_gem_prime_export(dev, &obj->base, DRM_CLOEXEC | DRM_RDWR); in intel_vgpu_get_dmabuf()
502 if (IS_ERR(dmabuf)) { in intel_vgpu_get_dmabuf()
504 ret = PTR_ERR(dmabuf); in intel_vgpu_get_dmabuf()
510 ret = dma_buf_fd(dmabuf, DRM_CLOEXEC | DRM_RDWR); in intel_vgpu_get_dmabuf()
531 file_count(dmabuf->file), in intel_vgpu_get_dmabuf()
537 dma_buf_put(dmabuf); in intel_vgpu_get_dmabuf()
/Linux-v4.19/drivers/gpu/drm/nouveau/
Dnouveau_prime.c65 struct reservation_object *robj = attach->dmabuf->resv; in nouveau_gem_prime_import_sg_table()
72 ret = nouveau_bo_new(&drm->client, attach->dmabuf->size, 0, flags, 0, 0, in nouveau_gem_prime_import_sg_table()

1234