Changeset View
Changeset View
Standalone View
Standalone View
dev/drm2/ttm/ttm_bo.c
Context not available. | |||||
struct ttm_bo_global_ref *bo_ref = | struct ttm_bo_global_ref *bo_ref = | ||||
container_of(ref, struct ttm_bo_global_ref, ref); | container_of(ref, struct ttm_bo_global_ref, ref); | ||||
struct ttm_bo_global *glob = ref->object; | struct ttm_bo_global *glob = ref->object; | ||||
int ret; | int req, ret; | ||||
int tries; | int tries; | ||||
sx_init(&glob->device_list_mutex, "ttmdlm"); | sx_init(&glob->device_list_mutex, "ttmdlm"); | ||||
mtx_init(&glob->lru_lock, "ttmlru", NULL, MTX_DEF); | mtx_init(&glob->lru_lock, "ttmlru", NULL, MTX_DEF); | ||||
glob->mem_glob = bo_ref->mem_glob; | glob->mem_glob = bo_ref->mem_glob; | ||||
req = VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ; | |||||
tries = 0; | tries = 0; | ||||
retry: | retry: | ||||
glob->dummy_read_page = vm_page_alloc_contig(NULL, 0, | glob->dummy_read_page = vm_page_alloc_contig(NULL, 0, req, | ||||
VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ, | |||||
1, 0, VM_MAX_ADDRESS, PAGE_SIZE, 0, VM_MEMATTR_UNCACHEABLE); | 1, 0, VM_MAX_ADDRESS, PAGE_SIZE, 0, VM_MEMATTR_UNCACHEABLE); | ||||
if (unlikely(glob->dummy_read_page == NULL)) { | if (unlikely(glob->dummy_read_page == NULL)) { | ||||
if (tries < 1) { | if (tries < 1 && vm_page_reclaim_contig(req, 1, | ||||
vm_pageout_grow_cache(tries, 0, VM_MAX_ADDRESS); | 0, VM_MAX_ADDRESS, PAGE_SIZE, 0)) { | ||||
tries++; | tries++; | ||||
goto retry; | goto retry; | ||||
} | } | ||||
Context not available. |