From: Maarten Lankhorst <maarten.lankhorst@xxxxxxxxxxxxxxx> We may not be perfect at reading out the initial mode, but when the mode is sanitized by our first modeset we know for sure the state is compatible, so we can compare with intel_pipe_config_compare. Changes in v2 (Hans de Goede): -When checking if we need to reset the mode (initial modeset), check I915_MODE_FLAG_INHERITED is set in private_flags instead of private_flags != 0 Signed-off-by: Maarten Lankhorst <maarten.lankhorst@xxxxxxxxxxxxxxx> Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx> --- drivers/gpu/drm/i915/intel_display.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index c2980643a1a5..071954d255c6 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -12501,6 +12501,22 @@ static int calc_watermark_data(struct drm_atomic_state *state) return 0; } +static bool can_fastset(struct drm_i915_private *dev_priv, + struct intel_crtc_state *old_crtc_state, + struct intel_crtc_state *new_crtc_state) +{ + bool reset_mode = + (old_crtc_state->base.mode.private_flags & I915_MODE_FLAG_INHERITED) && + !(new_crtc_state->base.mode.private_flags & I915_MODE_FLAG_INHERITED); + + /* Without fastboot, we always want to modeset the initial mode. */ + if (reset_mode && !i915_modparams.fastboot) + return false; + + return intel_pipe_config_compare(dev_priv, old_crtc_state, + new_crtc_state, true); +} + /** * intel_atomic_check - validate state object * @dev: drm device @@ -12531,6 +12547,8 @@ static int intel_atomic_check(struct drm_device *dev, for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, crtc_state, i) { struct intel_crtc_state *pipe_config = to_intel_crtc_state(crtc_state); + struct intel_crtc_state *old_intel_crtc_state = + to_intel_crtc_state(old_crtc_state); if (!needs_modeset(crtc_state)) continue; @@ -12547,10 +12565,7 @@ static int intel_atomic_check(struct drm_device *dev, return ret; } - if (i915_modparams.fastboot && - intel_pipe_config_compare(dev_priv, - to_intel_crtc_state(old_crtc_state), - pipe_config, true)) { + if (can_fastset(dev_priv, old_intel_crtc_state, pipe_config)) { crtc_state->mode_changed = false; pipe_config->update_pipe = true; } -- 2.20.1 _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel