All of 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 3/4] drm/i915: Use intel_de_{read, write})fw() in VLV/CHV irq handlers
Date: Thu, 22 Oct 2026 15:31:17 +0300	[thread overview]
Message-ID: <ec5542fe2c281219ff4c63bb5fd1bed9775a0d36@intel.com> (raw)
In-Reply-To: <20261022115548.32678-4-ville.syrjala@linux.intel.com>

On Thu, 22 Oct 2026, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> MMIO is rather expensive on VLV and CHV. MMIO read in particular
> seems to take around 450 ns on CHV. VLV is a bit better
> in the 200-300 ns range. The use of the non-fw() register
> accessors means that each actual register access is bracketed
> by two CLAIM_ER reads. I'm thinking we don't want that extra
> cost in the irq handlers, so switch over to the fw() accessors.
>
> On VLV/CHV this also means we lose the uncore.lock protection
> around the MMIO accesses, but that is fine as these platforms
> do not need any serialization of parallel MMIO accesses.
>
> This actually changes all GMCH platofors since the irq

*platforms

> handlers are shared between the platforms. But that doesn't
> actually cause significant functional changes on the older
> platforms as the non-fw() accessors are identical to the fw()
> versions, apart from some rpm asserts.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Subject needs one s/)/_/

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

> ---
>  .../gpu/drm/i915/display/intel_display_irq.c  | 32 +++++++++----------
>  .../gpu/drm/i915/display/intel_hotplug_irq.c  |  8 ++---
>  2 files changed, 20 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display_irq.c b/drivers/gpu/drm/i915/display/intel_display_irq.c
> index d2d45767bfd2..25b899990475 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_irq.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_irq.c
> @@ -501,19 +501,19 @@ static void i9xx_pipe_crc_irq_handler(struct intel_display *display,
>  	u32 res1, res2;
>  
>  	if (DISPLAY_VER(display) >= 3)
> -		res1 = intel_de_read(display, PIPE_CRC_RES_RES1_I915(display, pipe));
> +		res1 = intel_de_read_fw(display, PIPE_CRC_RES_RES1_I915(display, pipe));
>  	else
>  		res1 = 0;
>  
>  	if (DISPLAY_VER(display) >= 5 || display->platform.g4x)
> -		res2 = intel_de_read(display, PIPE_CRC_RES_RES2_G4X(display, pipe));
> +		res2 = intel_de_read_fw(display, PIPE_CRC_RES_RES2_G4X(display, pipe));
>  	else
>  		res2 = 0;
>  
>  	display_pipe_crc_irq_handler(display, pipe,
> -				     intel_de_read(display, PIPE_CRC_RES_RED(display, pipe)),
> -				     intel_de_read(display, PIPE_CRC_RES_GREEN(display, pipe)),
> -				     intel_de_read(display, PIPE_CRC_RES_BLUE(display, pipe)),
> +				     intel_de_read_fw(display, PIPE_CRC_RES_RED(display, pipe)),
> +				     intel_de_read_fw(display, PIPE_CRC_RES_GREEN(display, pipe)),
> +				     intel_de_read_fw(display, PIPE_CRC_RES_BLUE(display, pipe)),
>  				     res1, res2);
>  }
>  
> @@ -577,7 +577,7 @@ static void i9xx_pipestat_irq_ack(struct intel_display *display,
>  			continue;
>  
>  		reg = PIPESTAT(display, pipe);
> -		pipe_stats[pipe] = intel_de_read(display, reg) & status_mask;
> +		pipe_stats[pipe] = intel_de_read_fw(display, reg) & status_mask;
>  		enable_mask = i915_pipestat_enable_mask(display, pipe);
>  
>  		/*
> @@ -590,8 +590,8 @@ static void i9xx_pipestat_irq_ack(struct intel_display *display,
>  		 * an interrupt is still pending.
>  		 */
>  		if (pipe_stats[pipe]) {
> -			intel_de_write(display, reg, pipe_stats[pipe]);
> -			intel_de_write(display, reg, enable_mask);
> +			intel_de_write_fw(display, reg, pipe_stats[pipe]);
> +			intel_de_write_fw(display, reg, enable_mask);
>  		}
>  	}
>  	spin_unlock(&display->irq.lock);
> @@ -1893,7 +1893,7 @@ static void vlv_page_table_error_irq_ack(struct intel_display *display, u32 *dpi
>  {
>  	u32 status, enable, tmp;
>  
> -	tmp = intel_de_read(display, DPINVGTT);
> +	tmp = intel_de_read_fw(display, DPINVGTT);
>  
>  	enable = tmp >> 16;
>  	status = tmp & 0xffff;
> @@ -1909,8 +1909,8 @@ static void vlv_page_table_error_irq_ack(struct intel_display *display, u32 *dpi
>  	enable &= ~status;
>  
>  	/* customary ack+disable then re-enable to guarantee an edge */
> -	intel_de_write(display, DPINVGTT, status);
> -	intel_de_write(display, DPINVGTT, enable << 16);
> +	intel_de_write_fw(display, DPINVGTT, status);
> +	intel_de_write_fw(display, DPINVGTT, enable << 16);
>  }
>  
>  static void vlv_page_table_error_irq_handler(struct intel_display *display, u32 dpinvgtt)
> @@ -1932,21 +1932,21 @@ static void vlv_display_error_irq_ack(struct intel_display *display,
>  {
>  	u32 emr;
>  
> -	*eir = intel_de_read(display, VLV_EIR);
> +	*eir = intel_de_read_fw(display, VLV_EIR);
>  
>  	if (*eir & VLV_ERROR_PAGE_TABLE)
>  		vlv_page_table_error_irq_ack(display, dpinvgtt);
>  
> -	intel_de_write(display, VLV_EIR, *eir);
> +	intel_de_write_fw(display, VLV_EIR, *eir);
>  
>  	/*
>  	 * Toggle all EMR bits to make sure we get an edge
>  	 * in the ISR master error bit if we don't clear
>  	 * all the EIR bits.
>  	 */
> -	emr = intel_de_read(display, VLV_EMR);
> -	intel_de_write(display, VLV_EMR, 0xffffffff);
> -	intel_de_write(display, VLV_EMR, emr);
> +	emr = intel_de_read_fw(display, VLV_EMR);
> +	intel_de_write_fw(display, VLV_EMR, 0xffffffff);
> +	intel_de_write_fw(display, VLV_EMR, emr);
>  }
>  
>  static void vlv_display_error_irq_handler(struct intel_display *display,
> diff --git a/drivers/gpu/drm/i915/display/intel_hotplug_irq.c b/drivers/gpu/drm/i915/display/intel_hotplug_irq.c
> index 913fcd2a1723..ce0c8f56106a 100644
> --- a/drivers/gpu/drm/i915/display/intel_hotplug_irq.c
> +++ b/drivers/gpu/drm/i915/display/intel_hotplug_irq.c
> @@ -439,15 +439,15 @@ u32 i9xx_hpd_irq_ack(struct intel_display *display)
>  	 * bits can itself generate a new hotplug interrupt :(
>  	 */
>  	for (i = 0; i < 10; i++) {
> -		u32 tmp = intel_de_read(display,
> -					PORT_HOTPLUG_STAT(display)) & hotplug_status_mask;
> +		u32 tmp = intel_de_read_fw(display,
> +					   PORT_HOTPLUG_STAT(display)) & hotplug_status_mask;
>  
>  		if (tmp == 0)
>  			return hotplug_status;
>  
>  		hotplug_status |= tmp;
> -		intel_de_write(display, PORT_HOTPLUG_STAT(display),
> -			       hotplug_status);
> +		intel_de_write_fw(display, PORT_HOTPLUG_STAT(display),
> +				  hotplug_status);
>  	}
>  
>  	drm_WARN_ONCE(display->drm, 1,

-- 
Jani Nikula, Intel

  reply	other threads:[~2026-10-22 12:31 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-22 11:55 [PATCH 0/4] drm/i915: Optimize registers accesses in irq handlers Ville Syrjala
2026-10-22 11:55 ` [PATCH 1/4] drm/i915: Use intel_de_read64_2x32_volatile_fw() for IVB_TIMESTAMP_CTR+PIPE_FRMTMSTMP query Ville Syrjala
2026-10-22 12:10   ` Jani Nikula
2026-10-22 11:55 ` [PATCH 2/4] drm/i915: Use intel_de_{read, write})fw() in BDW+ irq handlers Ville Syrjala
2026-10-22 12:29   ` Jani Nikula
2026-10-22 11:55 ` [PATCH 3/4] drm/i915: Use intel_de_{read, write})fw() in VLV/CHV " Ville Syrjala
2026-10-22 12:31   ` Jani Nikula [this message]
2026-10-22 11:55 ` [PATCH 4/4] drm/i915: Skip redundant frame/scanline/time reads for async flips Ville Syrjala
2026-10-22 12:15   ` Jani Nikula
2026-10-22 12:02 ` ✗ CI.checkpatch: warning for drm/i915: Optimize registers accesses in irq handlers Patchwork
2026-10-22 12:05 ` ✓ CI.KUnit: success " Patchwork
2026-10-22 12:41 ` ✗ Xe.CI.BAT: failure " Patchwork
2026-10-22 13:25 ` ✓ i915.CI.BAT: success " Patchwork
2026-10-22 19:28 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-10-23  0:54 ` ✗ i915.CI.Full: " Patchwork
2026-10-23 18:20 ` ✗ CI.checkpatch: warning for drm/i915: Optimize registers accesses in irq handlers (rev2) Patchwork
2026-10-23 18:23 ` ✓ CI.KUnit: success " Patchwork
2026-10-23 18:45 ` ✓ i915.CI.BAT: " Patchwork
2026-10-23 19:00 ` ✓ Xe.CI.BAT: " Patchwork
2026-10-24  2:08 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-10-28 11:04   ` Saarinen, Jani
2026-10-24  3:50 ` ✓ i915.CI.Full: success " 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=ec5542fe2c281219ff4c63bb5fd1bed9775a0d36@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 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.