[Intel-gfx] [PATCH] drm/i915/pmu: Skip sampling engines if gt is asleep

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Wed Dec 18 11:07:18 UTC 2019


On 18/12/2019 00:07, Chris Wilson wrote:
> If the whole GT is asleep, we know that each engine must also be asleep
> and so we can quickly return without checking them all.
> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> ---
>   drivers/gpu/drm/i915/i915_pmu.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c
> index 5f2adfbf85be..00325471be90 100644
> --- a/drivers/gpu/drm/i915/i915_pmu.c
> +++ b/drivers/gpu/drm/i915/i915_pmu.c
> @@ -312,6 +312,9 @@ engines_sample(struct intel_gt *gt, unsigned int period_ns)
>   	if ((i915->pmu.enable & ENGINE_SAMPLE_MASK) == 0)
>   		return;
>   
> +	if (!intel_gt_pm_is_awake(gt))
> +		return;
> +
>   	for_each_engine(engine, gt, id) {
>   		struct intel_engine_pmu *pmu = &engine->pmu;
>   		spinlock_t *mmio_lock;
> 

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>

Regards,

Tvrtko


More information about the Intel-gfx mailing list