From: Lukasz Laguna <lukasz.laguna@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: michal.wajdeczko@intel.com, lukasz.laguna@intel.com
Subject: [PATCH 2/3] drm/xe/vf: Add helper to get negotiated GuC ABI version
Date: Tue, 25 Feb 2025 14:23:36 +0100 [thread overview]
Message-ID: <20250225132337.6508-3-lukasz.laguna@intel.com> (raw)
In-Reply-To: <20250225132337.6508-1-lukasz.laguna@intel.com>
Introduce a helper function to retrieve the negotiated GuC ABI version
in the generic xe_uc_fw_version structure format.
Signed-off-by: Lukasz Laguna <lukasz.laguna@intel.com>
---
drivers/gpu/drm/xe/xe_gt_sriov_vf.c | 26 ++++++++++++++++++++++++++
drivers/gpu/drm/xe/xe_gt_sriov_vf.h | 2 ++
2 files changed, 28 insertions(+)
diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_vf.c b/drivers/gpu/drm/xe/xe_gt_sriov_vf.c
index 4831549da319..d0dbc00dd8ae 100644
--- a/drivers/gpu/drm/xe/xe_gt_sriov_vf.c
+++ b/drivers/gpu/drm/xe/xe_gt_sriov_vf.c
@@ -1014,6 +1014,32 @@ void xe_gt_sriov_vf_write32(struct xe_gt *gt, struct xe_reg reg, u32 val)
val, reg.addr, addr - reg.addr);
}
+/**
+ * xe_gt_sriov_vf_get_guc_ver - Get negotiated GuC ABI version.
+ * @gt: the &xe_gt
+ * @ver: pointer to storage for read GuC ABI version
+ *
+ * This function is for VF use only.
+ *
+ * Return: 0 on success or a negative error code on failure.
+ */
+int xe_gt_sriov_vf_get_guc_ver(struct xe_gt *gt, struct xe_uc_fw_version *ver)
+{
+ struct xe_gt_sriov_vf_guc_version *guc_version = >->sriov.vf.guc_version;
+
+ xe_gt_assert(gt, IS_SRIOV_VF(gt_to_xe(gt)));
+
+ if (!guc_version->major)
+ return -ENOPKG;
+
+ ver->major = guc_version->major;
+ ver->minor = guc_version->minor;
+ ver->patch = guc_version->patch;
+ ver->build = 0;
+
+ return 0;
+}
+
/**
* xe_gt_sriov_vf_print_config - Print VF self config.
* @gt: the &xe_gt
diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_vf.h b/drivers/gpu/drm/xe/xe_gt_sriov_vf.h
index ba6c5d74e326..b139d1e026e5 100644
--- a/drivers/gpu/drm/xe/xe_gt_sriov_vf.h
+++ b/drivers/gpu/drm/xe/xe_gt_sriov_vf.h
@@ -11,6 +11,7 @@
struct drm_printer;
struct xe_gt;
struct xe_reg;
+struct xe_uc_fw_version;
int xe_gt_sriov_vf_reset(struct xe_gt *gt);
int xe_gt_sriov_vf_bootstrap(struct xe_gt *gt);
@@ -26,6 +27,7 @@ u16 xe_gt_sriov_vf_guc_ids(struct xe_gt *gt);
u64 xe_gt_sriov_vf_lmem(struct xe_gt *gt);
u32 xe_gt_sriov_vf_read32(struct xe_gt *gt, struct xe_reg reg);
void xe_gt_sriov_vf_write32(struct xe_gt *gt, struct xe_reg reg, u32 val);
+int xe_gt_sriov_vf_get_guc_ver(struct xe_gt *gt, struct xe_uc_fw_version *ver);
void xe_gt_sriov_vf_print_config(struct xe_gt *gt, struct drm_printer *p);
void xe_gt_sriov_vf_print_runtime(struct xe_gt *gt, struct drm_printer *p);
--
2.40.0
next prev parent reply other threads:[~2025-02-25 13:24 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-25 13:23 [PATCH 0/3] VF: Set submission version in xe_uc_fw struct Lukasz Laguna
2025-02-25 13:23 ` [PATCH 1/3] drm/xe/uc: Add helpers to set firmware version Lukasz Laguna
2025-02-25 13:23 ` Lukasz Laguna [this message]
2025-02-25 13:23 ` [PATCH 3/3] drm/xe/vf: Set submission version in xe_uc_fw struct Lukasz Laguna
2025-02-25 22:30 ` Daniele Ceraolo Spurio
2025-02-27 11:22 ` Laguna, Lukasz
2025-02-27 19:43 ` Daniele Ceraolo Spurio
2025-02-28 9:25 ` Laguna, Lukasz
2025-02-28 16:29 ` Daniele Ceraolo Spurio
2025-02-28 20:07 ` Daniele Ceraolo Spurio
2025-02-25 14:35 ` ✓ CI.Patch_applied: success for VF: " Patchwork
2025-02-25 14:35 ` ✓ CI.checkpatch: " Patchwork
2025-02-25 14:36 ` ✓ CI.KUnit: " Patchwork
2025-02-25 14:53 ` ✓ CI.Build: " Patchwork
2025-02-25 14:57 ` ✓ CI.Hooks: " Patchwork
2025-02-25 15:00 ` ✓ CI.checksparse: " Patchwork
2025-02-25 15:20 ` ✓ Xe.CI.BAT: " Patchwork
2025-02-25 21:18 ` ✗ Xe.CI.Full: failure " 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=20250225132337.6508-3-lukasz.laguna@intel.com \
--to=lukasz.laguna@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=michal.wajdeczko@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