[Intel-gfx] [PATCH 1/3] drm/i915/uc: Consider enable_guc modparam during fw selection

Chris Wilson chris at chris-wilson.co.uk
Wed Jul 31 13:22:42 UTC 2019


Quoting Michal Wajdeczko (2019-07-31 14:19:06)
> On Tue, 30 Jul 2019 21:07:28 +0200, Chris Wilson  
> <chris at chris-wilson.co.uk> wrote:
> 
> >> +static const char* __override_huc_firmware_path(void)
> >> +{
> >> +       if ((i915_modparams.enable_guc < 0) ||
> >> +           (i915_modparams.enable_guc & ENABLE_GUC_LOAD_HUC))
> >> +               return i915_modparams.huc_firmware_path;
> >
> > We can even lose the <0. No negative value other than -1 is documented.
> 
> I used <0 to match existing implementation in sanitize_options_early()
> 
>         /* A negative value means "use platform default" */
>         if (i915_modparams.enable_guc < 0)
>                 i915_modparams.enable_guc = __get_platform_enable_guc(uc);
> 
> if we lose <0 condition there are questions how to treat undocumented  
> values:
> -2 is disabled(0) or auto but without submission aka huc-only(2)
> -3 is disabled(0) or auto but without huc aka submission_only(1)
> ...

I'm willing to let users shoot themselves in the foot for undocumented
values for an unsafe parameter. They already snatched hold of the
shotgun for using an unsafe parameter in the first place.
-Chris


More information about the Intel-gfx mailing list