Lines Matching refs:g2d_userptr

379 	struct g2d_cmdlist_userptr *g2d_userptr = obj;  in g2d_userptr_put_dma_addr()  local
388 atomic_dec(&g2d_userptr->refcount); in g2d_userptr_put_dma_addr()
390 if (atomic_read(&g2d_userptr->refcount) > 0) in g2d_userptr_put_dma_addr()
393 if (g2d_userptr->in_pool) in g2d_userptr_put_dma_addr()
397 dma_unmap_sg(to_dma_dev(g2d->drm_dev), g2d_userptr->sgt->sgl, in g2d_userptr_put_dma_addr()
398 g2d_userptr->sgt->nents, DMA_BIDIRECTIONAL); in g2d_userptr_put_dma_addr()
400 pages = frame_vector_pages(g2d_userptr->vec); in g2d_userptr_put_dma_addr()
404 for (i = 0; i < frame_vector_count(g2d_userptr->vec); i++) in g2d_userptr_put_dma_addr()
407 put_vaddr_frames(g2d_userptr->vec); in g2d_userptr_put_dma_addr()
408 frame_vector_destroy(g2d_userptr->vec); in g2d_userptr_put_dma_addr()
410 if (!g2d_userptr->out_of_list) in g2d_userptr_put_dma_addr()
411 list_del_init(&g2d_userptr->list); in g2d_userptr_put_dma_addr()
413 sg_free_table(g2d_userptr->sgt); in g2d_userptr_put_dma_addr()
414 kfree(g2d_userptr->sgt); in g2d_userptr_put_dma_addr()
415 kfree(g2d_userptr); in g2d_userptr_put_dma_addr()
425 struct g2d_cmdlist_userptr *g2d_userptr; in g2d_userptr_get_dma_addr() local
437 list_for_each_entry(g2d_userptr, &file_priv->userptr_list, list) { in g2d_userptr_get_dma_addr()
438 if (g2d_userptr->userptr == userptr) { in g2d_userptr_get_dma_addr()
443 if (g2d_userptr->size == size) { in g2d_userptr_get_dma_addr()
444 atomic_inc(&g2d_userptr->refcount); in g2d_userptr_get_dma_addr()
445 *obj = g2d_userptr; in g2d_userptr_get_dma_addr()
447 return &g2d_userptr->dma_addr; in g2d_userptr_get_dma_addr()
457 g2d_userptr->out_of_list = true; in g2d_userptr_get_dma_addr()
458 g2d_userptr->in_pool = false; in g2d_userptr_get_dma_addr()
459 list_del_init(&g2d_userptr->list); in g2d_userptr_get_dma_addr()
465 g2d_userptr = kzalloc(sizeof(*g2d_userptr), GFP_KERNEL); in g2d_userptr_get_dma_addr()
466 if (!g2d_userptr) in g2d_userptr_get_dma_addr()
469 atomic_set(&g2d_userptr->refcount, 1); in g2d_userptr_get_dma_addr()
470 g2d_userptr->size = size; in g2d_userptr_get_dma_addr()
476 g2d_userptr->vec = frame_vector_create(npages); in g2d_userptr_get_dma_addr()
477 if (!g2d_userptr->vec) { in g2d_userptr_get_dma_addr()
483 g2d_userptr->vec); in g2d_userptr_get_dma_addr()
492 if (frame_vector_to_pages(g2d_userptr->vec) < 0) { in g2d_userptr_get_dma_addr()
504 frame_vector_pages(g2d_userptr->vec), in g2d_userptr_get_dma_addr()
511 g2d_userptr->sgt = sgt; in g2d_userptr_get_dma_addr()
520 g2d_userptr->dma_addr = sgt->sgl[0].dma_address; in g2d_userptr_get_dma_addr()
521 g2d_userptr->userptr = userptr; in g2d_userptr_get_dma_addr()
523 list_add_tail(&g2d_userptr->list, &file_priv->userptr_list); in g2d_userptr_get_dma_addr()
527 g2d_userptr->in_pool = true; in g2d_userptr_get_dma_addr()
530 *obj = g2d_userptr; in g2d_userptr_get_dma_addr()
532 return &g2d_userptr->dma_addr; in g2d_userptr_get_dma_addr()
541 put_vaddr_frames(g2d_userptr->vec); in g2d_userptr_get_dma_addr()
544 frame_vector_destroy(g2d_userptr->vec); in g2d_userptr_get_dma_addr()
547 kfree(g2d_userptr); in g2d_userptr_get_dma_addr()
555 struct g2d_cmdlist_userptr *g2d_userptr, *n; in g2d_userptr_free_all() local
557 list_for_each_entry_safe(g2d_userptr, n, &file_priv->userptr_list, list) in g2d_userptr_free_all()
558 if (g2d_userptr->in_pool) in g2d_userptr_free_all()
559 g2d_userptr_put_dma_addr(g2d, g2d_userptr, true); in g2d_userptr_free_all()
735 struct drm_exynos_g2d_userptr g2d_userptr; in g2d_map_cmdlist_gem() local
737 if (copy_from_user(&g2d_userptr, (void __user *)handle, in g2d_map_cmdlist_gem()
745 g2d_userptr.size)) { in g2d_map_cmdlist_gem()
751 g2d_userptr.userptr, in g2d_map_cmdlist_gem()
752 g2d_userptr.size, in g2d_map_cmdlist_gem()