diff mbox series

[19/23] drm/i915/vrr: Avoid sending PUSH when VRR TG is used with Fixed refresh rate

Message ID 20241111091221.2992818-20-ankit.k.nautiyal@intel.com (mailing list archive)
State New
Headers show
Series Use VRR timing generator for fixed refresh rate modes | expand

Commit Message

Ankit Nautiyal Nov. 11, 2024, 9:12 a.m. UTC
As per Bspec:68925: Push enable must be set if not configuring for a
fixed refresh rate (i.e Vmin == Flipline == Vmax is not true).

v2: Use helper intel_vrr_use_push(). (Ville)

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Mitul Golani <mitulkumar.ajitkumar.golani@intel.com> (v1)
---
 drivers/gpu/drm/i915/display/intel_vrr.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_vrr.c b/drivers/gpu/drm/i915/display/intel_vrr.c
index bc3b78a6bf8b..c27886ace0a9 100644
--- a/drivers/gpu/drm/i915/display/intel_vrr.c
+++ b/drivers/gpu/drm/i915/display/intel_vrr.c
@@ -356,6 +356,12 @@  void intel_vrr_set_transcoder_timings(const struct intel_crtc_state *crtc_state)
 		       crtc_state->vrr.flipline - 1);
 }
 
+static bool intel_vrr_use_push(const struct intel_crtc_state *crtc_state)
+{
+	return crtc_state->vrr.tg_enable &&
+	       crtc_state->vrr.mode != INTEL_VRRTG_MODE_FIXED_RR;
+}
+
 void intel_vrr_send_push(const struct intel_crtc_state *crtc_state)
 {
 	struct intel_display *display = to_intel_display(crtc_state);
@@ -364,7 +370,7 @@  void intel_vrr_send_push(const struct intel_crtc_state *crtc_state)
 	if (intel_crtc_is_joiner_secondary(crtc_state))
 		return;
 
-	if (!crtc_state->vrr.tg_enable)
+	if (!intel_vrr_use_push(crtc_state))
 		return;
 
 	intel_de_write(display, TRANS_PUSH(display, cpu_transcoder),
@@ -376,7 +382,7 @@  bool intel_vrr_is_push_sent(const struct intel_crtc_state *crtc_state)
 	struct intel_display *display = to_intel_display(crtc_state);
 	enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;
 
-	if (!crtc_state->vrr.tg_enable)
+	if (!intel_vrr_use_push(crtc_state))
 		return false;
 
 	return intel_de_read(display, TRANS_PUSH(display, cpu_transcoder)) & TRANS_PUSH_SEND;
@@ -393,8 +399,9 @@  void intel_vrr_enable(const struct intel_crtc_state *crtc_state)
 	if (!crtc_state->vrr.tg_enable)
 		return;
 
-	intel_de_write(display, TRANS_PUSH(display, cpu_transcoder),
-		       TRANS_PUSH_EN);
+	if (intel_vrr_use_push(crtc_state))
+		intel_de_write(display, TRANS_PUSH(display, cpu_transcoder),
+			       TRANS_PUSH_EN);
 
 	if (HAS_AS_SDP(display))
 		intel_de_write(display,