Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/6] drm/i915: Use snprintf to avoid line-break when pretty-printing engines
Date: Wed, 22 Nov 2017 11:12:29 +0200	[thread overview]
Message-ID: <87po8a4qyq.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20171121093941.15459-2-chris@chris-wilson.co.uk>

Chris Wilson <chris@chris-wilson.co.uk> writes:

> When printing the execlist ports, we first print the ELSP header then
> follow it with the pretty-printed request. Since switching to
> drm_printer and show the output via printk, it automatically appends a
> newline to each call (unlike the old seq_printf output). To avoid the
> unwanted line break, construct the ELSP request header in a temporary
> buffer.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>

Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>

> ---
>  drivers/gpu/drm/i915/intel_engine_cs.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c
> index 22c095035539..b51400c25c2e 100644
> --- a/drivers/gpu/drm/i915/intel_engine_cs.c
> +++ b/drivers/gpu/drm/i915/intel_engine_cs.c
> @@ -1660,6 +1660,7 @@ void intel_engine_dump(struct intel_engine_cs *engine, struct drm_printer *m)
>  	struct drm_i915_private *dev_priv = engine->i915;
>  	struct drm_i915_gem_request *rq;
>  	struct rb_node *rb;
> +	char hdr[80];
>  	u64 addr;
>  
>  	drm_printf(m, "%s\n", engine->name);
> @@ -1772,12 +1773,12 @@ void intel_engine_dump(struct intel_engine_cs *engine, struct drm_printer *m)
>  
>  			rq = port_unpack(&execlists->port[idx], &count);
>  			if (rq) {
> -				drm_printf(m, "\t\tELSP[%d] count=%d, ",
> -					   idx, count);
> -				print_request(m, rq, "rq: ");
> +				snprintf(hdr, sizeof(hdr),
> +					 "\t\tELSP[%d] count=%d, rq: ",
> +					 idx, count);
> +				print_request(m, rq, hdr);
>  			} else {
> -				drm_printf(m, "\t\tELSP[%d] idle\n",
> -					   idx);
> +				drm_printf(m, "\t\tELSP[%d] idle\n", idx);
>  			}
>  		}
>  		drm_printf(m, "\t\tHW active? 0x%x\n", execlists->active);
> -- 
> 2.15.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-11-22  9:13 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-21  9:39 [PATCH 1/6] drm/printer: Add drm_vprintf() Chris Wilson
2017-11-21  9:39 ` [PATCH 2/6] drm/i915: Use snprintf to avoid line-break when pretty-printing engines Chris Wilson
2017-11-22  9:12   ` Mika Kuoppala [this message]
2017-11-21  9:39 ` [PATCH 3/6] drm/i915: Make engine state pretty-printer header configurable Chris Wilson
2017-11-21  9:39 ` [PATCH 4/6] drm/i915: Include engine state on detecting a missed breadcrumb/seqno Chris Wilson
2017-11-22  9:29   ` Mika Kuoppala
2017-11-21  9:39 ` [PATCH 5/6] drm/i915: Include the global reset count for intel_engine_dump() Chris Wilson
2017-11-22  9:50   ` Mika Kuoppala
2017-11-21  9:39 ` [PATCH 6/6] drm/i915: Add is-wedged flag to intel_engine_dump() Chris Wilson
2017-11-21 10:13 ` ✓ Fi.CI.BAT: success for series starting with [1/6] drm/printer: Add drm_vprintf() Patchwork
2017-11-21 10:57 ` ✓ Fi.CI.IGT: " Patchwork
2017-11-21 11:21 ` [PATCH v2] " Chris Wilson
2017-11-21 12:04   ` Michal Wajdeczko
2017-11-21 12:25     ` Chris Wilson
2017-11-21 13:07 ` ✓ Fi.CI.BAT: success for series starting with [v2] drm/printer: Add drm_vprintf() (rev2) Patchwork
2017-11-21 14:50 ` ✗ Fi.CI.IGT: warning " Patchwork
2017-11-22 10:55 ` [PATCH v3] drm/printer: Add drm_vprintf() Chris Wilson
2017-11-22 11:20 ` ✓ Fi.CI.BAT: success for series starting with [v3] drm/printer: Add drm_vprintf() (rev3) Patchwork
2017-11-22 14:28 ` ✗ Fi.CI.IGT: warning " Patchwork

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=87po8a4qyq.fsf@gaia.fi.intel.com \
    --to=mika.kuoppala@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox