[PATCH 1/3] drm/ttm: rename ttm_resource_manager_func callbacks

Christian König ckoenig.leichtzumerken at gmail.com
Thu Aug 6 13:51:46 UTC 2020


The names get/put are associated with reference counting
in the Linux kernel, use alloc/free instead.

Signed-off-by: Christian König <christian.koenig at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c   |  4 ++--
 drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c  |  6 +++---
 drivers/gpu/drm/nouveau/nouveau_ttm.c         | 12 ++++++------
 drivers/gpu/drm/ttm/ttm_bo.c                  |  8 ++++----
 drivers/gpu/drm/ttm/ttm_range_manager.c       | 16 ++++++++--------
 drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c |  4 ++--
 drivers/gpu/drm/vmwgfx/vmwgfx_thp.c           |  4 ++--
 include/drm/ttm/ttm_bo_driver.h               | 18 +++++++++---------
 8 files changed, 36 insertions(+), 36 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c
index c847a5fe94c9..4f8451bdc28c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c
@@ -324,7 +324,7 @@ static void amdgpu_gtt_mgr_debug(struct ttm_resource_manager *man,
 }
 
 static const struct ttm_resource_manager_func amdgpu_gtt_mgr_func = {
-	.get_node = amdgpu_gtt_mgr_new,
-	.put_node = amdgpu_gtt_mgr_del,
+	.alloc = amdgpu_gtt_mgr_new,
+	.free = amdgpu_gtt_mgr_del,
 	.debug = amdgpu_gtt_mgr_debug
 };
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
index 895634cbf999..044262b9ded4 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
@@ -619,7 +619,7 @@ static void amdgpu_vram_mgr_debug(struct ttm_resource_manager *man,
 }
 
 static const struct ttm_resource_manager_func amdgpu_vram_mgr_func = {
-	.get_node	= amdgpu_vram_mgr_new,
-	.put_node	= amdgpu_vram_mgr_del,
-	.debug		= amdgpu_vram_mgr_debug
+	.alloc	= amdgpu_vram_mgr_new,
+	.free	= amdgpu_vram_mgr_del,
+	.debug	= amdgpu_vram_mgr_debug
 };
diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c
index e6a30865a00b..53c6f8827322 100644
--- a/drivers/gpu/drm/nouveau/nouveau_ttm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c
@@ -64,8 +64,8 @@ nouveau_vram_manager_new(struct ttm_resource_manager *man,
 }
 
 const struct ttm_resource_manager_func nouveau_vram_manager = {
-	.get_node = nouveau_vram_manager_new,
-	.put_node = nouveau_manager_del,
+	.alloc = nouveau_vram_manager_new,
+	.free = nouveau_manager_del,
 };
 
 static int
@@ -87,8 +87,8 @@ nouveau_gart_manager_new(struct ttm_resource_manager *man,
 }
 
 const struct ttm_resource_manager_func nouveau_gart_manager = {
-	.get_node = nouveau_gart_manager_new,
-	.put_node = nouveau_manager_del,
+	.alloc = nouveau_gart_manager_new,
+	.free = nouveau_manager_del,
 };
 
 static int
@@ -119,8 +119,8 @@ nv04_gart_manager_new(struct ttm_resource_manager *man,
 }
 
 const struct ttm_resource_manager_func nv04_gart_manager = {
-	.get_node = nv04_gart_manager_new,
-	.put_node = nouveau_manager_del,
+	.alloc = nv04_gart_manager_new,
+	.free = nouveau_manager_del,
 };
 
 int
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index ad09329b62d3..ae71c3ab6cc4 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -846,20 +846,20 @@ static int ttm_bo_mem_get(struct ttm_buffer_object *bo,
 	struct ttm_resource_manager *man = ttm_manager_type(bo->bdev, mem->mem_type);
 
 	mem->mm_node = NULL;
-	if (!man->func || !man->func->get_node)
+	if (!man->func || !man->func->alloc)
 		return 0;
 
-	return man->func->get_node(man, bo, place, mem);
+	return man->func->alloc(man, bo, place, mem);
 }
 
 void ttm_bo_mem_put(struct ttm_buffer_object *bo, struct ttm_resource *mem)
 {
 	struct ttm_resource_manager *man = ttm_manager_type(bo->bdev, mem->mem_type);
 
-	if (!man->func || !man->func->put_node)
+	if (!man->func || !man->func->free)
 		return;
 
-	man->func->put_node(man, mem);
+	man->func->free(man, mem);
 	mem->mm_node = NULL;
 	mem->mem_type = TTM_PL_SYSTEM;
 }
diff --git a/drivers/gpu/drm/ttm/ttm_range_manager.c b/drivers/gpu/drm/ttm/ttm_range_manager.c
index 274a05ca13d3..770c8988c139 100644
--- a/drivers/gpu/drm/ttm/ttm_range_manager.c
+++ b/drivers/gpu/drm/ttm/ttm_range_manager.c
@@ -54,10 +54,10 @@ static inline struct ttm_range_manager *to_range_manager(struct ttm_resource_man
 	return container_of(man, struct ttm_range_manager, manager);
 }
 
-static int ttm_range_man_get_node(struct ttm_resource_manager *man,
-				  struct ttm_buffer_object *bo,
-				  const struct ttm_place *place,
-				  struct ttm_resource *mem)
+static int ttm_range_man_alloc(struct ttm_resource_manager *man,
+			       struct ttm_buffer_object *bo,
+			       const struct ttm_place *place,
+			       struct ttm_resource *mem)
 {
 	struct ttm_range_manager *rman = to_range_manager(man);
 	struct drm_mm *mm = &rman->mm;
@@ -95,8 +95,8 @@ static int ttm_range_man_get_node(struct ttm_resource_manager *man,
 	return ret;
 }
 
-static void ttm_range_man_put_node(struct ttm_resource_manager *man,
-				   struct ttm_resource *mem)
+static void ttm_range_man_free(struct ttm_resource_manager *man,
+			       struct ttm_resource *mem)
 {
 	struct ttm_range_manager *rman = to_range_manager(man);
 
@@ -181,7 +181,7 @@ static void ttm_range_man_debug(struct ttm_resource_manager *man,
 }
 
 static const struct ttm_resource_manager_func ttm_range_manager_func = {
-	.get_node = ttm_range_man_get_node,
-	.put_node = ttm_range_man_put_node,
+	.alloc = ttm_range_man_alloc,
+	.free = ttm_range_man_free,
 	.debug = ttm_range_man_debug
 };
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
index 3fea7a6c7cfa..bb76acb5b0fc 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
@@ -156,6 +156,6 @@ void vmw_gmrid_man_fini(struct vmw_private *dev_priv, int type)
 }
 
 static const struct ttm_resource_manager_func vmw_gmrid_manager_func = {
-	.get_node = vmw_gmrid_man_get_node,
-	.put_node = vmw_gmrid_man_put_node,
+	.alloc = vmw_gmrid_man_get_node,
+	.free = vmw_gmrid_man_put_node,
 };
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_thp.c b/drivers/gpu/drm/vmwgfx/vmwgfx_thp.c
index f594e2e6ab7e..3c00a9e7cfcc 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_thp.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_thp.c
@@ -177,7 +177,7 @@ static void vmw_thp_debug(struct ttm_resource_manager *man,
 }
 
 const struct ttm_resource_manager_func vmw_thp_func = {
-	.get_node = vmw_thp_get_node,
-	.put_node = vmw_thp_put_node,
+	.alloc = vmw_thp_get_node,
+	.free = vmw_thp_put_node,
 	.debug = vmw_thp_debug
 };
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
index eb1c3312e175..bfdda61edadb 100644
--- a/include/drm/ttm/ttm_bo_driver.h
+++ b/include/drm/ttm/ttm_bo_driver.h
@@ -49,7 +49,7 @@ struct ttm_resource_manager;
 
 struct ttm_resource_manager_func {
 	/**
-	 * struct ttm_resource_manager member get_node
+	 * struct ttm_resource_manager_func member alloc
 	 *
 	 * @man: Pointer to a memory type manager.
 	 * @bo: Pointer to the buffer object we're allocating space for.
@@ -76,13 +76,13 @@ struct ttm_resource_manager_func {
 	 * an implementation can and must use either a mutex or a spinlock to
 	 * protect any data structures managing the space.
 	 */
-	int  (*get_node)(struct ttm_resource_manager *man,
-			 struct ttm_buffer_object *bo,
-			 const struct ttm_place *place,
-			 struct ttm_resource *mem);
+	int  (*alloc)(struct ttm_resource_manager *man,
+		      struct ttm_buffer_object *bo,
+		      const struct ttm_place *place,
+		      struct ttm_resource *mem);
 
 	/**
-	 * struct ttm_resource_manager member put_node
+	 * struct ttm_resource_manager_func member free
 	 *
 	 * @man: Pointer to a memory type manager.
 	 * @mem: Pointer to a struct ttm_resource to be filled in.
@@ -91,11 +91,11 @@ struct ttm_resource_manager_func {
 	 * and that are identified by @mem::mm_node and @mem::start. May not
 	 * be called from within atomic context.
 	 */
-	void (*put_node)(struct ttm_resource_manager *man,
-			 struct ttm_resource *mem);
+	void (*free)(struct ttm_resource_manager *man,
+		     struct ttm_resource *mem);
 
 	/**
-	 * struct ttm_resource_manager member debug
+	 * struct ttm_resource_manager_func member debug
 	 *
 	 * @man: Pointer to a memory type manager.
 	 * @printer: Prefix to be used in printout to identify the caller.
-- 
2.17.1



More information about the amd-gfx mailing list