[Intel-gfx] [PATCH] drm/i915/guc: Skip suspend/resume GuC action on platforms w/o GuC submission

Tomas Janousek tomi at nomi.cz
Wed Oct 30 07:25:40 UTC 2019


On Tue, Oct 29, 2019 at 01:33:22PM +0100, Michal Wajdeczko wrote:
> On Mon, 28 Oct 2019 22:25:27 +0100, <don.hiatt at intel.com> wrote:
> > +	 * we do not need to suspend the GuC but we do need to disable the
> > +	 * GuC communication on suspend.
> > +	 */
> > +	if (!guc->submission_supported)
> 
> Using submission_supported flag directly can be tricky, as today it
> is always set to false, but in the future it may indicate either that
> submission is supported by the driver/fw and/or enabled by modparam.
> 
> There is no guarantee that it will reflect actual runtime status,
> as even supported/unblocked guc submission may fallback to execlists.
> 
> We may need something like intel_guc_submission_is_active() that will
> reflect actual mode of submission currently used by the driver.

What about this:

diff --git a/drivers/gpu/drm/i915/intel_uc.c b/drivers/gpu/drm/i915/intel_uc.c
index ae45651ac73c..acda38a9fec5 100644
--- a/drivers/gpu/drm/i915/intel_uc.c
+++ b/drivers/gpu/drm/i915/intel_uc.c
@@ -522,10 +522,19 @@ void intel_uc_runtime_suspend(struct drm_i915_private *i915)
 	if (!intel_guc_is_loaded(guc))
 		return;
 
+	/*
+	 * If GuC communication is enabled but submission is not supported,
+	 * we do not need to suspend the GuC but we do need to disable the
+	 * GuC communication on suspend.
+	 */
+	if (!USES_GUC_SUBMISSION(i915))
+		goto guc_disable_comm;
+
 	err = intel_guc_suspend(guc);
 	if (err)
 		DRM_DEBUG_DRIVER("Failed to suspend GuC, err=%d", err);
 
+guc_disable_comm:
 	guc_disable_communication(guc);
 }
 
@@ -551,6 +560,14 @@ int intel_uc_resume(struct drm_i915_private *i915)
 
 	guc_enable_communication(guc);
 
+	/*
+	 * If GuC communication is enabled but submission is not supported,
+	 * we do not need to resume the GuC but we do need to enable the
+	 * GuC communication on resume (above).
+	 */
+	if (!USES_GUC_SUBMISSION(i915))
+		return 0;
+
 	err = intel_guc_resume(guc);
 	if (err) {
 		DRM_DEBUG_DRIVER("Failed to resume GuC, err=%d", err);

This is what the backport to stable-5.3 will look like anyway as there's no
submission_supported there. The name "USES_GUC_SUBMISSION" does suggest it
might reflect actual runtime status... :-)

-- 
Tomáš Janoušek, a.k.a. Pivník, a.k.a. Liskni_si, http://work.lisk.in/


More information about the Intel-gfx mailing list