AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Khatri, Sunil" <sukhatri@amd.com>
To: Alex Deucher <alexander.deucher@amd.com>, amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH 04/11] drm/amdgpu/mes: centralize gfx_hqd mask management
Date: Thu, 6 Mar 2025 15:50:32 +0530	[thread overview]
Message-ID: <6b54efaa-901f-408e-9eeb-c95b89d3523b@amd.com> (raw)
In-Reply-To: <20250305204721.1213836-5-alexander.deucher@amd.com>


On 3/6/2025 2:17 AM, Alex Deucher wrote:
> Move it to amdgpu_mes to align with the compute and
> sdma hqd masks. No functional change.
>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 24 ++++++++++++++++++++++++
>   drivers/gpu/drm/amd/amdgpu/mes_v11_0.c  | 16 +++-------------
>   drivers/gpu/drm/amd/amdgpu/mes_v12_0.c  | 15 +++------------
>   3 files changed, 30 insertions(+), 25 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
> index ca076306adba4..afc2ce344df52 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
> @@ -144,6 +144,30 @@ int amdgpu_mes_init(struct amdgpu_device *adev)
>   	adev->mes.vmid_mask_mmhub = 0xffffff00;
>   	adev->mes.vmid_mask_gfxhub = 0xffffff00;
>   
> +	if (adev->gfx.num_gfx_rings) {
when kernel queue is disabled then arent we having gfx.num_gfx_rings ==  
0, so this might not run at all ? Hope we taking care of that situation 
too ?
> +		for (i = 0; i < AMDGPU_MES_MAX_GFX_PIPES; i++) {
> +			/* use only 1st ME pipe */
> +			if (i >= adev->gfx.me.num_pipe_per_me)
> +				continue;

this if condition makes the outside for loop to run just once and due to 
which adev->mes.gfx_hqd_mask[1] = 0x0; is never set but based on 
previous code we need to set that to 0

as pipe 1 is disabled in hq or here we do not need to set 
adev->mes.gfx_hqd_mask at all now ?

> +			if (amdgpu_ip_version(adev, GC_HWIP, 0) >=
> +			    IP_VERSION(12, 0, 0))
> +				/*
> +				 * GFX V12 has only one GFX pipe, but 8 queues in it.
> +				 * GFX pipe 0 queue 0 is being used by Kernel queue.
> +				 * Set GFX pipe 0 queue 1-7 for MES scheduling
> +				 * mask = 1111 1110b
> +				 */
> +				adev->mes.gfx_hqd_mask[i] = 0xFE;
> +			else
> +				/*
> +				 * GFX pipe 0 queue 0 is being used by Kernel queue.
> +				 * Set GFX pipe 0 queue 1 for MES scheduling
> +				 * mask = 10b
> +				 */
> +				adev->mes.gfx_hqd_mask[i] = 0x2;
> +		}
> +	}
> +
>   	for (i = 0; i < AMDGPU_MES_MAX_COMPUTE_PIPES; i++) {
>   		/* use only 1st MEC pipes */
>   		if (i >= adev->gfx.mec.num_pipe_per_mec)
> diff --git a/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c b/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
> index a569d09a1a748..39b45d8b5f049 100644
> --- a/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
> @@ -669,18 +669,6 @@ static int mes_v11_0_misc_op(struct amdgpu_mes *mes,
>   			offsetof(union MESAPI__MISC, api_status));
>   }
>   
> -static void mes_v11_0_set_gfx_hqd_mask(union MESAPI_SET_HW_RESOURCES *pkt)
> -{
> -	/*
> -	 * GFX pipe 0 queue 0 is being used by Kernel queue.
> -	 * Set GFX pipe 0 queue 1 for MES scheduling
> -	 * mask = 10b
> -	 * GFX pipe 1 can't be used for MES due to HW limitation.
> -	 */
> -	pkt->gfx_hqd_mask[0] = 0x2;
> -	pkt->gfx_hqd_mask[1] = 0;
> -}
> -
>   static int mes_v11_0_set_hw_resources(struct amdgpu_mes *mes)
>   {
>   	int i;
> @@ -705,7 +693,9 @@ static int mes_v11_0_set_hw_resources(struct amdgpu_mes *mes)
>   		mes_set_hw_res_pkt.compute_hqd_mask[i] =
>   			mes->compute_hqd_mask[i];
>   
> -	mes_v11_0_set_gfx_hqd_mask(&mes_set_hw_res_pkt);
> +	for (i = 0; i < MAX_GFX_PIPES; i++)
> +		mes_set_hw_res_pkt.gfx_hqd_mask[i] =
> +			mes->gfx_hqd_mask[i];
>   
>   	for (i = 0; i < MAX_SDMA_PIPES; i++)
>   		mes_set_hw_res_pkt.sdma_hqd_mask[i] = mes->sdma_hqd_mask[i];
> diff --git a/drivers/gpu/drm/amd/amdgpu/mes_v12_0.c b/drivers/gpu/drm/amd/amdgpu/mes_v12_0.c
> index 96336652d14c5..519f054bec60d 100644
> --- a/drivers/gpu/drm/amd/amdgpu/mes_v12_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/mes_v12_0.c
> @@ -694,17 +694,6 @@ static int mes_v12_0_set_hw_resources_1(struct amdgpu_mes *mes, int pipe)
>   			offsetof(union MESAPI_SET_HW_RESOURCES_1, api_status));
>   }
>   
> -static void mes_v12_0_set_gfx_hqd_mask(union MESAPI_SET_HW_RESOURCES *pkt)
> -{
> -	/*
> -	 * GFX V12 has only one GFX pipe, but 8 queues in it.
> -	 * GFX pipe 0 queue 0 is being used by Kernel queue.
> -	 * Set GFX pipe 0 queue 1-7 for MES scheduling
> -	 * mask = 1111 1110b
> -	 */
> -	pkt->gfx_hqd_mask[0] = 0xFE;
> -}
> -
>   static int mes_v12_0_set_hw_resources(struct amdgpu_mes *mes, int pipe)
>   {
>   	int i;
> @@ -727,7 +716,9 @@ static int mes_v12_0_set_hw_resources(struct amdgpu_mes *mes, int pipe)
>   			mes_set_hw_res_pkt.compute_hqd_mask[i] =
>   				mes->compute_hqd_mask[i];
>   
> -		mes_v12_0_set_gfx_hqd_mask(&mes_set_hw_res_pkt);
> +		for (i = 0; i < MAX_GFX_PIPES; i++)
> +			mes_set_hw_res_pkt.gfx_hqd_mask[i] =
> +				mes->gfx_hqd_mask[i];
>   
>   		for (i = 0; i < MAX_SDMA_PIPES; i++)
>   			mes_set_hw_res_pkt.sdma_hqd_mask[i] =

  reply	other threads:[~2025-03-06 10:20 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-05 20:47 [PATCH 00/11] Add disable kernel queue support Alex Deucher
2025-03-05 20:47 ` [PATCH 01/11] drm/amdgpu: add parameter to disable kernel queues Alex Deucher
2025-03-06  7:37   ` Khatri, Sunil
2025-03-05 20:47 ` [PATCH 02/11] drm/amdgpu: add ring flag for no user submissions Alex Deucher
2025-03-06  7:48   ` Khatri, Sunil
2025-03-06 16:00     ` Alex Deucher
2025-03-05 20:47 ` [PATCH 03/11] drm/amdgpu/gfx: add generic handling for disable_kq Alex Deucher
2025-03-06  1:06   ` Felix Kuehling
2025-03-06  9:57     ` Khatri, Sunil
2025-03-05 20:47 ` [PATCH 04/11] drm/amdgpu/mes: centralize gfx_hqd mask management Alex Deucher
2025-03-06 10:20   ` Khatri, Sunil [this message]
2025-03-05 20:47 ` [PATCH 05/11] drm/amdgpu/mes: update hqd masks when disable_kq is set Alex Deucher
2025-03-06 10:21   ` Khatri, Sunil
2025-03-05 20:47 ` [PATCH 06/11] drm/amdgpu/mes: make more vmids available when disable_kq=1 Alex Deucher
2025-03-06 10:21   ` Khatri, Sunil
2025-03-05 20:47 ` [PATCH 07/11] drm/amdgpu/gfx11: add support for disable_kq Alex Deucher
2025-03-06 11:03   ` Khatri, Sunil
2025-03-05 20:47 ` [PATCH 08/11] drm/amdgpu/gfx12: " Alex Deucher
2025-03-06 11:16   ` Khatri, Sunil
2025-03-05 20:47 ` [PATCH 09/11] drm/amdgpu/sdma: add flag for tracking disable_kq Alex Deucher
2025-03-06 11:19   ` Khatri, Sunil
2025-03-05 20:47 ` [PATCH 10/11] drm/amdgpu/sdma6: add support for disable_kq Alex Deucher
2025-03-06 11:19   ` Khatri, Sunil
2025-03-05 20:47 ` [PATCH 11/11] drm/amdgpu/sdma7: " Alex Deucher
2025-03-06 11:20   ` Khatri, Sunil
  -- strict thread matches above, loose matches on Subject: below --
2025-03-06 18:46 [PATCH V2 00/11] Add disable kernel queue support Alex Deucher
2025-03-06 18:46 ` [PATCH 04/11] drm/amdgpu/mes: centralize gfx_hqd mask management Alex Deucher
2025-03-07 15:15 [PATCH V3 00/11] Add disable kernel queue support Alex Deucher
2025-03-07 15:15 ` [PATCH 04/11] drm/amdgpu/mes: centralize gfx_hqd mask management Alex Deucher
2025-03-10  6:25   ` Khatri, Sunil
2025-03-12 18:57 [PATCH V4 00/11] Add disable kernel queue support Alex Deucher
2025-03-12 18:57 ` [PATCH 04/11] drm/amdgpu/mes: centralize gfx_hqd mask management Alex Deucher
2025-03-13 14:41 [PATCH V5 00/11] Add disable kernel queue support Alex Deucher
2025-03-13 14:41 ` [PATCH 04/11] drm/amdgpu/mes: centralize gfx_hqd mask management Alex Deucher
2025-03-19  6:12   ` Liang, Prike
2025-03-19 13:46     ` Alex Deucher

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=6b54efaa-901f-408e-9eeb-c95b89d3523b@amd.com \
    --to=sukhatri@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    /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