All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michal Wajdeczko" <michal.wajdeczko@intel.com>
To: intel-gfx@lists.freedesktop.org,
	Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Subject: Re: [PATCH 3/9] drm/i915/uc: Unify uC FW selection
Date: Tue, 23 Jul 2019 15:22:51 +0200	[thread overview]
Message-ID: <op.z5dt4dbwxaggs7@mwajdecz-mobl1.ger.corp.intel.com> (raw)
In-Reply-To: <20190722232048.9970-4-daniele.ceraolospurio@intel.com>

On Tue, 23 Jul 2019 01:20:42 +0200, Daniele Ceraolo Spurio  
<daniele.ceraolospurio@intel.com> wrote:

> +
> +#define GUC_FW_BLOB(prefix_, major_, minor_, patch_) \
> +UC_FW_BLOB(prefix_##_guc, major_, minor_, \
> +	   __MAKE_GUC_FW_PATH(prefix_, major_, minor_, patch_))
> +
> +GUC_FW_BLOB(skl, 33, 0, 0);
> +GUC_FW_BLOB(bxt, 33, 0, 0);
> +GUC_FW_BLOB(kbl, 33, 0, 0);
> +GUC_FW_BLOB(glk, 33, 0, 0);
> +GUC_FW_BLOB(icl, 33, 0, 0);
> +
> +/* 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 },
> +};

Can we avoid pointers to separate blob definitions ?
What about defining each fw in single line like below

#define INTEL_GUC_FIRMWARE_DEFS(fw_def) \
	fw_def(ICELAKE, 0, 33, 0, 0, icl, GUC) \
	fw_def(COFFEELAKE, 0, 33, 0, 0, kbl, GUC) \
	fw_def(GEMINILAKE, 0, 33, 0, 0, glk, GUC) \
	fw_def(KABYLAKE, 0, 33, 0, 0, kbl, GUC) \
	fw_def(BROXTON, 0, 33, 0, 0, bxt, GUC) \
	fw_def(SKYLAKE, 0, 33, 0, 0, skl, GUC) \
	/* end */

with some extra common helpers

#define TO_MODULE_FIRMWARE(_platform, _rev, _major, _minor, _patch,  
_prefix, _builder) \
	MODULE_FIRMWARE(_builder##_FW_PATH_BUILDER(_prefix, _major, _minor,  
_patch));

#define TO_BLOB_ENTRY(_platform, _rev, _major, _minor, _patch, _prefix,  
_builder) \
{ \
	.platform = INTEL_##_platform, \
	.rev = (_rev), \
	.major = (_major), \
	.minor = (_minor), \
	.patch = (_patch), \
	.blob = _builder##_FW_PATH_BUILDER(_prefix, _major, _minor, _patch), \
},

then we can have immutable

static const struct intel_uc_blob guc_fw_blobs[] = {
INTEL_GUC_FIRMWARE_DEFS(TO_BLOB_ENTRY)
};
INTEL_GUC_FIRMWARE_DEFS(TO_MODULE_FIRMWARE)

(tested locally for feasibility)

Michal
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2019-07-23 13:22 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
2019-07-23 13:22   ` Michal Wajdeczko [this message]
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=op.z5dt4dbwxaggs7@mwajdecz-mobl1.ger.corp.intel.com \
    --to=michal.wajdeczko@intel.com \
    --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.