[PATCH] drm/amdkfd: Remove duplicate functions update_mqd_hiq()

Liu, Zhan Zhan.Liu at amd.com
Fri Nov 22 04:21:36 UTC 2019


Looks good to me.

Reviewed-by: Zhan Liu <zhan.liu at amd.com>

> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> On Behalf Of
> Yong Zhao
> Sent: 2019/November/21, Thursday 4:25 PM
> To: amd-gfx at lists.freedesktop.org
> Cc: Zhao, Yong <Yong.Zhao at amd.com>
> Subject: [PATCH] drm/amdkfd: Remove duplicate functions
> update_mqd_hiq()
> 
> The functions are the same as update_mqd().
> 
> Change-Id: Ic8d8f23cdde6b7806ab766ddf3d71fa668cca5fb
> Signed-off-by: Yong Zhao <Yong.Zhao at amd.com>
> ---
>  drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c | 16 ++--------------
> drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c  | 16 ++--------------
> drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c  |  4 ----
>  3 files changed, 4 insertions(+), 32 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c
> b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c
> index 8d21325b5cbb..7832ec6e480b 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c
> @@ -282,18 +282,6 @@ static void init_mqd_hiq(struct mqd_manager *mm,
> void **mqd,
>  			1 << CP_HQD_PQ_CONTROL__KMD_QUEUE__SHIFT;
>  }
> 
> -static void update_mqd_hiq(struct mqd_manager *mm, void *mqd,
> -			struct queue_properties *q)
> -{
> -	struct v10_compute_mqd *m;
> -
> -	update_mqd(mm, mqd, q);
> -
> -	/* TODO: what's the point? update_mqd already does this. */
> -	m = get_mqd(mqd);
> -	m->cp_hqd_vmid = q->vmid;
> -}
> -
>  static void init_mqd_sdma(struct mqd_manager *mm, void **mqd,
>  		struct kfd_mem_obj *mqd_mem_obj, uint64_t *gart_addr,
>  		struct queue_properties *q)
> @@ -422,7 +410,7 @@ struct mqd_manager *mqd_manager_init_v10(enum
> KFD_MQD_TYPE type,
>  		mqd->init_mqd = init_mqd_hiq;
>  		mqd->free_mqd = free_mqd_hiq_sdma;
>  		mqd->load_mqd = load_mqd;
> -		mqd->update_mqd = update_mqd_hiq;
> +		mqd->update_mqd = update_mqd;
>  		mqd->destroy_mqd = destroy_mqd;
>  		mqd->is_occupied = is_occupied;
>  		mqd->mqd_size = sizeof(struct v10_compute_mqd); @@ -
> 436,7 +424,7 @@ struct mqd_manager *mqd_manager_init_v10(enum
> KFD_MQD_TYPE type,
>  		mqd->init_mqd = init_mqd_hiq;
>  		mqd->free_mqd = free_mqd;
>  		mqd->load_mqd = load_mqd;
> -		mqd->update_mqd = update_mqd_hiq;
> +		mqd->update_mqd = update_mqd;
>  		mqd->destroy_mqd = destroy_mqd;
>  		mqd->is_occupied = is_occupied;
>  		mqd->mqd_size = sizeof(struct v10_compute_mqd); diff --git
> a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c
> b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c
> index df77d67ec9aa..aa9010995eaf 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c
> @@ -325,18 +325,6 @@ static void init_mqd_hiq(struct mqd_manager *mm,
> void **mqd,
>  			1 << CP_HQD_PQ_CONTROL__KMD_QUEUE__SHIFT;
>  }
> 
> -static void update_mqd_hiq(struct mqd_manager *mm, void *mqd,
> -			struct queue_properties *q)
> -{
> -	struct v9_mqd *m;
> -
> -	update_mqd(mm, mqd, q);
> -
> -	/* TODO: what's the point? update_mqd already does this. */
> -	m = get_mqd(mqd);
> -	m->cp_hqd_vmid = q->vmid;
> -}
> -
>  static void init_mqd_sdma(struct mqd_manager *mm, void **mqd,
>  		struct kfd_mem_obj *mqd_mem_obj, uint64_t *gart_addr,
>  		struct queue_properties *q)
> @@ -462,7 +450,7 @@ struct mqd_manager *mqd_manager_init_v9(enum
> KFD_MQD_TYPE type,
>  		mqd->init_mqd = init_mqd_hiq;
>  		mqd->free_mqd = free_mqd_hiq_sdma;
>  		mqd->load_mqd = load_mqd;
> -		mqd->update_mqd = update_mqd_hiq;
> +		mqd->update_mqd = update_mqd;
>  		mqd->destroy_mqd = destroy_mqd;
>  		mqd->is_occupied = is_occupied;
>  		mqd->mqd_size = sizeof(struct v9_mqd); @@ -475,7 +463,7
> @@ struct mqd_manager *mqd_manager_init_v9(enum KFD_MQD_TYPE
> type,
>  		mqd->init_mqd = init_mqd_hiq;
>  		mqd->free_mqd = free_mqd;
>  		mqd->load_mqd = load_mqd;
> -		mqd->update_mqd = update_mqd_hiq;
> +		mqd->update_mqd = update_mqd;
>  		mqd->destroy_mqd = destroy_mqd;
>  		mqd->is_occupied = is_occupied;
>  		mqd->mqd_size = sizeof(struct v9_mqd); diff --git
> a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c
> b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c
> index 3b6b5671964c..a5e8ff1e5945 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c
> @@ -312,11 +312,7 @@ static void init_mqd_hiq(struct mqd_manager *mm,
> void **mqd,  static void update_mqd_hiq(struct mqd_manager *mm, void
> *mqd,
>  			struct queue_properties *q)
>  {
> -	struct vi_mqd *m;
>  	__update_mqd(mm, mqd, q, MTYPE_UC, 0);
> -
> -	m = get_mqd(mqd);
> -	m->cp_hqd_vmid = q->vmid;
>  }
> 
>  static void init_mqd_sdma(struct mqd_manager *mm, void **mqd,
> --
> 2.17.1
> 
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.
> freedesktop.org%2Fmailman%2Flistinfo%2Famd-
> gfx&data=02%7C01%7Czhan.liu%40amd.com%7C0e3ab1a1d11f4846d03
> a08d76ec95df3%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C6370
> 99683517302702&sdata=jmmtdHugjl5B6P%2FRAojzPqKPlC8s%2F07wmS
> kY82iOUvQ%3D&reserved=0


More information about the amd-gfx mailing list