From: Oak Zeng <oak.zeng@intel.com>
To: dri-devel@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Cc: felix.kuehling@amd.com, airlied@gmail.com, christian.koenig@amd.com
Subject: [Intel-xe] [RFC 06/11] drm/ttm: Set lru manager to ttm resource manager
Date: Thu, 2 Nov 2023 00:33:01 -0400 [thread overview]
Message-ID: <20231102043306.2931989-7-oak.zeng@intel.com> (raw)
In-Reply-To: <20231102043306.2931989-1-oak.zeng@intel.com>
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(+)
diff --git a/include/drm/ttm/ttm_resource.h b/include/drm/ttm/ttm_resource.h
index 92241c2374fa..e4fc1ada5236 100644
--- a/include/drm/ttm/ttm_resource.h
+++ b/include/drm/ttm/ttm_resource.h
@@ -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
*
--
2.26.3
next prev parent reply other threads:[~2023-11-02 4:24 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-02 4:32 [Intel-xe] [PATCH 00/11] Introduce drm evictable lru Oak Zeng
2023-11-02 4:27 ` [Intel-xe] ✗ CI.Patch_applied: failure for " Patchwork
2023-11-02 4:32 ` [Intel-xe] [RFC 01/11] drm/ttm: re-parameter ttm_device_init Oak Zeng
2023-11-02 4:32 ` [Intel-xe] [RFC 02/11] drm: move lru_lock from ttm_device to drm_device Oak Zeng
2023-11-02 12:53 ` Christian König
2023-11-03 3:26 ` Zeng, Oak
2023-11-02 4:32 ` [Intel-xe] [RFC 03/11] drm: introduce drm evictable LRU Oak Zeng
2023-11-02 13:23 ` Christian König
2023-11-03 4:04 ` Zeng, Oak
2023-11-03 9:36 ` Christian König
2023-11-03 14:36 ` Zeng, Oak
2023-11-02 4:32 ` [Intel-xe] [RFC 04/11] drm: Add evict function pointer to drm lru entity Oak Zeng
2023-11-02 4:33 ` [Intel-xe] [RFC 05/11] drm: Replace ttm macros with drm macros Oak Zeng
2023-11-02 4:33 ` Oak Zeng [this message]
2023-11-02 4:33 ` [Intel-xe] [RFC 07/11] drm/ttm: re-parameterize a few ttm functions Oak Zeng
2023-11-02 4:33 ` [Intel-xe] [RFC 08/11] drm: Initialize drm lru manager Oak Zeng
2023-11-02 4:33 ` [Intel-xe] [RFC 09/11] drm/ttm: Use drm LRU manager iterator Oak Zeng
2023-11-02 4:33 ` [Intel-xe] [RFC 10/11] drm/ttm: Implement ttm memory evict functions Oak Zeng
2023-11-02 4:33 ` [Intel-xe] [RFC 11/11] drm/ttm: Write ttm functions using drm lru manager functions Oak Zeng
2023-12-21 13:12 ` [PATCH 00/11] Introduce drm evictable lru Thomas Hellström
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=20231102043306.2931989-7-oak.zeng@intel.com \
--to=oak.zeng@intel.com \
--cc=airlied@gmail.com \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=felix.kuehling@amd.com \
--cc=intel-xe@lists.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