[RFC PATCH 2/3] drm: Introduce DRM_MEM defines for specifying type of drm_mem_region

Brian Welty brian.welty at intel.com
Tue Jul 30 00:32:24 UTC 2019


Introduce DRM memory region types to be common for both drivers using
TTM and for i915.  For now, TTM continues to define it's own set but
uses the DRM base definitions.

Signed-off-by: Brian Welty <brian.welty at intel.com>
---
 include/drm/drm_mm.h            | 8 ++++++++
 include/drm/ttm/ttm_placement.h | 8 ++++----
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/include/drm/drm_mm.h b/include/drm/drm_mm.h
index 465f8d10d863..b78dc9284702 100644
--- a/include/drm/drm_mm.h
+++ b/include/drm/drm_mm.h
@@ -59,6 +59,14 @@
 struct drm_device;
 struct drm_mm;
 
+/*
+ * Memory types for drm_mem_region
+ */
+#define DRM_MEM_SYSTEM	0
+#define DRM_MEM_STOLEN	1
+#define DRM_MEM_VRAM	2
+#define DRM_MEM_PRIV	3
+
 /**
  * struct drm_mem_region
  *
diff --git a/include/drm/ttm/ttm_placement.h b/include/drm/ttm/ttm_placement.h
index e88a8e39767b..976cf8d2f899 100644
--- a/include/drm/ttm/ttm_placement.h
+++ b/include/drm/ttm/ttm_placement.h
@@ -37,10 +37,10 @@
  * Memory regions for data placement.
  */
 
-#define TTM_PL_SYSTEM           0
-#define TTM_PL_TT               1
-#define TTM_PL_VRAM             2
-#define TTM_PL_PRIV             3
+#define TTM_PL_SYSTEM           DRM_MEM_SYSTEM
+#define TTM_PL_TT               DRM_MEM_STOLEN
+#define TTM_PL_VRAM             DRM_MEM_VRAM
+#define TTM_PL_PRIV             DRM_MEM_PRIV
 
 #define TTM_PL_FLAG_SYSTEM      (1 << TTM_PL_SYSTEM)
 #define TTM_PL_FLAG_TT          (1 << TTM_PL_TT)
-- 
2.21.0



More information about the amd-gfx mailing list