[PATCH 2/2] drm/amdkfd: navi2x requires extended engines to map and unmap sdma queues

Felix Kuehling felix.kuehling at amd.com
Fri Feb 11 19:00:48 UTC 2022


Am 2022-02-11 um 12:15 schrieb Jonathan Kim:
> SDMA 5.2.x queues are required to be mapped and unmapped from the extended
> engines.
>
> Signed-off-by: Jonathan Kim <jonathan.kim at amd.com>
> ---
>   drivers/gpu/drm/amd/amdkfd/kfd_packet_manager_v9.c | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager_v9.c b/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager_v9.c
> index ed4f2d3c6dcc..645d42af8849 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager_v9.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager_v9.c
> @@ -183,6 +183,7 @@ static int pm_map_queues_v9(struct packet_manager *pm, uint32_t *buffer,
>   {
>   	struct pm4_mes_map_queues *packet;
>   	bool use_static = is_static;
> +	bool use_ext_eng = q->device->adev->ip_versions[SDMA0_HWIP][0] >= IP_VERSION(5, 2, 0);

I'd put this in a macro or helper function to avoid duplicating the 
condition in case we ever need to update it. With that fixed, the patch is

Reviewed-by: Felix Kuehling <Felix.Kuehling at amd.com>


>   
>   	packet = (struct pm4_mes_map_queues *)buffer;
>   	memset(buffer, 0, sizeof(struct pm4_mes_map_queues));
> @@ -214,7 +215,7 @@ static int pm_map_queues_v9(struct packet_manager *pm, uint32_t *buffer,
>   	case KFD_QUEUE_TYPE_SDMA:
>   	case KFD_QUEUE_TYPE_SDMA_XGMI:
>   		use_static = false; /* no static queues under SDMA */
> -		if (q->properties.sdma_engine_id < 2)
> +		if (q->properties.sdma_engine_id < 2 && !use_ext_eng)
>   			packet->bitfields2.engine_sel = q->properties.sdma_engine_id +
>   				engine_sel__mes_map_queues__sdma0_vi;
>   		else {
> @@ -250,6 +251,7 @@ static int pm_unmap_queues_v9(struct packet_manager *pm, uint32_t *buffer,
>   			uint32_t filter_param, bool reset)
>   {
>   	struct pm4_mes_unmap_queues *packet;
> +	bool use_ext_eng = pm->dqm->dev->adev->ip_versions[SDMA0_HWIP][0] >= IP_VERSION(5, 2, 0);
>   
>   	packet = (struct pm4_mes_unmap_queues *)buffer;
>   	memset(buffer, 0, sizeof(struct pm4_mes_unmap_queues));
> @@ -257,8 +259,10 @@ static int pm_unmap_queues_v9(struct packet_manager *pm, uint32_t *buffer,
>   	packet->header.u32All = pm_build_pm4_header(IT_UNMAP_QUEUES,
>   					sizeof(struct pm4_mes_unmap_queues));
>   
> -	packet->bitfields2.extended_engine_sel =
> +	packet->bitfields2.extended_engine_sel = use_ext_eng ?
> +		extended_engine_sel__mes_map_queues__sdma0_to_7_sel :
>   		extended_engine_sel__mes_unmap_queues__legacy_engine_sel;
> +
>   	packet->bitfields2.engine_sel =
>   		engine_sel__mes_unmap_queues__compute;
>   


More information about the amd-gfx mailing list