All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm/i915: Track the number of times we have woken the GPU up
Date: Wed, 24 Jan 2018 10:33:29 +0000	[thread overview]
Message-ID: <86ff1d11-ce02-6e28-f00c-ca65f76b4132@linux.intel.com> (raw)
In-Reply-To: <20180119152356.17025-1-chris@chris-wilson.co.uk>


On 19/01/2018 15:23, Chris Wilson wrote:
> By counting the number of times we have woken up, we have a very simple
> means of defining an epoch, which will come in handy if we want to
> perform deferred tasks at the end of an epoch (i.e. while we are going
> to sleep) without imposing on the next activity cycle.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>   drivers/gpu/drm/i915/i915_debugfs.c     | 7 ++++---
>   drivers/gpu/drm/i915/i915_drv.h         | 5 +++++
>   drivers/gpu/drm/i915/i915_gem_request.c | 1 +
>   3 files changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index cc659b4b2a45..1aac3ec7d14d 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -2717,7 +2717,8 @@ static int i915_runtime_pm_status(struct seq_file *m, void *unused)
>   	if (!HAS_RUNTIME_PM(dev_priv))
>   		seq_puts(m, "Runtime power management not supported\n");
>   
> -	seq_printf(m, "GPU idle: %s\n", yesno(!dev_priv->gt.awake));
> +	seq_printf(m, "GPU idle: %s (epoch %d)\n",
> +		   yesno(!dev_priv->gt.awake), dev_priv->gt.epoch);
>   	seq_printf(m, "IRQs disabled: %s\n",
>   		   yesno(!intel_irqs_enabled(dev_priv)));
>   #ifdef CONFIG_PM
> @@ -3150,8 +3151,8 @@ static int i915_engine_info(struct seq_file *m, void *unused)
>   
>   	intel_runtime_pm_get(dev_priv);
>   
> -	seq_printf(m, "GT awake? %s\n",
> -		   yesno(dev_priv->gt.awake));
> +	seq_printf(m, "GT awake? %s (epoch %d)\n",
> +		   yesno(dev_priv->gt.awake), dev_priv->gt.epoch);
>   	seq_printf(m, "Global active requests: %d\n",
>   		   dev_priv->gt.active_requests);
>   	seq_printf(m, "CS timestamp frequency: %u kHz\n",
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 317953484fec..98e8385d1bb0 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -2302,6 +2302,11 @@ struct drm_i915_private {
>   		struct i915_gem_timeline global_timeline;
>   		u32 active_requests;
>   
> +		/**
> +		 * The number of times we have woken up.
> +		 */
> +		u32 epoch;
> +
>   		/**
>   		 * Is the GPU currently considered idle, or busy executing
>   		 * userspace requests? Whilst idle, we allow runtime power
> diff --git a/drivers/gpu/drm/i915/i915_gem_request.c b/drivers/gpu/drm/i915/i915_gem_request.c
> index a0f451b4a4e8..f0fab070a3a0 100644
> --- a/drivers/gpu/drm/i915/i915_gem_request.c
> +++ b/drivers/gpu/drm/i915/i915_gem_request.c
> @@ -274,6 +274,7 @@ static void mark_busy(struct drm_i915_private *i915)
>   	intel_display_power_get(i915, POWER_DOMAIN_GT_IRQ);
>   
>   	i915->gt.awake = true;
> +	i915->gt.epoch++;
>   
>   	intel_enable_gt_powersave(i915);
>   	i915_update_gfx_val(i915);
> 

I'd be tempted to use a standard type like unsigned int where explicit 
width is not needed but it's minor.

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

Regards,

Tvrtko

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2018-01-24 10:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-19 15:23 [PATCH 1/2] drm/i915: Track the number of times we have woken the GPU up Chris Wilson
2018-01-19 15:23 ` [PATCH 2/2] drm/i915: Shrink the GEM kmem_caches upon idling Chris Wilson
2018-01-24 10:32   ` Tvrtko Ursulin
2018-01-24 10:37     ` Chris Wilson
2018-01-24 11:06       ` Tvrtko Ursulin
2018-01-19 16:13 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Track the number of times we have woken the GPU up Patchwork
2018-01-19 21:56 ` ✗ Fi.CI.IGT: failure " Patchwork
2018-01-24 10:33 ` Tvrtko Ursulin [this message]
2018-01-24 10:42   ` [PATCH 1/2] " Chris Wilson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86ff1d11-ce02-6e28-f00c-ca65f76b4132@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.