diff mbox

[v8,7/8] drm/i915/guc: Disable GuC submission and suspend it prior to i915 reset

Message ID 1506432285-14979-7-git-send-email-sagar.a.kamble@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

sagar.a.kamble@intel.com Sept. 26, 2017, 1:24 p.m. UTC
Before i915 reset, we need to disable GuC submission and suspend GuC
operations as it is recreated during intel_uc_init_hw. We can't reuse the
intel_uc_suspend functionality as reset path already holds struct_mutex.

v2: Rebase w.r.t removal of GuC code restructuring. Updated reset_prepare
function as struct_mutex is not needed.

v3: Fixed typo in commit message. Made return from intel_uc_reset_prepare
simpler. (Michal)
Rebase w.r.t i915_modparams change.

Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: MichaƂ Winiarski <michal.winiarski@intel.com>
Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Signed-off-by: Sagar Arun Kamble <sagar.a.kamble@intel.com>
---
 drivers/gpu/drm/i915/i915_gem.c | 2 ++
 drivers/gpu/drm/i915/intel_uc.c | 8 ++++++++
 drivers/gpu/drm/i915/intel_uc.h | 1 +
 3 files changed, 11 insertions(+)

Comments

Chris Wilson Sept. 26, 2017, 1:52 p.m. UTC | #1
Quoting Sagar Arun Kamble (2017-09-26 14:24:44)
> diff --git a/drivers/gpu/drm/i915/intel_uc.c b/drivers/gpu/drm/i915/intel_uc.c
> index d710f0d..aec3f6b 100644
> --- a/drivers/gpu/drm/i915/intel_uc.c
> +++ b/drivers/gpu/drm/i915/intel_uc.c
> @@ -562,6 +562,14 @@ int intel_uc_resume(struct drm_i915_private *dev_priv)
>         return 0;
>  }
>  
> +int intel_uc_reset_prepare(struct drm_i915_private *dev_priv)
> +{
> +       if (i915_modparams.enable_guc_submission)
> +               i915_guc_submission_disable(dev_priv);

General rule of thumb is that in disable we want to check some dependent
state setup by enable, not a user parameter.
-Chris
sagar.a.kamble@intel.com Sept. 26, 2017, 2:18 p.m. UTC | #2
On 9/26/2017 7:22 PM, Chris Wilson wrote:
> Quoting Sagar Arun Kamble (2017-09-26 14:24:44)
>> diff --git a/drivers/gpu/drm/i915/intel_uc.c b/drivers/gpu/drm/i915/intel_uc.c
>> index d710f0d..aec3f6b 100644
>> --- a/drivers/gpu/drm/i915/intel_uc.c
>> +++ b/drivers/gpu/drm/i915/intel_uc.c
>> @@ -562,6 +562,14 @@ int intel_uc_resume(struct drm_i915_private *dev_priv)
>>          return 0;
>>   }
>>   
>> +int intel_uc_reset_prepare(struct drm_i915_private *dev_priv)
>> +{
>> +       if (i915_modparams.enable_guc_submission)
>> +               i915_guc_submission_disable(dev_priv);
> General rule of thumb is that in disable we want to check some dependent
> state setup by enable, not a user parameter.
> -Chris
Ok. then will update the disable path to check if execbuf_client is 
setup and call it without checking for modparam.
Thanks.
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 0d9a107..64b278c 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2882,6 +2882,8 @@  int i915_gem_reset_prepare(struct drm_i915_private *dev_priv)
 
 	i915_gem_revoke_fences(dev_priv);
 
+	intel_uc_reset_prepare(dev_priv);
+
 	return err;
 }
 
diff --git a/drivers/gpu/drm/i915/intel_uc.c b/drivers/gpu/drm/i915/intel_uc.c
index d710f0d..aec3f6b 100644
--- a/drivers/gpu/drm/i915/intel_uc.c
+++ b/drivers/gpu/drm/i915/intel_uc.c
@@ -562,6 +562,14 @@  int intel_uc_resume(struct drm_i915_private *dev_priv)
 	return 0;
 }
 
+int intel_uc_reset_prepare(struct drm_i915_private *dev_priv)
+{
+	if (i915_modparams.enable_guc_submission)
+		i915_guc_submission_disable(dev_priv);
+
+	return intel_uc_runtime_suspend(dev_priv);
+}
+
 int intel_guc_send_nop(struct intel_guc *guc, const u32 *action, u32 len)
 {
 	WARN(1, "Unexpected send: action=%#x\n", *action);
diff --git a/drivers/gpu/drm/i915/intel_uc.h b/drivers/gpu/drm/i915/intel_uc.h
index 6163ff9..9b12f3c 100644
--- a/drivers/gpu/drm/i915/intel_uc.h
+++ b/drivers/gpu/drm/i915/intel_uc.h
@@ -212,6 +212,7 @@  struct intel_huc {
 int intel_uc_runtime_resume(struct drm_i915_private *dev_priv);
 int intel_uc_suspend(struct drm_i915_private *dev_priv);
 int intel_uc_resume(struct drm_i915_private *dev_priv);
+int intel_uc_reset_prepare(struct drm_i915_private *dev_priv);
 int intel_guc_sample_forcewake(struct intel_guc *guc);
 void intel_guc_sanitize(struct intel_guc *guc);
 int intel_guc_send_nop(struct intel_guc *guc, const u32 *action, u32 len);