[v3,14/15] drm/i915: Taking forcewake during GuC load.

Submitted by yu.dai@intel.com on April 17, 2015, 9:21 p.m.

Details

Message ID 1429305680-4990-15-git-send-email-yu.dai@intel.com
State New
Headers show

Not browsing as part of any series.

Commit Message

yu.dai@intel.com April 17, 2015, 9:21 p.m.
From: Sagar Kamble <sagar.a.kamble@intel.com>

The firmware loader will use GuC DMA engine to move data from
ggtt to WOPCM. Need to take forcewake before GuC loading.

Issue: VIZ-4884
Change-Id: Ie422fc1e122933b161ff63cab23622197e6bba54
Signed-off-by: Sagar Kamble <sagar.a.kamble@intel.com>
---
 drivers/gpu/drm/i915/intel_guc_loader.c | 3 +++
 1 file changed, 3 insertions(+)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/i915/intel_guc_loader.c b/drivers/gpu/drm/i915/intel_guc_loader.c
index d1fd11e..f19eb90 100644
--- a/drivers/gpu/drm/i915/intel_guc_loader.c
+++ b/drivers/gpu/drm/i915/intel_guc_loader.c
@@ -340,6 +340,7 @@  static int guc_load_ucode(struct drm_device *dev)
 	int ret;
 
 	WARN_ON(!mutex_is_locked(&dev->struct_mutex));
+	intel_uncore_forcewake_get(dev_priv, FORCEWAKE_ALL);
 
 	ret = i915_gem_obj_ggtt_pin(guc_fw->uc_fw_obj, 0, 0);
 	if (ret)
@@ -388,6 +389,8 @@  out:
 	if (pinned)
 		i915_gem_object_ggtt_unpin(guc_fw->uc_fw_obj);
 
+	intel_uncore_forcewake_put(dev_priv, FORCEWAKE_ALL);
+
 	return ret;
 }
 

Comments

On 17/04/15 22:21, yu.dai@intel.com wrote:
> From: Sagar Kamble <sagar.a.kamble@intel.com>
> 
> The firmware loader will use GuC DMA engine to move data from
> ggtt to WOPCM. Need to take forcewake before GuC loading.
> 
> Issue: VIZ-4884
> Change-Id: Ie422fc1e122933b161ff63cab23622197e6bba54
> Signed-off-by: Sagar Kamble <sagar.a.kamble@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_guc_loader.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_guc_loader.c b/drivers/gpu/drm/i915/intel_guc_loader.c
> index d1fd11e..f19eb90 100644
> --- a/drivers/gpu/drm/i915/intel_guc_loader.c
> +++ b/drivers/gpu/drm/i915/intel_guc_loader.c
> @@ -340,6 +340,7 @@ static int guc_load_ucode(struct drm_device *dev)
>  	int ret;
>  
>  	WARN_ON(!mutex_is_locked(&dev->struct_mutex));
> +	intel_uncore_forcewake_get(dev_priv, FORCEWAKE_ALL);
>  
>  	ret = i915_gem_obj_ggtt_pin(guc_fw->uc_fw_obj, 0, 0);
>  	if (ret)
> @@ -388,6 +389,8 @@ out:
>  	if (pinned)
>  		i915_gem_object_ggtt_unpin(guc_fw->uc_fw_obj);
>  
> +	intel_uncore_forcewake_put(dev_priv, FORCEWAKE_ALL);
> +
>  	return ret;
>  }

This doesn't need to be a separate patch; it can be squashed into the
initial creation of the GuC loader, so we don't (even temporarily)  have
a broken version in the codebase.

We keep the authorship, of course :) And maybe turn the commit message
into a code comment in the affected function?

.Dave.