From: Alex Deucher <alexander.deucher@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: Alex Deucher <alexander.deucher@amd.com>, <marek.olsak@amd.com>,
<prike.liang@amd.com>, <sunil.khatri@amd.com>,
<yogesh.mohanmarimuthu@amd.com>
Subject: [PATCH 1/2] drm/amdgpu: add UAPI to query if user queues are supported
Date: Mon, 24 Mar 2025 16:33:27 -0400 [thread overview]
Message-ID: <20250324203328.4174703-1-alexander.deucher@amd.com> (raw)
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
next reply other threads:[~2025-03-24 20:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-24 20:33 Alex Deucher [this message]
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
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=20250324203328.4174703-1-alexander.deucher@amd.com \
--to=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=marek.olsak@amd.com \
--cc=prike.liang@amd.com \
--cc=sunil.khatri@amd.com \
--cc=yogesh.mohanmarimuthu@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