[PATCH 1/2] drm/amdkfd: Rename pm_release_ib() to pm_destroy_runlist_ib()

Yong Zhao Yong.Zhao at amd.com
Thu Nov 21 21:26:38 UTC 2019


Its counterparty is called pm_create_runlist_ib(). The new name makes
it easier to navigate in the code.

Accordingly, Add rl_ to the variable names to indicate it is runlist.

Change-Id: Id63bfebeb8a5ed6aaefbebe98858d84724fd26be
Signed-off-by: Yong Zhao <Yong.Zhao at amd.com>
---
 .../drm/amd/amdkfd/kfd_device_queue_manager.c  |  2 +-
 .../gpu/drm/amd/amdkfd/kfd_packet_manager.c    | 18 +++++++++---------
 drivers/gpu/drm/amd/amdkfd/kfd_priv.h          |  6 +++---
 3 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
index f7f6df40875e..510f2d1bb8bb 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
@@ -1355,7 +1355,7 @@ static int unmap_queues_cpsch(struct device_queue_manager *dqm,
 	if (retval)
 		return retval;
 
-	pm_release_ib(&dqm->packets);
+	pm_destroy_runlist_ib(&dqm->packets);
 	dqm->active_runlist = false;
 
 	return retval;
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c
index 6cabed06ef5d..4a9433257428 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c
@@ -98,15 +98,15 @@ static int pm_allocate_runlist_ib(struct packet_manager *pm,
 	mutex_lock(&pm->lock);
 
 	retval = kfd_gtt_sa_allocate(pm->dqm->dev, *rl_buffer_size,
-					&pm->ib_buffer_obj);
+					&pm->rl_ib_obj);
 
 	if (retval) {
 		pr_err("Failed to allocate runlist IB\n");
 		goto out;
 	}
 
-	*(void **)rl_buffer = pm->ib_buffer_obj->cpu_ptr;
-	*rl_gpu_buffer = pm->ib_buffer_obj->gpu_addr;
+	*(void **)rl_buffer = pm->rl_ib_obj->cpu_ptr;
+	*rl_gpu_buffer = pm->rl_ib_obj->gpu_addr;
 
 	memset(*rl_buffer, 0, *rl_buffer_size);
 	pm->allocated = true;
@@ -138,7 +138,7 @@ static int pm_create_runlist_ib(struct packet_manager *pm,
 		return retval;
 
 	*rl_size_bytes = alloc_size_bytes;
-	pm->ib_size_bytes = alloc_size_bytes;
+	pm->rl_ib_size_bytes = alloc_size_bytes;
 
 	pr_debug("Building runlist ib process count: %d queues count %d\n",
 		pm->dqm->processes_count, pm->dqm->queue_count);
@@ -149,7 +149,7 @@ static int pm_create_runlist_ib(struct packet_manager *pm,
 		/* build map process packet */
 		if (proccesses_mapped >= pm->dqm->processes_count) {
 			pr_debug("Not enough space left in runlist IB\n");
-			pm_release_ib(pm);
+			pm_destroy_runlist_ib(pm);
 			return -ENOMEM;
 		}
 
@@ -337,7 +337,7 @@ int pm_send_runlist(struct packet_manager *pm, struct list_head *dqm_queues)
 fail_acquire_packet_buffer:
 	mutex_unlock(&pm->lock);
 fail_create_runlist_ib:
-	pm_release_ib(pm);
+	pm_destroy_runlist_ib(pm);
 	return retval;
 }
 
@@ -401,11 +401,11 @@ int pm_send_unmap_queue(struct packet_manager *pm, enum kfd_queue_type type,
 	return retval;
 }
 
-void pm_release_ib(struct packet_manager *pm)
+void pm_destroy_runlist_ib(struct packet_manager *pm)
 {
 	mutex_lock(&pm->lock);
 	if (pm->allocated) {
-		kfd_gtt_sa_free(pm->dqm->dev, pm->ib_buffer_obj);
+		kfd_gtt_sa_free(pm->dqm->dev, pm->rl_ib_obj);
 		pm->allocated = false;
 	}
 	mutex_unlock(&pm->lock);
@@ -425,7 +425,7 @@ int pm_debugfs_runlist(struct seq_file *m, void *data)
 	}
 
 	seq_hex_dump(m, "  ", DUMP_PREFIX_OFFSET, 32, 4,
-		     pm->ib_buffer_obj->cpu_ptr, pm->ib_size_bytes, false);
+		     pm->rl_ib_obj->cpu_ptr, pm->rl_ib_size_bytes, false);
 
 out:
 	mutex_unlock(&pm->lock);
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
index 514896bef99a..389cda7c8f1a 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
@@ -937,8 +937,8 @@ struct packet_manager {
 	struct kernel_queue *priv_queue;
 	struct mutex lock;
 	bool allocated;
-	struct kfd_mem_obj *ib_buffer_obj;
-	unsigned int ib_size_bytes;
+	struct kfd_mem_obj *rl_ib_obj;
+	unsigned int rl_ib_size_bytes;
 	bool is_over_subscription;
 
 	const struct packet_manager_funcs *pmf;
@@ -989,7 +989,7 @@ int pm_send_unmap_queue(struct packet_manager *pm, enum kfd_queue_type type,
 			uint32_t filter_param, bool reset,
 			unsigned int sdma_engine);
 
-void pm_release_ib(struct packet_manager *pm);
+void pm_destroy_runlist_ib(struct packet_manager *pm);
 
 /* Following PM funcs can be shared among VI and AI */
 unsigned int pm_build_pm4_header(unsigned int opcode, size_t packet_size);
-- 
2.17.1



More information about the amd-gfx mailing list