drm/i915: sync dp link status checks against atomic commmits
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 13 Nov 2017 16:01:40 +0000 (17:01 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 23 Nov 2017 13:59:07 +0000 (14:59 +0100)
commit42e5e65765265485ecf2a480c244d76c2c624449
tree4c6301da3957e5db2ebe819e911e1e39cbae70cc
parentfbba5559d91e812db0fd446fb383a37fde48b1cb
drm/i915: sync dp link status checks against atomic commmits

Two bits:
- check actual atomic state, the legacy stuff can only be looked at
  from within the atomic_commit_tail function, since it's only
  protected by ordering and not by any locks.

- Make sure we don't wreak the work an ongoing nonblocking commit is
  doing.

v2: We need the crtc lock too, because a plane update might change it
without having to acquire the connection_mutex (Maarten). Use
Maarten's changes for this locking, while keeping the logic that uses
the connection->commit->hw_done signal for syncing with nonblocking
commits.

v3: The initial state objects from the hw state readout do not have a
commit object. Check for that (spotted by CI).

v4: Fix deadlock from jumping to put_power with locks still held.
    (mlankhorst)

Cc: Manasi Navare <manasi.d.navare@intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=103336
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99272
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20171113160140.22679-1-maarten.lankhorst@linux.intel.com
drivers/gpu/drm/i915/intel_dp.c