Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
	intel-gfx@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH 1/7] drm/i915/de: Move the register tracepoint to display
Date: Fri, 27 Nov 2026 16:32:06 +0200	[thread overview]
Message-ID: <773de96611b8e4085d51239fb04a8a54c5a01ff7@intel.com> (raw)
In-Reply-To: <20261126212728.9034-2-ville.syrjala@linux.intel.com>

On Thu, 26 Nov 2026, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Implement the register read/write tracepoint directly in display
> code. The goal is to eliminate the uncore stuff completely
> and this is one step towards it.
>
> Having a display exclusive tracepoint does mean that one has
> to enable both the core xe/i915 tracepoint and the display
> tracepoint to get a full view of the system (ignoring all
> the completely untraced exceptions in i915). But in general
> I think this is an improvement for pure display work as you
> no longer have to filter out all kinds of irrelevant registers.
> The only thing I might end up missing from the core side is
> the top level interrupt registers. With just the display
> tracepoint enabled you'll not catch those.
>
> Until we eliminate the remaining uncore usage you will see
> double traces for display registers on xe if you have
> both tracepoints enabled. i915 does not trace the _fw()
> stuff (which we use to implement the display register
> accessors) so on i915 you will get just the display traces
> for display registers.
>
> Support for 64bit register values is dropped since we
> don't use those in the display. The few 64bit registers that
> we have in display are accessed as a pair of 32bit registers.
>
> The display code always passed 'true' as the condition to the
> i915 tracpoint, so there is no point in making the new
> tracepoint conditional.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

> ---
>  drivers/gpu/drm/i915/display/intel_de.c       | 21 ++++++++++++----
>  .../drm/i915/display/intel_display_trace.h    | 24 +++++++++++++++++++
>  2 files changed, 40 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_de.c b/drivers/gpu/drm/i915/display/intel_de.c
> index bb008e1ee8fd..fe77e8769c9b 100644
> --- a/drivers/gpu/drm/i915/display/intel_de.c
> +++ b/drivers/gpu/drm/i915/display/intel_de.c
> @@ -10,8 +10,8 @@
>  #include "intel_de.h"
>  #include "intel_display_regs.h"
>  #include "intel_display_rpm.h"
> +#include "intel_display_trace.h"
>  #include "intel_uncore.h"
> -#include "intel_uncore_trace.h"
>  
>  static inline struct intel_uncore *__to_uncore(struct intel_display *display)
>  {
> @@ -151,25 +151,36 @@ int intel_de_wait_for_clear_ms(struct intel_display *display, intel_reg_t reg,
>  
>  u8 intel_de_read8(struct intel_display *display, intel_reg_t reg)
>  {
> +	u8 val;
> +
>  	/* this is only used on VGA registers (possible on pre-g4x) */
>  	drm_WARN_ON(display->drm, DISPLAY_VER(display) >= 5 || display->platform.g4x);
>  
> -	return intel_uncore_read8(__to_uncore(display), reg);
> +	val = intel_uncore_read8(__to_uncore(display), reg);
> +	trace_intel_reg_rw(false, reg, val, sizeof(val));
> +
> +	return val;
>  }
>  
>  void intel_de_write8(struct intel_display *display, intel_reg_t reg, u8 val)
>  {
>  	drm_WARN_ON(display->drm, DISPLAY_VER(display) >= 5 || display->platform.g4x);
>  
> +	trace_intel_reg_rw(true, reg, val, sizeof(val));
>  	intel_uncore_write8(__to_uncore(display), reg, val);
>  }
>  
>  u16 intel_de_read16(struct intel_display *display, intel_reg_t reg)
>  {
> +	u16 val;
> +
>  	/* this is only used on MCHBAR registers on pre-SNB */
>  	drm_WARN_ON(display->drm, DISPLAY_VER(display) >= 6);
>  
> -	return intel_uncore_read16(__to_uncore(display), reg);
> +	val = intel_uncore_read16(__to_uncore(display), reg);
> +	trace_intel_reg_rw(false, reg, val, sizeof(val));
> +
> +	return val;
>  }
>  
>  static __always_inline u32
> @@ -178,7 +189,7 @@ __intel_de_read_fw(struct intel_display *display, intel_reg_t reg)
>  	u32 val;
>  
>  	val = intel_uncore_read_fw(__to_uncore(display), reg);
> -	trace_i915_reg_rw(false, reg, val, sizeof(val), true);
> +	trace_intel_reg_rw(false, reg, val, sizeof(val));
>  
>  	return val;
>  }
> @@ -186,7 +197,7 @@ __intel_de_read_fw(struct intel_display *display, intel_reg_t reg)
>  static __always_inline void
>  __intel_de_write_fw(struct intel_display *display, intel_reg_t reg, u32 val)
>  {
> -	trace_i915_reg_rw(true, reg, val, sizeof(val), true);
> +	trace_intel_reg_rw(true, reg, val, sizeof(val));
>  	intel_uncore_write_fw(__to_uncore(display), reg, val);
>  }
>  
> diff --git a/drivers/gpu/drm/i915/display/intel_display_trace.h b/drivers/gpu/drm/i915/display/intel_display_trace.h
> index 98ba7e20ca30..fe69d203549b 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_trace.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_trace.h
> @@ -959,6 +959,30 @@ TRACE_EVENT(intel_frontbuffer_flush,
>  		      __get_str(dev), __entry->frontbuffer_bits, __entry->origin)
>  );
>  
> +TRACE_EVENT(intel_reg_rw,
> +	TP_PROTO(bool write, intel_reg_t reg, u32 val, int len),
> +
> +	TP_ARGS(write, reg, val, len),
> +
> +	TP_STRUCT__entry(
> +		__field(u32, val)
> +		__field(u32, reg)
> +		__field(u16, write)
> +		__field(u16, len)
> +		),
> +
> +	TP_fast_assign(
> +		__entry->val = val;
> +		__entry->reg = intel_reg_offset(reg);
> +		__entry->write = write;
> +		__entry->len = len;
> +		),
> +
> +	TP_printk("%s reg=0x%x, len=%d, val=0x%x",
> +		__entry->write ? "write" : "read",
> +		__entry->reg, __entry->len, __entry->val)
> +);
> +
>  #endif /* __INTEL_DISPLAY_TRACE_H__ */
>  
>  /* This part must be outside protection */

-- 
Jani Nikula, Intel

  reply	other threads:[~2026-11-27 14:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26 21:27 [PATCH 0/7] drm/i915/de: Nuke uncore Ville Syrjala
2026-11-26 21:27 ` [PATCH 1/7] drm/i915/de: Move the register tracepoint to display Ville Syrjala
2026-11-27 14:32   ` Jani Nikula [this message]
2026-11-26 21:27 ` [PATCH 2/7] drm/i915/de: Pimp the intel_reg_rw tracepoint printf format Ville Syrjala
2026-11-26 21:27 ` [PATCH 3/7] drm/i915/de: Convert intel_de_read_fw() into a vfunc Ville Syrjala
2026-11-26 21:27 ` [PATCH 4/7] drm/i915/de: Use raw readl()/writel()/etc for register access in display Ville Syrjala
2026-11-26 21:27 ` [PATCH 5/7] drm/i915/de: Add intel_parent_mmio_regs() interface Ville Syrjala
2026-11-26 21:27 ` [PATCH 6/7] drm/xe: Nuke the compat uncore stuff Ville Syrjala
2026-11-26 21:27 ` [PATCH 7/7] drm/i915/de: Document intel_de_write8()'s usage restrictions Ville Syrjala
2026-11-26 23:43 ` ✗ CI.checkpatch: warning for drm/i915/de: Nuke uncore Patchwork
2026-11-26 23:46 ` ✓ CI.KUnit: success " Patchwork
2026-11-27  0:24 ` ✓ Xe.CI.BAT: " Patchwork
2026-11-27 12:20 ` ✗ Xe.CI.FULL: failure " 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=773de96611b8e4085d51239fb04a8a54c5a01ff7@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=ville.syrjala@linux.intel.com \
    /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