dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Dave Airlie <airlied@gmail.com>
To: dri-devel@lists.freedesktop.org
Cc: christian.koenig@amd.com, bskeggs@redhat.com
Subject: [PATCH 7/7] drm/ttm: move populated state into page flags
Date: Tue, 15 Sep 2020 12:40:07 +1000	[thread overview]
Message-ID: <20200915024007.67163-8-airlied@gmail.com> (raw)
In-Reply-To: <20200915024007.67163-1-airlied@gmail.com>

From: Dave Airlie <airlied@redhat.com>

Just use the top bit of page flags to store the populated state.

Signed-off-by: Dave Airlie <airlied@redhat.com>
---
 include/drm/ttm/ttm_tt.h | 9 +++++----
 1 file 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;
 }
 
 /**
-- 
2.27.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2020-09-15  2:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-15  2:40 Dave Airlie
2020-09-15  2:40 ` [PATCH 1/7] drm/ttm/tt: add wrappers to set tt state Dave Airlie
2020-09-15  2:40 ` [PATCH 2/7] drm/ttm: wrap tt destroy Dave Airlie
2020-09-15  7:47   ` Christian König
2020-09-15  2:40 ` [PATCH 3/7] drm/ttm: tt destroy move null check to outer function Dave Airlie
2020-09-15  2:40 ` [PATCH 4/7] drm/ttm: split populate out from binding Dave Airlie
2020-09-15  7:50   ` Christian König
2020-09-15  2:40 ` [PATCH 5/7] drm/ttm: move ttm binding/unbinding out of ttm_tt paths Dave Airlie
2020-09-15  2:40 ` [PATCH 6/7] drm/ttm: split bound/populated flags Dave Airlie
2020-09-15  2:40 ` Dave Airlie [this message]
2020-09-15  7:53 ` Christian König

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200915024007.67163-8-airlied@gmail.com \
    --to=airlied@gmail.com \
    --cc=PATCH@freedesktop.org \
    --cc=bskeggs@redhat.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=drm@freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).