From: Nirmoy Das <nirmoy.das@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: Nirmoy Das <nirmoy.das@intel.com>
Subject: [PATCH v2 7/7] drm/xe/uapi: Add a query flag for has_device_atomics_on_smem
Date: Fri, 12 Apr 2024 11:22:49 +0200 [thread overview]
Message-ID: <20240412092249.3636-8-nirmoy.das@intel.com> (raw)
In-Reply-To: <20240412092249.3636-1-nirmoy.das@intel.com>
Add a query flag for xe->info.has_device_atomics_on_smem
as this is platform dependent. This flag can be use to inform
whether DRM_XE_VM_BIND_FLAG_DEVICE_ATOMICS can be effectively
applied for a given platform.
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
---
drivers/gpu/drm/xe/xe_query.c | 4 +++-
include/uapi/drm/xe_drm.h | 3 +++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/xe/xe_query.c b/drivers/gpu/drm/xe/xe_query.c
index df407d73e5f5..b8a606698e38 100644
--- a/drivers/gpu/drm/xe/xe_query.c
+++ b/drivers/gpu/drm/xe/xe_query.c
@@ -312,7 +312,7 @@ static int query_mem_regions(struct xe_device *xe,
static int query_config(struct xe_device *xe, struct drm_xe_device_query *query)
{
- const u32 num_params = DRM_XE_QUERY_CONFIG_MAX_EXEC_QUEUE_PRIORITY + 1;
+ const u32 num_params = DRM_XE_QUERY_CONFIG_SUPP_DEV_ATOMIC_ON_SMEM + 1;
size_t size =
sizeof(struct drm_xe_query_config) + num_params * sizeof(u64);
struct drm_xe_query_config __user *query_ptr =
@@ -341,6 +341,8 @@ static int query_config(struct xe_device *xe, struct drm_xe_device_query *query)
config->info[DRM_XE_QUERY_CONFIG_VA_BITS] = xe->info.va_bits;
config->info[DRM_XE_QUERY_CONFIG_MAX_EXEC_QUEUE_PRIORITY] =
xe_exec_queue_device_get_max_priority(xe);
+ config->info[DRM_XE_QUERY_CONFIG_SUPP_DEV_ATOMIC_ON_SMEM] =
+ xe->info.has_device_atomics_on_smem;
if (copy_to_user(query_ptr, config, size)) {
kfree(config);
diff --git a/include/uapi/drm/xe_drm.h b/include/uapi/drm/xe_drm.h
index a44c057d4471..4804b8a5d028 100644
--- a/include/uapi/drm/xe_drm.h
+++ b/include/uapi/drm/xe_drm.h
@@ -394,6 +394,8 @@ struct drm_xe_query_mem_regions {
* - %DRM_XE_QUERY_CONFIG_VA_BITS - Maximum bits of a virtual address
* - %DRM_XE_QUERY_CONFIG_MAX_EXEC_QUEUE_PRIORITY - Value of the highest
* available exec queue priority
+ * - %DRM_XE_QUERY_CONFIG_SUPP_DEV_ATOMIC_ON_SMEM - Flag is set if the device
+ * supports device atomics on system memory
*/
struct drm_xe_query_config {
/** @num_params: number of parameters returned in info */
@@ -408,6 +410,7 @@ struct drm_xe_query_config {
#define DRM_XE_QUERY_CONFIG_MIN_ALIGNMENT 2
#define DRM_XE_QUERY_CONFIG_VA_BITS 3
#define DRM_XE_QUERY_CONFIG_MAX_EXEC_QUEUE_PRIORITY 4
+#define DRM_XE_QUERY_CONFIG_SUPP_DEV_ATOMIC_ON_SMEM 5
/** @info: array of elements containing the config info */
__u64 info[];
};
--
2.42.0
next prev parent reply other threads:[~2024-04-12 9:37 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-12 9:22 [PATCH v2 0/7] Enable device atomics with a VM bind flag Nirmoy Das
2024-04-12 9:22 ` [PATCH v2 1/7] drm/xe: Introduce has_atomic_enable_pte_bit device info Nirmoy Das
2024-04-12 9:22 ` [PATCH v2 2/7] drm/xe: Consolidate setting PTE_AE into one place Nirmoy Das
2024-04-12 9:22 ` [PATCH v2 3/7] drm/xe: Add function to check if BO has single placement Nirmoy Das
2024-04-12 9:22 ` [PATCH v2 4/7] drm/xe: Move vm bind bo validation to a helper function Nirmoy Das
2024-04-12 18:37 ` Matthew Brost
2024-04-12 9:22 ` [PATCH v2 5/7] drm/xe: Introduce has_device_atomics_on_smem device info Nirmoy Das
2024-04-12 13:31 ` Souza, Jose
2024-04-12 15:22 ` Nirmoy Das
2024-04-12 9:22 ` [PATCH v2 6/7] drm/xe/uapi: Introduce VMA bind flag for device atomics Nirmoy Das
2024-04-12 9:22 ` Nirmoy Das [this message]
2024-04-12 13:37 ` [PATCH v2 7/7] drm/xe/uapi: Add a query flag for has_device_atomics_on_smem Souza, Jose
2024-04-12 15:16 ` Nirmoy Das
2024-04-12 9:58 ` ✓ CI.Patch_applied: success for Enable device atomics with a VM bind flag (rev2) Patchwork
2024-04-12 9:58 ` ✓ CI.checkpatch: " Patchwork
2024-04-12 9:59 ` ✓ CI.KUnit: " Patchwork
2024-04-12 10:11 ` ✓ CI.Build: " Patchwork
2024-04-12 10:13 ` ✓ CI.Hooks: " Patchwork
2024-04-12 10:15 ` ✓ CI.checksparse: " Patchwork
2024-04-12 10:38 ` ✗ CI.BAT: failure " Patchwork
2024-04-15 7:52 ` ✗ CI.FULL: " Patchwork
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=20240412092249.3636-8-nirmoy.das@intel.com \
--to=nirmoy.das@intel.com \
--cc=intel-xe@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