Lines Matching refs:g2d_userptr

382 	struct g2d_cmdlist_userptr *g2d_userptr = obj;  in g2d_userptr_put_dma_addr()  local
390 refcount_dec(&g2d_userptr->refcount); in g2d_userptr_put_dma_addr()
392 if (refcount_read(&g2d_userptr->refcount) > 0) in g2d_userptr_put_dma_addr()
395 if (g2d_userptr->in_pool) in g2d_userptr_put_dma_addr()
399 dma_unmap_sgtable(to_dma_dev(g2d->drm_dev), g2d_userptr->sgt, in g2d_userptr_put_dma_addr()
402 unpin_user_pages_dirty_lock(g2d_userptr->pages, g2d_userptr->npages, in g2d_userptr_put_dma_addr()
404 kvfree(g2d_userptr->pages); in g2d_userptr_put_dma_addr()
406 if (!g2d_userptr->out_of_list) in g2d_userptr_put_dma_addr()
407 list_del_init(&g2d_userptr->list); in g2d_userptr_put_dma_addr()
409 sg_free_table(g2d_userptr->sgt); in g2d_userptr_put_dma_addr()
410 kfree(g2d_userptr->sgt); in g2d_userptr_put_dma_addr()
411 kfree(g2d_userptr); in g2d_userptr_put_dma_addr()
421 struct g2d_cmdlist_userptr *g2d_userptr; in g2d_userptr_get_dma_addr() local
433 list_for_each_entry(g2d_userptr, &file_priv->userptr_list, list) { in g2d_userptr_get_dma_addr()
434 if (g2d_userptr->userptr == userptr) { in g2d_userptr_get_dma_addr()
439 if (g2d_userptr->size == size) { in g2d_userptr_get_dma_addr()
440 refcount_inc(&g2d_userptr->refcount); in g2d_userptr_get_dma_addr()
441 *obj = g2d_userptr; in g2d_userptr_get_dma_addr()
443 return &g2d_userptr->dma_addr; in g2d_userptr_get_dma_addr()
453 g2d_userptr->out_of_list = true; in g2d_userptr_get_dma_addr()
454 g2d_userptr->in_pool = false; in g2d_userptr_get_dma_addr()
455 list_del_init(&g2d_userptr->list); in g2d_userptr_get_dma_addr()
461 g2d_userptr = kzalloc(sizeof(*g2d_userptr), GFP_KERNEL); in g2d_userptr_get_dma_addr()
462 if (!g2d_userptr) in g2d_userptr_get_dma_addr()
465 refcount_set(&g2d_userptr->refcount, 1); in g2d_userptr_get_dma_addr()
466 g2d_userptr->size = size; in g2d_userptr_get_dma_addr()
472 g2d_userptr->pages = kvmalloc_array(npages, sizeof(*g2d_userptr->pages), in g2d_userptr_get_dma_addr()
474 if (!g2d_userptr->pages) { in g2d_userptr_get_dma_addr()
481 g2d_userptr->pages); in g2d_userptr_get_dma_addr()
491 g2d_userptr->npages = npages; in g2d_userptr_get_dma_addr()
500 g2d_userptr->pages, in g2d_userptr_get_dma_addr()
507 g2d_userptr->sgt = sgt; in g2d_userptr_get_dma_addr()
516 g2d_userptr->dma_addr = sgt->sgl[0].dma_address; in g2d_userptr_get_dma_addr()
517 g2d_userptr->userptr = userptr; in g2d_userptr_get_dma_addr()
519 list_add_tail(&g2d_userptr->list, &file_priv->userptr_list); in g2d_userptr_get_dma_addr()
523 g2d_userptr->in_pool = true; in g2d_userptr_get_dma_addr()
526 *obj = g2d_userptr; in g2d_userptr_get_dma_addr()
528 return &g2d_userptr->dma_addr; in g2d_userptr_get_dma_addr()
537 unpin_user_pages(g2d_userptr->pages, npages); in g2d_userptr_get_dma_addr()
540 kvfree(g2d_userptr->pages); in g2d_userptr_get_dma_addr()
543 kfree(g2d_userptr); in g2d_userptr_get_dma_addr()
551 struct g2d_cmdlist_userptr *g2d_userptr, *n; in g2d_userptr_free_all() local
553 list_for_each_entry_safe(g2d_userptr, n, &file_priv->userptr_list, list) in g2d_userptr_free_all()
554 if (g2d_userptr->in_pool) in g2d_userptr_free_all()
555 g2d_userptr_put_dma_addr(g2d, g2d_userptr, true); in g2d_userptr_free_all()
731 struct drm_exynos_g2d_userptr g2d_userptr; in g2d_map_cmdlist_gem() local
733 if (copy_from_user(&g2d_userptr, (void __user *)handle, in g2d_map_cmdlist_gem()
741 g2d_userptr.size)) { in g2d_map_cmdlist_gem()
747 g2d_userptr.userptr, in g2d_map_cmdlist_gem()
748 g2d_userptr.size, in g2d_map_cmdlist_gem()