[Intel-gfx] [PATCH v2 6/7] drm/i915/huc: Load HuC only if requested
Chris Wilson
chris at chris-wilson.co.uk
Fri Dec 1 12:40:01 UTC 2017
Quoting Michal Wajdeczko (2017-12-01 10:33:16)
> Our new "enable_guc" modparam allows to control whenever HuC
> should be loaded. However existing code will try load and
> authenticate HuC always when we use the GuC. This patch is
> trying to enforce modparam selection.
>
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko at intel.com>
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
> Cc: Sagar Arun Kamble <sagar.a.kamble at intel.com>
> ---
> -void intel_huc_auth(struct intel_huc *huc)
> +int intel_huc_auth(struct intel_huc *huc)
> {
> struct drm_i915_private *i915 = huc_to_i915(huc);
> struct intel_guc *guc = &i915->guc;
> @@ -213,14 +213,14 @@ void intel_huc_auth(struct intel_huc *huc)
> int ret;
>
> if (huc->fw.load_status != INTEL_UC_FIRMWARE_SUCCESS)
> - return;
> + return -ENOEXEC;
>
> vma = i915_gem_object_ggtt_pin(huc->fw.obj, NULL, 0, 0,
> PIN_OFFSET_BIAS | GUC_WOPCM_TOP);
> if (IS_ERR(vma)) {
> - DRM_ERROR("failed to pin huc fw object %d\n",
> - (int)PTR_ERR(vma));
> - return;
> + ret = (int)PTR_ERR(vma);
The advantage here is that (int) is now implicit.
Looks ok. I'd recommend we add the various expected combinations to
drv_module_reload.
"enable_guc=0"
"enable_guc=0x1"
"enable_guc=0x2"
"enable_guc=0x3"
etc?
-Chris
More information about the Intel-gfx
mailing list