drm/i915: do not read swizzle info if unavailable
diff mbox series

Message ID 20200701183626.2450-1-lucas.demarchi@intel.com
State New
Headers show
Series
  • drm/i915: do not read swizzle info if unavailable
Related show

Commit Message

Lucas De Marchi July 1, 2020, 6:36 p.m. UTC
Since gen8 we don't use swizzle anymore. Don't dump registers related to
it: registers may or may not be there.

Cc: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
 drivers/gpu/drm/i915/i915_debugfs.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Chris Wilson July 1, 2020, 7:34 p.m. UTC | #1
Quoting Lucas De Marchi (2020-07-01 19:36:26)
> Since gen8 we don't use swizzle anymore. Don't dump registers related to
> it: registers may or may not be there.
> 
> Cc: Matt Roper <matthew.d.roper@intel.com>
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_debugfs.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 8594a8ef08ce..d9e56eee0453 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -1138,13 +1138,17 @@ static int i915_swizzle_info(struct seq_file *m, void *data)
>         struct intel_uncore *uncore = &dev_priv->uncore;
>         intel_wakeref_t wakeref;
>  
> -       wakeref = intel_runtime_pm_get(&dev_priv->runtime_pm);
> -
>         seq_printf(m, "bit6 swizzle for X-tiling = %s\n",
>                    swizzle_string(dev_priv->ggtt.bit_6_swizzle_x));
>         seq_printf(m, "bit6 swizzle for Y-tiling = %s\n",
>                    swizzle_string(dev_priv->ggtt.bit_6_swizzle_y));

I'm really tempted to say kill this, it's past the point of usefulness.
There's one user in igt, who can just use the information provided via
the get_tiling_ioctl.

However, if you pull the

        if (dev_priv->quirks & QUIRK_PIN_SWIZZLED_PAGES)
                seq_puts(m, "L-shaped memory detected\n");

here to before the register read out as well (as that is also plain
driver state), you have a deal.
-Chris
Lucas De Marchi July 2, 2020, 12:03 a.m. UTC | #2
On Wed, Jul 1, 2020 at 12:34 PM Chris Wilson <chris@chris-wilson.co.uk> wrote:
>
> Quoting Lucas De Marchi (2020-07-01 19:36:26)
> > Since gen8 we don't use swizzle anymore. Don't dump registers related to
> > it: registers may or may not be there.
> >
> > Cc: Matt Roper <matthew.d.roper@intel.com>
> > Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
> > ---
> >  drivers/gpu/drm/i915/i915_debugfs.c | 8 ++++++--
> >  1 file changed, 6 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> > index 8594a8ef08ce..d9e56eee0453 100644
> > --- a/drivers/gpu/drm/i915/i915_debugfs.c
> > +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> > @@ -1138,13 +1138,17 @@ static int i915_swizzle_info(struct seq_file *m, void *data)
> >         struct intel_uncore *uncore = &dev_priv->uncore;
> >         intel_wakeref_t wakeref;
> >
> > -       wakeref = intel_runtime_pm_get(&dev_priv->runtime_pm);
> > -
> >         seq_printf(m, "bit6 swizzle for X-tiling = %s\n",
> >                    swizzle_string(dev_priv->ggtt.bit_6_swizzle_x));
> >         seq_printf(m, "bit6 swizzle for Y-tiling = %s\n",
> >                    swizzle_string(dev_priv->ggtt.bit_6_swizzle_y));
>
> I'm really tempted to say kill this, it's past the point of usefulness.
> There's one user in igt, who can just use the information provided via
> the get_tiling_ioctl.
>
> However, if you pull the
>
>         if (dev_priv->quirks & QUIRK_PIN_SWIZZLED_PAGES)
>                 seq_puts(m, "L-shaped memory detected\n");
>
> here to before the register read out as well (as that is also plain
> driver state), you have a deal.

Ok. I think I will do this first that is simpler and later take a look in igt.

Thanks
Lucas De Marchi

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

Patch
diff mbox series

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 8594a8ef08ce..d9e56eee0453 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -1138,13 +1138,17 @@  static int i915_swizzle_info(struct seq_file *m, void *data)
 	struct intel_uncore *uncore = &dev_priv->uncore;
 	intel_wakeref_t wakeref;
 
-	wakeref = intel_runtime_pm_get(&dev_priv->runtime_pm);
-
 	seq_printf(m, "bit6 swizzle for X-tiling = %s\n",
 		   swizzle_string(dev_priv->ggtt.bit_6_swizzle_x));
 	seq_printf(m, "bit6 swizzle for Y-tiling = %s\n",
 		   swizzle_string(dev_priv->ggtt.bit_6_swizzle_y));
 
+	/* On BDW+, swizzling is not used. See detect_bit_6_swizzle() */
+	if (INTEL_GEN(dev_priv) >= 8 || IS_VALLEYVIEW(dev_priv))
+		return 0;
+
+	wakeref = intel_runtime_pm_get(&dev_priv->runtime_pm);
+
 	if (IS_GEN_RANGE(dev_priv, 3, 4)) {
 		seq_printf(m, "DDC = 0x%08x\n",
 			   intel_uncore_read(uncore, DCC));