AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: Shashank Sharma <shashank.sharma@amd.com>, amd-gfx@lists.freedesktop.org
Cc: Arvind Yadav <arvind.yadav@amd.com>,
	Alex Deucher <alexander.deucher@amd.com>
Subject: Re: [PATCH v10 14/14] drm/amdgpu: add kernel config for gfx-userqueue
Date: Fri, 3 May 2024 08:44:05 +0200	[thread overview]
Message-ID: <cdc0d944-1c24-4b53-b654-0ca77b620ce1@amd.com> (raw)
In-Reply-To: <20240502163152.1382-15-shashank.sharma@amd.com>

Am 02.05.24 um 18:31 schrieb Shashank Sharma:
> This patch:
> - adds a kernel config option "CONFIG_DRM_AMD_USERQ_GFX"
> - moves the usequeue initialization code for all IPs under
>    this flag
>
> so that the userqueue works only when the config is enabled.
>
> V9:  Introduce this patch
> V10: Call it CONFIG_DRM_AMDGPU_NAVI3X_USERQ instead of
>       CONFIG_DRM_AMDGPU_USERQ_GFX (Christian)
>
> Cc: Alex Deucher <alexander.deucher@amd.com>
> Cc: Christian Koenig <christian.koenig@amd.com>
> Signed-off-by: Shashank Sharma <shashank.sharma@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/Kconfig     | 8 ++++++++
>   drivers/gpu/drm/amd/amdgpu/Makefile    | 4 +++-
>   drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 4 ++++
>   drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c | 3 +++
>   4 files changed, 18 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/Kconfig b/drivers/gpu/drm/amd/amdgpu/Kconfig
> index 22d88f8ef527..a7c85eeec756 100644
> --- a/drivers/gpu/drm/amd/amdgpu/Kconfig
> +++ b/drivers/gpu/drm/amd/amdgpu/Kconfig
> @@ -80,6 +80,14 @@ config DRM_AMDGPU_WERROR
>   	  Add -Werror to the build flags for amdgpu.ko.
>   	  Only enable this if you are warning code for amdgpu.ko.
>   
> +config DRM_AMDGPU_NAVI3X_USERQ
> +	bool "Enable Navi 3x gfx usermode queues"

Yeah, you are right that we somehow need to distinct that from KFD user 
queues.

I think we should stick the name, but maybe mention here and in the 
helptext below that this is for user queues on the DRM render nodes.

With that done the patch is Reviewed-by: Christian König 
<christian.koenig@amd.com>.

Regards,
Christian.

> +	depends on DRM_AMDGPU
> +	default n
> +	help
> +	  Choose this option to enable usermode queue support for GFX/SDMA/Compute
> +          workload submission. This feature is supported on Navi 3X only.
> +
>   source "drivers/gpu/drm/amd/acp/Kconfig"
>   source "drivers/gpu/drm/amd/display/Kconfig"
>   source "drivers/gpu/drm/amd/amdkfd/Kconfig"
> diff --git a/drivers/gpu/drm/amd/amdgpu/Makefile b/drivers/gpu/drm/amd/amdgpu/Makefile
> index 987fabb2b2c6..0a64f2c57def 100644
> --- a/drivers/gpu/drm/amd/amdgpu/Makefile
> +++ b/drivers/gpu/drm/amd/amdgpu/Makefile
> @@ -189,9 +189,11 @@ amdgpu-y += \
>   	amdgpu_mes.o \
>   	mes_v10_1.o \
>   	mes_v11_0.o \
> -	mes_v11_0_userqueue.o \
>   	mes_v12_0.o
>   
> +# add GFX userqueue support
> +amdgpu-$(DRM_AMDGPU_NAVI3X_USERQ) += mes_v11_0_userqueue.o
> +
>   # add UVD block
>   amdgpu-y += \
>   	amdgpu_uvd.o \
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
> index 46304d09c4bd..5c4bf243ed04 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
> @@ -1348,8 +1348,10 @@ static int gfx_v11_0_sw_init(void *handle)
>   		adev->gfx.mec.num_mec = 2;
>   		adev->gfx.mec.num_pipe_per_mec = 4;
>   		adev->gfx.mec.num_queue_per_pipe = 4;
> +#ifdef DRM_AMDGPU_NAVI3X_USERQ
>   		adev->userq_funcs[AMDGPU_HW_IP_GFX] = &userq_mes_v11_0_funcs;
>   		adev->userq_funcs[AMDGPU_HW_IP_COMPUTE] = &userq_mes_v11_0_funcs;
> +#endif
>   		break;
>   	case IP_VERSION(11, 0, 1):
>   	case IP_VERSION(11, 0, 4):
> @@ -1361,8 +1363,10 @@ static int gfx_v11_0_sw_init(void *handle)
>   		adev->gfx.mec.num_mec = 1;
>   		adev->gfx.mec.num_pipe_per_mec = 4;
>   		adev->gfx.mec.num_queue_per_pipe = 4;
> +#ifdef CONFIG_DRM_AMD_USERQ_GFX
>   		adev->userq_funcs[AMDGPU_HW_IP_GFX] = &userq_mes_v11_0_funcs;
>   		adev->userq_funcs[AMDGPU_HW_IP_COMPUTE] = &userq_mes_v11_0_funcs;
> +#endif
>   		break;
>   	default:
>   		adev->gfx.me.num_me = 1;
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c
> index 0989400d0afe..f6a2c2daa00f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c
> @@ -1274,7 +1274,10 @@ static int sdma_v6_0_sw_init(void *handle)
>   		return -EINVAL;
>   	}
>   
> +#ifdef DRM_AMDGPU_NAVI3X_USERQ
>   	adev->userq_funcs[AMDGPU_HW_IP_DMA] = &userq_mes_v11_0_funcs;
> +#endif
> +
>   	return r;
>   }
>   


      reply	other threads:[~2024-05-03  6:44 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-02 16:31 [PATCH v10 00/14] AMDGPU usermode queues Shashank Sharma
2024-05-02 16:31 ` [PATCH v10 01/14] drm/amdgpu: UAPI for user queue management Shashank Sharma
2024-05-02 16:31 ` [PATCH v10 02/14] drm/amdgpu: add usermode queue base code Shashank Sharma
2024-05-02 16:31 ` [PATCH v10 03/14] drm/amdgpu: add new IOCTL for usermode queue Shashank Sharma
2024-05-02 21:25   ` Alex Deucher
2024-05-03  5:14     ` Sharma, Shashank
2024-05-02 16:31 ` [PATCH v10 04/14] drm/amdgpu: add helpers to create userqueue object Shashank Sharma
2024-05-02 16:31 ` [PATCH v10 05/14] drm/amdgpu: create MES-V11 usermode queue for GFX Shashank Sharma
2024-05-02 16:31 ` [PATCH v10 06/14] drm/amdgpu: create context space for usermode queue Shashank Sharma
2024-05-02 16:31 ` [PATCH v10 07/14] drm/amdgpu: map usermode queue into MES Shashank Sharma
2024-05-02 16:31 ` [PATCH v10 08/14] drm/amdgpu: map wptr BO into GART Shashank Sharma
2024-05-02 16:31 ` [PATCH v10 09/14] drm/amdgpu: generate doorbell index for userqueue Shashank Sharma
2024-05-02 16:31 ` [PATCH v10 10/14] drm/amdgpu: cleanup leftover queues Shashank Sharma
2024-05-02 16:31 ` [PATCH v10 11/14] drm/amdgpu: enable GFX-V11 userqueue support Shashank Sharma
2024-05-02 16:31 ` [PATCH v10 12/14] drm/amdgpu: enable SDMA-V6 usermode queues Shashank Sharma
2024-05-03  6:53   ` Christian König
2024-05-02 16:31 ` [PATCH v10 13/14] drm/amdgpu: enable compute/gfx usermode queue Shashank Sharma
2024-05-03  6:52   ` Christian König
2024-05-02 16:31 ` [PATCH v10 14/14] drm/amdgpu: add kernel config for gfx-userqueue Shashank Sharma
2024-05-03  6:44   ` Christian König [this message]

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=cdc0d944-1c24-4b53-b654-0ca77b620ce1@amd.com \
    --to=christian.koenig@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=arvind.yadav@amd.com \
    --cc=shashank.sharma@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