Re: [PATCH 6/8] drm/i915/guc: Extract param logic form guc_init

Arkadiusz Hiler
2017-02-21T13:38:40Z

On Fri, Feb 17, 2017 at 02:52:00PM +0100, Michal Wajdeczko wrote:
> On Fri, Feb 17, 2017 at 02:05:55PM +0100, Arkadiusz Hiler wrote:
> > Let intel_guc_fetch_fw() focus on determining and fetching the correct
> > firmware.
> >
> > This patch introduces intel_sanitize_uc_params() that is called from
> > intel_sanitize_options().
>
> Function name mentioned here does not match function in the patch.
> Also, can we use "options" to match parent function name?
>
>
> >
> > Then, if we have GuC, we can call intel_guc_fetch_fw() conditionally and
> > we do not have to do the internal checks.
> >
> > v2: fix comment, notify when nuking GuC explicitly enabled (M. Wajdeczko)
> >
> > Cc: Michal Winiarski <michal.winiarski@intel.com>
> > Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
> > Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> > Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> > ---
> > drivers/gpu/drm/i915/i915_drv.c | 2 ++
> > drivers/gpu/drm/i915/intel_guc_loader.c | 16 +---------------
> > drivers/gpu/drm/i915/intel_uc.c | 27 ++++++++++++++++++++++++++-
> > drivers/gpu/drm/i915/intel_uc.h | 1 +
> > 4 files changed, 30 insertions(+), 16 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_uc.c b/drivers/gpu/drm/i915/intel_uc.c
> > index d2d2b6c..ef9dc72 100644
> > --- a/drivers/gpu/drm/i915/intel_uc.c
> > +++ b/drivers/gpu/drm/i915/intel_uc.c
> > @@ -36,8 +57,12 @@ void intel_uc_init_early(struct drm_i915_private *dev_priv)
> >
> > void intel_fetch_uc_fw(struct drm_i915_private *dev_priv)
> > {
> > + if (!i915.enable_guc_loading)
> > + return;
> > +
> > dev_priv->huc.fw.fetch = uc_fetch_fw;
> > - intel_huc_fetch_fw(&dev_priv->huc);
> > + if (HAS_HUC_UCODE(dev_priv))
> > + intel_huc_fetch_fw(&dev_priv->huc);
>
> I'm not sure how it goes after this series, but previously HAS_HUC check
> was done inside huc_fetch_fw() function...

The check in huc_fetch_fw() is removed in later patch. The one that is
cleaning both ?uc_fetch_fw() functions.

--
Cheers,
Arek