Patchwork [1/2] drm/atomic-helper: always track connector commits, too

login
register
mail settings
Submitter Daniel Vetter
Date Nov. 10, 2017, 10:53 a.m.
Message ID <20171110105313.16718-1-daniel.vetter@ffwll.ch>
Download mbox | patch
Permalink /patch/10052817/
State New
Headers show

Comments

Daniel Vetter - Nov. 10, 2017, 10:53 a.m.
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>
---
 drivers/gpu/drm/drm_atomic_helper.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
Maarten Lankhorst - Nov. 15, 2017, 11:39 a.m.
Op 10-11-17 om 11:53 schreef Daniel Vetter:
> 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>
> ---
>  drivers/gpu/drm/drm_atomic_helper.c | 12 +++---------
>  1 file changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index c18c271e7508..ced1ac8e68a0 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -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;

First patch reviewed and pushed to drm-misc-next. Will wait for CI_DRM results before pushing the second patch, though I don't expect anything breaking from this. :-)

Patch

diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index c18c271e7508..ced1ac8e68a0 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -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;