diff mbox

[DPU,03/11] drm/msm: Refactor complete_commit() to look more the helpers

Message ID 20180228191906.185417-4-seanpaul@chromium.org (mailing list archive)
State New, archived
Headers show

Commit Message

Sean Paul Feb. 28, 2018, 7:18 p.m. UTC
Factor out the commit_tail() portions of complete_commit() into a
separate function to facilitate moving to the atomic helpers in future
patches.

Change-Id: I4b858ad9fe356b31ed0ed9eecdb394a61048e39c
Signed-off-by: Sean Paul <seanpaul@chromium.org>
---
 drivers/gpu/drm/msm/msm_atomic.c | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

Comments

Jeykumar Sankaran March 9, 2018, 1:01 a.m. UTC | #1
On 2018-02-28 11:18, Sean Paul wrote:
> Factor out the commit_tail() portions of complete_commit() into a
> separate function to facilitate moving to the atomic helpers in future
> patches.
> 
> Change-Id: I4b858ad9fe356b31ed0ed9eecdb394a61048e39c
> Signed-off-by: Sean Paul <seanpaul@chromium.org>

Reviewed-by: Jeykumar Sankaran <jsanka@codeaurora.org>

> ---
>  drivers/gpu/drm/msm/msm_atomic.c | 25 ++++++++++++++++---------
>  1 file changed, 16 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/msm_atomic.c
> b/drivers/gpu/drm/msm/msm_atomic.c
> index f5794dce25dd..eb2ccda5da0f 100644
> --- a/drivers/gpu/drm/msm/msm_atomic.c
> +++ b/drivers/gpu/drm/msm/msm_atomic.c
> @@ -84,18 +84,12 @@ static void msm_atomic_wait_for_commit_done(
>  	}
>  }
> 
> -/* The (potentially) asynchronous part of the commit.  At this point
> - * nothing can fail short of armageddon.
> - */
> -static void complete_commit(struct msm_commit *c)
> +static void msm_atomic_commit_tail(struct drm_atomic_state *state)
>  {
> -	struct drm_atomic_state *state = c->state;
>  	struct drm_device *dev = state->dev;
>  	struct msm_drm_private *priv = dev->dev_private;
>  	struct msm_kms *kms = priv->kms;
> 
> -	drm_atomic_helper_wait_for_fences(dev, state, false);
> -
>  	kms->funcs->prepare_commit(kms, state);
> 
>  	drm_atomic_helper_commit_modeset_disables(dev, state);
> @@ -127,10 +121,21 @@ static void complete_commit(struct msm_commit *c)
>  	drm_atomic_helper_cleanup_planes(dev, state);
> 
>  	kms->funcs->complete_commit(kms, state);
> +}
> 
> -	drm_atomic_state_put(state);
> +/* The (potentially) asynchronous part of the commit.  At this point
> + * nothing can fail short of armageddon.
> + */
> +static void complete_commit(struct msm_commit *c)
> +{
> +	struct drm_atomic_state *state = c->state;
> +	struct drm_device *dev = state->dev;
> 
> -	commit_destroy(c);
> +	drm_atomic_helper_wait_for_fences(dev, state, false);
> +
> +	msm_atomic_commit_tail(state);
> +
> +	drm_atomic_state_put(state);
>  }
> 
>  static void _msm_drm_commit_work_cb(struct kthread_work *work)
> @@ -145,6 +150,8 @@ static void _msm_drm_commit_work_cb(struct
> kthread_work *work)
>  	commit = container_of(work, struct msm_commit, commit_work);
> 
>  	complete_commit(commit);
> +
> +	commit_destroy(commit);
>  }
> 
>  static struct msm_commit *commit_init(struct drm_atomic_state *state,
diff mbox

Patch

diff --git a/drivers/gpu/drm/msm/msm_atomic.c b/drivers/gpu/drm/msm/msm_atomic.c
index f5794dce25dd..eb2ccda5da0f 100644
--- a/drivers/gpu/drm/msm/msm_atomic.c
+++ b/drivers/gpu/drm/msm/msm_atomic.c
@@ -84,18 +84,12 @@  static void msm_atomic_wait_for_commit_done(
 	}
 }
 
-/* The (potentially) asynchronous part of the commit.  At this point
- * nothing can fail short of armageddon.
- */
-static void complete_commit(struct msm_commit *c)
+static void msm_atomic_commit_tail(struct drm_atomic_state *state)
 {
-	struct drm_atomic_state *state = c->state;
 	struct drm_device *dev = state->dev;
 	struct msm_drm_private *priv = dev->dev_private;
 	struct msm_kms *kms = priv->kms;
 
-	drm_atomic_helper_wait_for_fences(dev, state, false);
-
 	kms->funcs->prepare_commit(kms, state);
 
 	drm_atomic_helper_commit_modeset_disables(dev, state);
@@ -127,10 +121,21 @@  static void complete_commit(struct msm_commit *c)
 	drm_atomic_helper_cleanup_planes(dev, state);
 
 	kms->funcs->complete_commit(kms, state);
+}
 
-	drm_atomic_state_put(state);
+/* The (potentially) asynchronous part of the commit.  At this point
+ * nothing can fail short of armageddon.
+ */
+static void complete_commit(struct msm_commit *c)
+{
+	struct drm_atomic_state *state = c->state;
+	struct drm_device *dev = state->dev;
 
-	commit_destroy(c);
+	drm_atomic_helper_wait_for_fences(dev, state, false);
+
+	msm_atomic_commit_tail(state);
+
+	drm_atomic_state_put(state);
 }
 
 static void _msm_drm_commit_work_cb(struct kthread_work *work)
@@ -145,6 +150,8 @@  static void _msm_drm_commit_work_cb(struct kthread_work *work)
 	commit = container_of(work, struct msm_commit, commit_work);
 
 	complete_commit(commit);
+
+	commit_destroy(commit);
 }
 
 static struct msm_commit *commit_init(struct drm_atomic_state *state,