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 1/2] drm/i915/display: Introduce transcoder_has_vrr() helper
Date: Wed, 26 Mar 2025 19:08:58 +0200	[thread overview]
Message-ID: <Z-Q0quW7h2y-eKy2@intel.com> (raw)
In-Reply-To: <20250326160321.550753-2-ankit.k.nautiyal@intel.com>

On Wed, Mar 26, 2025 at 09:33:20PM +0530, Ankit Nautiyal wrote:
> To avoid having VRR read/write for DSI transcoders, we currently use
> !transcoder_is_dsi() in many places.
> Instead introduce a new helper to check transcoder_has_vrr() and use
> that to exclude transcoders which do not support VRR.
> 
> v2: Include HAS_VRR into the helper. (Ville)
> 
> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_display.c | 15 ++++++++++++---
>  1 file changed, 12 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index ee7812126129..0db1cd4fc963 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -2625,6 +2625,15 @@ void intel_cpu_transcoder_set_m2_n2(struct intel_crtc *crtc,
>  		      PIPE_LINK_N2(display, transcoder));
>  }
>  
> +static bool
> +transcoder_has_vrr(const struct intel_crtc_state *crtc_state)
> +{
> +	struct intel_display *display = to_intel_display(crtc_state);
> +	enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;
> +
> +	return HAS_VRR(display) && !transcoder_is_dsi(cpu_transcoder);
> +}
> +
>  static void intel_set_transcoder_timings(const struct intel_crtc_state *crtc_state)
>  {
>  	struct intel_display *display = to_intel_display(crtc_state);
> @@ -2635,7 +2644,7 @@ static void intel_set_transcoder_timings(const struct intel_crtc_state *crtc_sta
>  	u32 crtc_vdisplay, crtc_vtotal, crtc_vblank_start, crtc_vblank_end;
>  	int vsyncshift = 0;
>  
> -	drm_WARN_ON(display->drm, transcoder_is_dsi(cpu_transcoder));
> +	drm_WARN_ON(display->drm, !transcoder_has_vrr(crtc_state));

Actually, this one should stay as is. We don't use this for
DSI even on hardware that lacks VRR support.

>  
>  	/* We need to be careful not to changed the adjusted mode, for otherwise
>  	 * the hw state checker will get angry at the mismatch. */
> @@ -2717,7 +2726,7 @@ static void intel_set_transcoder_timings_lrr(const struct intel_crtc_state *crtc
>  	const struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode;
>  	u32 crtc_vdisplay, crtc_vtotal, crtc_vblank_start, crtc_vblank_end;
>  
> -	drm_WARN_ON(display->drm, transcoder_is_dsi(cpu_transcoder));
> +	drm_WARN_ON(display->drm, !transcoder_has_vrr(crtc_state));

same here.

>  
>  	crtc_vdisplay = adjusted_mode->crtc_vdisplay;
>  	crtc_vtotal = adjusted_mode->crtc_vtotal;
> @@ -3908,7 +3917,7 @@ static bool hsw_get_pipe_config(struct intel_crtc *crtc,
>  	    DISPLAY_VER(display) >= 11)
>  		intel_get_transcoder_timings(crtc, pipe_config);
>  
> -	if (HAS_VRR(display) && !transcoder_is_dsi(pipe_config->cpu_transcoder))
> +	if (transcoder_has_vrr(pipe_config))
>  		intel_vrr_get_config(pipe_config);

This one is fine.

>  
>  	intel_get_pipe_src_size(crtc, pipe_config);
> -- 
> 2.45.2

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2025-03-26 17:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-26 16:03 [PATCH 0/2] VRR Register Read/Write Updates Ankit Nautiyal
2025-03-26 16:03 ` [PATCH 1/2] drm/i915/display: Introduce transcoder_has_vrr() helper Ankit Nautiyal
2025-03-26 17:08   ` Ville Syrjälä [this message]
2025-03-26 16:03 ` [PATCH 2/2] drm/i915/display: Avoid use of VTOTAL.Vtotal bits Ankit Nautiyal
2025-03-26 17:09   ` Ville Syrjälä
2025-03-27  4:35     ` Nautiyal, Ankit K
2025-03-26 16:58 ` ✓ CI.Patch_applied: success for VRR Register Read/Write Updates (rev2) Patchwork
2025-03-26 16:58 ` ✓ CI.checkpatch: " Patchwork
2025-03-26 16:59 ` ✓ CI.KUnit: " Patchwork
2025-03-26 17:16 ` ✓ CI.Build: " Patchwork
2025-03-26 17:18 ` ✓ CI.Hooks: " Patchwork
2025-03-26 17:20 ` ✓ CI.checksparse: " Patchwork
2025-03-26 17:40 ` ✓ Xe.CI.BAT: " Patchwork
2025-03-27  6:42 ` ✗ Xe.CI.Full: failure " Patchwork
2025-03-27 11:26 ` Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2025-03-27 14:46 [PATCH 0/2] VRR Register Read/Write Updates Ankit Nautiyal
2025-03-27 14:46 ` [PATCH 1/2] drm/i915/display: Introduce transcoder_has_vrr() helper Ankit Nautiyal
2025-03-28 10:35   ` Ville Syrjälä
2025-03-26  4:05 [PATCH 0/2] VRR Register Read/Write Updates Ankit Nautiyal
2025-03-26  4:05 ` [PATCH 1/2] drm/i915/display: Introduce transcoder_has_vrr() helper Ankit Nautiyal
2025-03-26 13:01   ` Ville Syrjälä

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=Z-Q0quW7h2y-eKy2@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