Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org,
	jani.nikula@linux.intel.com,
	mitulkumar.ajitkumar.golani@intel.com
Subject: Re: [PATCH 06/28] drm/i915/vrr: Fill VRR timing generator mode for CMRR and VRR
Date: Wed, 12 Feb 2025 23:06:24 +0200	[thread overview]
Message-ID: <Z60NUJ6z8lGoeSpt@intel.com> (raw)
In-Reply-To: <20250203123840.3855874-7-ankit.k.nautiyal@intel.com>

On Mon, Feb 03, 2025 at 06:08:18PM +0530, Ankit Nautiyal wrote:
> Fill vrr.mode during compute_config and update intel_vrr_get_config() to
> read vrr.mode based on CMRR and VRR enable conditions.

This vrr.mode thing still feels like a bit of a distraction at this
point in the series. If we canskip this stuff for now I think we
should be able to get this done more simply. 

The other thing that seems to complicate things is the attempt at doing
something to intel_crtc_update_active_timings(). I think it'll be
easier to just essentially pretend that things are running with the
legacy timing generator when using fixed refresh rate. That way 
we don't have to touch intel_crtc_update_active_timings() at all.

So basically just:
- add the vmin/vmax/flipline reprogramming to vrr_disable() and vrr_enable()
- make the timing generator enable/disable optional in those places
- add the stuff to the modeset sequence to program the initial
  timings (ie. fixed timings) and enable/disable the timing generator
- also update to the new fixed timings in intel_set_transcoder_timings_lrr()
- adjust readout to not set vrr.enable when vmax==vmin_flipline

I think that should work perfectly fine for adl+. icl/tgl will be
slightly wrong due to the weird extra scanline delay after
vactive, but I don't think we should really have to care about that
since we aren't going to enable this on those platforms anyway.

> 
> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_display.c | 1 +
>  drivers/gpu/drm/i915/display/intel_vrr.c     | 5 +++++
>  2 files changed, 6 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index a6383ddde871..9cff080d4ff9 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -5803,6 +5803,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,
>  
>  	if (!fastset) {
>  		PIPE_CONF_CHECK_BOOL(vrr.enable);
> +		PIPE_CONF_CHECK_X(vrr.mode);
>  		PIPE_CONF_CHECK_I(vrr.vmin);
>  		PIPE_CONF_CHECK_I(vrr.vmax);
>  		PIPE_CONF_CHECK_I(vrr.flipline);
> diff --git a/drivers/gpu/drm/i915/display/intel_vrr.c b/drivers/gpu/drm/i915/display/intel_vrr.c
> index 6f314e209e96..ded5466c5214 100644
> --- a/drivers/gpu/drm/i915/display/intel_vrr.c
> +++ b/drivers/gpu/drm/i915/display/intel_vrr.c
> @@ -227,6 +227,7 @@ void intel_vrr_compute_cmrr_timings(struct intel_crtc_state *crtc_state)
>  {
>  	crtc_state->vrr.enable = true;
>  	crtc_state->cmrr.enable = true;
> +	crtc_state->vrr.mode = INTEL_VRRTG_MODE_CMRR;
>  	/*
>  	 * TODO: Compute precise target refresh rate to determine
>  	 * if video_mode_required should be true. Currently set to
> @@ -243,6 +244,7 @@ static
>  void intel_vrr_compute_vrr_timings(struct intel_crtc_state *crtc_state)
>  {
>  	crtc_state->vrr.enable = true;
> +	crtc_state->vrr.mode = INTEL_VRRTG_MODE_VRR;
>  	crtc_state->mode_flags |= I915_MODE_FLAG_VRR;
>  }
>  
> @@ -506,12 +508,15 @@ void intel_vrr_get_config(struct intel_crtc_state *crtc_state)
>  
>  	if (HAS_CMRR(display) && trans_vrr_ctl & VRR_CTL_CMRR_ENABLE) {
>  		crtc_state->cmrr.enable = true;
> +		crtc_state->vrr.mode = INTEL_VRRTG_MODE_CMRR;
>  		crtc_state->cmrr.cmrr_n =
>  			intel_de_read64_2x32(display, TRANS_CMRR_N_LO(display, cpu_transcoder),
>  					     TRANS_CMRR_N_HI(display, cpu_transcoder));
>  		crtc_state->cmrr.cmrr_m =
>  			intel_de_read64_2x32(display, TRANS_CMRR_M_LO(display, cpu_transcoder),
>  					     TRANS_CMRR_M_HI(display, cpu_transcoder));
> +	} else if (trans_vrr_ctl & VRR_CTL_VRR_ENABLE) {
> +		crtc_state->vrr.mode = INTEL_VRRTG_MODE_VRR;
>  	}
>  
>  	if (DISPLAY_VER(display) >= 13)
> -- 
> 2.45.2

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2025-02-12 21:06 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-03 12:38 [PATCH 00/28] Use VRR timing generator for fixed refresh rate modes Ankit Nautiyal
2025-02-03 12:38 ` [PATCH 01/28] drm/i915/vrr: Remove unwanted comment Ankit Nautiyal
2025-02-03 12:38 ` [PATCH 02/28] drm/i915:vrr: Separate out functions to compute vmin and vmax Ankit Nautiyal
2025-02-03 12:38 ` [PATCH 03/28] drm/i915/vrr: Make helpers for cmrr and vrr timings Ankit Nautiyal
2025-02-03 12:38 ` [PATCH 04/28] drm/i915/vrr: Simplify CMRR Enable Check in intel_vrr_get_config Ankit Nautiyal
2025-02-03 12:38 ` [PATCH 05/28] drm/i915/vrr: Introduce new field for VRR mode Ankit Nautiyal
2025-02-03 12:38 ` [PATCH 06/28] drm/i915/vrr: Fill VRR timing generator mode for CMRR and VRR Ankit Nautiyal
2025-02-12 21:06   ` Ville Syrjälä [this message]
2025-02-13 11:05     ` Nautiyal, Ankit K
2025-02-03 12:38 ` [PATCH 07/28] drm/i915/display: Remove vrr.enable and instead check vrr.mode != NONE Ankit Nautiyal
2025-02-03 12:38 ` [PATCH 08/28] drm/i915/display: Absorb cmrr attributes into vrr struct Ankit Nautiyal
2025-02-03 12:38 ` [PATCH 09/28] drm/i915/display: Add vrr mode to crtc_state dump Ankit Nautiyal
2025-02-03 12:38 ` [PATCH 10/28] drm/i915/vrr: Disable CMRR Ankit Nautiyal
2025-02-03 12:38 ` [PATCH 11/28] drm/i915/display: Update intel_crtc_vrr_{enable/disable} Ankit Nautiyal
2025-02-03 12:38 ` [PATCH 12/28] drm/i915/vrr: Use crtc_vtotal for vmin Ankit Nautiyal
2025-02-03 12:38 ` [PATCH 13/28] drm/i915/vrr: Prepare for fixed refresh rate timings Ankit Nautiyal
2025-02-03 12:38 ` [PATCH 14/28] drm/i915/dp: Avoid vrr compute config for HDMI sink Ankit Nautiyal
2025-02-03 12:38 ` [PATCH 15/28] drm/i915/vrr: Introduce VRR mode Fixed RR Ankit Nautiyal
2025-02-03 12:38 ` [PATCH 16/28] drm/i915/display: Enable MSA Ignore Timing PAR only when in not fixed_rr mode Ankit Nautiyal
2025-02-03 12:38 ` [PATCH 17/28] drm/i915/hdmi: Use VRR Timing generator for HDMI Ankit Nautiyal
2025-02-03 12:38 ` [PATCH 18/28] drm/i915/display: Disable PSR before disabling VRR Ankit Nautiyal
2025-02-03 12:38 ` [PATCH 19/28] drm/i915/psr: Allow PSR for fixed refrsh rate with VRR TG Ankit Nautiyal
2025-02-03 12:38 ` [PATCH 20/28] drm/i915/display: Extend WA 14015406119 for PSR2 Ankit Nautiyal
2025-02-03 12:38 ` [PATCH 21/28] drm/i915/vrr: Handle joiner with vrr Ankit Nautiyal
2025-02-03 12:38 ` [PATCH 22/28] drm/i915/vrr: Refactor condition for computing vmax and LRR Ankit Nautiyal
2025-02-03 12:38 ` [PATCH 23/28] drm/i915/display: Pass vrr.mode to intel_crtc_update_active_timings() Ankit Nautiyal
2025-02-03 12:38 ` [PATCH 24/28] drm/i915/vblank: Add crtc active timings for fixed_rr mode Ankit Nautiyal
2025-02-03 12:38 ` [PATCH 25/28] drm/i915/vrr: Always set vrr vmax/vmin/flipline in vrr_{enable/disable} Ankit Nautiyal
2025-02-03 12:38 ` [PATCH 26/28] drm/i915/display: Use fixed_rr timings in modeset sequence Ankit Nautiyal
2025-02-03 12:38 ` [PATCH 27/28] drm/i915/vrr: Always use VRR timing generator for MTL+ Ankit Nautiyal
2025-02-03 12:38 ` [PATCH 28/28] drm/i915/vblank: Avoid warning for platforms that always use VRR TG Ankit Nautiyal
2025-02-03 14:35 ` ✓ CI.Patch_applied: success for Use VRR timing generator for fixed refresh rate modes (rev3) Patchwork
2025-02-03 14:35 ` ✓ CI.checkpatch: " Patchwork
2025-02-03 14:36 ` ✓ CI.KUnit: " Patchwork
2025-02-03 14:53 ` ✓ CI.Build: " Patchwork
2025-02-03 14:55 ` ✓ CI.Hooks: " Patchwork
2025-02-03 14:57 ` ✗ CI.checksparse: warning " Patchwork
2025-02-03 15:20 ` ✓ Xe.CI.BAT: success " Patchwork
2025-02-03 16:15 ` ✗ 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=Z60NUJ6z8lGoeSpt@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=ankit.k.nautiyal@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=mitulkumar.ajitkumar.golani@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