Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Gustavo Sousa <gustavo.sousa@intel.com>
To: Suraj Kandpal <suraj.kandpal@intel.com>,
	<intel-xe@lists.freedesktop.org>,
	 <intel-gfx@lists.freedesktop.org>
Cc: <ankit.k.nautiyal@intel.com>, <arun.r.murthy@intel.com>,
	Suraj Kandpal <suraj.kandpal@intel.com>
Subject: Re: [PATCH] drm/i915/display: Use PIPEDMC_FRMTMSTMP on display ver >= 30
Date: Fri, 15 May 2026 11:55:37 -0300	[thread overview]
Message-ID: <87ik8opvrq.fsf@intel.com> (raw)
In-Reply-To: <20260515082443.975592-1-suraj.kandpal@intel.com>

Suraj Kandpal <suraj.kandpal@intel.com> writes:

> Starting with display version 30, the per-pipe frame timestamp is read
> from the PIPEDMC register block (PIPEDMC_FRMTMSTMP) instead of the
> legacy PIPE_FRMTMSTMP MMIO. Extend PIPE_FRMTMSTMP() to take the display
> and select the appropriate register based on DISPLAY_VER(), and update
> all callers (intel_vblank, intel_initial_plane) accordingly.
>
> Bspec: 79482
> WA: 14022946399

Why is this workaround being mentioned here?

If this is part of the workaround implementation, we should use the proper
display workaround infra (intel_display_wa.*) and we probably don't need
to add this commit trailer IMO.

Is the idea to use the PIPEDMC_FRMTMSTMP register as an alternative for
the workaround in display IPs that support such a register? If so, I
think this alternative will not apply to previous display versions,
right?

Another important question is: is this register updated even when the
DMC is not loaded?

--
Gustavo Sousa

> Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_display_regs.h  | 7 +++++--
>  drivers/gpu/drm/i915/display/intel_initial_plane.c | 4 ++--
>  drivers/gpu/drm/i915/display/intel_vblank.c        | 4 ++--
>  3 files changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display_regs.h b/drivers/gpu/drm/i915/display/intel_display_regs.h
> index 4321f8b529da..579f802215d3 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_regs.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_regs.h
> @@ -3149,8 +3149,11 @@ enum skl_power_gate {
>  /* g4x+, except vlv/chv! */
>  #define _PIPE_FRMTMSTMP_A		0x70048
>  #define _PIPE_FRMTMSTMP_B		0x71048
> -#define PIPE_FRMTMSTMP(pipe)		\
> -	_MMIO_PIPE(pipe, _PIPE_FRMTMSTMP_A, _PIPE_FRMTMSTMP_B)
> +#define _PIPEDMC_FRMTMSTMP_A		0x5f0ac
> +#define _PIPEDMC_FRMTMSTMP_B		0x5f4ac
> +#define PIPE_FRMTMSTMP(display, pipe)	(DISPLAY_VER(display) >= 30 ? \
> +	_MMIO_PIPE(pipe, _PIPEDMC_FRMTMSTMP_A, _PIPEDMC_FRMTMSTMP_B) : \
> +	_MMIO_PIPE(pipe, _PIPE_FRMTMSTMP_A, _PIPE_FRMTMSTMP_B))
>  
>  /* g4x+, except vlv/chv! */
>  #define _PIPE_FLIPTMSTMP_A		0x7004C
> diff --git a/drivers/gpu/drm/i915/display/intel_initial_plane.c b/drivers/gpu/drm/i915/display/intel_initial_plane.c
> index 034fe199c2a1..004cbdb6be32 100644
> --- a/drivers/gpu/drm/i915/display/intel_initial_plane.c
> +++ b/drivers/gpu/drm/i915/display/intel_initial_plane.c
> @@ -34,9 +34,9 @@ void intel_initial_plane_vblank_wait(struct intel_crtc *crtc)
>  		return;
>  	}
>  
> -	start_ts = intel_de_read(display, PIPE_FRMTMSTMP(crtc->pipe));
> +	start_ts = intel_de_read(display, PIPE_FRMTMSTMP(display, crtc->pipe));
>  
> -	ret = poll_timeout_us(end_ts = intel_de_read(display, PIPE_FRMTMSTMP(crtc->pipe)),
> +	ret = poll_timeout_us(end_ts = intel_de_read(display, PIPE_FRMTMSTMP(display, crtc->pipe)),
>  			      end_ts != start_ts, 1000, 1000 * 1000, false);
>  	if (ret)
>  		drm_warn(display->drm, "[CRTC:%d:%s] early vblank wait timed out\n",
> diff --git a/drivers/gpu/drm/i915/display/intel_vblank.c b/drivers/gpu/drm/i915/display/intel_vblank.c
> index 28d81199792e..52ff47936f9e 100644
> --- a/drivers/gpu/drm/i915/display/intel_vblank.c
> +++ b/drivers/gpu/drm/i915/display/intel_vblank.c
> @@ -157,7 +157,7 @@ static u32 intel_crtc_scanlines_since_frame_timestamp(struct intel_crtc *crtc)
>  		 * is sampled at every start of vertical blank.
>  		 */
>  		scan_prev_time = intel_de_read_fw(display,
> -						  PIPE_FRMTMSTMP(crtc->pipe));
> +						  PIPE_FRMTMSTMP(display, crtc->pipe));
>  
>  		/*
>  		 * The TIMESTAMP_CTR register has the current
> @@ -166,7 +166,7 @@ static u32 intel_crtc_scanlines_since_frame_timestamp(struct intel_crtc *crtc)
>  		scan_curr_time = intel_de_read_fw(display, IVB_TIMESTAMP_CTR);
>  
>  		scan_post_time = intel_de_read_fw(display,
> -						  PIPE_FRMTMSTMP(crtc->pipe));
> +						  PIPE_FRMTMSTMP(display, crtc->pipe));
>  	} while (scan_post_time != scan_prev_time);
>  
>  	return div_u64(mul_u32_u32(scan_curr_time - scan_prev_time,
> -- 
> 2.34.1

  parent reply	other threads:[~2026-05-15 14:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-15  8:24 [PATCH] drm/i915/display: Use PIPEDMC_FRMTMSTMP on display ver >= 30 Suraj Kandpal
2026-05-15  8:35 ` ✗ CI.checkpatch: warning for " Patchwork
2026-05-15  8:36 ` ✓ CI.KUnit: success " Patchwork
2026-05-15  9:23 ` ✗ Xe.CI.BAT: failure " Patchwork
2026-05-15 10:21 ` [PATCH] " Jani Nikula
2026-05-15 15:04   ` Kandpal, Suraj
2026-05-15 14:55 ` Gustavo Sousa [this message]
2026-05-15 15:07   ` Kandpal, Suraj
2026-05-15 23:23 ` ✗ Xe.CI.FULL: failure for " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2026-05-15 15:53 [PATCH] Revert "drm/i915/backlight: Remove try_vesa_interface" Suraj Kandpal
2026-05-15 16:10 ` [PATCH] drm/i915/display: Use PIPEDMC_FRMTMSTMP on display ver >= 30 Suraj Kandpal

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=87ik8opvrq.fsf@intel.com \
    --to=gustavo.sousa@intel.com \
    --cc=ankit.k.nautiyal@intel.com \
    --cc=arun.r.murthy@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=suraj.kandpal@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