Add new interface for checking possible PSR/PR mode change. We need this information to decide if DSB can be used. Signed-off-by: Jouni Högander <jouni.hogander@xxxxxxxxx> --- drivers/gpu/drm/i915/display/intel_psr.c | 20 ++++++++++++++++++++ drivers/gpu/drm/i915/display/intel_psr.h | 2 ++ 2 files changed, 22 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c index 1e99329b70a1..90e36e34e0c7 100644 --- a/drivers/gpu/drm/i915/display/intel_psr.c +++ b/drivers/gpu/drm/i915/display/intel_psr.c @@ -225,6 +225,26 @@ bool intel_psr_needs_aux_io_power(struct intel_encoder *encoder, intel_encoder_can_psr(encoder); } +/** + * intel_psr_is_psr_mode_changing - Check if PSR/PR mode is changing + * @old_crtc_state: pointer to old intel_crtc_state + * @new_crtc_state: pointer to new intel_crtc_state + * + * This can be used to figure out if PSR/PR mode is changing between old and new + * crtc state. + * + * Returns true if mode is changing, false if mode is not changing. + */ +bool intel_psr_is_psr_mode_changing(const struct intel_crtc_state *old_crtc_state, + const struct intel_crtc_state *new_crtc_state) +{ + return old_crtc_state->has_psr != new_crtc_state->has_psr || + old_crtc_state->has_sel_update != new_crtc_state->has_sel_update || + old_crtc_state->has_panel_replay != new_crtc_state->has_panel_replay || + old_crtc_state->enable_psr2_su_region_et != + new_crtc_state->enable_psr2_su_region_et; +} + static bool psr_global_enabled(struct intel_dp *intel_dp) { struct intel_display *display = to_intel_display(intel_dp); diff --git a/drivers/gpu/drm/i915/display/intel_psr.h b/drivers/gpu/drm/i915/display/intel_psr.h index fc807817863e..cc6267e87933 100644 --- a/drivers/gpu/drm/i915/display/intel_psr.h +++ b/drivers/gpu/drm/i915/display/intel_psr.h @@ -26,6 +26,8 @@ struct intel_plane_state; (intel_dp)->psr.source_panel_replay_support) bool intel_encoder_can_psr(struct intel_encoder *encoder); +bool intel_psr_is_psr_mode_changing(const struct intel_crtc_state *old_crtc_state, + const struct intel_crtc_state *new_crtc_state); bool intel_psr_needs_aux_io_power(struct intel_encoder *encoder, const struct intel_crtc_state *crtc_state); void intel_psr_init_dpcd(struct intel_dp *intel_dp); -- 2.43.0