Re: [PATCH] drm/i915: Allow the user to override default firmware file names

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 06, 2017 at 02:52:14PM +0100, Michal Wajdeczko wrote:
> On Mon, Feb 06, 2017 at 01:05:29PM +0000, Chris Wilson wrote:
> > Make the actual path we attempt to load for each of (DMC, GuC, HuC)
> > overidable by the user. This helps testing new firmware releases.
> > 
> > Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> > ---
> >  drivers/gpu/drm/i915/i915_params.c      | 12 ++++++++++++
> >  drivers/gpu/drm/i915/i915_params.h      |  3 +++
> >  drivers/gpu/drm/i915/intel_csr.c        |  9 ++++++++-
> >  drivers/gpu/drm/i915/intel_guc_loader.c |  4 ++++
> >  drivers/gpu/drm/i915/intel_huc.c        |  8 ++++++++
> >  5 files changed, 35 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c
> > index f1fa51190dc6..d7001c0effa5 100644
> > --- a/drivers/gpu/drm/i915/i915_params.c
> > +++ b/drivers/gpu/drm/i915/i915_params.c
> > @@ -243,3 +243,15 @@ MODULE_PARM_DESC(enable_dpcd_backlight,
> >  module_param_named(enable_gvt, i915.enable_gvt, bool, 0400);
> >  MODULE_PARM_DESC(enable_gvt,
> >  	"Enable support for Intel GVT-g graphics virtualization host support(default:false)");
> > +
> > +module_param_named(dmc_firmware, i915.dmc_firmware_path, charp, 0400);
> > +MODULE_PARM_DESC(dmc_firmare,
> > +	"Provide an alternate name for the DMC firmware file");
> > +
> > +module_param_named(guc_firmware, i915.guc_firmware_path, charp, 0400);
> > +MODULE_PARM_DESC(guc_firmare,
> > +	"Provide an alternate name for the GuC firmware file");
> > +
> > +module_param_named(huc_firmware, i915.huc_firmware_path, charp, 0400);
> > +MODULE_PARM_DESC(huc_firmare,
> > +	"Provide an alternate name for the HuC firmware file");
> > diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
> > index 55d47eea172e..d35d6ff600c1 100644
> > --- a/drivers/gpu/drm/i915/i915_params.h
> > +++ b/drivers/gpu/drm/i915/i915_params.h
> > @@ -28,6 +28,9 @@
> >  #include <linux/cache.h> /* for __read_mostly */
> >  
> >  #define I915_PARAMS_FOR_EACH(func) \
> > +	func(char *, dmc_firmware_path); \
> > +	func(char *, guc_firmware_path); \
> > +	func(char *, huc_firmware_path); \
> >  	func(int, modeset); \
> >  	func(int, panel_ignore_lid); \
> >  	func(int, semaphores); \
> > diff --git a/drivers/gpu/drm/i915/intel_csr.c b/drivers/gpu/drm/i915/intel_csr.c
> > index 9dcc434d3b74..49932f85a786 100644
> > --- a/drivers/gpu/drm/i915/intel_csr.c
> > +++ b/drivers/gpu/drm/i915/intel_csr.c
> > @@ -447,7 +447,14 @@ void intel_csr_ucode_init(struct drm_i915_private *dev_priv)
> >  		csr->fw_path = I915_CSR_SKL;
> >  	else if (IS_BROXTON(dev_priv))
> >  		csr->fw_path = I915_CSR_BXT;
> > -	else {
> > +	else
> > +		csr->fw_path = "";
> > +
> > +	/* Allow the user to override the default path via a module parameter */
> > +	if (csr->fw_path && i915.dmc_firmware_path)
> 
> First check for null fw_path is redundant here, as it looks that at least "" will be used.

I was preferring to use a consistent method for all fw paths, since one
path was using that method, I'd prefer all to use the same and some
bright soul to refactor.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux