Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Roper <matthew.d.roper@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: matthew.d.roper@intel.com
Subject: [Intel-xe] [PATCH 1/2] drm/xe: Stash GMD_ID value in xe_gt
Date: Wed,  6 Dec 2023 12:50:36 -0800	[thread overview]
Message-ID: <20231206205034.1105637-5-matthew.d.roper@intel.com> (raw)
In-Reply-To: <20231206205034.1105637-4-matthew.d.roper@intel.com>

Although we've stored the major and minor versions for graphics/media in
xe_device, it will be simpler to implement the uapi version query if we
also stash the raw register value in the GT itself.

Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
---
 drivers/gpu/drm/xe/xe_gt.c       | 6 ++++++
 drivers/gpu/drm/xe/xe_gt_types.h | 2 ++
 2 files changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c
index 154d6c7072b9..c6f7885ffdc0 100644
--- a/drivers/gpu/drm/xe/xe_gt.c
+++ b/drivers/gpu/drm/xe/xe_gt.c
@@ -381,6 +381,12 @@ static int gt_fw_domain_init(struct xe_gt *gt)
 	/* Initialize CCS mode sysfs after early initialization of HW engines */
 	xe_gt_ccs_mode_sysfs_init(gt);
 
+	/*
+	 * Stash hardware-reported version.  Since this register does not exist
+	 * on pre-MTL platforms, reading it there will (correctly) return 0.
+	 */
+	gt->info.gmdid = xe_mmio_read32(gt, GMD_ID);
+
 	err = xe_force_wake_put(gt_to_fw(gt), XE_FW_GT);
 	XE_WARN_ON(err);
 	xe_device_mem_access_put(gt_to_xe(gt));
diff --git a/drivers/gpu/drm/xe/xe_gt_types.h b/drivers/gpu/drm/xe/xe_gt_types.h
index 4e48c4643163..4e7a4494a554 100644
--- a/drivers/gpu/drm/xe/xe_gt_types.h
+++ b/drivers/gpu/drm/xe/xe_gt_types.h
@@ -117,6 +117,8 @@ struct xe_gt {
 		 * hwconfig blob.
 		 */
 		u64 __engine_mask;
+		/** @gmdid: raw GMD_ID value from hardware */
+		u32 gmdid;
 	} info;
 
 	/**
-- 
2.43.0


  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 ` Matt Roper [this message]
2023-12-06 22:55   ` [Intel-xe] [PATCH 1/2] drm/xe: Stash GMD_ID value in xe_gt 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 ` [Intel-xe] [PATCH 2/2] drm/xe/uapi: Add IP version and stepping to GT list query Matt Roper
2023-12-07 16:49   ` 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-5-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