@@ -46,6 +46,7 @@ struct iosys_map;
struct io_mapping;
struct sg_table;
struct scatterlist;
+struct drm_lru_mgr;
struct ttm_resource_manager_func {
/**
@@ -172,6 +173,12 @@ struct ttm_resource_manager {
* bdev->lru_lock.
*/
uint64_t usage;
+
+ /**
+ * @lru_mgr: weak reference of the lru manager that manages lru
+ * list for this ttm resource manager.
+ */
+ struct drm_lru_mgr *lru_mgr;
};
/**
@@ -326,6 +333,18 @@ static inline bool ttm_resource_manager_used(struct ttm_resource_manager *man)
return man->use_type;
}
+/**
+ * ttm_resource_manager_set_lru_mgr
+ *
+ * @man: ttm resource manager
+ * @mgr: pointing to lru manager
+ */
+static inline void
+ttm_resource_manager_set_lru_mgr(struct ttm_resource_manager *man, struct drm_lru_mgr *mgr)
+{
+ man->lru_mgr = mgr;
+}
+
/**
* ttm_resource_manager_cleanup
*
Add a weak reference of lru manager to ttm resource manager, and add a function to set lru manager for ttm resource manager. Signed-off-by: Oak Zeng <oak.zeng@intel.com> --- include/drm/ttm/ttm_resource.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)