public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 6/6] drm/i915: Convert the register access tracepoint to be conditional
Date: Thu, 25 Jul 2013 10:48:21 +0200	[thread overview]
Message-ID: <20130725084821.GG5939@phenom.ffwll.local> (raw)
In-Reply-To: <1374262616-2099-6-git-send-email-chris@chris-wilson.co.uk>

On Fri, Jul 19, 2013 at 08:36:56PM +0100, Chris Wilson wrote:
> The TRACE_EVENT_CONDITION is supposed to generate more efficient code
> than if (cond) trace(), which is what we are currently using inside the
> register access functions.
> 
> v2: Rebase onto uncore
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

Ok, merged the remaining patches in this series. The "move functions
around" one need a bit of wrestling to fit, but I think I've done it
correctly.
-Daniel

> ---
>  drivers/gpu/drm/i915/i915_debugfs.c | 2 +-
>  drivers/gpu/drm/i915/i915_trace.h   | 8 +++++---
>  drivers/gpu/drm/i915/intel_uncore.c | 4 ++--
>  3 files changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 0513743..cc3e74a 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -1004,7 +1004,7 @@ static int gen6_drpc_info(struct seq_file *m)
>  	}
>  
>  	gt_core_status = readl(dev_priv->regs + GEN6_GT_CORE_STATUS);
> -	trace_i915_reg_rw(false, GEN6_GT_CORE_STATUS, gt_core_status, 4);
> +	trace_i915_reg_rw(false, GEN6_GT_CORE_STATUS, gt_core_status, 4, true);
>  
>  	rpmodectl1 = I915_READ(GEN6_RP_CONTROL);
>  	rcctl1 = I915_READ(GEN6_RC_CONTROL);
> diff --git a/drivers/gpu/drm/i915/i915_trace.h b/drivers/gpu/drm/i915/i915_trace.h
> index 7d283b5..2933e2f 100644
> --- a/drivers/gpu/drm/i915/i915_trace.h
> +++ b/drivers/gpu/drm/i915/i915_trace.h
> @@ -406,10 +406,12 @@ TRACE_EVENT(i915_flip_complete,
>  	    TP_printk("plane=%d, obj=%p", __entry->plane, __entry->obj)
>  );
>  
> -TRACE_EVENT(i915_reg_rw,
> -	TP_PROTO(bool write, u32 reg, u64 val, int len),
> +TRACE_EVENT_CONDITION(i915_reg_rw,
> +	TP_PROTO(bool write, u32 reg, u64 val, int len, bool trace),
>  
> -	TP_ARGS(write, reg, val, len),
> +	TP_ARGS(write, reg, val, len, trace),
> +
> +	TP_CONDITION(trace),
>  
>  	TP_STRUCT__entry(
>  		__field(u64, val)
> diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
> index 2c39467..b2703db 100644
> --- a/drivers/gpu/drm/i915/intel_uncore.c
> +++ b/drivers/gpu/drm/i915/intel_uncore.c
> @@ -361,7 +361,7 @@ u##x i915_read##x(struct drm_i915_private *dev_priv, u32 reg, bool trace) { \
>  		val = __raw_i915_read##x(dev_priv, reg); \
>  	} \
>  	spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags); \
> -	if (trace) trace_i915_reg_rw(false, reg, val, sizeof(val)); \
> +	trace_i915_reg_rw(false, reg, val, sizeof(val), trace); \
>  	return val; \
>  }
>  
> @@ -375,7 +375,7 @@ __i915_read(64)
>  void i915_write##x(struct drm_i915_private *dev_priv, u32 reg, u##x val, bool trace) { \
>  	unsigned long irqflags; \
>  	u32 __fifo_ret = 0; \
> -	if (trace) trace_i915_reg_rw(true, reg, val, sizeof(val)); \
> +	trace_i915_reg_rw(true, reg, val, sizeof(val), trace); \
>  	spin_lock_irqsave(&dev_priv->uncore.lock, irqflags); \
>  	if (NEEDS_FORCE_WAKE((dev_priv), (reg))) { \
>  		__fifo_ret = __gen6_gt_wait_for_fifo(dev_priv); \
> -- 
> 1.8.3.2
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

  reply	other threads:[~2013-07-25  8:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-19 19:36 [PATCH 1/6] drm/i915: Serialize almost all register access Chris Wilson
2013-07-19 19:36 ` [PATCH 2/6] drm/i915: Colocate all GT access routines in the same file Chris Wilson
2013-07-19 19:36 ` [PATCH 3/6] drm/i915: Use a private interface for register access within GT Chris Wilson
2013-07-19 19:36 ` [PATCH 4/6] drm/i915: Use the common register access functions for NOTRACE variants Chris Wilson
2013-07-19 19:36 ` [PATCH 5/6] drm/i915: Squash gen lookup through multiple indirections inside GT access Chris Wilson
2013-07-19 19:36 ` [PATCH 6/6] drm/i915: Convert the register access tracepoint to be conditional Chris Wilson
2013-07-25  8:48   ` Daniel Vetter [this message]
2013-07-20  8:55 ` [Intel-gfx] [PATCH 1/6] drm/i915: Serialize almost all register access Daniel Vetter
  -- strict thread matches above, loose matches on Subject: below --
2013-07-16 19:02 [PATCH 1/6] drm/i915: Colocate all GT access routines in the same file Chris Wilson
2013-07-16 19:02 ` [PATCH 6/6] drm/i915: Convert the register access tracepoint to be conditional Chris Wilson
2013-07-12 17:08 [PATCH 1/6] drm/i915: Colocate all GT access routines in the same file Chris Wilson
2013-07-12 17:08 ` [PATCH 6/6] drm/i915: Convert the register access tracepoint to be conditional Chris Wilson
2013-07-14 20:28   ` Ben Widawsky
2013-07-16 16:09     ` Chris Wilson
2013-07-12 14:59 [PATCH 1/6] drm/i915: Colocate all GT access routines in the same file Chris Wilson
2013-07-12 14:59 ` [PATCH 6/6] drm/i915: Convert the register access tracepoint to be conditional Chris Wilson
2013-07-12 14:02 [PATCH 1/6] drm/i915: Colocate all GT access routines in the same file Chris Wilson
2013-07-12 14:02 ` [PATCH 6/6] drm/i915: Convert the register access tracepoint to be conditional 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=20130725084821.GG5939@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --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