drm/i915/huc: always init the delayed load fence
authorDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Wed, 23 Nov 2022 23:54:17 +0000 (15:54 -0800)
committerDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Tue, 29 Nov 2022 16:18:06 +0000 (08:18 -0800)
commit14347a9c889fbdbae81e500f6c6e313f5d8e5271
tree5cc93e6b41161516853f16eb23b21105b0176936
parent0f85715804e72cdcf489a89930ec64437e11ca8c
drm/i915/huc: always init the delayed load fence

The fence is only tracking if the HuC load is in progress or not and
doesn't distinguish between already loaded, not supported or disabled,
so we can always initialize it to completed, no matter the actual
support. We already do that for most platforms, but we skip it on
GTs that lack VCS engines (e.g. MTL root GT), so fix that. Note that the
cleanup is already unconditional.

While at it, move the init/fini to helper functions.

Fixes: 02224691cb0f ("drm/i915/huc: fix leak of debug object in huc load fence on driver unload")
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: John Harrison <John.C.Harrison@Intel.com>
Cc: Alan Previn <alan.previn.teres.alexis@intel.com>
Reviewed-by: John Harrison <John.C.Harrison@Intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221123235417.1475709-1-daniele.ceraolospurio@intel.com
drivers/gpu/drm/i915/gt/uc/intel_huc.c