Commit e3f503f1 authored by Daniele Ceraolo Spurio's avatar Daniele Ceraolo Spurio Committed by Chris Wilson

drm/i915/uc: replace uc init/fini misc

The "misc" terminology doesn't clearly explain what we intend to cover
in this phase. The only thing we used ot do in there apart from FW fetch
was initializing the log workqueue, with the latter being required only in
the very rare case where we enable the log relay. As we no longer create
our own workqueue, piggybacking on the system_highpri_wq instead, we can
rename the function to clarify that they only fetch/release the blobs.

v2: only create log wq when needed (Michal), reword commit msg
accordingly
v3: after rebase the wq is gone, reword commit msg accordingly
Signed-off-by: default avatarDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarMichal Wajdeczko <michal.wajdeczko@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190713100016.8026-2-chris@chris-wilson.co.ukSigned-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
parent a30eff49
...@@ -1433,13 +1433,11 @@ int i915_gem_init(struct drm_i915_private *dev_priv) ...@@ -1433,13 +1433,11 @@ int i915_gem_init(struct drm_i915_private *dev_priv)
if (ret) if (ret)
return ret; return ret;
ret = intel_uc_init_misc(dev_priv); intel_uc_fetch_firmwares(dev_priv);
if (ret)
return ret;
ret = intel_wopcm_init(&dev_priv->wopcm); ret = intel_wopcm_init(&dev_priv->wopcm);
if (ret) if (ret)
goto err_uc_misc; goto err_uc_fw;
/* This is just a security blanket to placate dragons. /* This is just a security blanket to placate dragons.
* On some systems, we very sporadically observe that the first TLBs * On some systems, we very sporadically observe that the first TLBs
...@@ -1565,8 +1563,8 @@ int i915_gem_init(struct drm_i915_private *dev_priv) ...@@ -1565,8 +1563,8 @@ int i915_gem_init(struct drm_i915_private *dev_priv)
intel_uncore_forcewake_put(&dev_priv->uncore, FORCEWAKE_ALL); intel_uncore_forcewake_put(&dev_priv->uncore, FORCEWAKE_ALL);
mutex_unlock(&dev_priv->drm.struct_mutex); mutex_unlock(&dev_priv->drm.struct_mutex);
err_uc_misc: err_uc_fw:
intel_uc_fini_misc(dev_priv); intel_uc_cleanup_firmwares(dev_priv);
if (ret != -EIO) { if (ret != -EIO) {
i915_gem_cleanup_userptr(dev_priv); i915_gem_cleanup_userptr(dev_priv);
...@@ -1632,7 +1630,7 @@ void i915_gem_driver_release(struct drm_i915_private *dev_priv) ...@@ -1632,7 +1630,7 @@ void i915_gem_driver_release(struct drm_i915_private *dev_priv)
intel_cleanup_gt_powersave(dev_priv); intel_cleanup_gt_powersave(dev_priv);
intel_uc_fini_misc(dev_priv); intel_uc_cleanup_firmwares(dev_priv);
i915_gem_cleanup_userptr(dev_priv); i915_gem_cleanup_userptr(dev_priv);
intel_timelines_fini(dev_priv); intel_timelines_fini(dev_priv);
......
...@@ -99,20 +99,6 @@ void intel_guc_init_early(struct intel_guc *guc) ...@@ -99,20 +99,6 @@ void intel_guc_init_early(struct intel_guc *guc)
} }
} }
int intel_guc_init_misc(struct intel_guc *guc)
{
struct drm_i915_private *i915 = guc_to_i915(guc);
intel_uc_fw_fetch(i915, &guc->fw);
return 0;
}
void intel_guc_fini_misc(struct intel_guc *guc)
{
intel_uc_fw_cleanup_fetch(&guc->fw);
}
static int guc_shared_data_create(struct intel_guc *guc) static int guc_shared_data_create(struct intel_guc *guc)
{ {
struct i915_vma *vma; struct i915_vma *vma;
......
...@@ -153,10 +153,8 @@ static inline u32 intel_guc_ggtt_offset(struct intel_guc *guc, ...@@ -153,10 +153,8 @@ static inline u32 intel_guc_ggtt_offset(struct intel_guc *guc,
void intel_guc_init_early(struct intel_guc *guc); void intel_guc_init_early(struct intel_guc *guc);
void intel_guc_init_send_regs(struct intel_guc *guc); void intel_guc_init_send_regs(struct intel_guc *guc);
void intel_guc_init_params(struct intel_guc *guc); void intel_guc_init_params(struct intel_guc *guc);
int intel_guc_init_misc(struct intel_guc *guc);
int intel_guc_init(struct intel_guc *guc); int intel_guc_init(struct intel_guc *guc);
void intel_guc_fini(struct intel_guc *guc); void intel_guc_fini(struct intel_guc *guc);
void intel_guc_fini_misc(struct intel_guc *guc);
int intel_guc_send_nop(struct intel_guc *guc, const u32 *action, u32 len, int intel_guc_send_nop(struct intel_guc *guc, const u32 *action, u32 len,
u32 *response_buf, u32 response_buf_size); u32 *response_buf, u32 response_buf_size);
int intel_guc_send_mmio(struct intel_guc *guc, const u32 *action, u32 len, int intel_guc_send_mmio(struct intel_guc *guc, const u32 *action, u32 len,
......
...@@ -44,14 +44,6 @@ void intel_huc_init_early(struct intel_huc *huc) ...@@ -44,14 +44,6 @@ void intel_huc_init_early(struct intel_huc *huc)
} }
} }
int intel_huc_init_misc(struct intel_huc *huc)
{
struct drm_i915_private *i915 = huc_to_i915(huc);
intel_uc_fw_fetch(i915, &huc->fw);
return 0;
}
static int intel_huc_rsa_data_create(struct intel_huc *huc) static int intel_huc_rsa_data_create(struct intel_huc *huc)
{ {
struct drm_i915_private *i915 = huc_to_i915(huc); struct drm_i915_private *i915 = huc_to_i915(huc);
......
...@@ -45,17 +45,11 @@ struct intel_huc { ...@@ -45,17 +45,11 @@ struct intel_huc {
}; };
void intel_huc_init_early(struct intel_huc *huc); void intel_huc_init_early(struct intel_huc *huc);
int intel_huc_init_misc(struct intel_huc *huc);
int intel_huc_init(struct intel_huc *huc); int intel_huc_init(struct intel_huc *huc);
void intel_huc_fini(struct intel_huc *huc); void intel_huc_fini(struct intel_huc *huc);
int intel_huc_auth(struct intel_huc *huc); int intel_huc_auth(struct intel_huc *huc);
int intel_huc_check_status(struct intel_huc *huc); int intel_huc_check_status(struct intel_huc *huc);
static inline void intel_huc_fini_misc(struct intel_huc *huc)
{
intel_uc_fw_cleanup_fetch(&huc->fw);
}
static inline int intel_huc_sanitize(struct intel_huc *huc) static inline int intel_huc_sanitize(struct intel_huc *huc)
{ {
intel_uc_fw_sanitize(&huc->fw); intel_uc_fw_sanitize(&huc->fw);
......
...@@ -349,44 +349,26 @@ static void guc_disable_communication(struct intel_guc *guc) ...@@ -349,44 +349,26 @@ static void guc_disable_communication(struct intel_guc *guc)
DRM_INFO("GuC communication disabled\n"); DRM_INFO("GuC communication disabled\n");
} }
int intel_uc_init_misc(struct drm_i915_private *i915) void intel_uc_fetch_firmwares(struct drm_i915_private *i915)
{ {
struct intel_guc *guc = &i915->guc;
struct intel_huc *huc = &i915->huc;
int ret;
if (!USES_GUC(i915)) if (!USES_GUC(i915))
return 0; return;
ret = intel_guc_init_misc(guc);
if (ret)
return ret;
if (USES_HUC(i915)) {
ret = intel_huc_init_misc(huc);
if (ret)
goto err_guc;
}
return 0; intel_uc_fw_fetch(i915, &i915->guc.fw);
err_guc: if (USES_HUC(i915))
intel_guc_fini_misc(guc); intel_uc_fw_fetch(i915, &i915->huc.fw);
return ret;
} }
void intel_uc_fini_misc(struct drm_i915_private *i915) void intel_uc_cleanup_firmwares(struct drm_i915_private *i915)
{ {
struct intel_guc *guc = &i915->guc;
struct intel_huc *huc = &i915->huc;
if (!USES_GUC(i915)) if (!USES_GUC(i915))
return; return;
if (USES_HUC(i915)) if (USES_HUC(i915))
intel_huc_fini_misc(huc); intel_uc_fw_cleanup_fetch(&i915->huc.fw);
intel_guc_fini_misc(guc); intel_uc_fw_cleanup_fetch(&i915->guc.fw);
} }
int intel_uc_init(struct drm_i915_private *i915) int intel_uc_init(struct drm_i915_private *i915)
......
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
void intel_uc_init_early(struct drm_i915_private *dev_priv); void intel_uc_init_early(struct drm_i915_private *dev_priv);
void intel_uc_cleanup_early(struct drm_i915_private *dev_priv); void intel_uc_cleanup_early(struct drm_i915_private *dev_priv);
void intel_uc_init_mmio(struct drm_i915_private *dev_priv); void intel_uc_init_mmio(struct drm_i915_private *dev_priv);
int intel_uc_init_misc(struct drm_i915_private *dev_priv); void intel_uc_fetch_firmwares(struct drm_i915_private *dev_priv);
void intel_uc_fini_misc(struct drm_i915_private *dev_priv); void intel_uc_cleanup_firmwares(struct drm_i915_private *dev_priv);
void intel_uc_sanitize(struct drm_i915_private *dev_priv); void intel_uc_sanitize(struct drm_i915_private *dev_priv);
int intel_uc_init_hw(struct drm_i915_private *dev_priv); int intel_uc_init_hw(struct drm_i915_private *dev_priv);
void intel_uc_fini_hw(struct drm_i915_private *dev_priv); void intel_uc_fini_hw(struct drm_i915_private *dev_priv);
......
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