[PATCH] drm/amdkfd: Rename kfd_kernel_queue_*.c to kfd_packet_manager_*.c

Felix Kuehling felix.kuehling at amd.com
Wed Nov 13 22:50:18 UTC 2019


On 2019-11-13 5:39 p.m., Yong Zhao wrote:
> After the recent cleanup, the functionalities provided by the previous
> kfd_kernel_queue_*.c are actually all packet manager related. So rename
> them to reflect that.

NAK. Like I mentioned in the other email, AI refers to the SOC 
generation by its deprecated code name that predates the Vega code name.

I also want to avoid having a mix of kfd_*_v9 and kfd_*_ai files and 
functions referring to the same GFX generation.

Regards,
   Felix

>
> Change-Id: I6544ccb38da827c747544c0787aa949df20edbb0
> Signed-off-by: Yong Zhao <Yong.Zhao at amd.com>
> ---
>   drivers/gpu/drm/amd/amdkfd/Makefile           |  4 +--
>   .../gpu/drm/amd/amdkfd/kfd_packet_manager.c   |  4 +--
>   ...nel_queue_v9.c => kfd_packet_manager_ai.c} | 26 +++++++++----------
>   ...nel_queue_vi.c => kfd_packet_manager_vi.c} |  2 +-
>   drivers/gpu/drm/amd/amdkfd/kfd_priv.h         |  4 +--
>   5 files changed, 20 insertions(+), 20 deletions(-)
>   rename drivers/gpu/drm/amd/amdkfd/{kfd_kernel_queue_v9.c => kfd_packet_manager_ai.c} (94%)
>   rename drivers/gpu/drm/amd/amdkfd/{kfd_kernel_queue_vi.c => kfd_packet_manager_vi.c} (99%)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/Makefile b/drivers/gpu/drm/amd/amdkfd/Makefile
> index f93a16372325..55bfecf04239 100644
> --- a/drivers/gpu/drm/amd/amdkfd/Makefile
> +++ b/drivers/gpu/drm/amd/amdkfd/Makefile
> @@ -38,9 +38,9 @@ AMDKFD_FILES	:= $(AMDKFD_PATH)/kfd_module.o \
>   		$(AMDKFD_PATH)/kfd_mqd_manager_v9.o \
>   		$(AMDKFD_PATH)/kfd_mqd_manager_v10.o \
>   		$(AMDKFD_PATH)/kfd_kernel_queue.o \
> -		$(AMDKFD_PATH)/kfd_kernel_queue_vi.o \
> -		$(AMDKFD_PATH)/kfd_kernel_queue_v9.o \
>   		$(AMDKFD_PATH)/kfd_packet_manager.o \
> +		$(AMDKFD_PATH)/kfd_packet_manager_vi.o \
> +		$(AMDKFD_PATH)/kfd_packet_manager_ai.o \
>   		$(AMDKFD_PATH)/kfd_process_queue_manager.o \
>   		$(AMDKFD_PATH)/kfd_device_queue_manager.o \
>   		$(AMDKFD_PATH)/kfd_device_queue_manager_cik.o \
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c
> index 6cabed06ef5d..cc945a2acd66 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c
> @@ -233,7 +233,7 @@ int pm_init(struct packet_manager *pm, struct device_queue_manager *dqm)
>   	case CHIP_POLARIS11:
>   	case CHIP_POLARIS12:
>   	case CHIP_VEGAM:
> -		pm->pmf = &kfd_vi_pm_funcs;
> +		pm->pmf = &kfd_pm_funcs_vi;
>   		break;
>   	case CHIP_VEGA10:
>   	case CHIP_VEGA12:
> @@ -244,7 +244,7 @@ int pm_init(struct packet_manager *pm, struct device_queue_manager *dqm)
>   	case CHIP_NAVI10:
>   	case CHIP_NAVI12:
>   	case CHIP_NAVI14:
> -		pm->pmf = &kfd_v9_pm_funcs;
> +		pm->pmf = &kfd_pm_funcs_ai;
>   		break;
>   	default:
>   		WARN(1, "Unexpected ASIC family %u",
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue_v9.c b/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager_ai.c
> similarity index 94%
> rename from drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue_v9.c
> rename to drivers/gpu/drm/amd/amdkfd/kfd_packet_manager_ai.c
> index 2de01009f1b6..713530cd9760 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue_v9.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager_ai.c
> @@ -27,7 +27,7 @@
>   #include "kfd_pm4_opcodes.h"
>   #include "gc/gc_10_1_0_sh_mask.h"
>   
> -static int pm_map_process_v9(struct packet_manager *pm,
> +static int pm_map_process_ai(struct packet_manager *pm,
>   		uint32_t *buffer, struct qcm_process_device *qpd)
>   {
>   	struct pm4_mes_map_process *packet;
> @@ -73,7 +73,7 @@ static int pm_map_process_v9(struct packet_manager *pm,
>   	return 0;
>   }
>   
> -static int pm_runlist_v9(struct packet_manager *pm, uint32_t *buffer,
> +static int pm_runlist_ai(struct packet_manager *pm, uint32_t *buffer,
>   			uint64_t ib, size_t ib_size_in_dwords, bool chain)
>   {
>   	struct pm4_mes_runlist *packet;
> @@ -111,7 +111,7 @@ static int pm_runlist_v9(struct packet_manager *pm, uint32_t *buffer,
>   	return 0;
>   }
>   
> -static int pm_set_resources_v9(struct packet_manager *pm, uint32_t *buffer,
> +static int pm_set_resources_ai(struct packet_manager *pm, uint32_t *buffer,
>   				struct scheduling_resources *res)
>   {
>   	struct pm4_mes_set_resources *packet;
> @@ -139,7 +139,7 @@ static int pm_set_resources_v9(struct packet_manager *pm, uint32_t *buffer,
>   	return 0;
>   }
>   
> -static int pm_map_queues_v9(struct packet_manager *pm, uint32_t *buffer,
> +static int pm_map_queues_ai(struct packet_manager *pm, uint32_t *buffer,
>   		struct queue *q, bool is_static)
>   {
>   	struct pm4_mes_map_queues *packet;
> @@ -206,7 +206,7 @@ static int pm_map_queues_v9(struct packet_manager *pm, uint32_t *buffer,
>   	return 0;
>   }
>   
> -static int pm_unmap_queues_v9(struct packet_manager *pm, uint32_t *buffer,
> +static int pm_unmap_queues_ai(struct packet_manager *pm, uint32_t *buffer,
>   			enum kfd_queue_type type,
>   			enum kfd_unmap_queues_filter filter,
>   			uint32_t filter_param, bool reset,
> @@ -282,7 +282,7 @@ static int pm_unmap_queues_v9(struct packet_manager *pm, uint32_t *buffer,
>   
>   }
>   
> -static int pm_query_status_v9(struct packet_manager *pm, uint32_t *buffer,
> +static int pm_query_status_ai(struct packet_manager *pm, uint32_t *buffer,
>   			uint64_t fence_address,	uint32_t fence_value)
>   {
>   	struct pm4_mes_query_status *packet;
> @@ -308,13 +308,13 @@ static int pm_query_status_v9(struct packet_manager *pm, uint32_t *buffer,
>   	return 0;
>   }
>   
> -const struct packet_manager_funcs kfd_v9_pm_funcs = {
> -	.map_process		= pm_map_process_v9,
> -	.runlist		= pm_runlist_v9,
> -	.set_resources		= pm_set_resources_v9,
> -	.map_queues		= pm_map_queues_v9,
> -	.unmap_queues		= pm_unmap_queues_v9,
> -	.query_status		= pm_query_status_v9,
> +const struct packet_manager_funcs kfd_pm_funcs_ai = {
> +	.map_process		= pm_map_process_ai,
> +	.runlist		= pm_runlist_ai,
> +	.set_resources		= pm_set_resources_ai,
> +	.map_queues		= pm_map_queues_ai,
> +	.unmap_queues		= pm_unmap_queues_ai,
> +	.query_status		= pm_query_status_ai,
>   	.release_mem		= NULL,
>   	.map_process_size	= sizeof(struct pm4_mes_map_process),
>   	.runlist_size		= sizeof(struct pm4_mes_runlist),
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue_vi.c b/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager_vi.c
> similarity index 99%
> rename from drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue_vi.c
> rename to drivers/gpu/drm/amd/amdkfd/kfd_packet_manager_vi.c
> index bed4d0ccb6b1..92eb659a1c63 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue_vi.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager_vi.c
> @@ -316,7 +316,7 @@ static int pm_release_mem_vi(uint64_t gpu_addr, uint32_t *buffer)
>   	return 0;
>   }
>   
> -const struct packet_manager_funcs kfd_vi_pm_funcs = {
> +const struct packet_manager_funcs kfd_pm_funcs_vi = {
>   	.map_process		= pm_map_process_vi,
>   	.runlist		= pm_runlist_vi,
>   	.set_resources		= pm_set_resources_vi,
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
> index 1049759dc6bb..fecee1f96683 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
> @@ -974,8 +974,8 @@ struct packet_manager_funcs {
>   	int release_mem_size;
>   };
>   
> -extern const struct packet_manager_funcs kfd_vi_pm_funcs;
> -extern const struct packet_manager_funcs kfd_v9_pm_funcs;
> +extern const struct packet_manager_funcs kfd_pm_funcs_vi;
> +extern const struct packet_manager_funcs kfd_pm_funcs_ai;
>   
>   int pm_init(struct packet_manager *pm, struct device_queue_manager *dqm);
>   void pm_uninit(struct packet_manager *pm);


More information about the amd-gfx mailing list