@@ -1121,14 +1121,18 @@ static bool intel_crtc_vrr_enabling(struct intel_atomic_state *state,
intel_atomic_get_old_crtc_state(state, crtc);
const struct intel_crtc_state *new_crtc_state =
intel_atomic_get_new_crtc_state(state, crtc);
+ bool old_mode_is_vrr = intel_vrr_is_mode_vrr(old_crtc_state);
+ bool new_mode_is_vrr = intel_vrr_is_mode_vrr(new_crtc_state);
+ bool needs_modeset = intel_crtc_needs_modeset(new_crtc_state);
+ bool update_m_n = new_crtc_state->update_m_n;
+ bool update_lrr = new_crtc_state->update_lrr;
+ bool params_changed = vrr_params_changed(old_crtc_state, new_crtc_state);
if (!new_crtc_state->hw.active)
return false;
- return is_enabling(vrr.mode, old_crtc_state, new_crtc_state) ||
- (intel_vrr_is_enabled(new_crtc_state) &&
- (new_crtc_state->update_m_n || new_crtc_state->update_lrr ||
- vrr_params_changed(old_crtc_state, new_crtc_state)));
+ return (new_mode_is_vrr && (!old_mode_is_vrr || needs_modeset)) ||
+ (new_mode_is_vrr && (update_m_n || update_lrr || params_changed));
}
bool intel_crtc_vrr_disabling(struct intel_atomic_state *state,
@@ -1138,14 +1142,18 @@ bool intel_crtc_vrr_disabling(struct intel_atomic_state *state,
intel_atomic_get_old_crtc_state(state, crtc);
const struct intel_crtc_state *new_crtc_state =
intel_atomic_get_new_crtc_state(state, crtc);
+ bool old_mode_is_vrr = intel_vrr_is_mode_vrr(old_crtc_state);
+ bool new_mode_is_vrr = intel_vrr_is_mode_vrr(new_crtc_state);
+ bool needs_modeset = intel_crtc_needs_modeset(new_crtc_state);
+ bool update_m_n = new_crtc_state->update_m_n;
+ bool update_lrr = new_crtc_state->update_lrr;
+ bool params_changed = vrr_params_changed(old_crtc_state, new_crtc_state);
if (!old_crtc_state->hw.active)
return false;
- return is_disabling(vrr.mode, old_crtc_state, new_crtc_state) ||
- (intel_vrr_is_enabled(old_crtc_state) &&
- (new_crtc_state->update_m_n || new_crtc_state->update_lrr ||
- vrr_params_changed(old_crtc_state, new_crtc_state)));
+ return (old_mode_is_vrr && (!new_mode_is_vrr || needs_modeset)) ||
+ (old_mode_is_vrr && (update_m_n || update_lrr || params_changed));
}
static bool audio_enabling(const struct intel_crtc_state *old_crtc_state,
@@ -280,6 +280,11 @@ bool intel_vrr_is_enabled(const struct intel_crtc_state *crtc_state)
return crtc_state->vrr.mode != INTEL_VRRTG_MODE_NONE;
}
+bool intel_vrr_is_mode_vrr(const struct intel_crtc_state *crtc_state)
+{
+ return crtc_state->vrr.mode == INTEL_VRRTG_MODE_VRR;
+}
+
void
intel_vrr_compute_config(struct intel_crtc_state *crtc_state,
struct drm_connector_state *conn_state)
@@ -34,5 +34,6 @@ int intel_vrr_vmax_vblank_start(const struct intel_crtc_state *crtc_state);
int intel_vrr_vmin_vblank_start(const struct intel_crtc_state *crtc_state);
int intel_vrr_vblank_delay(const struct intel_crtc_state *crtc_state);
bool intel_vrr_is_enabled(const struct intel_crtc_state *crtc_state);
+bool intel_vrr_is_mode_vrr(const struct intel_crtc_state *crtc_state);
#endif /* __INTEL_VRR_H__ */
With CMRR the vrr.enable was tracking the vrr timing generator, which made the helpers intel_crtc_vrr_{enable/disable} also track the vrr timing generator. Since we don not have CMRR now, the crtc_vrr_{enable/disable} should now track the vrr mode of operation of the vrr timing generator. Update the helpers intel_crtc_vrr_{enable/disable} to track the vrr mode of the vrr timing generator. Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com> --- drivers/gpu/drm/i915/display/intel_display.c | 24 +++++++++++++------- drivers/gpu/drm/i915/display/intel_vrr.c | 5 ++++ drivers/gpu/drm/i915/display/intel_vrr.h | 1 + 3 files changed, 22 insertions(+), 8 deletions(-)