drm/atomic-helper: always track connector commits, too
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 10 Nov 2017 10:53:12 +0000 (11:53 +0100)
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Wed, 15 Nov 2017 11:34:35 +0000 (12:34 +0100)
It's useful for syncing async connector work like link retraining.

v2: Make it work (Manasi&Ville)

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>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171110105313.16718-1-daniel.vetter@ffwll.ch
drivers/gpu/drm/drm_atomic_helper.c

index 15cc189ed1a33c24010ef6aa8a192c5a5dd632e8..07d4058d97d0dd69b73e6ca2c08ea507b9614000 100644 (file)
@@ -1793,11 +1793,8 @@ int drm_atomic_helper_setup_commit(struct drm_atomic_state *state,
                    !try_wait_for_completion(&old_conn_state->commit->flip_done))
                        return -EBUSY;
 
-               /* commit tracked through new_crtc_state->commit, no need to do it explicitly */
-               if (new_conn_state->crtc)
-                       continue;
-
-               commit = crtc_or_fake_commit(state, old_conn_state->crtc);
+               /* Always track connectors explicitly for e.g. link retraining. */
+               commit = crtc_or_fake_commit(state, new_conn_state->crtc ?: old_conn_state->crtc);
                if (!commit)
                        return -ENOMEM;
 
@@ -1811,10 +1808,7 @@ int drm_atomic_helper_setup_commit(struct drm_atomic_state *state,
                    !try_wait_for_completion(&old_plane_state->commit->flip_done))
                        return -EBUSY;
 
-               /*
-                * Unlike connectors, always track planes explicitly for
-                * async pageflip support.
-                */
+               /* Always track planes explicitly for async pageflip support. */
                commit = crtc_or_fake_commit(state, new_plane_state->crtc ?: old_plane_state->crtc);
                if (!commit)
                        return -ENOMEM;