Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "José Roberto de Souza" <jose.souza@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: Lucas De Marchi <lucas.demarchi@intel.com>,
	Matt Roper <matthew.d.roper@intel.com>
Subject: [PATCH v2 6/9] drm/xe: Stash GMD_ID value in xe_gt
Date: Mon, 22 Jan 2024 13:17:06 -0800	[thread overview]
Message-ID: <20240122211709.224419-6-jose.souza@intel.com> (raw)
In-Reply-To: <20240122211709.224419-1-jose.souza@intel.com>

From: Matt Roper <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>
Reviewed-by: Lucas De Marchi <lucas.demarchi@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 1fe4d54409d34..47cb87f599e46 100644
--- a/drivers/gpu/drm/xe/xe_gt.c
+++ b/drivers/gpu/drm/xe/xe_gt.c
@@ -399,6 +399,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 047cde6cda107..177b93a96929e 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


  parent reply	other threads:[~2024-01-22 21:17 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-22 21:17 [PATCH v2 1/9] drm/xe: Remove double new lines in devcoredump José Roberto de Souza
2024-01-22 21:17 ` [PATCH v2 2/9] drm/xe: Change devcoredump functions parameters to xe_sched_job José Roberto de Souza
2024-01-22 21:17 ` [PATCH v2 3/9] drm/xe: Add functions to convert regular address to canonical address and back José Roberto de Souza
2024-01-22 21:17 ` [PATCH v2 4/9] drm/xe: Add batch buffer addresses to devcoredump José Roberto de Souza
2024-01-22 21:17 ` [PATCH v2 5/9] drm/xe: Nuke xe from xe_devcoredump José Roberto de Souza
2024-01-22 21:17 ` José Roberto de Souza [this message]
2024-01-22 21:17 ` [PATCH v2 7/9] drm/xe: Print more device information in devcoredump José Roberto de Souza
2024-01-22 21:17 ` [PATCH v2 8/9] drm/xe: Print registers spread in 2 u32 as u64 José Roberto de Souza
2024-01-22 21:17 ` [PATCH v2 9/9] drm/xe: Remove additional spaces in devcoredump HW Engines section José Roberto de Souza
2024-01-22 21:40 ` ✓ CI.Patch_applied: success for series starting with [v2,1/9] drm/xe: Remove double new lines in devcoredump Patchwork
2024-01-22 21:40 ` ✓ CI.checkpatch: " Patchwork
2024-01-22 21:41 ` ✓ CI.KUnit: " Patchwork
2024-01-22 21:49 ` ✓ CI.Build: " Patchwork
2024-01-22 21:49 ` ✗ CI.Hooks: failure " Patchwork
2024-01-22 21:50 ` ✓ CI.checksparse: success " Patchwork
2024-01-22 22:14 ` ✓ 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=20240122211709.224419-6-jose.souza@intel.com \
    --to=jose.souza@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=lucas.demarchi@intel.com \
    --cc=matthew.d.roper@intel.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