Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org,
	Xizhe Tang <xizheTang2005@163.com>,
	Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Subject: [PATCH 2/3] drm/i915/vrr: Introduce intel_vrr_can_use_vrr_tg()
Date: Wed, 23 Sep 2026 19:43:20 +0300	[thread overview]
Message-ID: <20260923164321.9230-2-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20260923164321.9230-1-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Supposedly Wa_14015401596 is only relevant when using the VRR
timing generator. intel_vrr_possible() can return true even if
we can never use the VRR TG (eg. when always_use_vrr_tg()==false,
and we're outside the VRR range). So we're currently enabling
the workaround even when not strictly needed.

Introduce a new helper intel_vrr_can_use_vrr_tg() which will
actually tell us whether the VRR TG might get used (now or later).

Cc: Xizhe Tang <xizheTang2005@163.com>
Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_psr.c | 2 +-
 drivers/gpu/drm/i915/display/intel_vrr.c | 8 ++++++++
 drivers/gpu/drm/i915/display/intel_vrr.h | 1 +
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c
index f1d48b69a18f..08abaa2277b0 100644
--- a/drivers/gpu/drm/i915/display/intel_psr.c
+++ b/drivers/gpu/drm/i915/display/intel_psr.c
@@ -1373,7 +1373,7 @@ int _intel_psr_min_set_context_latency(const struct intel_crtc_state *crtc_state
 		return 0;
 
 	/* Wa_14015401596 */
-	if (intel_vrr_possible(crtc_state) && IS_DISPLAY_VER(display, 13, 14))
+	if (intel_vrr_can_use_vrr_tg(crtc_state) && IS_DISPLAY_VER(display, 13, 14))
 		return 1;
 
 	/* Rest is for SRD_STATUS needed on LunarLake and onwards */
diff --git a/drivers/gpu/drm/i915/display/intel_vrr.c b/drivers/gpu/drm/i915/display/intel_vrr.c
index d43a06907d18..bb2bfa8e76e2 100644
--- a/drivers/gpu/drm/i915/display/intel_vrr.c
+++ b/drivers/gpu/drm/i915/display/intel_vrr.c
@@ -839,6 +839,14 @@ bool intel_vrr_always_use_vrr_tg(struct intel_display *display)
 	return false;
 }
 
+bool intel_vrr_can_use_vrr_tg(const struct intel_crtc_state *crtc_state)
+{
+	struct intel_display *display = to_intel_display(crtc_state);
+
+	return intel_vrr_always_use_vrr_tg(display) ||
+		crtc_state->vrr.in_range;
+}
+
 static int intel_vrr_hw_vmin(const struct intel_crtc_state *crtc_state)
 {
 	struct intel_display *display = to_intel_display(crtc_state);
diff --git a/drivers/gpu/drm/i915/display/intel_vrr.h b/drivers/gpu/drm/i915/display/intel_vrr.h
index 19c7990be1b2..f04e81593d99 100644
--- a/drivers/gpu/drm/i915/display/intel_vrr.h
+++ b/drivers/gpu/drm/i915/display/intel_vrr.h
@@ -48,6 +48,7 @@ void intel_vrr_set_fixed_rr_timings(const struct intel_crtc_state *crtc_state,
 void intel_vrr_dcb_reset(const struct intel_crtc_state *old_crtc_state,
 			 struct intel_crtc *crtc);
 bool intel_vrr_always_use_vrr_tg(struct intel_display *display);
+bool intel_vrr_can_use_vrr_tg(const struct intel_crtc_state *crtc_state);
 int intel_vrr_safe_window_start(const struct intel_crtc_state *crtc_state);
 int intel_vrr_vmin_safe_window_end(const struct intel_crtc_state *crtc_state);
 
-- 
2.54.0


  reply	other threads:[~2026-09-23 16:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-23 16:43 [PATCH 1/3] drm/i915/vrr: Use vrr.in_range to determine if we need the AS SDP Ville Syrjala
2026-09-23 16:43 ` Ville Syrjala [this message]
2026-09-23 16:43 ` [PATCH 3/3] drm/i915/vrr: s/intel_vrr_possible()/has_vrr_tg_timings()/ Ville Syrjala
2026-09-23 16:50 ` ✗ CI.checkpatch: warning for series starting with [1/3] drm/i915/vrr: Use vrr.in_range to determine if we need the AS SDP Patchwork
2026-09-23 16:52 ` ✓ CI.KUnit: success " Patchwork
2026-09-23 18:46 ` ✓ Xe.CI.BAT: " Patchwork
2026-09-24  6:35 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-09-25 19:23 ` [PATCH 1/3] " xizheTang2005
2026-09-28  8:46   ` Jani Nikula
2026-09-28 18:50     ` xizheTang2005

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=20260923164321.9230-2-ville.syrjala@linux.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=xizheTang2005@163.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