Commit 4ed9fb37 authored by Ander Conselvan de Oliveira's avatar Ander Conselvan de Oliveira Committed by Jani Nikula

drm/i915: Don't set enabled value of all CRTCs when restoring the mode

The code in intel_crtc_restore_mode() sets the enabled value of all the
CRTCs when restoring the mode after a suspend/resume cycle. When more
than one CRTC is enabled, that causes drm_atomic_helper_check_modeset()
to fail if there is more than one pipe enabled, since all but one CRTC
has valid connector data. Instead, set only the enabled value for the
CRTC passed as an argument.

v2: Don't leak atomic state. (Matt)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90468
References: https://bugs.freedesktop.org/show_bug.cgi?id=90396Signed-off-by: default avatarAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Reviewed-by: default avatarMatt Roper <matthew.d.roper@intel.com>
parent 0d26fb89
...@@ -12683,7 +12683,6 @@ void intel_crtc_restore_mode(struct drm_crtc *crtc) ...@@ -12683,7 +12683,6 @@ void intel_crtc_restore_mode(struct drm_crtc *crtc)
{ {
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
struct drm_atomic_state *state; struct drm_atomic_state *state;
struct intel_crtc *intel_crtc;
struct intel_encoder *encoder; struct intel_encoder *encoder;
struct intel_connector *connector; struct intel_connector *connector;
struct drm_connector_state *connector_state; struct drm_connector_state *connector_state;
...@@ -12726,24 +12725,18 @@ void intel_crtc_restore_mode(struct drm_crtc *crtc) ...@@ -12726,24 +12725,18 @@ void intel_crtc_restore_mode(struct drm_crtc *crtc)
} }
} }
for_each_intel_crtc(dev, intel_crtc) { crtc_state = intel_atomic_get_crtc_state(state, to_intel_crtc(crtc));
if (intel_crtc->new_enabled == intel_crtc->base.enabled) if (IS_ERR(crtc_state)) {
continue; DRM_DEBUG_KMS("Failed to add [CRTC:%d] to state: %ld\n",
crtc->base.id, PTR_ERR(crtc_state));
crtc_state = intel_atomic_get_crtc_state(state, intel_crtc); drm_atomic_state_free(state);
if (IS_ERR(crtc_state)) { return;
DRM_DEBUG_KMS("Failed to add [CRTC:%d] to state: %ld\n", }
intel_crtc->base.base.id,
PTR_ERR(crtc_state));
continue;
}
crtc_state->base.active = crtc_state->base.enable = crtc_state->base.active = crtc_state->base.enable =
intel_crtc->new_enabled; to_intel_crtc(crtc)->new_enabled;
if (&intel_crtc->base == crtc) drm_mode_copy(&crtc_state->base.mode, &crtc->mode);
drm_mode_copy(&crtc_state->base.mode, &crtc->mode);
}
intel_modeset_setup_plane_state(state, crtc, &crtc->mode, intel_modeset_setup_plane_state(state, crtc, &crtc->mode,
crtc->primary->fb, crtc->x, crtc->y); crtc->primary->fb, crtc->x, crtc->y);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment