[Intel-gfx] [PATCH] [intel-gfx] drm/i915/csr Added DC5 and DC6 counter register for ICL in debugfs entry.

Chris Wilson chris at chris-wilson.co.uk
Tue Oct 2 07:20:25 UTC 2018


Quoting Jyoti Yadav (2018-10-02 05:42:27)
> DC5 and DC6 counter register tells about residency of DC5 and DC6.
> These registers are same for SKL and ICL.
> 
> v2 : Remove csr_version check.
>      Added generic check regarding DC counters for  Gen9 onwards. (Rodrigo)
> 
> Signed-off-by: Jyoti Yadav <jyoti.r.yadav at intel.com>
> ---
>  drivers/gpu/drm/i915/i915_debugfs.c | 7 ++++---
>  drivers/gpu/drm/i915/i915_reg.h     | 1 +
>  2 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index a5265c2..bcc1e86 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -2880,11 +2880,13 @@ static int i915_dmc_info(struct seq_file *m, void *unused)
>  {
>         struct drm_i915_private *dev_priv = node_to_i915(m->private);
>         struct intel_csr *csr;
> +       int gen;
>  
>         if (!HAS_CSR(dev_priv))
>                 return -ENODEV;
>  
>         csr = &dev_priv->csr;
> +       gen = INTEL_GEN(dev_priv);
>  
>         intel_runtime_pm_get(dev_priv);
>  
> @@ -2897,13 +2899,12 @@ static int i915_dmc_info(struct seq_file *m, void *unused)
>         seq_printf(m, "version: %d.%d\n", CSR_VERSION_MAJOR(csr->version),
>                    CSR_VERSION_MINOR(csr->version));
>  
> -       if (IS_KABYLAKE(dev_priv) ||
> -           (IS_SKYLAKE(dev_priv) && csr->version >= CSR_VERSION(1, 6))) {
> +       if ((!IS_BROXTON(dev_priv)) && gen >= 9 && gen <= 11) {

IS_GEN(dev_priv, 9, 11)

Though fixing the if-ladder would be a lot simpler.
-Chris


More information about the Intel-gfx mailing list