AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Felix Kuehling <felix.kuehling@amd.com>
To: Jonathan Kim <jonathan.kim@amd.com>, amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/2] drm/amdkfd: navi2x requires extended engines to map and unmap sdma queues
Date: Fri, 11 Feb 2022 14:00:48 -0500	[thread overview]
Message-ID: <ccb9663d-ff66-d5ac-c7ba-923ffc7e8eb9@amd.com> (raw)
In-Reply-To: <20220211171529.923453-2-jonathan.kim@amd.com>


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@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@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;
>   

  reply	other threads:[~2022-02-11 19:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-11 17:15 [PATCH 1/2] drm/amdkfd: remove unneeded unmap single queue option Jonathan Kim
2022-02-11 17:15 ` [PATCH 2/2] drm/amdkfd: navi2x requires extended engines to map and unmap sdma queues Jonathan Kim
2022-02-11 19:00   ` Felix Kuehling [this message]
2022-02-11 18:59 ` [PATCH 1/2] drm/amdkfd: remove unneeded unmap single queue option Felix Kuehling

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ccb9663d-ff66-d5ac-c7ba-923ffc7e8eb9@amd.com \
    --to=felix.kuehling@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=jonathan.kim@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox