AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/amdgpu: add UAPI to query if user queues are supported
@ 2025-03-24 20:33 Alex Deucher
  2025-03-24 20:33 ` [PATCH 2/2] drm/amdgpu: bump version for user queue IP support query Alex Deucher
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Alex Deucher @ 2025-03-24 20:33 UTC (permalink / raw)
  To: amd-gfx
  Cc: Alex Deucher, marek.olsak, prike.liang, sunil.khatri,
	yogesh.mohanmarimuthu

Add an INFO query to check if user queues are supported.

v2: switch to a mask of IPs (Marek)
v3: move to drm_amdgpu_info_device (Marek)

Cc: marek.olsak@amd.com
Cc: prike.liang@amd.com
Cc: sunil.khatri@amd.com
Cc: yogesh.mohanmarimuthu@amd.com
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 7 +++++++
 include/uapi/drm/amdgpu_drm.h           | 3 +++
 2 files changed, 10 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
index 3b7dfd56ccd0e..0ba3ef1e4a068 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
@@ -1009,6 +1009,13 @@ int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
 			}
 		}
 
+		if (adev->userq_funcs[AMDGPU_HW_IP_GFX])
+			dev_info->userq_ip_mask |= (1 << AMDGPU_HW_IP_GFX);
+		if (adev->userq_funcs[AMDGPU_HW_IP_COMPUTE])
+			dev_info->userq_ip_mask |= (1 << AMDGPU_HW_IP_COMPUTE);
+		if (adev->userq_funcs[AMDGPU_HW_IP_DMA])
+			dev_info->userq_ip_mask |= (1 << AMDGPU_HW_IP_DMA);
+
 		ret = copy_to_user(out, dev_info,
 				   min((size_t)size, sizeof(*dev_info))) ? -EFAULT : 0;
 		kfree(dev_info);
diff --git a/include/uapi/drm/amdgpu_drm.h b/include/uapi/drm/amdgpu_drm.h
index 5dbd9037afe75..ef97c0d78b8a0 100644
--- a/include/uapi/drm/amdgpu_drm.h
+++ b/include/uapi/drm/amdgpu_drm.h
@@ -1453,6 +1453,9 @@ struct drm_amdgpu_info_device {
 	__u32 csa_size;
 	/* context save area base virtual alignment for gfx11 */
 	__u32 csa_alignment;
+	/* Userq IP mask (1 << AMDGPU_HW_IP_*) */
+	__u32 userq_ip_mask;
+	__u32 pad;
 };
 
 struct drm_amdgpu_info_hw_ip {
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] drm/amdgpu: bump version for user queue IP support query
  2025-03-24 20:33 [PATCH 1/2] drm/amdgpu: add UAPI to query if user queues are supported Alex Deucher
@ 2025-03-24 20:33 ` Alex Deucher
  2025-04-07 10:30   ` Khatri, Sunil
  2025-04-07  5:39 ` [PATCH 1/2] drm/amdgpu: add UAPI to query if user queues are supported Marek Olšák
  2025-04-07 12:13 ` Khatri, Sunil
  2 siblings, 1 reply; 6+ messages in thread
From: Alex Deucher @ 2025-03-24 20:33 UTC (permalink / raw)
  To: amd-gfx
  Cc: Alex Deucher, marek.olsak, prike.liang, sunil.khatri,
	yogesh.mohanmarimuthu

Add the user queue IP support query to the drm_amdgpu_info_device
query.

Cc: marek.olsak@amd.com
Cc: prike.liang@amd.com
Cc: sunil.khatri@amd.com
Cc: yogesh.mohanmarimuthu@amd.com
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index b96d8c45312e6..4df11afe91252 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -125,9 +125,10 @@
  * - 3.61.0 - Contains fix for RV/PCO compute queues
  * - 3.62.0 - Add AMDGPU_IDS_FLAGS_MODE_PF, AMDGPU_IDS_FLAGS_MODE_VF & AMDGPU_IDS_FLAGS_MODE_PT
  * - 3.63.0 - GFX12 display DCC supports 256B max compressed block size
+ * - 3.64.0 - Userq IP support query
  */
 #define KMS_DRIVER_MAJOR	3
-#define KMS_DRIVER_MINOR	63
+#define KMS_DRIVER_MINOR	64
 #define KMS_DRIVER_PATCHLEVEL	0
 
 /*
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] drm/amdgpu: add UAPI to query if user queues are supported
  2025-03-24 20:33 [PATCH 1/2] drm/amdgpu: add UAPI to query if user queues are supported Alex Deucher
  2025-03-24 20:33 ` [PATCH 2/2] drm/amdgpu: bump version for user queue IP support query Alex Deucher
@ 2025-04-07  5:39 ` Marek Olšák
  2025-04-08  6:27   ` Liang, Prike
  2025-04-07 12:13 ` Khatri, Sunil
  2 siblings, 1 reply; 6+ messages in thread
From: Marek Olšák @ 2025-04-07  5:39 UTC (permalink / raw)
  To: Alex Deucher
  Cc: amd-gfx, marek.olsak, prike.liang, sunil.khatri,
	yogesh.mohanmarimuthu

[-- Attachment #1: Type: text/plain, Size: 2235 bytes --]

Reviewed-by: Marek Olšák <marek.olsak@amd.com>

For both patches.

Marek

On Mon, Mar 24, 2025 at 4:34 PM Alex Deucher <alexander.deucher@amd.com>
wrote:

> Add an INFO query to check if user queues are supported.
>
> v2: switch to a mask of IPs (Marek)
> v3: move to drm_amdgpu_info_device (Marek)
>
> Cc: marek.olsak@amd.com
> Cc: prike.liang@amd.com
> Cc: sunil.khatri@amd.com
> Cc: yogesh.mohanmarimuthu@amd.com
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 7 +++++++
>  include/uapi/drm/amdgpu_drm.h           | 3 +++
>  2 files changed, 10 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> index 3b7dfd56ccd0e..0ba3ef1e4a068 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> @@ -1009,6 +1009,13 @@ int amdgpu_info_ioctl(struct drm_device *dev, void
> *data, struct drm_file *filp)
>                         }
>                 }
>
> +               if (adev->userq_funcs[AMDGPU_HW_IP_GFX])
> +                       dev_info->userq_ip_mask |= (1 << AMDGPU_HW_IP_GFX);
> +               if (adev->userq_funcs[AMDGPU_HW_IP_COMPUTE])
> +                       dev_info->userq_ip_mask |= (1 <<
> AMDGPU_HW_IP_COMPUTE);
> +               if (adev->userq_funcs[AMDGPU_HW_IP_DMA])
> +                       dev_info->userq_ip_mask |= (1 << AMDGPU_HW_IP_DMA);
> +
>                 ret = copy_to_user(out, dev_info,
>                                    min((size_t)size, sizeof(*dev_info))) ?
> -EFAULT : 0;
>                 kfree(dev_info);
> diff --git a/include/uapi/drm/amdgpu_drm.h b/include/uapi/drm/amdgpu_drm.h
> index 5dbd9037afe75..ef97c0d78b8a0 100644
> --- a/include/uapi/drm/amdgpu_drm.h
> +++ b/include/uapi/drm/amdgpu_drm.h
> @@ -1453,6 +1453,9 @@ struct drm_amdgpu_info_device {
>         __u32 csa_size;
>         /* context save area base virtual alignment for gfx11 */
>         __u32 csa_alignment;
> +       /* Userq IP mask (1 << AMDGPU_HW_IP_*) */
> +       __u32 userq_ip_mask;
> +       __u32 pad;
>  };
>
>  struct drm_amdgpu_info_hw_ip {
> --
> 2.49.0
>
>

[-- Attachment #2: Type: text/html, Size: 3240 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] drm/amdgpu: bump version for user queue IP support query
  2025-03-24 20:33 ` [PATCH 2/2] drm/amdgpu: bump version for user queue IP support query Alex Deucher
@ 2025-04-07 10:30   ` Khatri, Sunil
  0 siblings, 0 replies; 6+ messages in thread
From: Khatri, Sunil @ 2025-04-07 10:30 UTC (permalink / raw)
  To: Alex Deucher, amd-gfx
  Cc: marek.olsak, prike.liang, sunil.khatri, yogesh.mohanmarimuthu

Reviewed-by: Sunil Khatri <sunil.khatri@amd.com>

On 3/25/2025 2:03 AM, Alex Deucher wrote:
> Add the user queue IP support query to the drm_amdgpu_info_device
> query.
>
> Cc: marek.olsak@amd.com
> Cc: prike.liang@amd.com
> Cc: sunil.khatri@amd.com
> Cc: yogesh.mohanmarimuthu@amd.com
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> index b96d8c45312e6..4df11afe91252 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> @@ -125,9 +125,10 @@
>    * - 3.61.0 - Contains fix for RV/PCO compute queues
>    * - 3.62.0 - Add AMDGPU_IDS_FLAGS_MODE_PF, AMDGPU_IDS_FLAGS_MODE_VF & AMDGPU_IDS_FLAGS_MODE_PT
>    * - 3.63.0 - GFX12 display DCC supports 256B max compressed block size
> + * - 3.64.0 - Userq IP support query
>    */
>   #define KMS_DRIVER_MAJOR	3
> -#define KMS_DRIVER_MINOR	63
> +#define KMS_DRIVER_MINOR	64
>   #define KMS_DRIVER_PATCHLEVEL	0
>   
>   /*

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] drm/amdgpu: add UAPI to query if user queues are supported
  2025-03-24 20:33 [PATCH 1/2] drm/amdgpu: add UAPI to query if user queues are supported Alex Deucher
  2025-03-24 20:33 ` [PATCH 2/2] drm/amdgpu: bump version for user queue IP support query Alex Deucher
  2025-04-07  5:39 ` [PATCH 1/2] drm/amdgpu: add UAPI to query if user queues are supported Marek Olšák
@ 2025-04-07 12:13 ` Khatri, Sunil
  2 siblings, 0 replies; 6+ messages in thread
From: Khatri, Sunil @ 2025-04-07 12:13 UTC (permalink / raw)
  To: Alex Deucher, amd-gfx
  Cc: marek.olsak, prike.liang, sunil.khatri, yogesh.mohanmarimuthu

[-- Attachment #1: Type: text/plain, Size: 1870 bytes --]

Reviewed-by: Sunil Khatri <sunil.khatri@amd.com>

On 3/25/2025 2:03 AM, Alex Deucher wrote:
> Add an INFO query to check if user queues are supported.
>
> v2: switch to a mask of IPs (Marek)
> v3: move to drm_amdgpu_info_device (Marek)
>
> Cc:marek.olsak@amd.com
> Cc:prike.liang@amd.com
> Cc:sunil.khatri@amd.com
> Cc:yogesh.mohanmarimuthu@amd.com
> Signed-off-by: Alex Deucher<alexander.deucher@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 7 +++++++
>   include/uapi/drm/amdgpu_drm.h           | 3 +++
>   2 files changed, 10 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> index 3b7dfd56ccd0e..0ba3ef1e4a068 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> @@ -1009,6 +1009,13 @@ int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
>   			}
>   		}
>   
> +		if (adev->userq_funcs[AMDGPU_HW_IP_GFX])
> +			dev_info->userq_ip_mask |= (1 << AMDGPU_HW_IP_GFX);
> +		if (adev->userq_funcs[AMDGPU_HW_IP_COMPUTE])
> +			dev_info->userq_ip_mask |= (1 << AMDGPU_HW_IP_COMPUTE);
> +		if (adev->userq_funcs[AMDGPU_HW_IP_DMA])
> +			dev_info->userq_ip_mask |= (1 << AMDGPU_HW_IP_DMA);
> +
>   		ret = copy_to_user(out, dev_info,
>   				   min((size_t)size, sizeof(*dev_info))) ? -EFAULT : 0;
>   		kfree(dev_info);
> diff --git a/include/uapi/drm/amdgpu_drm.h b/include/uapi/drm/amdgpu_drm.h
> index 5dbd9037afe75..ef97c0d78b8a0 100644
> --- a/include/uapi/drm/amdgpu_drm.h
> +++ b/include/uapi/drm/amdgpu_drm.h
> @@ -1453,6 +1453,9 @@ struct drm_amdgpu_info_device {
>   	__u32 csa_size;
>   	/* context save area base virtual alignment for gfx11 */
>   	__u32 csa_alignment;
> +	/* Userq IP mask (1 << AMDGPU_HW_IP_*) */
> +	__u32 userq_ip_mask;
> +	__u32 pad;
>   };
>   
>   struct drm_amdgpu_info_hw_ip {

[-- Attachment #2: Type: text/html, Size: 38076 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH 1/2] drm/amdgpu: add UAPI to query if user queues are supported
  2025-04-07  5:39 ` [PATCH 1/2] drm/amdgpu: add UAPI to query if user queues are supported Marek Olšák
@ 2025-04-08  6:27   ` Liang, Prike
  0 siblings, 0 replies; 6+ messages in thread
From: Liang, Prike @ 2025-04-08  6:27 UTC (permalink / raw)
  To: Marek Olšák, Deucher, Alexander
  Cc: amd-gfx@lists.freedesktop.org, Olsak, Marek, Khatri, Sunil,
	Mohan Marimuthu, Yogesh

[-- Attachment #1: Type: text/plain, Size: 3089 bytes --]

[AMD Official Use Only - AMD Internal Distribution Only]

It may be better to use the following alignment attribute rather than manually adding the padding.

__attribute__((packed, aligned()))

Anyway, the patch set is

Reviewed-by: Prike Liang <Prike.Liang@amd.com<mailto:Prike.Liang@amd.com>>

Regards,
      Prike

From: Marek Olšák <maraeo@gmail.com>
Sent: Monday, April 7, 2025 1:40 PM
To: Deucher, Alexander <Alexander.Deucher@amd.com>
Cc: amd-gfx@lists.freedesktop.org; Olsak, Marek <Marek.Olsak@amd.com>; Liang, Prike <Prike.Liang@amd.com>; Khatri, Sunil <Sunil.Khatri@amd.com>; Mohan Marimuthu, Yogesh <Yogesh.Mohanmarimuthu@amd.com>
Subject: Re: [PATCH 1/2] drm/amdgpu: add UAPI to query if user queues are supported

Reviewed-by: Marek Olšák <marek.olsak@amd.com<mailto:marek.olsak@amd.com>>

For both patches.

Marek

On Mon, Mar 24, 2025 at 4:34 PM Alex Deucher <alexander.deucher@amd.com<mailto:alexander.deucher@amd.com>> wrote:
Add an INFO query to check if user queues are supported.

v2: switch to a mask of IPs (Marek)
v3: move to drm_amdgpu_info_device (Marek)

Cc: marek.olsak@amd.com<mailto:marek.olsak@amd.com>
Cc: prike.liang@amd.com<mailto:prike.liang@amd.com>
Cc: sunil.khatri@amd.com<mailto:sunil.khatri@amd.com>
Cc: yogesh.mohanmarimuthu@amd.com<mailto:yogesh.mohanmarimuthu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com<mailto:alexander.deucher@amd.com>>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 7 +++++++
 include/uapi/drm/amdgpu_drm.h           | 3 +++
 2 files changed, 10 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
index 3b7dfd56ccd0e..0ba3ef1e4a068 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
@@ -1009,6 +1009,13 @@ int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
                        }
                }

+               if (adev->userq_funcs[AMDGPU_HW_IP_GFX])
+                       dev_info->userq_ip_mask |= (1 << AMDGPU_HW_IP_GFX);
+               if (adev->userq_funcs[AMDGPU_HW_IP_COMPUTE])
+                       dev_info->userq_ip_mask |= (1 << AMDGPU_HW_IP_COMPUTE);
+               if (adev->userq_funcs[AMDGPU_HW_IP_DMA])
+                       dev_info->userq_ip_mask |= (1 << AMDGPU_HW_IP_DMA);
+
                ret = copy_to_user(out, dev_info,
                                   min((size_t)size, sizeof(*dev_info))) ? -EFAULT : 0;
                kfree(dev_info);
diff --git a/include/uapi/drm/amdgpu_drm.h b/include/uapi/drm/amdgpu_drm.h
index 5dbd9037afe75..ef97c0d78b8a0 100644
--- a/include/uapi/drm/amdgpu_drm.h
+++ b/include/uapi/drm/amdgpu_drm.h
@@ -1453,6 +1453,9 @@ struct drm_amdgpu_info_device {
        __u32 csa_size;
        /* context save area base virtual alignment for gfx11 */
        __u32 csa_alignment;
+       /* Userq IP mask (1 << AMDGPU_HW_IP_*) */
+       __u32 userq_ip_mask;
+       __u32 pad;
 };

 struct drm_amdgpu_info_hw_ip {
--
2.49.0

[-- Attachment #2: Type: text/html, Size: 8540 bytes --]

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-04-08  6:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-24 20:33 [PATCH 1/2] drm/amdgpu: add UAPI to query if user queues are supported Alex Deucher
2025-03-24 20:33 ` [PATCH 2/2] drm/amdgpu: bump version for user queue IP support query Alex Deucher
2025-04-07 10:30   ` Khatri, Sunil
2025-04-07  5:39 ` [PATCH 1/2] drm/amdgpu: add UAPI to query if user queues are supported Marek Olšák
2025-04-08  6:27   ` Liang, Prike
2025-04-07 12:13 ` Khatri, Sunil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox