All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lucas De Marchi <lucas.demarchi@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Lucas De Marchi <lucas.demarchi@intel.com>,
	Chris Wilson <chris@chris-wilson.co.uk>
Subject: [Intel-gfx] [PATCH 2/2] drm/i915: trace intel_uncore_*_fw()
Date: Mon, 18 May 2020 16:30:49 -0700	[thread overview]
Message-ID: <20200518233049.19759-2-lucas.demarchi@intel.com> (raw)
In-Reply-To: <20200518233049.19759-1-lucas.demarchi@intel.com>

Now that we have the declaration of trace_i915_reg_rw() in a separate
header, start tracing intel_uncore_*_fw() mmio-accessors.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
 drivers/gpu/drm/i915/intel_uncore.h | 27 ++++++++++++++++++++++-----
 1 file changed, 22 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_uncore.h b/drivers/gpu/drm/i915/intel_uncore.h
index 8d3aa8b9acf9..0f95b32ff0f0 100644
--- a/drivers/gpu/drm/i915/intel_uncore.h
+++ b/drivers/gpu/drm/i915/intel_uncore.h
@@ -31,6 +31,7 @@
 #include <linux/io-64-nonatomic-lo-hi.h>
 
 #include "i915_reg.h"
+#include "i915_trace_reg_rw.h"
 
 struct drm_i915_private;
 struct intel_runtime_pm;
@@ -348,8 +349,9 @@ intel_uncore_read64_2x32(struct intel_uncore *uncore,
 #undef __uncore_read
 #undef __uncore_write
 
-/* These are untraced mmio-accessors that are only valid to be used inside
- * critical sections, such as inside IRQ handlers, where forcewake is explicitly
+/*
+ * These are mmio-accessors that are only valid to be used inside critical
+ * sections, such as inside IRQ handlers, where forcewake is explicitly
  * controlled.
  *
  * Think twice, and think again, before using these.
@@ -374,9 +376,24 @@ intel_uncore_read64_2x32(struct intel_uncore *uncore,
  * therefore generally be serialised, by either the dev_priv->uncore.lock or
  * a more localised lock guarding all access to that bank of registers.
  */
-#define intel_uncore_read_fw(...) __raw_uncore_read32(__VA_ARGS__)
-#define intel_uncore_write_fw(...) __raw_uncore_write32(__VA_ARGS__)
-#define intel_uncore_write64_fw(...) __raw_uncore_write64(__VA_ARGS__)
+#define intel_uncore_read_fw(uncore, reg) ({ \
+	typeof(reg) reg___ = reg; \
+	u32 val___ = __raw_uncore_read32(uncore, (reg___)); \
+	trace_i915_reg_rw(false, reg___, val___, sizeof(val___), true); \
+	val___; })
+
+#define intel_uncore_write_fw(uncore, reg, val) ({ \
+	typeof(reg) reg___ = reg; \
+	typeof(val) val___ =  val; \
+	trace_i915_reg_rw(true, reg___, val___, sizeof(val___), true); \
+	__raw_uncore_write32(uncore, reg___, val___); })
+
+#define intel_uncore_write64_fw(uncore, reg, val) ({ \
+	typeof(reg) reg___ = reg; \
+	typeof(val) val___ =  val; \
+	trace_i915_reg_rw(true, reg___, val___, sizeof(val___), true); \
+	__raw_uncore_write64(uncore, reg___, val___); })
+
 #define intel_uncore_posting_read_fw(...) ((void)intel_uncore_read_fw(__VA_ARGS__))
 
 static inline void intel_uncore_rmw(struct intel_uncore *uncore,
-- 
2.26.0

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

  reply	other threads:[~2020-05-18 23:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-18 23:30 [Intel-gfx] [PATCH 1/2] drm/i915: move trace_i915_reg_rw() to a separate file Lucas De Marchi
2020-05-18 23:30 ` Lucas De Marchi [this message]
2020-05-18 23:35   ` [Intel-gfx] [PATCH 2/2] drm/i915: trace intel_uncore_*_fw() Chris Wilson
2020-05-19  0:05     ` Lucas De Marchi
2020-05-19  0:23 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/2] drm/i915: move trace_i915_reg_rw() to a separate file Patchwork
2020-05-19  0:45 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2020-05-19  3:12 ` [Intel-gfx] ✓ Fi.CI.IGT: " 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=20200518233049.19759-2-lucas.demarchi@intel.com \
    --to=lucas.demarchi@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.