@@ -181,3 +181,24 @@ void intel_guc_auth_huc(struct intel_guc *guc, struct intel_huc *huc)
out:
i915_vma_unpin(vma);
}
+
+int intel_guc_enable_communication(struct intel_guc *guc)
+{
+ struct drm_i915_private *dev_priv = guc_to_i915(guc);
+
+ if (HAS_GUC_CT(dev_priv))
+ return intel_guc_enable_ct(guc);
+
+ guc->send = intel_guc_send_mmio;
+ return 0;
+}
+
+void intel_guc_disable_communication(struct intel_guc *guc)
+{
+ struct drm_i915_private *dev_priv = guc_to_i915(guc);
+
+ if (HAS_GUC_CT(dev_priv))
+ intel_guc_disable_ct(guc);
+
+ guc->send = intel_guc_send_nop;
+}
@@ -148,6 +148,8 @@ static inline u32 guc_ggtt_offset(struct i915_vma *vma)
int intel_guc_send_nop(struct intel_guc *guc, const u32 *action, u32 len);
int intel_guc_send_mmio(struct intel_guc *guc, const u32 *action, u32 len);
void intel_guc_auth_huc(struct intel_guc *guc, struct intel_huc *huc);
+int intel_guc_enable_communication(struct intel_guc *guc);
+void intel_guc_disable_communication(struct intel_guc *guc);
/* intel_guc_loader.c */
int intel_guc_select_fw(struct intel_guc *guc);
@@ -265,27 +265,6 @@ static void guc_free_load_err_log(struct intel_guc *guc)
i915_gem_object_put(guc->load_err_log);
}
-static int guc_enable_communication(struct intel_guc *guc)
-{
- struct drm_i915_private *dev_priv = guc_to_i915(guc);
-
- if (HAS_GUC_CT(dev_priv))
- return intel_guc_enable_ct(guc);
-
- guc->send = intel_guc_send_mmio;
- return 0;
-}
-
-static void guc_disable_communication(struct intel_guc *guc)
-{
- struct drm_i915_private *dev_priv = guc_to_i915(guc);
-
- if (HAS_GUC_CT(dev_priv))
- intel_guc_disable_ct(guc);
-
- guc->send = intel_guc_send_nop;
-}
-
int intel_uc_init_hw(struct drm_i915_private *dev_priv)
{
struct intel_guc *guc = &dev_priv->guc;
@@ -295,7 +274,7 @@ int intel_uc_init_hw(struct drm_i915_private *dev_priv)
if (!i915.enable_guc_loading)
return 0;
- guc_disable_communication(guc);
+ intel_guc_disable_communication(guc);
gen9_reset_guc_interrupts(dev_priv);
/* We need to notify the guc whenever we change the GGTT */
@@ -347,7 +326,7 @@ int intel_uc_init_hw(struct drm_i915_private *dev_priv)
intel_guc_init_send_regs(guc);
- ret = guc_enable_communication(guc);
+ ret = intel_guc_enable_communication(guc);
if (ret)
goto err_log_capture;
@@ -373,7 +352,7 @@ int intel_uc_init_hw(struct drm_i915_private *dev_priv)
* marks the GPU as wedged until reset).
*/
err_interrupts:
- guc_disable_communication(guc);
+ intel_guc_disable_communication(guc);
gen9_disable_guc_interrupts(dev_priv);
err_log_capture:
guc_capture_load_err_log(guc);
@@ -410,7 +389,7 @@ void intel_uc_fini_hw(struct drm_i915_private *dev_priv)
if (i915.enable_guc_submission)
i915_guc_submission_disable(dev_priv);
- guc_disable_communication(&dev_priv->guc);
+ intel_guc_disable_communication(&dev_priv->guc);
if (i915.enable_guc_submission) {
gen9_disable_guc_interrupts(dev_priv);