Lines Matching refs:dma_buf

94 	struct dma_buf *dma_buf;  member
102 struct dma_buf *dma_buf, uint32_t handle) in drm_prime_add_buf_handle() argument
111 get_dma_buf(dma_buf); in drm_prime_add_buf_handle()
112 member->dma_buf = dma_buf; in drm_prime_add_buf_handle()
122 if (dma_buf > pos->dma_buf) in drm_prime_add_buf_handle()
148 static struct dma_buf *drm_prime_lookup_buf_by_handle(struct drm_prime_file_private *prime_fpriv, in drm_prime_lookup_buf_by_handle()
159 return member->dma_buf; in drm_prime_lookup_buf_by_handle()
170 struct dma_buf *dma_buf, in drm_prime_lookup_buf_handle() argument
180 if (member->dma_buf == dma_buf) { in drm_prime_lookup_buf_handle()
183 } else if (member->dma_buf < dma_buf) { in drm_prime_lookup_buf_handle()
194 struct dma_buf *dma_buf) in drm_prime_remove_buf_handle_locked() argument
203 if (member->dma_buf == dma_buf) { in drm_prime_remove_buf_handle_locked()
207 dma_buf_put(dma_buf); in drm_prime_remove_buf_handle_locked()
210 } else if (member->dma_buf < dma_buf) { in drm_prime_remove_buf_handle_locked()
243 struct dma_buf *drm_gem_dmabuf_export(struct drm_device *dev, in drm_gem_dmabuf_export()
247 struct dma_buf *dma_buf; in drm_gem_dmabuf_export() local
249 dma_buf = dma_buf_export(exp_info); in drm_gem_dmabuf_export()
250 if (IS_ERR(dma_buf)) in drm_gem_dmabuf_export()
251 return dma_buf; in drm_gem_dmabuf_export()
255 dma_buf->file->f_mapping = obj->dev->anon_inode->i_mapping; in drm_gem_dmabuf_export()
257 return dma_buf; in drm_gem_dmabuf_export()
270 void drm_gem_dmabuf_release(struct dma_buf *dma_buf) in drm_gem_dmabuf_release() argument
272 struct drm_gem_object *obj = dma_buf->priv; in drm_gem_dmabuf_release()
300 struct dma_buf *dma_buf; in drm_gem_prime_fd_to_handle() local
304 dma_buf = dma_buf_get(prime_fd); in drm_gem_prime_fd_to_handle()
305 if (IS_ERR(dma_buf)) in drm_gem_prime_fd_to_handle()
306 return PTR_ERR(dma_buf); in drm_gem_prime_fd_to_handle()
311 dma_buf, handle); in drm_gem_prime_fd_to_handle()
318 obj = dev->driver->gem_prime_import(dev, dma_buf); in drm_gem_prime_fd_to_handle()
320 obj = drm_gem_prime_import(dev, dma_buf); in drm_gem_prime_fd_to_handle()
326 if (obj->dma_buf) { in drm_gem_prime_fd_to_handle()
327 WARN_ON(obj->dma_buf != dma_buf); in drm_gem_prime_fd_to_handle()
329 obj->dma_buf = dma_buf; in drm_gem_prime_fd_to_handle()
330 get_dma_buf(dma_buf); in drm_gem_prime_fd_to_handle()
340 dma_buf, *handle); in drm_gem_prime_fd_to_handle()
345 dma_buf_put(dma_buf); in drm_gem_prime_fd_to_handle()
354 dma_buf_put(dma_buf); in drm_gem_prime_fd_to_handle()
361 dma_buf_put(dma_buf); in drm_gem_prime_fd_to_handle()
378 static struct dma_buf *export_and_register_object(struct drm_device *dev, in export_and_register_object()
382 struct dma_buf *dmabuf; in export_and_register_object()
406 obj->dma_buf = dmabuf; in export_and_register_object()
407 get_dma_buf(obj->dma_buf); in export_and_register_object()
432 struct dma_buf *dmabuf; in drm_gem_prime_handle_to_fd()
455 if (obj->dma_buf) { in drm_gem_prime_handle_to_fd()
456 get_dma_buf(obj->dma_buf); in drm_gem_prime_handle_to_fd()
457 dmabuf = obj->dma_buf; in drm_gem_prime_handle_to_fd()
577 int drm_gem_map_attach(struct dma_buf *dma_buf, in drm_gem_map_attach() argument
580 struct drm_gem_object *obj = dma_buf->priv; in drm_gem_map_attach()
595 void drm_gem_map_detach(struct dma_buf *dma_buf, in drm_gem_map_detach() argument
598 struct drm_gem_object *obj = dma_buf->priv; in drm_gem_map_detach()
677 int drm_gem_dmabuf_vmap(struct dma_buf *dma_buf, struct dma_buf_map *map) in drm_gem_dmabuf_vmap() argument
679 struct drm_gem_object *obj = dma_buf->priv; in drm_gem_dmabuf_vmap()
693 void drm_gem_dmabuf_vunmap(struct dma_buf *dma_buf, struct dma_buf_map *map) in drm_gem_dmabuf_vunmap() argument
695 struct drm_gem_object *obj = dma_buf->priv; in drm_gem_dmabuf_vunmap()
775 int drm_gem_dmabuf_mmap(struct dma_buf *dma_buf, struct vm_area_struct *vma) in drm_gem_dmabuf_mmap() argument
777 struct drm_gem_object *obj = dma_buf->priv; in drm_gem_dmabuf_mmap()
877 struct dma_buf *drm_gem_prime_export(struct drm_gem_object *obj, in drm_gem_prime_export()
910 struct dma_buf *dma_buf, in drm_gem_prime_import_dev() argument
918 if (dma_buf->ops == &drm_gem_prime_dmabuf_ops) { in drm_gem_prime_import_dev()
919 obj = dma_buf->priv; in drm_gem_prime_import_dev()
933 attach = dma_buf_attach(dma_buf, attach_dev); in drm_gem_prime_import_dev()
937 get_dma_buf(dma_buf); in drm_gem_prime_import_dev()
952 obj->resv = dma_buf->resv; in drm_gem_prime_import_dev()
959 dma_buf_detach(dma_buf, attach); in drm_gem_prime_import_dev()
960 dma_buf_put(dma_buf); in drm_gem_prime_import_dev()
980 struct dma_buf *dma_buf) in drm_gem_prime_import() argument
982 return drm_gem_prime_import_dev(dev, dma_buf, dev->dev); in drm_gem_prime_import()
1051 struct dma_buf *dma_buf; in drm_prime_gem_destroy() local
1056 dma_buf = attach->dmabuf; in drm_prime_gem_destroy()
1059 dma_buf_put(dma_buf); in drm_prime_gem_destroy()