Skip to contentSkip to conversation

drm/amdgpu: return an error in the userq IOCTL when DRM_AMDGPU_NAVI3X_USERQ=n

PATCH In review Alex Deucher 3 participants 8 messages Feb 28, 2025 – Mar 4, 2025

Subsystems (2)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/5 drm/amdgpu: return an error in the userq IOCTL when DRM_AMDGPU_NAVI3X_USERQ=n

I'd swear this was already fixed, but I guess the patch never landed. Add it now.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue.c +1 -1
index 39279920a757c..a02614cbda36e 100644
@@ -416,7 +416,7 @@ int amdgpu_userq_ioctl(struct drm_device *dev, void *data,
 int amdgpu_userq_ioctl(struct drm_device *dev, void *data,
 		       struct drm_file *filp)
 {
-	return 0;
+	return -ENOTSUPP;
 }
 #endif
 
Signature · 1 line
2.48.1
author maintainer
#1 lore raw

PATCH 2/5 drm/amdgpu/Kconfig: fix wording of DRM_AMDGPU_NAVI3X_USERQ

The feature is not navi3x specific at this point.

---
 drivers/gpu/drm/amd/amdgpu/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/Kconfig +2 -2
index 6703bd832e2e8..a614320114796 100644
@@ -96,13 +96,13 @@ config DRM_AMDGPU_WERROR
 	  Only enable this if you are warning code for amdgpu.ko.
 
 config DRM_AMDGPU_NAVI3X_USERQ
-	bool "Enable Navi 3x gfx usermode queues"
+	bool "Enable amdgpu usermode queues"
 	depends on DRM_AMDGPU
 	depends on BROKEN
 	default n
 	help
 	  Choose this option to enable GFX usermode queue support for GFX/SDMA/Compute
-          workload submission. This feature is experimental and supported on Navi 3X only.
+          workload submission. This feature is experimental and supported on GFX11+.
 
 source "drivers/gpu/drm/amd/acp/Kconfig"
 source "drivers/gpu/drm/amd/display/Kconfig"
Signature · 1 line
2.48.1
author maintainer
#2 lore raw

PATCH 3/5 drm/amdgpu/gfx11: fix config guard

In reply to Alex Deucher

s/CONFIG_DRM_AMD_USERQ_GFX/CONFIG_DRM_AMDGPU_NAVI3X_USERQ/

---
 drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +1 -1
index 7970c848583d7..a56fccd21cf6f 100644
@@ -1610,7 +1610,7 @@ static int gfx_v11_0_sw_init(struct amdgpu_ip_block *ip_block)
 		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
+#ifdef CONFIG_DRM_AMDGPU_NAVI3X_USERQ
 		adev->userq_funcs[AMDGPU_HW_IP_GFX] = &userq_mes_funcs;
 		adev->userq_funcs[AMDGPU_HW_IP_COMPUTE] = &userq_mes_funcs;
 #endif
Signature · 1 line
2.48.1
author maintainer
#3 lore raw

PATCH 4/5 drm/amdgpu: add userq firmware version checks

In reply to Alex Deucher

Currently disabled until the firmwares are officially released.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 14 ++++++++++----
 drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c |  7 +++++--
 drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c |  4 +++-
 drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c |  4 +++-
 4 files changed, 21 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +10 -4
index a56fccd21cf6f..2cf663d25881d 100644
@@ -1594,8 +1594,11 @@ static int gfx_v11_0_sw_init(struct amdgpu_ip_block *ip_block)
 		adev->gfx.mec.num_pipe_per_mec = 4;
 		adev->gfx.mec.num_queue_per_pipe = 4;
 #ifdef CONFIG_DRM_AMDGPU_NAVI3X_USERQ
-		adev->userq_funcs[AMDGPU_HW_IP_GFX] = &userq_mes_funcs;
-		adev->userq_funcs[AMDGPU_HW_IP_COMPUTE] = &userq_mes_funcs;
+		/* add firmware version checks here */
+		if (0) {
+			adev->userq_funcs[AMDGPU_HW_IP_GFX] = &userq_mes_funcs;
+			adev->userq_funcs[AMDGPU_HW_IP_COMPUTE] = &userq_mes_funcs;
+		}
 #endif
 		break;
 	case IP_VERSION(11, 0, 1):
@@ -1611,8 +1614,11 @@ static int gfx_v11_0_sw_init(struct amdgpu_ip_block *ip_block)
 		adev->gfx.mec.num_pipe_per_mec = 4;
 		adev->gfx.mec.num_queue_per_pipe = 4;
 #ifdef CONFIG_DRM_AMDGPU_NAVI3X_USERQ
-		adev->userq_funcs[AMDGPU_HW_IP_GFX] = &userq_mes_funcs;
-		adev->userq_funcs[AMDGPU_HW_IP_COMPUTE] = &userq_mes_funcs;
+		/* add firmware version checks here */
+		if (0) {
+			adev->userq_funcs[AMDGPU_HW_IP_GFX] = &userq_mes_funcs;
+			adev->userq_funcs[AMDGPU_HW_IP_COMPUTE] = &userq_mes_funcs;
+		}
 #endif
 		break;
 	default:
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +5 -2
index e763151f056d4..60d8630a05c82 100644
@@ -1390,8 +1390,11 @@ static int gfx_v12_0_sw_init(struct amdgpu_ip_block *ip_block)
 		adev->gfx.mec.num_pipe_per_mec = 2;
 		adev->gfx.mec.num_queue_per_pipe = 4;
 #ifdef CONFIG_DRM_AMDGPU_NAVI3X_USERQ
-		adev->userq_funcs[AMDGPU_HW_IP_GFX] = &userq_mes_funcs;
-		adev->userq_funcs[AMDGPU_HW_IP_COMPUTE] = &userq_mes_funcs;
+		/* add firmware version checks here */
+		if (0) {
+			adev->userq_funcs[AMDGPU_HW_IP_GFX] = &userq_mes_funcs;
+			adev->userq_funcs[AMDGPU_HW_IP_COMPUTE] = &userq_mes_funcs;
+		}
 #endif
 		break;
 	default:
drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c +3 -1
index d5ef20202f44a..f1a02ce844e0f 100644
@@ -1381,7 +1381,9 @@ static int sdma_v6_0_sw_init(struct amdgpu_ip_block *ip_block)
 		DRM_ERROR("Failed to allocated memory for SDMA IP Dump\n");
 
 #ifdef CONFIG_DRM_AMDGPU_NAVI3X_USERQ
-	adev->userq_funcs[AMDGPU_HW_IP_DMA] = &userq_mes_funcs;
+	/* add firmware version checks here */
+	if (0)
+		adev->userq_funcs[AMDGPU_HW_IP_DMA] = &userq_mes_funcs;
 #endif
 	r = amdgpu_sdma_sysfs_reset_mask_init(adev);
 	if (r)
drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c +3 -1
index 0f9e5007d4171..f10de8e2fcae2 100644
@@ -1383,7 +1383,9 @@ static int sdma_v7_0_sw_init(struct amdgpu_ip_block *ip_block)
 		DRM_ERROR("Failed to allocated memory for SDMA IP Dump\n");
 
 #ifdef CONFIG_DRM_AMDGPU_NAVI3X_USERQ
-	adev->userq_funcs[AMDGPU_HW_IP_DMA] = &userq_mes_funcs;
+	/* add firmware version checks here */
+	if (0)
+		adev->userq_funcs[AMDGPU_HW_IP_DMA] = &userq_mes_funcs;
 #endif
 
 	return r;
Signature · 1 line
2.48.1
author maintainer
#4 lore raw

PATCH 5/5 drm/amdgpu/userq: remove BROKEN from config

In reply to Alex Deucher

This can be enabled now. We have the firmware checks in place.

---
 drivers/gpu/drm/amd/amdgpu/Kconfig | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/Kconfig +0 -1
index a614320114796..23c014da0f324 100644
@@ -98,7 +98,6 @@ config DRM_AMDGPU_WERROR
 config DRM_AMDGPU_NAVI3X_USERQ
 	bool "Enable amdgpu usermode queues"
 	depends on DRM_AMDGPU
-	depends on BROKEN
 	default n
 	help
 	  Choose this option to enable GFX usermode queue support for GFX/SDMA/Compute
Signature · 1 line
2.48.1
#5 lore raw

RE: [PATCH 5/5] drm/amdgpu/userq: remove BROKEN from config

[Public]

Question: Why use the CONFIG_DRM_AMDGPU_NAVI3X_USERQ to guard all the various GFX user mode queue enablement paths? It seems more generic and reasonable to use the config name CONFIG_DRM_AMDGPU_NAVI3X_USERQ.

Except for that question, the series patch is Reviewed-by: Prike Liang <[email protected]> .

Regards,
Prike

Quoted 31 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Saturday, March 1, 2025 3:54 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>
Subject: [PATCH 5/5] drm/amdgpu/userq: remove BROKEN from config

This can be enabled now. We have the firmware checks in place.

---
 drivers/gpu/drm/amd/amdgpu/Kconfig | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/Kconfig +0 -0
index a614320114796..23c014da0f324 100644
@@ -98,7 +98,6 @@ config DRM_AMDGPU_WERROR  config

DRM_AMDGPU_NAVI3X_USERQ
bool "Enable amdgpu usermode queues"
depends on DRM_AMDGPU
- depends on BROKEN
default n
help
Choose this option to enable GFX usermode queue support for
GFX/SDMA/Compute
--
2.48.1

#6 lore raw

Re: [PATCH 5/5] drm/amdgpu/userq: remove BROKEN from config

Quoted 5 lines · Prike

[Public]

Question: Why use the CONFIG_DRM_AMDGPU_NAVI3X_USERQ to guard all the various GFX user mode queue enablement paths? It seems more generic and reasonable to use the config name CONFIG_DRM_AMDGPU_NAVI3X_USERQ.

I assume you mean something more generic like CONFIG_DRM_AMDGPU_USERQ?
At this point it would make more sense, but at the time it was added
there was only gfx11 support. We could change it, but at this point, I'd be more inclined to just remove it.

Quoted 1 line

Except for that question, the series patch is Reviewed-by: Prike Liang <[email protected]> .

Thanks.

Alex

Quoted 36 lines

Regards,
Prike

Quoted 31 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Saturday, March 1, 2025 3:54 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>
Subject: [PATCH 5/5] drm/amdgpu/userq: remove BROKEN from config

This can be enabled now. We have the firmware checks in place.

---
 drivers/gpu/drm/amd/amdgpu/Kconfig | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/Kconfig +0 -0
index a614320114796..23c014da0f324 100644
@@ -98,7 +98,6 @@ config DRM_AMDGPU_WERROR  config

DRM_AMDGPU_NAVI3X_USERQ
bool "Enable amdgpu usermode queues"
depends on DRM_AMDGPU
- depends on BROKEN
default n
help
Choose this option to enable GFX usermode queue support for
GFX/SDMA/Compute
--
2.48.1

#7 lore raw

RE: [PATCH 5/5] drm/amdgpu/userq: remove BROKEN from config

[Public]

Quoted 17 lines

From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Tuesday, March 4, 2025 12:15 AM
To: Liang, Prike <[email protected]>
Cc: Deucher, Alexander <[email protected]>; amd- [email protected]
Subject: Re: [PATCH 5/5] drm/amdgpu/userq: remove BROKEN from config

Quoted 4 lines · Prike

[Public]

Question: Why use the CONFIG_DRM_AMDGPU_NAVI3X_USERQ to guard all

the various GFX user mode queue enablement paths? It seems more generic and reasonable to use the config name CONFIG_DRM_AMDGPU_NAVI3X_USERQ.

Quoted 1 line
Quoted 6 lines

I assume you mean something more generic like
CONFIG_DRM_AMDGPU_USERQ?
At this point it would make more sense, but at the time it was added there was
only gfx11 support. We could change it, but at this point, I'd be more inclined to just remove it.

Yes, it's a typo, and I mean we may need to change the userq config label to CONFIG_DRM_AMDGPU_USERQ later.

Thanks,
Prike

Quoted 43 lines
Quoted 1 line

Except for that question, the series patch is Reviewed-by: Prike Liang

<[email protected]> .

Thanks.

Alex

Quoted 36 lines

Regards,
Prike

Quoted 31 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Saturday, March 1, 2025 3:54 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>
Subject: [PATCH 5/5] drm/amdgpu/userq: remove BROKEN from config

This can be enabled now. We have the firmware checks in place.

---
 drivers/gpu/drm/amd/amdgpu/Kconfig | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/Kconfig +0 -0
index a614320114796..23c014da0f324 100644
@@ -98,7 +98,6 @@ config DRM_AMDGPU_WERROR  config

DRM_AMDGPU_NAVI3X_USERQ
bool "Enable amdgpu usermode queues"
depends on DRM_AMDGPU
- depends on BROKEN
default n
help
Choose this option to enable GFX usermode queue support for
GFX/SDMA/Compute
--
2.48.1