Lines Matching defs:ttm
45 #include <dev/drm2/ttm/ttm_bo_driver.h>
46 #include <dev/drm2/ttm/ttm_page_alloc.h>
136 KASSERT(m->object == NULL, ("ttm page %p is owned", m));
137 KASSERT(m->wire_count == 1, ("ttm lost wire %p", m));
138 KASSERT((m->flags & PG_FICTITIOUS) != 0, ("ttm lost fictitious %p", m));
139 KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("ttm got unmanaged %p", m));
267 * Select the right pool or requested caching state and ttm flags. */
825 int ttm_pool_populate(struct ttm_tt *ttm)
827 struct ttm_mem_global *mem_glob = ttm->glob->mem_glob;
831 if (ttm->state != tt_unpopulated)
834 for (i = 0; i < ttm->num_pages; ++i) {
835 ret = ttm_get_pages(&ttm->pages[i], 1,
836 ttm->page_flags,
837 ttm->caching_state);
839 ttm_pool_unpopulate(ttm);
843 ret = ttm_mem_global_alloc_page(mem_glob, ttm->pages[i],
846 ttm_pool_unpopulate(ttm);
851 if (unlikely(ttm->page_flags & TTM_PAGE_FLAG_SWAPPED)) {
852 ret = ttm_tt_swapin(ttm);
854 ttm_pool_unpopulate(ttm);
859 ttm->state = tt_unbound;
863 void ttm_pool_unpopulate(struct ttm_tt *ttm)
867 for (i = 0; i < ttm->num_pages; ++i) {
868 if (ttm->pages[i]) {
869 ttm_mem_global_free_page(ttm->glob->mem_glob,
870 ttm->pages[i]);
871 ttm_put_pages(&ttm->pages[i], 1,
872 ttm->page_flags,
873 ttm->caching_state);
876 ttm->state = tt_unpopulated;