Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: jani.nikula@intel.com, ville.syrjala@intel.com,
	ankit.k.nautiyal@intel.com, uma.shankar@intel.com
Subject: [PATCH v13 1/3] drm/i915/vrr: Add helper to check if vrr possible
Date: Tue,  1 Oct 2024 19:17:01 +0530	[thread overview]
Message-ID: <20241001134703.1128487-2-mitulkumar.ajitkumar.golani@intel.com> (raw)
In-Reply-To: <20241001134703.1128487-1-mitulkumar.ajitkumar.golani@intel.com>

Add helper to check if vrr is possible based on flipline
is computed.

Signed-off-by: Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>
---
 drivers/gpu/drm/i915/display/intel_vrr.c | 7 ++++++-
 drivers/gpu/drm/i915/display/intel_vrr.h | 1 +
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_vrr.c b/drivers/gpu/drm/i915/display/intel_vrr.c
index 9a51f5bac307..79db30e31324 100644
--- a/drivers/gpu/drm/i915/display/intel_vrr.c
+++ b/drivers/gpu/drm/i915/display/intel_vrr.c
@@ -56,6 +56,11 @@ bool intel_vrr_is_in_range(struct intel_connector *connector, int vrefresh)
 		vrefresh <= info->monitor_range.max_vfreq;
 }
 
+bool intel_vrr_possible(const struct intel_crtc_state *crtc_state)
+{
+	return (crtc_state->vrr.flipline) ? true : false;
+}
+
 void
 intel_vrr_check_modeset(struct intel_atomic_state *state)
 {
@@ -281,7 +286,7 @@ void intel_vrr_set_transcoder_timings(const struct intel_crtc_state *crtc_state)
 		intel_de_rmw(display, CHICKEN_TRANS(cpu_transcoder),
 			     0, PIPE_VBLANK_WITH_DELAY);
 
-	if (!crtc_state->vrr.flipline) {
+	if (!intel_vrr_possible(crtc_state)) {
 		intel_de_write(display,
 			       TRANS_VRR_CTL(display, cpu_transcoder), 0);
 		return;
diff --git a/drivers/gpu/drm/i915/display/intel_vrr.h b/drivers/gpu/drm/i915/display/intel_vrr.h
index 89937858200d..af921dda4619 100644
--- a/drivers/gpu/drm/i915/display/intel_vrr.h
+++ b/drivers/gpu/drm/i915/display/intel_vrr.h
@@ -15,6 +15,7 @@ struct intel_crtc_state;
 
 bool intel_vrr_is_capable(struct intel_connector *connector);
 bool intel_vrr_is_in_range(struct intel_connector *connector, int vrefresh);
+bool intel_vrr_possible(const struct intel_crtc_state *crtc_state);
 void intel_vrr_check_modeset(struct intel_atomic_state *state);
 void intel_vrr_compute_config(struct intel_crtc_state *crtc_state,
 			      struct drm_connector_state *conn_state);
-- 
2.46.0


  reply	other threads:[~2024-10-01 13:45 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-01 13:47 [PATCH v13 0/3] VRR refactoring and panel replay workaround Mitul Golani
2024-10-01 13:47 ` Mitul Golani [this message]
2024-10-01 14:06   ` [PATCH v13 1/3] drm/i915/vrr: Add helper to check if vrr possible Cavitt, Jonathan
2024-10-09  9:13     ` Golani, Mitulkumar Ajitkumar
2024-10-09  7:24   ` Ville Syrjälä
2024-10-09  9:22     ` Golani, Mitulkumar Ajitkumar
2024-10-01 13:47 ` [PATCH v13 2/3] drm/i915/vrr: Split vrr-compute-config in two phases Mitul Golani
2024-10-01 14:10   ` Cavitt, Jonathan
2024-10-09  9:16     ` Golani, Mitulkumar Ajitkumar
2024-10-01 13:47 ` [PATCH v13 3/3] drm/i915/panelreplay: Panel replay workaround with VRR Mitul Golani
2024-10-01 15:07   ` Cavitt, Jonathan
2024-10-09  9:18     ` Golani, Mitulkumar Ajitkumar
2024-10-09  7:30   ` Ville Syrjälä
2024-10-09  9:19     ` Golani, Mitulkumar Ajitkumar

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=20241001134703.1128487-2-mitulkumar.ajitkumar.golani@intel.com \
    --to=mitulkumar.ajitkumar.golani@intel.com \
    --cc=ankit.k.nautiyal@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=uma.shankar@intel.com \
    --cc=ville.syrjala@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