diff mbox

[2/4] drm/i915: Extract a intel_power_well_disable() function

Message ID 1438291229-7541-3-git-send-email-paulo.r.zanoni@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Zanoni, Paulo R July 30, 2015, 9:20 p.m. UTC
From: Damien Lespiau <damien.lespiau@intel.com>

Similar to the ->enable vfunc in commit:

  commit 865720564389b2b19cf58e41ed31701e5f464b9d
  Author: Damien Lespiau <damien.lespiau@intel.com>
  Date:   Wed Jun 3 14:27:05 2015 +0100

      drm/i915: Extract a intel_power_well_enable() function

v2 (from Paulo):
  - Same s/i915_/intel_/ bikeshed as the previous patch.
  - Update the commit hash.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
 drivers/gpu/drm/i915/intel_runtime_pm.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

Comments

Jani Nikula July 31, 2015, 9:24 a.m. UTC | #1
On Fri, 31 Jul 2015, Paulo Zanoni <paulo.r.zanoni@intel.com> wrote:
> From: Damien Lespiau <damien.lespiau@intel.com>
>
> Similar to the ->enable vfunc in commit:
>
>   commit 865720564389b2b19cf58e41ed31701e5f464b9d

That sha won't be the same once it gets applied. Maybe just squash these
two patches into one?

BR,
Jani.

>   Author: Damien Lespiau <damien.lespiau@intel.com>
>   Date:   Wed Jun 3 14:27:05 2015 +0100
>
>       drm/i915: Extract a intel_power_well_enable() function
>
> v2 (from Paulo):
>   - Same s/i915_/intel_/ bikeshed as the previous patch.
>   - Update the commit hash.
>
> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_runtime_pm.c | 15 ++++++++++-----
>  1 file changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
> index a52574d..821644d 100644
> --- a/drivers/gpu/drm/i915/intel_runtime_pm.c
> +++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
> @@ -76,6 +76,14 @@ static void intel_power_well_enable(struct drm_i915_private *dev_priv,
>  	power_well->hw_enabled = true;
>  }
>  
> +static void intel_power_well_disable(struct drm_i915_private *dev_priv,
> +				     struct i915_power_well *power_well)
> +{
> +	DRM_DEBUG_KMS("disabling %s\n", power_well->name);
> +	power_well->hw_enabled = false;
> +	power_well->ops->disable(dev_priv, power_well);
> +}
> +
>  /*
>   * We should only use the power well if we explicitly asked the hardware to
>   * enable it, so check if it's enabled and also check if we've requested it to
> @@ -1147,11 +1155,8 @@ void intel_display_power_put(struct drm_i915_private *dev_priv,
>  	for_each_power_well_rev(i, power_well, BIT(domain), power_domains) {
>  		WARN_ON(!power_well->count);
>  
> -		if (!--power_well->count && i915.disable_power_well) {
> -			DRM_DEBUG_KMS("disabling %s\n", power_well->name);
> -			power_well->hw_enabled = false;
> -			power_well->ops->disable(dev_priv, power_well);
> -		}
> +		if (!--power_well->count && i915.disable_power_well)
> +			intel_power_well_disable(dev_priv, power_well);
>  	}
>  
>  	mutex_unlock(&power_domains->lock);
> -- 
> 2.4.6
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Paulo Zanoni July 31, 2015, 3:19 p.m. UTC | #2
2015-07-31 6:24 GMT-03:00 Jani Nikula <jani.nikula@linux.intel.com>:
> On Fri, 31 Jul 2015, Paulo Zanoni <paulo.r.zanoni@intel.com> wrote:
>> From: Damien Lespiau <damien.lespiau@intel.com>
>>
>> Similar to the ->enable vfunc in commit:
>>
>>   commit 865720564389b2b19cf58e41ed31701e5f464b9d
>
> That sha won't be the same once it gets applied. Maybe just squash these
> two patches into one?

Or just ask the maintainers to remove that specific line containing
the sha while applying the patch since the commit title is already
listed and that won't change :)
</lazy_mode>

>
> BR,
> Jani.
>
>>   Author: Damien Lespiau <damien.lespiau@intel.com>
>>   Date:   Wed Jun 3 14:27:05 2015 +0100
>>
>>       drm/i915: Extract a intel_power_well_enable() function
>>
>> v2 (from Paulo):
>>   - Same s/i915_/intel_/ bikeshed as the previous patch.
>>   - Update the commit hash.
>>
>> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
>> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
>> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
>> ---
>>  drivers/gpu/drm/i915/intel_runtime_pm.c | 15 ++++++++++-----
>>  1 file changed, 10 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
>> index a52574d..821644d 100644
>> --- a/drivers/gpu/drm/i915/intel_runtime_pm.c
>> +++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
>> @@ -76,6 +76,14 @@ static void intel_power_well_enable(struct drm_i915_private *dev_priv,
>>       power_well->hw_enabled = true;
>>  }
>>
>> +static void intel_power_well_disable(struct drm_i915_private *dev_priv,
>> +                                  struct i915_power_well *power_well)
>> +{
>> +     DRM_DEBUG_KMS("disabling %s\n", power_well->name);
>> +     power_well->hw_enabled = false;
>> +     power_well->ops->disable(dev_priv, power_well);
>> +}
>> +
>>  /*
>>   * We should only use the power well if we explicitly asked the hardware to
>>   * enable it, so check if it's enabled and also check if we've requested it to
>> @@ -1147,11 +1155,8 @@ void intel_display_power_put(struct drm_i915_private *dev_priv,
>>       for_each_power_well_rev(i, power_well, BIT(domain), power_domains) {
>>               WARN_ON(!power_well->count);
>>
>> -             if (!--power_well->count && i915.disable_power_well) {
>> -                     DRM_DEBUG_KMS("disabling %s\n", power_well->name);
>> -                     power_well->hw_enabled = false;
>> -                     power_well->ops->disable(dev_priv, power_well);
>> -             }
>> +             if (!--power_well->count && i915.disable_power_well)
>> +                     intel_power_well_disable(dev_priv, power_well);
>>       }
>>
>>       mutex_unlock(&power_domains->lock);
>> --
>> 2.4.6
>>
>> _______________________________________________
>> Intel-gfx mailing list
>> Intel-gfx@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
> --
> Jani Nikula, Intel Open Source Technology Center
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
index a52574d..821644d 100644
--- a/drivers/gpu/drm/i915/intel_runtime_pm.c
+++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
@@ -76,6 +76,14 @@  static void intel_power_well_enable(struct drm_i915_private *dev_priv,
 	power_well->hw_enabled = true;
 }
 
+static void intel_power_well_disable(struct drm_i915_private *dev_priv,
+				     struct i915_power_well *power_well)
+{
+	DRM_DEBUG_KMS("disabling %s\n", power_well->name);
+	power_well->hw_enabled = false;
+	power_well->ops->disable(dev_priv, power_well);
+}
+
 /*
  * We should only use the power well if we explicitly asked the hardware to
  * enable it, so check if it's enabled and also check if we've requested it to
@@ -1147,11 +1155,8 @@  void intel_display_power_put(struct drm_i915_private *dev_priv,
 	for_each_power_well_rev(i, power_well, BIT(domain), power_domains) {
 		WARN_ON(!power_well->count);
 
-		if (!--power_well->count && i915.disable_power_well) {
-			DRM_DEBUG_KMS("disabling %s\n", power_well->name);
-			power_well->hw_enabled = false;
-			power_well->ops->disable(dev_priv, power_well);
-		}
+		if (!--power_well->count && i915.disable_power_well)
+			intel_power_well_disable(dev_priv, power_well);
 	}
 
 	mutex_unlock(&power_domains->lock);