diff mbox

drm/i915: Include RING_MODE when dumping the engine state

Message ID 20171026115048.20144-1-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Wilson Oct. 26, 2017, 11:50 a.m. UTC
Knowing the RING_MODE flags is useful for checking the state of the
engine, such as whether the CS is idle after trying to stop the engines
before reset.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_engine_cs.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Mika Kuoppala Oct. 26, 2017, 1:49 p.m. UTC | #1
Chris Wilson <chris@chris-wilson.co.uk> writes:

> Knowing the RING_MODE flags is useful for checking the state of the
> engine, such as whether the CS is idle after trying to stop the engines
> before reset.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_engine_cs.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c
> index fedb839dff61..e676e345c453 100644
> --- a/drivers/gpu/drm/i915/intel_engine_cs.c
> +++ b/drivers/gpu/drm/i915/intel_engine_cs.c
> @@ -1726,6 +1726,11 @@ void intel_engine_dump(struct intel_engine_cs *engine, struct drm_printer *m)
>  	drm_printf(m, "\tRING_CTL:   0x%08x [%s]\n",
>  		   I915_READ(RING_CTL(engine->mmio_base)),
>  		   I915_READ(RING_CTL(engine->mmio_base)) & (RING_WAIT | RING_WAIT_SEMAPHORE) ? "waiting" : "");
> +	if (INTEL_GEN(engine->i915) > 2) {
> +		drm_printf(m, "\tRING_MODE:  0x%08x [%s]\n",
> +			   I915_READ(RING_MI_MODE(engine->mmio_base)),
> +			   I915_READ(RING_MI_MODE(engine->mmio_base)) & (MODE_IDLE) ? "idle" : "");

or use "[idle]" and just %s in printf.

Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Chris Wilson Oct. 26, 2017, 9:38 p.m. UTC | #2
Quoting Mika Kuoppala (2017-10-26 14:49:43)
> Chris Wilson <chris@chris-wilson.co.uk> writes:
> 
> > Knowing the RING_MODE flags is useful for checking the state of the
> > engine, such as whether the CS is idle after trying to stop the engines
> > before reset.
> >
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_engine_cs.c | 5 +++++
> >  1 file changed, 5 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c
> > index fedb839dff61..e676e345c453 100644
> > --- a/drivers/gpu/drm/i915/intel_engine_cs.c
> > +++ b/drivers/gpu/drm/i915/intel_engine_cs.c
> > @@ -1726,6 +1726,11 @@ void intel_engine_dump(struct intel_engine_cs *engine, struct drm_printer *m)
> >       drm_printf(m, "    RING_CTL:   0x%08x [%s]\n",
> >                  I915_READ(RING_CTL(engine->mmio_base)),
> >                  I915_READ(RING_CTL(engine->mmio_base)) & (RING_WAIT | RING_WAIT_SEMAPHORE) ? "waiting" : "");
> > +     if (INTEL_GEN(engine->i915) > 2) {
> > +             drm_printf(m, "    RING_MODE:  0x%08x [%s]\n",
> > +                        I915_READ(RING_MI_MODE(engine->mmio_base)),
> > +                        I915_READ(RING_MI_MODE(engine->mmio_base)) & (MODE_IDLE) ? "idle" : "");
> 
> or use "[idle]" and just %s in printf.

Applied inline and pushed.

Thanks for the review,
-Chris
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c
index fedb839dff61..e676e345c453 100644
--- a/drivers/gpu/drm/i915/intel_engine_cs.c
+++ b/drivers/gpu/drm/i915/intel_engine_cs.c
@@ -1726,6 +1726,11 @@  void intel_engine_dump(struct intel_engine_cs *engine, struct drm_printer *m)
 	drm_printf(m, "\tRING_CTL:   0x%08x [%s]\n",
 		   I915_READ(RING_CTL(engine->mmio_base)),
 		   I915_READ(RING_CTL(engine->mmio_base)) & (RING_WAIT | RING_WAIT_SEMAPHORE) ? "waiting" : "");
+	if (INTEL_GEN(engine->i915) > 2) {
+		drm_printf(m, "\tRING_MODE:  0x%08x [%s]\n",
+			   I915_READ(RING_MI_MODE(engine->mmio_base)),
+			   I915_READ(RING_MI_MODE(engine->mmio_base)) & (MODE_IDLE) ? "idle" : "");
+	}
 
 	rcu_read_unlock();