aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/drm/ttm/ttm_resource.h
diff options
context:
space:
mode:
authorThomas Hellström <thomas.hellstrom@linux.intel.com>2024-12-17 15:58:44 +0100
committerChristian König <christian.koenig@amd.com>2025-01-13 12:58:10 +0100
commit1f463794097dcdf4c64fffd31de2177681525e35 (patch)
treed8e818f6d6f4b8515579cc8708e43c8860be1484 /include/drm/ttm/ttm_resource.h
parentdrm/panthor: Fix a race between the reset and suspend path (diff)
downloadwireguard-linux-1f463794097dcdf4c64fffd31de2177681525e35.tar.xz
wireguard-linux-1f463794097dcdf4c64fffd31de2177681525e35.zip
drm/ttm: Balance ttm_resource_cursor_init() and ttm_resource_cursor_fini()
Make the interface more symmetric by providing and using a ttm_resource_cursor_init(). v10: - Fix a stray newline (Matthew Brost) - Update kerneldoc (Matthew Brost) Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Reviewed-by: Christian König <christian.koenig@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20241217145852.37342-2-thomas.hellstrom@linux.intel.com Signed-off-by: Christian König <christian.koenig@amd.com>
Diffstat (limited to 'include/drm/ttm/ttm_resource.h')
-rw-r--r--include/drm/ttm/ttm_resource.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/include/drm/ttm/ttm_resource.h b/include/drm/ttm/ttm_resource.h
index be034be56ba1..e1f3b95d73b6 100644
--- a/include/drm/ttm/ttm_resource.h
+++ b/include/drm/ttm/ttm_resource.h
@@ -325,6 +325,9 @@ struct ttm_resource_cursor {
unsigned int priority;
};
+void ttm_resource_cursor_init(struct ttm_resource_cursor *cursor,
+ struct ttm_resource_manager *man);
+
void ttm_resource_cursor_fini(struct ttm_resource_cursor *cursor);
/**
@@ -456,8 +459,7 @@ void ttm_resource_manager_debug(struct ttm_resource_manager *man,
struct drm_printer *p);
struct ttm_resource *
-ttm_resource_manager_first(struct ttm_resource_manager *man,
- struct ttm_resource_cursor *cursor);
+ttm_resource_manager_first(struct ttm_resource_cursor *cursor);
struct ttm_resource *
ttm_resource_manager_next(struct ttm_resource_cursor *cursor);
@@ -466,14 +468,13 @@ ttm_lru_first_res_or_null(struct list_head *head);
/**
* ttm_resource_manager_for_each_res - iterate over all resources
- * @man: the resource manager
* @cursor: struct ttm_resource_cursor for the current position
* @res: the current resource
*
* Iterate over all the evictable resources in a resource manager.
*/
-#define ttm_resource_manager_for_each_res(man, cursor, res) \
- for (res = ttm_resource_manager_first(man, cursor); res; \
+#define ttm_resource_manager_for_each_res(cursor, res) \
+ for (res = ttm_resource_manager_first(cursor); res; \
res = ttm_resource_manager_next(cursor))
struct ttm_kmap_iter *