summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2020-09-15 11:47:19 +1000
committerDave Airlie <airlied@redhat.com>2020-09-16 09:36:19 +1000
commit3312be8f6fc8a8dc7cef01986dbd436eab7af0f7 (patch)
tree5b328e5a94f1d16c67813fc7c4ad09f5bb9a641a
parent3a4ab168a5df5c9532763ac26cde5c2ad06ca1e5 (diff)
downloadlinux-3312be8f6fc8a8dc7cef01986dbd436eab7af0f7.tar.gz
linux-3312be8f6fc8a8dc7cef01986dbd436eab7af0f7.tar.bz2
linux-3312be8f6fc8a8dc7cef01986dbd436eab7af0f7.zip
drm/ttm: move populated state into page flags
Just use the top bit of page flags to store the populated state. Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200915024007.67163-8-airlied@gmail.com
-rw-r--r--include/drm/ttm/ttm_tt.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/include/drm/ttm/ttm_tt.h b/include/drm/ttm/ttm_tt.h
index 94e16238c93d..c777b72063db 100644
--- a/include/drm/ttm/ttm_tt.h
+++ b/include/drm/ttm/ttm_tt.h
@@ -42,6 +42,8 @@ struct ttm_operation_ctx;
#define TTM_PAGE_FLAG_SG (1 << 8)
#define TTM_PAGE_FLAG_NO_RETRY (1 << 9)
+#define TTM_PAGE_FLAG_PRIV_POPULATED (1 << 31)
+
enum ttm_caching_state {
tt_uncached,
tt_wc,
@@ -70,22 +72,21 @@ struct ttm_tt {
struct sg_table *sg; /* for SG objects via dma-buf */
struct file *swap_storage;
enum ttm_caching_state caching_state;
- bool populated;
};
static inline bool ttm_tt_is_populated(struct ttm_tt *tt)
{
- return tt->populated;
+ return tt->page_flags & TTM_PAGE_FLAG_PRIV_POPULATED;
}
static inline void ttm_tt_set_unpopulated(struct ttm_tt *tt)
{
- tt->populated = false;
+ tt->page_flags &= ~TTM_PAGE_FLAG_PRIV_POPULATED;
}
static inline void ttm_tt_set_populated(struct ttm_tt *tt)
{
- tt->populated = true;
+ tt->page_flags |= TTM_PAGE_FLAG_PRIV_POPULATED;
}
/**