From: Jani Nikula <jani.nikula@linux.intel.com>
To: Suraj Kandpal <suraj.kandpal@intel.com>,
intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Cc: ankit.k.nautiyal@intel.com, uma.shankar@intel.com,
chaitanya.kumar.borah@intel.com,
Suraj Kandpal <suraj.kandpal@intel.com>
Subject: Re: [PATCH 10/15] drm/i915/vrr: Split out setting the guardband
Date: Thu, 26 Nov 2026 10:58:57 +0200 [thread overview]
Message-ID: <5c3107ba9fadff86183457e3d98e630b381a7ba7@intel.com> (raw)
In-Reply-To: <20261126063459.863698-11-suraj.kandpal@intel.com>
On Thu, 26 Nov 2026, Suraj Kandpal <suraj.kandpal@intel.com> wrote:
> Move setting the VRR guardband, and the vblank start and pipeline
> full derived from it, out of intel_vrr_compute_guardband() into a
> new intel_vrr_guardband_val(). Pipelock is going to use it to raise
> the guardband of a tile to match the other tiles in its group.
>
> No functional change.
>
> Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_vrr.c | 30 +++++++++++++++---------
> drivers/gpu/drm/i915/display/intel_vrr.h | 1 +
> 2 files changed, 20 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_vrr.c b/drivers/gpu/drm/i915/display/intel_vrr.c
> index 47603c141298..ad88034c23f8 100644
> --- a/drivers/gpu/drm/i915/display/intel_vrr.c
> +++ b/drivers/gpu/drm/i915/display/intel_vrr.c
> @@ -620,22 +620,13 @@ static bool intel_vrr_use_optimized_guardband(const struct intel_crtc_state *crt
> return true;
> }
>
> -void intel_vrr_compute_guardband(struct intel_crtc_state *crtc_state)
> +void intel_vrr_guardband_val(struct intel_crtc_state *crtc_state, int guardband)
What does intel_vrr_guardband_val() mean?
I mean I don't actually want you to explain it to me, but think about
it, and compare with what the function *does*, and ask yourself if the
name describes the function.
It's a non-static function. It better have a good name. This one doesn't
say anything about what it does.
> {
> struct intel_display *display = to_intel_display(crtc_state);
> struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode;
> struct drm_display_mode *pipe_mode = &crtc_state->hw.pipe_mode;
> - int guardband;
>
> - if (!intel_vrr_possible(crtc_state))
> - return;
> -
> - if (intel_vrr_use_optimized_guardband(crtc_state))
> - guardband = intel_vrr_compute_optimized_guardband(crtc_state);
> - else
> - guardband = crtc_state->vrr.vmin - adjusted_mode->crtc_vdisplay;
> -
> - crtc_state->vrr.guardband = min(guardband, intel_vrr_max_guardband(crtc_state));
> + crtc_state->vrr.guardband = guardband;
>
> if (intel_vrr_always_use_vrr_tg(display)) {
> adjusted_mode->crtc_vblank_start =
> @@ -654,6 +645,23 @@ void intel_vrr_compute_guardband(struct intel_crtc_state *crtc_state)
> crtc_state->vrr.guardband);
> }
>
> +void intel_vrr_compute_guardband(struct intel_crtc_state *crtc_state)
> +{
> + struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode;
> + int guardband;
> +
> + if (!intel_vrr_possible(crtc_state))
> + return;
> +
> + if (intel_vrr_use_optimized_guardband(crtc_state))
> + guardband = intel_vrr_compute_optimized_guardband(crtc_state);
> + else
> + guardband = crtc_state->vrr.vmin - adjusted_mode->crtc_vdisplay;
> +
> + intel_vrr_guardband_val(crtc_state,
> + min(guardband, intel_vrr_max_guardband(crtc_state)));
> +}
> +
> static u32 trans_vrr_ctl(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..225e2607c9df 100644
> --- a/drivers/gpu/drm/i915/display/intel_vrr.h
> +++ b/drivers/gpu/drm/i915/display/intel_vrr.h
> @@ -24,6 +24,7 @@ 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);
> void intel_vrr_compute_guardband(struct intel_crtc_state *crtc_state);
> +void intel_vrr_guardband_val(struct intel_crtc_state *crtc_state, int guardband);
> void intel_vrr_set_transcoder_timings(const struct intel_crtc_state *crtc_state);
> void intel_vrr_enable(const struct intel_crtc_state *crtc_state);
> void intel_vrr_send_push(struct intel_dsb *dsb,
--
Jani Nikula, Intel
next prev parent reply other threads:[~2026-11-26 8:59 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 6:34 [PATCH 00/15] drm/i915/display: Sync tiled displays with pipelock Suraj Kandpal
2026-11-26 6:34 ` [PATCH 01/15] drm/i915/display: Rename port sync master/slave to primary/secondary Suraj Kandpal
2026-11-26 6:43 ` sashiko-bot
2026-11-26 6:34 ` [PATCH 02/15] drm/i915/display: Add HAS_PIPELOCK() Suraj Kandpal
2026-11-26 6:34 ` [PATCH 03/15] drm/i915/display: Add pipelock bits to TRANS_DDI_FUNC_CTL2 Suraj Kandpal
2026-11-26 8:45 ` Jani Nikula
2026-11-26 6:34 ` [PATCH 04/15] drm/i915/ddi: Program pipelock in TRANS_DDI_FUNC_CTL2 Suraj Kandpal
2026-11-26 6:34 ` [PATCH 05/15] drm/i915/ddi: Don't hold the DP link in idle with pipelock Suraj Kandpal
2026-11-26 6:34 ` [PATCH 06/15] drm/i915/display: Enable the pipelock primary before its secondaries Suraj Kandpal
2026-11-26 6:34 ` [PATCH 07/15] drm/i915/display: Read out and verify pipelock state Suraj Kandpal
2026-11-26 6:34 ` [PATCH 08/15] drm/i915/pipelock: Keep SSC, PSR and CMRR off on pipelock tiles Suraj Kandpal
2026-11-26 8:52 ` Jani Nikula
2026-11-26 9:14 ` Kandpal, Suraj
2026-11-26 6:34 ` [PATCH 09/15] drm/i915/pipelock: Compute pipelock groups for DP tiled displays Suraj Kandpal
2026-11-26 8:56 ` Jani Nikula
2026-11-26 9:16 ` Kandpal, Suraj
2026-11-26 6:34 ` [PATCH 10/15] drm/i915/vrr: Split out setting the guardband Suraj Kandpal
2026-11-26 6:44 ` sashiko-bot
2026-11-26 8:58 ` Jani Nikula [this message]
2026-11-26 9:17 ` Kandpal, Suraj
2026-11-26 6:34 ` [PATCH 11/15] drm/i915/pipelock: Equalize the guardband across a pipelock group Suraj Kandpal
2026-11-26 6:49 ` sashiko-bot
2026-11-27 5:14 ` Kandpal, Suraj
2026-11-26 6:34 ` [PATCH 12/15] drm/i915/dp: Apply link training fallback to the whole tile group Suraj Kandpal
2026-11-26 7:06 ` sashiko-bot
2026-11-26 6:34 ` [PATCH 13/15] drm/i915/display: Show transcoder sync state in i915_display_info Suraj Kandpal
2026-11-26 6:34 ` [PATCH 14/15] drm/i915/display: Use pipelock on PTL Suraj Kandpal
2026-11-26 6:54 ` sashiko-bot
2026-11-27 5:42 ` Kandpal, Suraj
2026-11-26 6:34 ` [PATCH 15/15] drm/i915/ddi: Disable port sync " Suraj Kandpal
2026-11-26 6:42 ` ✗ CI.checkpatch: warning for drm/i915/display: Sync tiled displays with pipelock Patchwork
2026-11-26 6:45 ` ✓ CI.KUnit: success " Patchwork
2026-11-26 7:26 ` ✓ Xe.CI.BAT: " Patchwork
2026-11-26 7:49 ` ✓ i915.CI.BAT: " Patchwork
2026-11-26 12:54 ` ✓ Xe.CI.FULL: " 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=5c3107ba9fadff86183457e3d98e630b381a7ba7@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=ankit.k.nautiyal@intel.com \
--cc=chaitanya.kumar.borah@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=suraj.kandpal@intel.com \
--cc=uma.shankar@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.