Lines Matching +full:sleep +full:- +full:map

3  * Copyright (c) 2006-2009 VMware, Inc., Palo Alto, CA., USA
20 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
28 * Authors: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
41 /* Default number of pre-faulted pages in the TTM fault handler */
62 * but they cannot be accessed from user-space. For kernel-only use.
166 * @interruptible: Sleep interruptible if sleeping.
189 * ttm_bo_get - reference a struct ttm_buffer_object
195 kref_get(&bo->kref); in ttm_bo_get()
199 * ttm_bo_get_unless_zero - reference a struct ttm_buffer_object unless
211 if (!kref_get_unless_zero(&bo->kref)) in ttm_bo_get_unless_zero()
220 * @interruptible: Sleep interruptible if waiting.
221 * @no_wait: Don't sleep while trying to reserve, rather return -EBUSY.
229 * -EDEADLK: The reservation may cause a deadlock.
232 * -ERESTARTSYS: A wait for the buffer to become unreserved was interrupted by
233 * a signal. Release all buffer reservations and return to user-space.
234 * -EBUSY: The function needed to sleep, but @no_wait was true
235 * -EALREADY: Bo already reserved using @ticket. This error code will only
248 return -EBUSY; in ttm_bo_reserve()
250 success = dma_resv_trylock(bo->base.resv); in ttm_bo_reserve()
251 return success ? 0 : -EBUSY; in ttm_bo_reserve()
255 ret = dma_resv_lock_interruptible(bo->base.resv, ticket); in ttm_bo_reserve()
257 ret = dma_resv_lock(bo->base.resv, ticket); in ttm_bo_reserve()
258 if (ret == -EINTR) in ttm_bo_reserve()
259 return -ERESTARTSYS; in ttm_bo_reserve()
266 * @interruptible: Sleep interruptible if waiting.
267 * @sequence: Set (@bo)->sequence to this value after lock
269 * This is called after ttm_bo_reserve returns -EAGAIN and we backed off
278 int ret = dma_resv_lock_slow_interruptible(bo->base.resv, in ttm_bo_reserve_slowpath()
280 if (ret == -EINTR) in ttm_bo_reserve_slowpath()
281 ret = -ERESTARTSYS; in ttm_bo_reserve_slowpath()
284 dma_resv_lock_slow(bo->base.resv, ticket); in ttm_bo_reserve_slowpath()
293 spin_lock(&bo->bdev->lru_lock); in ttm_bo_move_to_lru_tail_unlocked()
295 spin_unlock(&bo->bdev->lru_lock); in ttm_bo_move_to_lru_tail_unlocked()
301 WARN_ON(bo->resource); in ttm_bo_assign_mem()
302 bo->resource = new_mem; in ttm_bo_assign_mem()
315 ttm_resource_free(bo, &bo->resource); in ttm_bo_move_null()
329 dma_resv_unlock(bo->base.resv); in ttm_bo_unreserve()
335 * @map: A struct ttm_bo_kmap_obj returned from ttm_bo_kmap.
337 * virtual map is io memory, 0 if normal memory.
343 static inline void *ttm_kmap_obj_virtual(struct ttm_bo_kmap_obj *map, in ttm_kmap_obj_virtual() argument
346 *is_iomem = !!(map->bo_kmap_type & TTM_BO_MAP_IOMEM_MASK); in ttm_kmap_obj_virtual()
347 return map->virtual; in ttm_kmap_obj_virtual()
371 unsigned long num_pages, struct ttm_bo_kmap_obj *map);
372 void ttm_bo_kunmap(struct ttm_bo_kmap_obj *map);
373 int ttm_bo_vmap(struct ttm_buffer_object *bo, struct iosys_map *map);
374 void ttm_bo_vunmap(struct ttm_buffer_object *bo, struct iosys_map *map);