Lines Matching refs:gtt
543 struct radeon_ttm_tt *gtt = (void *)ttm; in radeon_ttm_tt_pin_userptr() local
547 int write = !(gtt->userflags & RADEON_GEM_USERPTR_READONLY); in radeon_ttm_tt_pin_userptr()
551 if (current->mm != gtt->usermm) in radeon_ttm_tt_pin_userptr()
554 if (gtt->userflags & RADEON_GEM_USERPTR_ANONONLY) { in radeon_ttm_tt_pin_userptr()
557 unsigned long end = gtt->userptr + ttm->num_pages * PAGE_SIZE; in radeon_ttm_tt_pin_userptr()
559 vma = find_vma(gtt->usermm, gtt->userptr); in radeon_ttm_tt_pin_userptr()
566 uint64_t userptr = gtt->userptr + pinned * PAGE_SIZE; in radeon_ttm_tt_pin_userptr()
590 gtt->ttm.dma_address, ttm->num_pages); in radeon_ttm_tt_pin_userptr()
605 struct radeon_ttm_tt *gtt = (void *)ttm; in radeon_ttm_tt_unpin_userptr() local
608 int write = !(gtt->userflags & RADEON_GEM_USERPTR_READONLY); in radeon_ttm_tt_unpin_userptr()
621 if (!(gtt->userflags & RADEON_GEM_USERPTR_READONLY)) in radeon_ttm_tt_unpin_userptr()
634 struct radeon_ttm_tt *gtt = (void*)ttm; in radeon_ttm_backend_bind() local
639 if (gtt->userptr) { in radeon_ttm_backend_bind()
644 gtt->offset = (unsigned long)(bo_mem->start << PAGE_SHIFT); in radeon_ttm_backend_bind()
651 r = radeon_gart_bind(gtt->rdev, gtt->offset, ttm->num_pages, in radeon_ttm_backend_bind()
652 ttm->pages, gtt->ttm.dma_address, flags); in radeon_ttm_backend_bind()
655 ttm->num_pages, (unsigned)gtt->offset); in radeon_ttm_backend_bind()
663 struct radeon_ttm_tt *gtt = (void *)ttm; in radeon_ttm_backend_unbind() local
665 radeon_gart_unbind(gtt->rdev, gtt->offset, ttm->num_pages); in radeon_ttm_backend_unbind()
667 if (gtt->userptr) in radeon_ttm_backend_unbind()
675 struct radeon_ttm_tt *gtt = (void *)ttm; in radeon_ttm_backend_destroy() local
677 ttm_dma_tt_fini(>t->ttm); in radeon_ttm_backend_destroy()
678 kfree(gtt); in radeon_ttm_backend_destroy()
692 struct radeon_ttm_tt *gtt; in radeon_ttm_tt_create() local
702 gtt = kzalloc(sizeof(struct radeon_ttm_tt), GFP_KERNEL); in radeon_ttm_tt_create()
703 if (gtt == NULL) { in radeon_ttm_tt_create()
706 gtt->ttm.ttm.func = &radeon_backend_func; in radeon_ttm_tt_create()
707 gtt->rdev = rdev; in radeon_ttm_tt_create()
708 if (ttm_dma_tt_init(>t->ttm, bdev, size, page_flags, dummy_read_page)) { in radeon_ttm_tt_create()
709 kfree(gtt); in radeon_ttm_tt_create()
712 return >t->ttm.ttm; in radeon_ttm_tt_create()
724 struct radeon_ttm_tt *gtt = radeon_ttm_tt_to_gtt(ttm); in radeon_ttm_tt_populate() local
733 if (gtt && gtt->userptr) { in radeon_ttm_tt_populate()
745 gtt->ttm.dma_address, ttm->num_pages); in radeon_ttm_tt_populate()
759 return ttm_dma_populate(>t->ttm, rdev->dev); in radeon_ttm_tt_populate()
769 gtt->ttm.dma_address[i] = pci_map_page(rdev->pdev, ttm->pages[i], in radeon_ttm_tt_populate()
772 if (pci_dma_mapping_error(rdev->pdev, gtt->ttm.dma_address[i])) { in radeon_ttm_tt_populate()
774 pci_unmap_page(rdev->pdev, gtt->ttm.dma_address[i], in radeon_ttm_tt_populate()
776 gtt->ttm.dma_address[i] = 0; in radeon_ttm_tt_populate()
788 struct radeon_ttm_tt *gtt = radeon_ttm_tt_to_gtt(ttm); in radeon_ttm_tt_unpopulate() local
792 if (gtt && gtt->userptr) { in radeon_ttm_tt_unpopulate()
811 ttm_dma_unpopulate(>t->ttm, rdev->dev); in radeon_ttm_tt_unpopulate()
817 if (gtt->ttm.dma_address[i]) { in radeon_ttm_tt_unpopulate()
818 pci_unmap_page(rdev->pdev, gtt->ttm.dma_address[i], in radeon_ttm_tt_unpopulate()
829 struct radeon_ttm_tt *gtt = radeon_ttm_tt_to_gtt(ttm); in radeon_ttm_tt_set_userptr() local
831 if (gtt == NULL) in radeon_ttm_tt_set_userptr()
834 gtt->userptr = addr; in radeon_ttm_tt_set_userptr()
835 gtt->usermm = current->mm; in radeon_ttm_tt_set_userptr()
836 gtt->userflags = flags; in radeon_ttm_tt_set_userptr()
842 struct radeon_ttm_tt *gtt = radeon_ttm_tt_to_gtt(ttm); in radeon_ttm_tt_has_userptr() local
844 if (gtt == NULL) in radeon_ttm_tt_has_userptr()
847 return !!gtt->userptr; in radeon_ttm_tt_has_userptr()
852 struct radeon_ttm_tt *gtt = radeon_ttm_tt_to_gtt(ttm); in radeon_ttm_tt_is_readonly() local
854 if (gtt == NULL) in radeon_ttm_tt_is_readonly()
857 return !!(gtt->userflags & RADEON_GEM_USERPTR_READONLY); in radeon_ttm_tt_is_readonly()
1182 rdev->mman.gtt = ent; in radeon_ttm_debugfs_init()
1205 debugfs_remove(rdev->mman.gtt); in radeon_ttm_debugfs_fini()
1206 rdev->mman.gtt = NULL; in radeon_ttm_debugfs_fini()