All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 3/9] drm/i915/uc: Unify uC FW selection
Date: Tue, 23 Jul 2019 09:26:46 +0100	[thread overview]
Message-ID: <156387040615.31349.9170466969316321387@skylake-alporthouse-com> (raw)
In-Reply-To: <20190722232048.9970-4-daniele.ceraolospurio@intel.com>

Quoting Daniele Ceraolo Spurio (2019-07-23 00:20:42)
> +/* must be ordered base on platform + revid, from newer to older */
> +static const struct intel_uc_platform_requirement guc_fw_blobs[] = {
> +       { INTEL_ICELAKE,        0,      &icl_guc_fw_blob },
> +       { INTEL_COFFEELAKE,     0,      &kbl_guc_fw_blob },
> +       { INTEL_GEMINILAKE,     0,      &glk_guc_fw_blob },
> +       { INTEL_KABYLAKE,       0,      &kbl_guc_fw_blob },
> +       { INTEL_BROXTON,        0,      &bxt_guc_fw_blob },
> +       { INTEL_SKYLAKE,        0,      &skl_guc_fw_blob },
> +};

> +/**
> + * intel_uc_fw_select - select the uC firmware to fetch & load
> + * @i915: device private
> + * @uc_fw: uC firmware
> + * @list: list of required firmware for each platform
> + * @length: number of entries in the list
> + *
> + * Select the uC firmware from the provided list based on platform and revid of
> + * the device we're on. If the firmware_path modparam override is set, it takes
> + * precedence over the entries in the list.
> + */
> +void intel_uc_fw_select(struct drm_i915_private *i915,
> +                       struct intel_uc_fw *uc_fw,
> +                       const struct intel_uc_platform_requirement *list,
> +                       unsigned int length)

If this is a list, do we need a length? Is a sentinel not good enough?

> +{
> +       GEM_BUG_ON(uc_fw->fetch_status != INTEL_UC_FIRMWARE_UNINITIALIZED);
> +
> +       if (!HAS_UC(i915)) {
> +               uc_fw->fetch_status = INTEL_UC_FIRMWARE_NOT_SUPPORTED;
> +               return;
> +       }

if (IS_ENABLED(CONFIG_DRM_I915_SELFTEST)) {
	for (i = 1; i < length; i++)
		if (list[i].first_rev <= list[i-1].first_rev) {
			pr_err("...");
			uc_fw->fetch_status = INTEL_UC_FIRMWARE_NOT_SUPPORTED;
			return;
		}
}

> +
> +       uc_fw->fetch_status = INTEL_UC_FIRMWARE_NOT_STARTED;
> +
> +       if (unlikely(i915_modparams.guc_firmware_path &&
> +                    uc_fw->type == INTEL_UC_FW_TYPE_GUC)) {
> +               uc_fw->path = i915_modparams.guc_firmware_path;
> +       } else if (unlikely(i915_modparams.huc_firmware_path &&
> +                           uc_fw->type == INTEL_UC_FW_TYPE_HUC)) {
> +               uc_fw->path = i915_modparams.huc_firmware_path;
> +       } else {
> +               enum intel_platform p = INTEL_INFO(i915)->platform;
> +               u8 rev = INTEL_REVID(i915);
> +               int i;
> +
> +               for (i = 0; i < length && p <= list[i].p; i++) {
> +                       if (p == list[i].p && rev >= list[i].first_rev) {
> +                               uc_fw->path = list[i].blob->path;
> +                               uc_fw->major_ver_wanted = list[i].blob->major;
> +                               uc_fw->minor_ver_wanted = list[i].blob->minor;
> +                               break;
> +                       }
> +               }
> +       }
> +}
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-07-23  8:26 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-22 23:20 [PATCH 0/9] uC fw path unification + misc clean-up Daniele Ceraolo Spurio
2019-07-22 23:20 ` [PATCH 1/9] drm/i915/uc: Gt-fy uc reset Daniele Ceraolo Spurio
2019-07-23  7:47   ` Chris Wilson
2019-07-22 23:20 ` [PATCH 2/9] drm/i915/uc: Unify uC platform check Daniele Ceraolo Spurio
2019-07-23  8:21   ` Chris Wilson
2019-07-23 11:19   ` Michal Wajdeczko
2019-07-23 14:52     ` Daniele Ceraolo Spurio
2019-07-23 21:15       ` Daniele Ceraolo Spurio
2019-07-22 23:20 ` [PATCH 3/9] drm/i915/uc: Unify uC FW selection Daniele Ceraolo Spurio
2019-07-23  8:26   ` Chris Wilson [this message]
2019-07-23 13:22   ` Michal Wajdeczko
2019-07-23 15:01     ` Daniele Ceraolo Spurio
2019-07-22 23:20 ` [PATCH 4/9] drm/i915/uc: Sanitize uC when GT is sanitized Daniele Ceraolo Spurio
2019-07-23  8:00   ` Chris Wilson
2019-07-22 23:20 ` [PATCH 5/9] drm/i915/uc: Unify uc_fw status tracking Daniele Ceraolo Spurio
2019-07-23  8:28   ` Chris Wilson
2019-07-23 14:20   ` Michal Wajdeczko
2019-07-22 23:20 ` [PATCH 6/9] drm/i915/uc: Move xfer rsa logic to common function Daniele Ceraolo Spurio
2019-07-23  8:34   ` Chris Wilson
2019-07-22 23:20 ` [PATCH 7/9] drm/i915/huc: Copy huc rsa only once Daniele Ceraolo Spurio
2019-07-23  8:37   ` Chris Wilson
2019-07-22 23:20 ` [PATCH 8/9] drm/i915/uc: Plumb the gt through fw_upload Daniele Ceraolo Spurio
2019-07-23  8:39   ` Chris Wilson
2019-07-22 23:20 ` [PATCH 9/9] drm/i915/uc: Unify uC firmware upload Daniele Ceraolo Spurio
2019-07-23  8:45   ` Chris Wilson
2019-07-23  0:14 ` ✗ Fi.CI.CHECKPATCH: warning for uC fw path unification + misc clean-up Patchwork
2019-07-23  0:19 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-07-23  1:08 ` ✓ Fi.CI.BAT: success " Patchwork
2019-07-23  4:54 ` ✓ Fi.CI.IGT: " Patchwork
2019-07-23  8:01 ` [PATCH 0/9] " Chris Wilson

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=156387040615.31349.9170466969316321387@skylake-alporthouse-com \
    --to=chris@chris-wilson.co.uk \
    --cc=daniele.ceraolospurio@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.