diff mbox series

[01/21] drm/i915/guc: Update GuC power domain states

Message ID 20180829191056.63760-2-michal.wajdeczko@intel.com (mailing list archive)
State New, archived
Headers show
Series New GuC ABI | expand

Commit Message

Michal Wajdeczko Aug. 29, 2018, 7:10 p.m. UTC
We should update GuC power domain states also when GuC submission
is disabled, otherwise GuC might complain or ignore our requests.
This seems to be required for all currently released GuC firmwares.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: John Spotswood <john.a.spotswood@intel.com>
Cc: Anusha Srivatsa <anusha.srivatsa@intel.com>
Cc: Tomasz Lis <tomasz.lis@intel.com>
---
 drivers/gpu/drm/i915/intel_uc.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Daniele Ceraolo Spurio Aug. 29, 2018, 8:57 p.m. UTC | #1
On 29/08/18 12:10, Michal Wajdeczko wrote:
> We should update GuC power domain states also when GuC submission
> is disabled, otherwise GuC might complain or ignore our requests.
> This seems to be required for all currently released GuC firmwares.
> 
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: John Spotswood <john.a.spotswood@intel.com>
> Cc: Anusha Srivatsa <anusha.srivatsa@intel.com>
> Cc: Tomasz Lis <tomasz.lis@intel.com>
> ---
>   drivers/gpu/drm/i915/intel_uc.c | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_uc.c b/drivers/gpu/drm/i915/intel_uc.c
> index 7c95697..7a3a4ca 100644
> --- a/drivers/gpu/drm/i915/intel_uc.c
> +++ b/drivers/gpu/drm/i915/intel_uc.c
> @@ -401,6 +401,10 @@ int intel_uc_init_hw(struct drm_i915_private *i915)
>   		ret = intel_guc_submission_enable(guc);
>   		if (ret)
>   			goto err_communication;
> +	} else {
> +		ret = intel_guc_sample_forcewake(guc);
> +		if (ret)
> +			goto err_communication;
>   	}

We can just pull this out of intel_guc_submission_enable and call it 
unconditionally instead of having the if here. Even better, we should 
only call this when we write to GEN9_PG_ENABLE and pass the value we're 
writing instead of re-calculating it inside the function, but that's a 
job for another time I guess.

Daniele

>   
>   	dev_info(i915->drm.dev, "GuC firmware version %u.%u\n",
>
Michal Wajdeczko Aug. 29, 2018, 10:43 p.m. UTC | #2
On Wed, 29 Aug 2018 22:57:54 +0200, Daniele Ceraolo Spurio  
<daniele.ceraolospurio@intel.com> wrote:

>
>
> On 29/08/18 12:10, Michal Wajdeczko wrote:
>> We should update GuC power domain states also when GuC submission
>> is disabled, otherwise GuC might complain or ignore our requests.
>> This seems to be required for all currently released GuC firmwares.
>>  Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
>> Cc: John Spotswood <john.a.spotswood@intel.com>
>> Cc: Anusha Srivatsa <anusha.srivatsa@intel.com>
>> Cc: Tomasz Lis <tomasz.lis@intel.com>
>> ---
>>   drivers/gpu/drm/i915/intel_uc.c | 4 ++++
>>   1 file changed, 4 insertions(+)
>>  diff --git a/drivers/gpu/drm/i915/intel_uc.c  
>> b/drivers/gpu/drm/i915/intel_uc.c
>> index 7c95697..7a3a4ca 100644
>> --- a/drivers/gpu/drm/i915/intel_uc.c
>> +++ b/drivers/gpu/drm/i915/intel_uc.c
>> @@ -401,6 +401,10 @@ int intel_uc_init_hw(struct drm_i915_private *i915)
>>   		ret = intel_guc_submission_enable(guc);
>>   		if (ret)
>>   			goto err_communication;
>> +	} else {
>> +		ret = intel_guc_sample_forcewake(guc);
>> +		if (ret)
>> +			goto err_communication;
>>   	}
>
> We can just pull this out of intel_guc_submission_enable and call it  
> unconditionally instead of having the if here.

I was considering this, but decided to call it separately as it is very
likely that it will be no longer required for never fw releases, so it
will be easier to revert.

Michal
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/intel_uc.c b/drivers/gpu/drm/i915/intel_uc.c
index 7c95697..7a3a4ca 100644
--- a/drivers/gpu/drm/i915/intel_uc.c
+++ b/drivers/gpu/drm/i915/intel_uc.c
@@ -401,6 +401,10 @@  int intel_uc_init_hw(struct drm_i915_private *i915)
 		ret = intel_guc_submission_enable(guc);
 		if (ret)
 			goto err_communication;
+	} else {
+		ret = intel_guc_sample_forcewake(guc);
+		if (ret)
+			goto err_communication;
 	}
 
 	dev_info(i915->drm.dev, "GuC firmware version %u.%u\n",