summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/drm/ttm/ttm_tt.h32
1 files changed, 31 insertions, 1 deletions
diff --git a/include/drm/ttm/ttm_tt.h b/include/drm/ttm/ttm_tt.h
index 146544ba1c10..86ae759ff018 100644
--- a/include/drm/ttm/ttm_tt.h
+++ b/include/drm/ttm/ttm_tt.h
@@ -74,9 +74,39 @@ struct ttm_tt {
tt_bound,
tt_unbound,
tt_unpopulated,
- } state;
+ } _state;
};
+static inline bool ttm_tt_is_populated(struct ttm_tt *tt)
+{
+ return tt->_state != tt_unpopulated;
+}
+
+static inline bool ttm_tt_is_bound(struct ttm_tt *tt)
+{
+ return tt->_state == tt_bound;
+}
+
+static inline void ttm_tt_set_unpopulated(struct ttm_tt *tt)
+{
+ tt->_state = tt_unpopulated;
+}
+
+static inline void ttm_tt_set_populated(struct ttm_tt *tt)
+{
+ tt->_state = tt_unbound;
+}
+
+static inline void ttm_tt_set_unbound(struct ttm_tt *tt)
+{
+ tt->_state = tt_unbound;
+}
+
+static inline void ttm_tt_set_bound(struct ttm_tt *tt)
+{
+ tt->_state = tt_bound;
+}
+
/**
* struct ttm_dma_tt
*