* bo to be unbound and destroyed.
*/
- if (man->use_tt)
+ if (man->use_tt) {
ghost_obj->ttm = NULL;
- else
+ ttm_bo_tt_set_unbound(ghost_obj);
+ } else {
bo->ttm = NULL;
+ ttm_bo_tt_set_unbound(bo);
+ }
dma_resv_unlock(&ghost_obj->base._resv);
ttm_bo_put(ghost_obj);
* bo to be unbound and destroyed.
*/
- if (to->use_tt)
+ if (to->use_tt) {
ghost_obj->ttm = NULL;
- else
+ ttm_bo_tt_set_unbound(ghost_obj);
+ } else {
bo->ttm = NULL;
+ ttm_bo_tt_set_unbound(bo);
+ }
dma_resv_unlock(&ghost_obj->base._resv);
ttm_bo_put(ghost_obj);
memset(&bo->mem, 0, sizeof(bo->mem));
bo->mem.mem_type = TTM_PL_SYSTEM;
bo->ttm = NULL;
+ ttm_bo_tt_set_unbound(bo);
dma_resv_unlock(&ghost->base._resv);
ttm_bo_put(ghost);
struct ttm_resource mem;
struct file *persistent_swap_storage;
struct ttm_tt *ttm;
+ bool ttm_bound;
bool evicted;
bool deleted;
static inline bool ttm_bo_tt_is_bound(struct ttm_buffer_object *bo)
{
- return bo->ttm->_state == tt_bound;
+ return bo->ttm_bound;
}
static inline void ttm_bo_tt_set_unbound(struct ttm_buffer_object *bo)
{
- bo->ttm->_state = tt_unbound;
+ bo->ttm_bound = false;
}
static inline void ttm_bo_tt_set_bound(struct ttm_buffer_object *bo)
{
- bo->ttm->_state = tt_bound;
+ bo->ttm_bound = true;
}
/**
* ttm_bo_tt_destroy.
struct sg_table *sg; /* for SG objects via dma-buf */
struct file *swap_storage;
enum ttm_caching_state caching_state;
- enum {
- tt_bound,
- tt_unbound,
- tt_unpopulated,
- } _state;
+ bool populated;
};
static inline bool ttm_tt_is_populated(struct ttm_tt *tt)
{
- return tt->_state != tt_unpopulated;
+ return tt->populated;
}
static inline void ttm_tt_set_unpopulated(struct ttm_tt *tt)
{
- tt->_state = tt_unpopulated;
+ tt->populated = false;
}
static inline void ttm_tt_set_populated(struct ttm_tt *tt)
{
- tt->_state = tt_unbound;
+ tt->populated = true;
}
/**