From: Maarten Lankhorst Date: Mon, 13 Jul 2015 14:30:14 +0000 (+0200) Subject: drm/i915: Only update state on crtc's that are part of the atomic state. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8a75d157ccddc2c1fb5aeefe6a1a45a9eb0c0176;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git drm/i915: Only update state on crtc's that are part of the atomic state. This is probably hard to hit right now because in most cases all atomic locks are taken, but after conversion to atomic this will make it more likely to corrupt the crtc->config pointer, resulting in hard to find bugs. Signed-off-by: Maarten Lankhorst Reviewed-by: Daniel Stone Signed-off-by: Daniel Vetter --- diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 00c60c1c5162..9995df578fa8 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -12312,6 +12312,7 @@ intel_modeset_update_state(struct drm_atomic_state *state) struct drm_crtc *crtc; struct drm_crtc_state *crtc_state; struct drm_connector *connector; + int i; intel_shared_dpll_commit(state); @@ -12331,7 +12332,7 @@ intel_modeset_update_state(struct drm_atomic_state *state) intel_modeset_update_staged_output_state(state->dev); /* Double check state. */ - for_each_crtc(dev, crtc) { + for_each_crtc_in_state(state, crtc, crtc_state, i) { WARN_ON(crtc->state->enable != intel_crtc_in_use(crtc)); to_intel_crtc(crtc)->config = to_intel_crtc_state(crtc->state);