Re: [RFC 02/11] drm/i915: Add intel_energy_uJ

Tvrtko Ursulin
2017-09-15T09:18:21Z

On 14/09/2017 20:49, Chris Wilson wrote:
> Quoting Tvrtko Ursulin (2017-09-11 16:25:50)
>> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
>> index 60461f49936b..ff67df8d99fa 100644
>> --- a/drivers/gpu/drm/i915/intel_pm.c
>> +++ b/drivers/gpu/drm/i915/intel_pm.c
>> @@ -9369,3 +9369,28 @@ u64 intel_rc6_residency_ns(struct drm_i915_private *dev_priv,
>>
>> return res;
>> }
>> +
>> +unsigned long long intel_energy_uJ(struct drm_i915_private *dev_priv)
>> +{
>> + unsigned long long power;
>> + unsigned long units;
>> +
>> + if (GEM_WARN_ON(INTEL_GEN(dev_priv) < 6))
>> + return 0;
>> +
>> + intel_runtime_pm_get(dev_priv);
>
> Same question on lifting the rpm_get to the caller?

Makes sense, will do both.

Regards,

Tvrtko