<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Series is:</p>
<p style="margin-top:0;margin-bottom:0">Reviewed-by: Alex Deucher <alexander.deucher@amd.com><br>
</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Lin, Amber <Amber.Lin@amd.com><br>
<b>Sent:</b> Thursday, October 18, 2018 5:15:24 PM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> Lin, Amber<br>
<b>Subject:</b> [PATCH 3/3] drm/amdkfd: Add proper prefix to functions</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Add amdgpu_amdkfd_ prefix to amdgpu functions served for amdkfd usage.<br>
<br>
Signed-off-by: Amber Lin <Amber.Lin@amd.com><br>
---<br>
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 12 ++++++------<br>
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h | 12 ++++++------<br>
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 4 ++--<br>
drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 4 ++--<br>
drivers/gpu/drm/amd/amdkfd/kfd_device.c | 6 +++---<br>
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager.c | 2 +-<br>
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c | 4 ++--<br>
drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 8 ++++----<br>
8 files changed, 26 insertions(+), 26 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c<br>
index c31a884..4e384ab 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c<br>
@@ -268,7 +268,7 @@ void amdgpu_amdkfd_gpu_reset(struct kgd_dev *kgd)<br>
amdgpu_device_gpu_recover(adev, NULL);<br>
}<br>
<br>
-int alloc_gtt_mem(struct kgd_dev *kgd, size_t size,<br>
+int amdgpu_amdkfd_alloc_gtt_mem(struct kgd_dev *kgd, size_t size,<br>
void **mem_obj, uint64_t *gpu_addr,<br>
void **cpu_ptr, bool mqd_gfx9)<br>
{<br>
@@ -340,7 +340,7 @@ int alloc_gtt_mem(struct kgd_dev *kgd, size_t size,<br>
return r;<br>
}<br>
<br>
-void free_gtt_mem(struct kgd_dev *kgd, void *mem_obj)<br>
+void amdgpu_amdkfd_free_gtt_mem(struct kgd_dev *kgd, void *mem_obj)<br>
{<br>
struct amdgpu_bo *bo = (struct amdgpu_bo *) mem_obj;<br>
<br>
@@ -351,7 +351,7 @@ void free_gtt_mem(struct kgd_dev *kgd, void *mem_obj)<br>
amdgpu_bo_unref(&(bo));<br>
}<br>
<br>
-void get_local_mem_info(struct kgd_dev *kgd,<br>
+void amdgpu_amdkfd_get_local_mem_info(struct kgd_dev *kgd,<br>
struct kfd_local_mem_info *mem_info)<br>
{<br>
struct amdgpu_device *adev = (struct amdgpu_device *)kgd;<br>
@@ -383,7 +383,7 @@ void get_local_mem_info(struct kgd_dev *kgd,<br>
mem_info->mem_clk_max = 100;<br>
}<br>
<br>
-uint64_t get_gpu_clock_counter(struct kgd_dev *kgd)<br>
+uint64_t amdgpu_amdkfd_get_gpu_clock_counter(struct kgd_dev *kgd)<br>
{<br>
struct amdgpu_device *adev = (struct amdgpu_device *)kgd;<br>
<br>
@@ -392,7 +392,7 @@ uint64_t get_gpu_clock_counter(struct kgd_dev *kgd)<br>
return 0;<br>
}<br>
<br>
-uint32_t get_max_engine_clock_in_mhz(struct kgd_dev *kgd)<br>
+uint32_t amdgpu_amdkfd_get_max_engine_clock_in_mhz(struct kgd_dev *kgd)<br>
{<br>
struct amdgpu_device *adev = (struct amdgpu_device *)kgd;<br>
<br>
@@ -405,7 +405,7 @@ uint32_t get_max_engine_clock_in_mhz(struct kgd_dev *kgd)<br>
return 100;<br>
}<br>
<br>
-void get_cu_info(struct kgd_dev *kgd, struct kfd_cu_info *cu_info)<br>
+void amdgpu_amdkfd_get_cu_info(struct kgd_dev *kgd, struct kfd_cu_info *cu_info)<br>
{<br>
struct amdgpu_device *adev = (struct amdgpu_device *)kgd;<br>
struct amdgpu_cu_info acu_info = adev->gfx.cu_info;<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h<br>
index 8e0d4f7..69cc9a9 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h<br>
@@ -134,16 +134,16 @@ int amdgpu_amdkfd_post_reset(struct amdgpu_device *adev);<br>
void amdgpu_amdkfd_gpu_reset(struct kgd_dev *kgd);<br>
<br>
/* Shared API */<br>
-int alloc_gtt_mem(struct kgd_dev *kgd, size_t size,<br>
+int amdgpu_amdkfd_alloc_gtt_mem(struct kgd_dev *kgd, size_t size,<br>
void **mem_obj, uint64_t *gpu_addr,<br>
void **cpu_ptr, bool mqd_gfx9);<br>
-void free_gtt_mem(struct kgd_dev *kgd, void *mem_obj);<br>
-void get_local_mem_info(struct kgd_dev *kgd,<br>
+void amdgpu_amdkfd_free_gtt_mem(struct kgd_dev *kgd, void *mem_obj);<br>
+void amdgpu_amdkfd_get_local_mem_info(struct kgd_dev *kgd,<br>
struct kfd_local_mem_info *mem_info);<br>
-uint64_t get_gpu_clock_counter(struct kgd_dev *kgd);<br>
+uint64_t amdgpu_amdkfd_get_gpu_clock_counter(struct kgd_dev *kgd);<br>
<br>
-uint32_t get_max_engine_clock_in_mhz(struct kgd_dev *kgd);<br>
-void get_cu_info(struct kgd_dev *kgd, struct kfd_cu_info *cu_info);<br>
+uint32_t amdgpu_amdkfd_get_max_engine_clock_in_mhz(struct kgd_dev *kgd);<br>
+void amdgpu_amdkfd_get_cu_info(struct kgd_dev *kgd, struct kfd_cu_info *cu_info);<br>
uint64_t amdgpu_amdkfd_get_vram_usage(struct kgd_dev *kgd);<br>
uint64_t amdgpu_amdkfd_get_hive_id(struct kgd_dev *kgd);<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c<br>
index 85e833d..5f4062b 100644<br>
--- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c<br>
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c<br>
@@ -835,7 +835,7 @@ static int kfd_ioctl_get_clock_counters(struct file *filep,<br>
dev = kfd_device_by_id(args->gpu_id);<br>
if (dev)<br>
/* Reading GPU clock counter from KGD */<br>
- args->gpu_clock_counter = get_gpu_clock_counter(dev->kgd);<br>
+ args->gpu_clock_counter = amdgpu_amdkfd_get_gpu_clock_counter(dev->kgd);<br>
else<br>
/* Node without GPU resource */<br>
args->gpu_clock_counter = 0;<br>
@@ -1240,7 +1240,7 @@ bool kfd_dev_is_large_bar(struct kfd_dev *dev)<br>
if (dev->device_info->needs_iommu_device)<br>
return false;<br>
<br>
- get_local_mem_info(dev->kgd, &mem_info);<br>
+ amdgpu_amdkfd_get_local_mem_info(dev->kgd, &mem_info);<br>
if (mem_info.local_mem_size_private == 0 &&<br>
mem_info.local_mem_size_public > 0)<br>
return true;<br>
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c b/drivers/gpu/drm/amd/amdkfd/kfd_crat.c<br>
index a48be99..3783d12 100644<br>
--- a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c<br>
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_crat.c<br>
@@ -1160,7 +1160,7 @@ static int kfd_create_vcrat_image_gpu(void *pcrat_image,<br>
cu->flags |= CRAT_CU_FLAGS_GPU_PRESENT;<br>
cu->proximity_domain = proximity_domain;<br>
<br>
- get_cu_info(kdev->kgd, &cu_info);<br>
+ amdgpu_amdkfd_get_cu_info(kdev->kgd, &cu_info);<br>
cu->num_simd_per_cu = cu_info.simd_per_cu;<br>
cu->num_simd_cores = cu_info.simd_per_cu * cu_info.cu_active_number;<br>
cu->max_waves_simd = cu_info.max_waves_per_simd;<br>
@@ -1191,7 +1191,7 @@ static int kfd_create_vcrat_image_gpu(void *pcrat_image,<br>
* report the total FB size (public+private) as a single<br>
* private heap.<br>
*/<br>
- get_local_mem_info(kdev->kgd, &local_mem_info);<br>
+ amdgpu_amdkfd_get_local_mem_info(kdev->kgd, &local_mem_info);<br>
sub_type_hdr = (typeof(sub_type_hdr))((char *)sub_type_hdr +<br>
sub_type_hdr->length);<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c<br>
index eeb42af..d7e0f41 100644<br>
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c<br>
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c<br>
@@ -479,7 +479,7 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd,<br>
/* add another 512KB for all other allocations on gart (HPD, fences) */<br>
size += 512 * 1024;<br>
<br>
- if (alloc_gtt_mem(<br>
+ if (amdgpu_amdkfd_alloc_gtt_mem(<br>
kfd->kgd, size, &kfd->gtt_mem,<br>
&kfd->gtt_start_gpu_addr, &kfd->gtt_start_cpu_ptr,<br>
false)) {<br>
@@ -553,7 +553,7 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd,<br>
kfd_doorbell_error:<br>
kfd_gtt_sa_fini(kfd);<br>
kfd_gtt_sa_init_error:<br>
- free_gtt_mem(kfd->kgd, kfd->gtt_mem);<br>
+ amdgpu_amdkfd_free_gtt_mem(kfd->kgd, kfd->gtt_mem);<br>
dev_err(kfd_device,<br>
"device %x:%x NOT added due to errors\n",<br>
kfd->pdev->vendor, kfd->pdev->device);<br>
@@ -570,7 +570,7 @@ void kgd2kfd_device_exit(struct kfd_dev *kfd)<br>
kfd_topology_remove_device(kfd);<br>
kfd_doorbell_fini(kfd);<br>
kfd_gtt_sa_fini(kfd);<br>
- free_gtt_mem(kfd->kgd, kfd->gtt_mem);<br>
+ amdgpu_amdkfd_free_gtt_mem(kfd->kgd, kfd->gtt_mem);<br>
}<br>
<br>
kfree(kfd);<br>
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager.c<br>
index 2708070..6910028 100644<br>
--- a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager.c<br>
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager.c<br>
@@ -59,7 +59,7 @@ void mqd_symmetrically_map_cu_mask(struct mqd_manager *mm,<br>
uint32_t cu_per_sh[4] = {0};<br>
int i, se, cu = 0;<br>
<br>
- get_cu_info(mm->dev->kgd, &cu_info);<br>
+ amdgpu_amdkfd_get_cu_info(mm->dev->kgd, &cu_info);<br>
<br>
if (cu_mask_count > cu_info.cu_active_number)<br>
cu_mask_count = cu_info.cu_active_number;<br>
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c<br>
index db3b195..9dbba60 100644<br>
--- a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c<br>
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c<br>
@@ -84,7 +84,7 @@ static int init_mqd(struct mqd_manager *mm, void **mqd,<br>
*mqd_mem_obj = kzalloc(sizeof(struct kfd_mem_obj), GFP_KERNEL);<br>
if (!*mqd_mem_obj)<br>
return -ENOMEM;<br>
- retval = alloc_gtt_mem(kfd->kgd,<br>
+ retval = amdgpu_amdkfd_alloc_gtt_mem(kfd->kgd,<br>
ALIGN(q->ctl_stack_size, PAGE_SIZE) +<br>
ALIGN(sizeof(struct v9_mqd), PAGE_SIZE),<br>
&((*mqd_mem_obj)->gtt_mem),<br>
@@ -251,7 +251,7 @@ static void uninit_mqd(struct mqd_manager *mm, void *mqd,<br>
struct kfd_dev *kfd = mm->dev;<br>
<br>
if (mqd_mem_obj->gtt_mem) {<br>
- free_gtt_mem(kfd->kgd, mqd_mem_obj->gtt_mem);<br>
+ amdgpu_amdkfd_free_gtt_mem(kfd->kgd, mqd_mem_obj->gtt_mem);<br>
kfree(mqd_mem_obj);<br>
} else {<br>
kfd_gtt_sa_free(mm->dev, mqd_mem_obj);<br>
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c<br>
index 6f73101..c73b4ff 100644<br>
--- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c<br>
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c<br>
@@ -1053,7 +1053,7 @@ static uint32_t kfd_generate_gpu_id(struct kfd_dev *gpu)<br>
if (!gpu)<br>
return 0;<br>
<br>
- get_local_mem_info(gpu->kgd, &local_mem_info);<br>
+ amdgpu_amdkfd_get_local_mem_info(gpu->kgd, &local_mem_info);<br>
<br>
local_mem_size = local_mem_info.local_mem_size_private +<br>
local_mem_info.local_mem_size_public;<br>
@@ -1119,7 +1119,7 @@ static void kfd_fill_mem_clk_max_info(struct kfd_topology_device *dev)<br>
* for APUs - If CRAT from ACPI reports more than one bank, then<br>
* all the banks will report the same mem_clk_max information<br>
*/<br>
- get_local_mem_info(dev->gpu->kgd, &local_mem_info);<br>
+ amdgpu_amdkfd_get_local_mem_info(dev->gpu->kgd, &local_mem_info);<br>
<br>
list_for_each_entry(mem, &dev->mem_props, list)<br>
mem->mem_clk_max = local_mem_info.mem_clk_max;<br>
@@ -1240,7 +1240,7 @@ int kfd_topology_add_device(struct kfd_dev *gpu)<br>
* needed for the topology<br>
*/<br>
<br>
- get_cu_info(dev->gpu->kgd, &cu_info);<br>
+ amdgpu_amdkfd_get_cu_info(dev->gpu->kgd, &cu_info);<br>
dev->node_props.simd_arrays_per_engine =<br>
cu_info.num_shader_arrays_per_engine;<br>
<br>
@@ -1249,7 +1249,7 @@ int kfd_topology_add_device(struct kfd_dev *gpu)<br>
dev->node_props.location_id = PCI_DEVID(gpu->pdev->bus->number,<br>
gpu->pdev->devfn);<br>
dev->node_props.max_engine_clk_fcompute =<br>
- get_max_engine_clock_in_mhz(dev->gpu->kgd);<br>
+ amdgpu_amdkfd_get_max_engine_clock_in_mhz(dev->gpu->kgd);<br>
dev->node_props.max_engine_clk_ccompute =<br>
cpufreq_quick_get_max(0) / 1000;<br>
dev->node_props.drm_render_minor =<br>
-- <br>
2.7.4<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
</div>
</span></font></div>
</body>
</html>