From: Matt Roper <matthew.d.roper@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: matthew.d.roper@intel.com
Subject: [Intel-xe] [PATCH 2/2] drm/xe/uapi: Add IP version and stepping to GT list query
Date: Wed, 6 Dec 2023 12:50:37 -0800 [thread overview]
Message-ID: <20231206205034.1105637-6-matthew.d.roper@intel.com> (raw)
In-Reply-To: <20231206205034.1105637-4-matthew.d.roper@intel.com>
For modern platforms (MTL and later), both kernel and userspace drivers
are expected to apply GT programming and workarounds based on the IP
version and stepping self-reported by the GT hardware via the the GMD_ID
registers. Since userspace drivers can't access these registers
directly, pass along the version and stepping information via the GT
list query. Note that the new query fields will remain 0's when running
on pre-GMD_ID platforms. Userspace is expected to continue using PCI
devid / revid on those older platforms.
Although the hardware also has a GMD_ID register for display
version/stepping, that value is intentionally *not* included anywhere in
the Xe uapi. Display userspace should be using platform-agnostic APIs
and auto-detecting platform capabilities rather than matching specific
IP versions.
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
---
drivers/gpu/drm/xe/xe_query.c | 8 ++++++++
include/uapi/drm/xe_drm.h | 10 +++++++++-
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/xe/xe_query.c b/drivers/gpu/drm/xe/xe_query.c
index 56d61bf596b2..c3e5163d40da 100644
--- a/drivers/gpu/drm/xe/xe_query.c
+++ b/drivers/gpu/drm/xe/xe_query.c
@@ -12,6 +12,7 @@
#include <drm/xe_drm.h>
#include "regs/xe_engine_regs.h"
+#include "regs/xe_gt_regs.h"
#include "xe_bo.h"
#include "xe_device.h"
#include "xe_exec_queue.h"
@@ -388,6 +389,13 @@ static int query_gt_list(struct xe_device *xe, struct drm_xe_device_query *query
BIT(gt_to_tile(gt)->id) << 1;
gt_list->gt_list[id].far_mem_regions = xe->info.mem_region_mask ^
gt_list->gt_list[id].near_mem_regions;
+
+ gt_list->gt_list[id].ip_ver_major =
+ REG_FIELD_GET(GMD_ID_ARCH_MASK, gt->info.gmdid);
+ gt_list->gt_list[id].ip_ver_minor =
+ REG_FIELD_GET(GMD_ID_RELEASE_MASK, gt->info.gmdid);
+ gt_list->gt_list[id].ip_ver_revid =
+ REG_FIELD_GET(GMD_ID_REVID, gt->info.gmdid);
}
if (copy_to_user(query_ptr, gt_list, size)) {
diff --git a/include/uapi/drm/xe_drm.h b/include/uapi/drm/xe_drm.h
index 0895e4d2a981..d84622f54e4b 100644
--- a/include/uapi/drm/xe_drm.h
+++ b/include/uapi/drm/xe_drm.h
@@ -397,8 +397,16 @@ struct drm_xe_gt {
* memory and memory living in a different tile.
*/
__u64 far_mem_regions;
+ /** @ip_ver_major: Graphics/media IP major version on GMD_ID platforms */
+ __u16 ip_ver_major;
+ /** @ip_ver_major: Graphics/media IP minor version on GMD_ID platforms */
+ __u16 ip_ver_minor;
+ /** @ip_ver_major: Graphics/media IP revision ID on GMD_ID platforms */
+ __u16 ip_ver_revid;
+ /** @pad2: MBZ */
+ __u16 pad2;
/** @reserved: Reserved */
- __u64 reserved[8];
+ __u64 reserved[7];
};
/**
--
2.43.0
next prev parent reply other threads:[~2023-12-06 20:50 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-06 20:50 [Intel-xe] [PATCH 0/2] xe: Add IP versions to GT query Matt Roper
2023-12-06 20:50 ` [Intel-xe] [PATCH 1/2] drm/xe: Stash GMD_ID value in xe_gt Matt Roper
2023-12-06 22:55 ` Lucas De Marchi
2023-12-06 23:09 ` Matt Roper
2023-12-06 23:19 ` Lucas De Marchi
2023-12-07 0:37 ` Matt Roper
2023-12-07 16:31 ` Lucas De Marchi
2023-12-06 20:50 ` Matt Roper [this message]
2023-12-07 16:49 ` [Intel-xe] [PATCH 2/2] drm/xe/uapi: Add IP version and stepping to GT list query Lucas De Marchi
2023-12-07 1:30 ` [Intel-xe] ✓ CI.Patch_applied: success for xe: Add IP versions to GT query Patchwork
2023-12-07 1:30 ` [Intel-xe] ✗ CI.checkpatch: warning " Patchwork
2023-12-07 1:31 ` [Intel-xe] ✓ CI.KUnit: success " Patchwork
2023-12-07 1:38 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-12-07 1:39 ` [Intel-xe] ✗ CI.Hooks: failure " Patchwork
2023-12-07 1:40 ` [Intel-xe] ✓ CI.checksparse: success " Patchwork
2023-12-07 2:16 ` [Intel-xe] ✓ CI.BAT: " 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=20231206205034.1105637-6-matthew.d.roper@intel.com \
--to=matthew.d.roper@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