Commit 2399ab52 authored by Michal Wajdeczko's avatar Michal Wajdeczko Committed by Chris Wilson

drm/i915/uc: HuC firmware can't be supported without GuC

There is no point in selecting HuC firmware if GuC is unsupported
or it was already disabled, as we need GuC to authenticate HuC.

While around, make uc_fw_init_early work without direct access
to whole i915, pass only needed platform/rev info.
Signed-off-by: default avatarMichal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20190807170034.8440-3-michal.wajdeczko@intel.com
parent 12be4a4c
...@@ -39,7 +39,10 @@ ...@@ -39,7 +39,10 @@
*/ */
void intel_guc_fw_init_early(struct intel_guc *guc) void intel_guc_fw_init_early(struct intel_guc *guc)
{ {
intel_uc_fw_init_early(&guc->fw, INTEL_UC_FW_TYPE_GUC, guc_to_gt(guc)->i915); struct drm_i915_private *i915 = guc_to_gt(guc)->i915;
intel_uc_fw_init_early(&guc->fw, INTEL_UC_FW_TYPE_GUC, HAS_GT_UC(i915),
INTEL_INFO(i915)->platform, INTEL_REVID(i915));
} }
static void guc_prepare_xfer(struct intel_uncore *uncore) static void guc_prepare_xfer(struct intel_uncore *uncore)
......
...@@ -31,7 +31,13 @@ ...@@ -31,7 +31,13 @@
*/ */
void intel_huc_fw_init_early(struct intel_huc *huc) void intel_huc_fw_init_early(struct intel_huc *huc)
{ {
intel_uc_fw_init_early(&huc->fw, INTEL_UC_FW_TYPE_HUC, huc_to_gt(huc)->i915); struct intel_gt *gt = huc_to_gt(huc);
struct intel_uc *uc = &gt->uc;
struct drm_i915_private *i915 = gt->i915;
intel_uc_fw_init_early(&huc->fw, INTEL_UC_FW_TYPE_HUC,
intel_uc_supports_guc(uc),
INTEL_INFO(i915)->platform, INTEL_REVID(i915));
} }
/** /**
......
...@@ -171,16 +171,18 @@ __uc_fw_override(struct intel_uc_fw *uc_fw) ...@@ -171,16 +171,18 @@ __uc_fw_override(struct intel_uc_fw *uc_fw)
/** /**
* intel_uc_fw_init_early - initialize the uC object and select the firmware * intel_uc_fw_init_early - initialize the uC object and select the firmware
* @i915: device private
* @uc_fw: uC firmware * @uc_fw: uC firmware
* @type: type of uC * @type: type of uC
* @supported: is uC support possible
* @platform: platform identifier
* @rev: hardware revision
* *
* Initialize the state of our uC object and relevant tracking and select the * Initialize the state of our uC object and relevant tracking and select the
* firmware to fetch and load. * firmware to fetch and load.
*/ */
void intel_uc_fw_init_early(struct intel_uc_fw *uc_fw, void intel_uc_fw_init_early(struct intel_uc_fw *uc_fw,
enum intel_uc_fw_type type, enum intel_uc_fw_type type, bool supported,
struct drm_i915_private *i915) enum intel_platform platform, u8 rev)
{ {
/* /*
* we use FIRMWARE_UNINITIALIZED to detect checks against uc_fw->status * we use FIRMWARE_UNINITIALIZED to detect checks against uc_fw->status
...@@ -192,9 +194,8 @@ void intel_uc_fw_init_early(struct intel_uc_fw *uc_fw, ...@@ -192,9 +194,8 @@ void intel_uc_fw_init_early(struct intel_uc_fw *uc_fw,
uc_fw->type = type; uc_fw->type = type;
if (HAS_GT_UC(i915) && likely(!__uc_fw_override(uc_fw))) if (supported && likely(!__uc_fw_override(uc_fw)))
__uc_fw_auto_select(uc_fw, INTEL_INFO(i915)->platform, __uc_fw_auto_select(uc_fw, platform, rev);
INTEL_REVID(i915));
if (uc_fw->path && *uc_fw->path) if (uc_fw->path && *uc_fw->path)
uc_fw->status = INTEL_UC_FIRMWARE_SELECTED; uc_fw->status = INTEL_UC_FIRMWARE_SELECTED;
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <linux/types.h> #include <linux/types.h>
#include "intel_uc_fw_abi.h" #include "intel_uc_fw_abi.h"
#include "intel_device_info.h"
#include "i915_gem.h" #include "i915_gem.h"
struct drm_printer; struct drm_printer;
...@@ -170,8 +171,8 @@ static inline u32 intel_uc_fw_get_upload_size(struct intel_uc_fw *uc_fw) ...@@ -170,8 +171,8 @@ static inline u32 intel_uc_fw_get_upload_size(struct intel_uc_fw *uc_fw)
} }
void intel_uc_fw_init_early(struct intel_uc_fw *uc_fw, void intel_uc_fw_init_early(struct intel_uc_fw *uc_fw,
enum intel_uc_fw_type type, enum intel_uc_fw_type type, bool supported,
struct drm_i915_private *i915); enum intel_platform platform, u8 rev);
void intel_uc_fw_fetch(struct intel_uc_fw *uc_fw, void intel_uc_fw_fetch(struct intel_uc_fw *uc_fw,
struct drm_i915_private *i915); struct drm_i915_private *i915);
void intel_uc_fw_cleanup_fetch(struct intel_uc_fw *uc_fw); void intel_uc_fw_cleanup_fetch(struct intel_uc_fw *uc_fw);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment