Commit fa05887a authored by Daniel Vetter's avatar Daniel Vetter

drm/i915: adjust has_pending_fb_unpin to atomic

A bit an oversight - the current code did nothing, since only
legacy flips used the unpin_work_count and assorted logic.

Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20170720175754.30751-6-daniel.vetter@ffwll.ch
parent fd3a4024
...@@ -4134,21 +4134,22 @@ static void ironlake_fdi_disable(struct drm_crtc *crtc) ...@@ -4134,21 +4134,22 @@ static void ironlake_fdi_disable(struct drm_crtc *crtc)
bool intel_has_pending_fb_unpin(struct drm_i915_private *dev_priv) bool intel_has_pending_fb_unpin(struct drm_i915_private *dev_priv)
{ {
struct intel_crtc *crtc; struct drm_crtc *crtc;
bool cleanup_done;
/* Note that we don't need to be called with mode_config.lock here
* as our list of CRTC objects is static for the lifetime of the drm_for_each_crtc(crtc, &dev_priv->drm) {
* device and so cannot disappear as we iterate. Similarly, we can struct drm_crtc_commit *commit;
* happily treat the predicates as racy, atomic checks as userspace spin_lock(&crtc->commit_lock);
* cannot claim and pin a new fb without at least acquring the commit = list_first_entry_or_null(&crtc->commit_list,
* struct_mutex and so serialising with us. struct drm_crtc_commit, commit_entry);
*/ cleanup_done = commit ?
for_each_intel_crtc(&dev_priv->drm, crtc) { try_wait_for_completion(&commit->cleanup_done) : true;
if (atomic_read(&crtc->unpin_work_count) == 0) spin_unlock(&crtc->commit_lock);
if (cleanup_done)
continue; continue;
if (crtc->flip_work) drm_crtc_wait_one_vblank(crtc);
intel_wait_for_vblank(dev_priv, crtc->pipe);
return true; return true;
} }
......
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