From e1e85eb0a977f1eb1d17d4627aceaa8eeac37159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= Date: Mon, 23 Jun 2025 17:53:12 +0200 Subject: drm/ttm, drm/xe: Modify the struct ttm_bo_lru_walk_cursor initialization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of the struct ttm_operation_ctx, Pass a struct ttm_lru_walk_arg to enable us to easily extend the walk functionality, and to implement ttm_lru_walk_for_evict() using the guarded LRU iteration. Signed-off-by: Thomas Hellström Reviewed-by: Christian König Link: https://lore.kernel.org/r/20250623155313.4901-3-thomas.hellstrom@linux.intel.com --- drivers/gpu/drm/ttm/ttm_bo_util.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers/gpu/drm/ttm/ttm_bo_util.c') diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c index 5433eb87593d..6de1f0c432c2 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_util.c +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c @@ -958,11 +958,11 @@ EXPORT_SYMBOL(ttm_bo_lru_cursor_fini); * ttm_bo_lru_cursor_init() - Initialize a struct ttm_bo_lru_cursor * @curs: The ttm_bo_lru_cursor to initialize. * @man: The ttm resource_manager whose LRU lists to iterate over. - * @ctx: The ttm_operation_ctx to govern the locking. + * @arg: The ttm_lru_walk_arg to govern the walk. * * Initialize a struct ttm_bo_lru_cursor. Currently only trylocking * or prelocked buffer objects are available as detailed by - * @ctx::resv and @ctx::allow_res_evict. Ticketlocking is not + * @arg->ctx.resv and @arg->ctx.allow_res_evict. Ticketlocking is not * supported. * * Return: Pointer to @curs. The function does not fail. @@ -970,11 +970,11 @@ EXPORT_SYMBOL(ttm_bo_lru_cursor_fini); struct ttm_bo_lru_cursor * ttm_bo_lru_cursor_init(struct ttm_bo_lru_cursor *curs, struct ttm_resource_manager *man, - struct ttm_operation_ctx *ctx) + struct ttm_lru_walk_arg *arg) { memset(curs, 0, sizeof(*curs)); ttm_resource_cursor_init(&curs->res_curs, man); - curs->arg.ctx = ctx; + curs->arg = arg; return curs; } @@ -985,7 +985,7 @@ ttm_bo_from_res_reserved(struct ttm_resource *res, struct ttm_bo_lru_cursor *cur { struct ttm_buffer_object *bo = res->bo; - if (!ttm_lru_walk_trylock(&curs->arg, bo, &curs->needs_unlock)) + if (!ttm_lru_walk_trylock(curs->arg, bo, &curs->needs_unlock)) return NULL; if (!ttm_bo_get_unless_zero(bo)) { -- cgit v1.2.3