Commit 665ae9c9 authored by John Harrison's avatar John Harrison Committed by Daniele Ceraolo Spurio
Browse files

drm/i915/uc: Support for version reduced and multiple firmware files



There was a misunderstanding in how firmware file compatibility should
be managed within i915. This has been clarified as:
  i915 must support all existing firmware releases forever
  new minor firmware releases should replace prior versions
  only backwards compatibility breaking releases should be a new file

This patch cleans up the single fallback file support that was added
as a quick fix emergency effort. That is now removed in preference to
supporting arbitrary numbers of firmware files per platform.

The patch also adds support for having GuC firmware files that are
named by major version only (because the major version indicates
backwards breaking changes that affect the KMD) and for having HuC
firmware files with no version number at all (because the KMD has no
interface requirements with the HuC).

For GuC, the driver will report via dmesg if the found file is older than
expected. For HuC, the KMD will no longer require updating for any new
HuC release so will not be able to report what the latest expected
version is.

Signed-off-by: default avatarJohn Harrison <John.C.Harrison@Intel.com>
Reviewed-by: default avatarDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Signed-off-by: default avatarDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220906230147.479945-1-daniele.ceraolospurio@intel.com
parent 68eb42b3
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -1868,7 +1868,7 @@ int intel_guc_submission_init(struct intel_guc *guc)
	if (guc->submission_initialized)
		return 0;

	if (guc->fw.major_ver_found < 70) {
	if (guc->fw.file_selected.major_ver < 70) {
		ret = guc_lrc_desc_pool_create_v69(guc);
		if (ret)
			return ret;
@@ -2303,7 +2303,7 @@ static int register_context(struct intel_context *ce, bool loop)
	GEM_BUG_ON(intel_context_is_child(ce));
	trace_intel_context_register(ce);

	if (guc->fw.major_ver_found >= 70)
	if (guc->fw.file_selected.major_ver >= 70)
		ret = register_context_v70(guc, ce, loop);
	else
		ret = register_context_v69(guc, ce, loop);
@@ -2315,7 +2315,7 @@ static int register_context(struct intel_context *ce, bool loop)
		set_context_registered(ce);
		spin_unlock_irqrestore(&ce->guc_state.lock, flags);

		if (guc->fw.major_ver_found >= 70)
		if (guc->fw.file_selected.major_ver >= 70)
			guc_context_policy_init_v70(ce, loop);
	}

@@ -2921,7 +2921,7 @@ static void __guc_context_set_preemption_timeout(struct intel_guc *guc,
						 u16 guc_id,
						 u32 preemption_timeout)
{
	if (guc->fw.major_ver_found >= 70) {
	if (guc->fw.file_selected.major_ver >= 70) {
		struct context_policy policy;

		__guc_context_policy_start_klv(&policy, guc_id);
@@ -3186,7 +3186,7 @@ static int guc_context_alloc(struct intel_context *ce)
static void __guc_context_set_prio(struct intel_guc *guc,
				   struct intel_context *ce)
{
	if (guc->fw.major_ver_found >= 70) {
	if (guc->fw.file_selected.major_ver >= 70) {
		struct context_policy policy;

		__guc_context_policy_start_klv(&policy, ce->guc_id.id);
+2 −2
Original line number Diff line number Diff line
@@ -436,8 +436,8 @@ static void print_fw_ver(struct intel_uc *uc, struct intel_uc_fw *fw)
	struct drm_i915_private *i915 = uc_to_gt(uc)->i915;

	drm_info(&i915->drm, "%s firmware %s version %u.%u\n",
		 intel_uc_fw_type_repr(fw->type), fw->path,
		 fw->major_ver_found, fw->minor_ver_found);
		 intel_uc_fw_type_repr(fw->type), fw->file_selected.path,
		 fw->file_selected.major_ver, fw->file_selected.minor_ver);
}

static int __uc_init_hw(struct intel_uc *uc)
+290 −152

File changed.

Preview size limit exceeded, changes collapsed.

+14 −19

File changed.

Preview size limit exceeded, changes collapsed.

+8 −8

File changed.

Preview size limit exceeded, changes collapsed.