diff mbox series

[v2,1/3] drm/ttm: cleanup and add TTM_PL_FLAG_TEMPORARY flag

Message ID 20210531082241.4254-1-Lang.Yu@amd.com (mailing list archive)
State New, archived
Headers show
Series [v2,1/3] drm/ttm: cleanup and add TTM_PL_FLAG_TEMPORARY flag | expand

Commit Message

Lang Yu May 31, 2021, 8:22 a.m. UTC
Cleanup and just make TTM_PL_FLAG_* start from zero.

Currently, we have a limitted GTT memory size and need a bounce buffer
when doing buffer migration between VRAM and SYSTEM domain.

The problem is under GTT memory pressure we can't do buffer migration
between VRAM and SYSTEM domain. But in some cases we really need that.
Eespecially when validating a VRAM backing store BO which resides in
SYSTEM domain.

Add TTM_PL_FLAG_TEMPORARY flag for temporary GTT memory allocation under
memory pressure. It may be useful for dirvers with a limited GTT memory
size.

v2: add detailed comments

Suggested-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Lang Yu <Lang.Yu@amd.com>
---
 include/drm/ttm/ttm_placement.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/include/drm/ttm/ttm_placement.h b/include/drm/ttm/ttm_placement.h
index aa6ba4d0cf78..9f5cfc7c2d5a 100644
--- a/include/drm/ttm/ttm_placement.h
+++ b/include/drm/ttm/ttm_placement.h
@@ -47,8 +47,9 @@ 
  * top of the memory area, instead of the bottom.
  */
 
-#define TTM_PL_FLAG_CONTIGUOUS  (1 << 19)
-#define TTM_PL_FLAG_TOPDOWN     (1 << 22)
+#define TTM_PL_FLAG_CONTIGUOUS  (1 << 0)
+#define TTM_PL_FLAG_TOPDOWN     (1 << 1)
+#define TTM_PL_FLAG_TEMPORARY   (1 << 2)
 
 /**
  * struct ttm_place