[PATCH 1/3] drm/xe/uc: Add helpers to set firmware version

Lukasz Laguna lukasz.laguna at intel.com
Tue Feb 25 13:23:35 UTC 2025


Introduce a helper functions to set the found and compatibility firmware
version, allowing reuse in different parts of the driver.

Signed-off-by: Lukasz Laguna <lukasz.laguna at intel.com>
---
 drivers/gpu/drm/xe/xe_uc_fw.h | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/drivers/gpu/drm/xe/xe_uc_fw.h b/drivers/gpu/drm/xe/xe_uc_fw.h
index 6195e353f269..feffa06fb968 100644
--- a/drivers/gpu/drm/xe/xe_uc_fw.h
+++ b/drivers/gpu/drm/xe/xe_uc_fw.h
@@ -188,6 +188,34 @@ static inline u32 xe_uc_fw_get_upload_size(struct xe_uc_fw *uc_fw)
 	return __xe_uc_fw_get_upload_size(uc_fw);
 }
 
+/**
+ * xe_uc_fw_set_found_ver - Set FW found version.
+ * @uc_fw: uC firmware
+ * @type: firmware version type
+ * @ver: pointer storing version to be set
+ *
+ * Set uC FW found version of given type.
+ */
+static inline void xe_uc_fw_set_found_ver(struct xe_uc_fw *uc_fw,
+					  enum xe_uc_fw_version_types type,
+					  const struct xe_uc_fw_version *ver)
+{
+	uc_fw->versions.found[type] = *ver;
+}
+
+/**
+ * xe_uc_fw_set_compatibility_ver - Set FW compatibility version.
+ * @uc_fw: uC firmware
+ * @ver: pointer storing version to be set
+ *
+ * Set uC FW found compatibility version.
+ */
+static inline void xe_uc_fw_set_compatibility_ver(struct xe_uc_fw *uc_fw,
+						  const struct xe_uc_fw_version *ver)
+{
+	xe_uc_fw_set_found_ver(uc_fw, XE_UC_FW_VER_COMPATIBILITY, ver);
+}
+
 #define XE_UC_FIRMWARE_URL "https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git"
 
 #endif
-- 
2.40.0



More information about the Intel-xe mailing list