diff options
Diffstat (limited to 'include/drm')
-rw-r--r-- | include/drm/ttm/ttm_bo_api.h | 1 | ||||
-rw-r--r-- | include/drm/ttm/ttm_bo_driver.h | 6 | ||||
-rw-r--r-- | include/drm/ttm/ttm_tt.h | 12 |
3 files changed, 8 insertions, 11 deletions
diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h index 36ff64e2736c..1d20a7f15a7a 100644 --- a/include/drm/ttm/ttm_bo_api.h +++ b/include/drm/ttm/ttm_bo_api.h @@ -141,6 +141,7 @@ struct ttm_buffer_object { struct ttm_resource mem; struct file *persistent_swap_storage; struct ttm_tt *ttm; + bool ttm_bound; bool evicted; bool deleted; diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index d2bea22f35ae..e66672f703a3 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h @@ -700,17 +700,17 @@ void ttm_bo_tt_unbind(struct ttm_buffer_object *bo); 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. diff --git a/include/drm/ttm/ttm_tt.h b/include/drm/ttm/ttm_tt.h index 1ac56730d952..94e16238c93d 100644 --- a/include/drm/ttm/ttm_tt.h +++ b/include/drm/ttm/ttm_tt.h @@ -70,26 +70,22 @@ struct ttm_tt { 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; } /** |