From: "Ceraolo Spurio, Daniele" <daniele.ceraolospurio@intel.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [CI 1/2] drm/i915/uc: Support for version reduced and multiple firmware files
Date: Mon, 12 Sep 2022 17:47:06 -0700 [thread overview]
Message-ID: <adce120b-a78a-259d-3684-73bffa3b0ab3@intel.com> (raw)
In-Reply-To: <20220913002329.ia4m33z5sqnds2ll@ldmartin-desk2.jf.intel.com>
On 9/12/2022 5:23 PM, Lucas De Marchi wrote:
> On Tue, Sep 06, 2022 at 04:01:46PM -0700, Daniele Ceraolo Spurio wrote:
>> @@ -184,49 +247,94 @@ __uc_fw_auto_select(struct drm_i915_private
>> *i915, struct intel_uc_fw *uc_fw)
>> fw_count = blobs_all[uc_fw->type].count;
>>
>> for (i = 0; i < fw_count && p <= fw_blobs[i].p; i++) {
>> - if (p == fw_blobs[i].p && rev >= fw_blobs[i].rev) {
>> - const struct uc_fw_blob *blob = &fw_blobs[i].blob;
>> - uc_fw->path = blob->path;
>> - uc_fw->wanted_path = blob->path;
>> - uc_fw->major_ver_wanted = blob->major;
>> - uc_fw->minor_ver_wanted = blob->minor;
>> - break;
>> - }
>> - }
>> + const struct uc_fw_blob *blob = &fw_blobs[i].blob;
>>
>> - if (uc_fw->type == INTEL_UC_FW_TYPE_GUC) {
>> - const struct uc_fw_platform_requirement *blobs =
>> blobs_guc_fallback;
>> - u32 count = ARRAY_SIZE(blobs_guc_fallback);
>> + if (p != fw_blobs[i].p)
>> + continue;
>>
>> - for (i = 0; i < count && p <= blobs[i].p; i++) {
>> - if (p == blobs[i].p && rev >= blobs[i].rev) {
>> - const struct uc_fw_blob *blob = &blobs[i].blob;
>> + if (rev < fw_blobs[i].rev)
>> + continue;
>>
>> - uc_fw->fallback.path = blob->path;
>> - uc_fw->fallback.major_ver = blob->major;
>> - uc_fw->fallback.minor_ver = blob->minor;
>> - break;
>> - }
>> + if (uc_fw->file_selected.path) {
>> + if (uc_fw->file_selected.path == blob->path)
>> + uc_fw->file_selected.path = NULL;
>> +
>> + continue;
>> }
>> +
>> + uc_fw->file_selected.path = blob->path;
>> + uc_fw->file_wanted.path = blob->path;
>> + uc_fw->file_wanted.major_ver = blob->major;
>> + uc_fw->file_wanted.minor_ver = blob->minor;
>> + break;
>> }
>>
>> /* make sure the list is ordered as expected */
>> - if (IS_ENABLED(CONFIG_DRM_I915_SELFTEST)) {
>> + if (IS_ENABLED(CONFIG_DRM_I915_SELFTEST) && !verified) {
>> + verified = true;
>> +
>> for (i = 1; i < fw_count; i++) {
>> + /* Next platform is good: */
>> if (fw_blobs[i].p < fw_blobs[i - 1].p)
>> continue;
>>
>> + /* Next platform revision is good: */
>> if (fw_blobs[i].p == fw_blobs[i - 1].p &&
>> fw_blobs[i].rev < fw_blobs[i - 1].rev)
>> continue;
>>
>> - drm_err(&i915->drm, "Invalid FW blob order: %s r%u comes
>> before %s r%u\n",
>> - intel_platform_name(fw_blobs[i - 1].p),
>> - fw_blobs[i - 1].rev,
>> - intel_platform_name(fw_blobs[i].p),
>> - fw_blobs[i].rev);
>> + /* Platform/revision must be in order: */
>> + if (fw_blobs[i].p != fw_blobs[i - 1].p ||
>> + fw_blobs[i].rev != fw_blobs[i - 1].rev)
>> + goto bad;
>> +
>> + /* Next major version is good: */
>> + if (fw_blobs[i].blob.major < fw_blobs[i - 1].blob.major)
>> + continue;
>> +
>> + /* New must be before legacy: */
>> + if (!fw_blobs[i].blob.legacy && fw_blobs[i -
>> 1].blob.legacy)
>> + goto bad;
>> +
>> + /* New to legacy also means 0.0 to X.Y (HuC), or X.0 to
>> X.Y (GuC) */
>> + if (fw_blobs[i].blob.legacy && !fw_blobs[i -
>> 1].blob.legacy) {
>> + if (!fw_blobs[i - 1].blob.major)
>> + continue;
>> +
>> + if (fw_blobs[i].blob.major == fw_blobs[i -
>> 1].blob.major)
>> + continue;
>> + }
>> +
>> + /* Major versions must be in order: */
>> + if (fw_blobs[i].blob.major != fw_blobs[i - 1].blob.major)
>> + goto bad;
>> +
>> + /* Next minor version is good: */
>> + if (fw_blobs[i].blob.minor < fw_blobs[i - 1].blob.minor)
>> + continue;
>>
>> - uc_fw->path = NULL;
>> + /* Minor versions must be in order: */
>> + if (fw_blobs[i].blob.minor != fw_blobs[i - 1].blob.minor)
>> + goto bad;
>> +
>> + /* Patch versions must be in order: */
>> + if (fw_blobs[i].blob.patch <= fw_blobs[i - 1].blob.patch)
>> + continue;
>> +
>> +bad:
>> + drm_err(&i915->drm, "\x1B[35;1mInvalid FW blob order: %s
>> r%u %s%d.%d.%d comes before %s r%u %s%d.%d.%d\n",
>
> what is this \x1B[35;1m? Probably something that went bad while
> writing/pasting this?
Looks like it slipped in. Fix coming soon (John will send a v2 of "
drm/i915/uc: Fix issues with overriding firmware files" and include it
there).
Daniele
>
> Lucas De Marchi
>
>> + intel_platform_name(fw_blobs[i - 1].p), fw_blobs[i - 1].rev,
>> + fw_blobs[i - 1].blob.legacy ? "L" : "v",
>> + fw_blobs[i - 1].blob.major,
>> + fw_blobs[i - 1].blob.minor,
>> + fw_blobs[i - 1].blob.patch,
>> + intel_platform_name(fw_blobs[i].p), fw_blobs[i].rev,
>> + fw_blobs[i].blob.legacy ? "L" : "v",
>> + fw_blobs[i].blob.major,
>> + fw_blobs[i].blob.minor,
>> + fw_blobs[i].blob.patch);
>> +
>> + uc_fw->file_selected.path = NULL;
>> }
>> }
>> }
>> @@ -259,7 +367,7 @@ static void __uc_fw_user_override(struct
>> drm_i915_private *i915, struct intel_uc
next prev parent reply other threads:[~2022-09-13 0:47 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-06 23:01 [Intel-gfx] [CI 1/2] drm/i915/uc: Support for version reduced and multiple firmware files Daniele Ceraolo Spurio
2022-09-06 23:01 ` [Intel-gfx] [CI 2/2] drm/i915/uc: Add patch level version number support Daniele Ceraolo Spurio
2022-09-06 23:27 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [CI,1/2] drm/i915/uc: Support for version reduced and multiple firmware files Patchwork
2022-09-06 23:27 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-09-06 23:40 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-09-07 3:16 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2022-09-13 0:23 ` [Intel-gfx] [CI 1/2] " Lucas De Marchi
2022-09-13 0:47 ` Ceraolo Spurio, Daniele [this message]
2022-11-22 14:12 ` Jani Nikula
2022-11-22 21:32 ` John Harrison
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=adce120b-a78a-259d-3684-73bffa3b0ab3@intel.com \
--to=daniele.ceraolospurio@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=lucas.demarchi@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