diff mbox series

[11/12] drm/i915: Assert that VRR is off during vblank evasion if necessary

Message ID 20230901130440.2085-12-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915: VRR, LRR, and M/N stuff | expand

Commit Message

Ville Syrjala Sept. 1, 2023, 1:04 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Whenever we change the actual transcoder timings (clock via
seamless M/N, full modeset, (or soon) vtotal via LRR) we
want the timing generator to be in non-VRR during the commit.
Warn if we forgot to turn VRR off prior to vblank evasion.

Cc: Manasi Navare <navaremanasi@chromium.org>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_crtc.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Manasi Navare Sept. 7, 2023, 6:49 p.m. UTC | #1
Reviewed-by: Manasi Navare <navaremanasi@chromium.org>

Manasi

On Fri, Sep 1, 2023 at 6:05 AM Ville Syrjala
<ville.syrjala@linux.intel.com> wrote:
>
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Whenever we change the actual transcoder timings (clock via
> seamless M/N, full modeset, (or soon) vtotal via LRR) we
> want the timing generator to be in non-VRR during the commit.
> Warn if we forgot to turn VRR off prior to vblank evasion.
>
> Cc: Manasi Navare <navaremanasi@chromium.org>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_crtc.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_crtc.c b/drivers/gpu/drm/i915/display/intel_crtc.c
> index a04076064f02..a39e31c1ca85 100644
> --- a/drivers/gpu/drm/i915/display/intel_crtc.c
> +++ b/drivers/gpu/drm/i915/display/intel_crtc.c
> @@ -493,6 +493,10 @@ static void intel_crtc_vblank_evade_scanlines(struct intel_atomic_state *state,
>         adjusted_mode = &crtc_state->hw.adjusted_mode;
>
>         if (crtc->mode_flags & I915_MODE_FLAG_VRR) {
> +               /* timing changes should happen with VRR disabled */
> +               drm_WARN_ON(state->base.dev, intel_crtc_needs_modeset(new_crtc_state) ||
> +                           new_crtc_state->update_m_n);
> +
>                 if (intel_vrr_is_push_sent(crtc_state))
>                         *vblank_start = intel_vrr_vmin_vblank_start(crtc_state);
>                 else
> --
> 2.41.0
>
Golani, Mitulkumar Ajitkumar Sept. 15, 2023, 8:34 a.m. UTC | #2
> -----Original Message-----
> From: Intel-gfx <intel-gfx-bounces@lists.freedesktop.org> On Behalf Of Ville
> Syrjala
> Sent: 01 September 2023 18:35
> To: intel-gfx@lists.freedesktop.org
> Subject: [Intel-gfx] [PATCH 11/12] drm/i915: Assert that VRR is off during
> vblank evasion if necessary
> 
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Whenever we change the actual transcoder timings (clock via seamless M/N,
> full modeset, (or soon) vtotal via LRR) we want the timing generator to be in
> non-VRR during the commit.
> Warn if we forgot to turn VRR off prior to vblank evasion.
> 
> Cc: Manasi Navare <navaremanasi@chromium.org>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_crtc.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_crtc.c
> b/drivers/gpu/drm/i915/display/intel_crtc.c
> index a04076064f02..a39e31c1ca85 100644
> --- a/drivers/gpu/drm/i915/display/intel_crtc.c
> +++ b/drivers/gpu/drm/i915/display/intel_crtc.c
> @@ -493,6 +493,10 @@ static void intel_crtc_vblank_evade_scanlines(struct
> intel_atomic_state *state,
>  	adjusted_mode = &crtc_state->hw.adjusted_mode;
> 
>  	if (crtc->mode_flags & I915_MODE_FLAG_VRR) {
> +		/* timing changes should happen with VRR disabled */
> +		drm_WARN_ON(state->base.dev,
> intel_crtc_needs_modeset(new_crtc_state) ||
> +			    new_crtc_state->update_m_n);
> +

Changes LGTM
Reviewed-by: Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>

Regards,
Mitul
>  		if (intel_vrr_is_push_sent(crtc_state))
>  			*vblank_start =
> intel_vrr_vmin_vblank_start(crtc_state);
>  		else
> --
> 2.41.0
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_crtc.c b/drivers/gpu/drm/i915/display/intel_crtc.c
index a04076064f02..a39e31c1ca85 100644
--- a/drivers/gpu/drm/i915/display/intel_crtc.c
+++ b/drivers/gpu/drm/i915/display/intel_crtc.c
@@ -493,6 +493,10 @@  static void intel_crtc_vblank_evade_scanlines(struct intel_atomic_state *state,
 	adjusted_mode = &crtc_state->hw.adjusted_mode;
 
 	if (crtc->mode_flags & I915_MODE_FLAG_VRR) {
+		/* timing changes should happen with VRR disabled */
+		drm_WARN_ON(state->base.dev, intel_crtc_needs_modeset(new_crtc_state) ||
+			    new_crtc_state->update_m_n);
+
 		if (intel_vrr_is_push_sent(crtc_state))
 			*vblank_start = intel_vrr_vmin_vblank_start(crtc_state);
 		else