drm/i915: Fix up verify_encoder_state
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 1 Mar 2017 09:52:26 +0000 (10:52 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 8 Mar 2017 22:42:40 +0000 (23:42 +0100)
commit86b04268d4b25c3a00fa5f77ceebabecf681040a
tree74bcf2db65b4d8e6406b34b9159d4e1823cfd91f
parentf9e905cabdccfda0be094debbf21cb2cc45b8c51
drm/i915: Fix up verify_encoder_state

The trouble here is that looking at all connector->state in the
verifier isn't good, because that's run from the commit work, which
doesn't hold the connection_mutex. Which means we're only allowed to
look at states in our atomic update.

The simple fix for future proofing would be to switch over to
drm_for_each_connector_in_state, but that has the problem that the
verification then fails if not all connectors are in the state. And we
also need to be careful to check both old and new encoders, and not
screw things up when an encoder gets reassigned.

Note that this isn't the full fix, since we still look at
connector->state. To fix that, we need Maarten's patch series to
switch over to state pointers within drm_atomic_state, but that's a
different series.

v2: Use oldnew iterator (Maarten).

v3: Rebase onto the iter_get/put->iter_begin/end rename.

Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170301095226.30584-6-daniel.vetter@ffwll.ch
drivers/gpu/drm/i915/intel_display.c