summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@quicinc.com>2017-05-25 15:51:48 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2017-05-25 15:51:48 -0700
commit599b4011d65bf3f8b2b6546e590f5c0d66a218d5 (patch)
treea9681df6ae04cce327fb0be3c7d59ebb42b526f5 /drivers/gpu/drm
parent768b5c4389c067df39f3bf7e230020f4bd969b81 (diff)
parent54133d0b7d535858cc04baa249cb93503786dcf6 (diff)
Merge "drm/msm: wait fence complete before flip"
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/msm/msm_atomic.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/drivers/gpu/drm/msm/msm_atomic.c b/drivers/gpu/drm/msm/msm_atomic.c
index d8791155236c..fa746d71cd3b 100644
--- a/drivers/gpu/drm/msm/msm_atomic.c
+++ b/drivers/gpu/drm/msm/msm_atomic.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
* Copyright (C) 2014 Red Hat
* Author: Rob Clark <robdclark@gmail.com>
*
@@ -429,11 +429,21 @@ static void complete_commit(struct msm_commit *commit)
commit_destroy(commit);
}
+static int msm_atomic_commit_dispatch(struct drm_device *dev,
+ struct drm_atomic_state *state, struct msm_commit *commit);
+
static void fence_cb(struct msm_fence_cb *cb)
{
struct msm_commit *commit =
container_of(cb, struct msm_commit, fence_cb);
- complete_commit(commit);
+ int ret = -EINVAL;
+
+ ret = msm_atomic_commit_dispatch(commit->dev, commit->state, commit);
+ if (ret) {
+ DRM_ERROR("%s: atomic commit failed\n", __func__);
+ drm_atomic_state_free(commit->state);
+ commit_destroy(commit);
+ }
}
static void _msm_drm_commit_work_cb(struct kthread_work *work)
@@ -624,13 +634,7 @@ int msm_atomic_commit(struct drm_device *dev,
*/
if (async) {
- ret = msm_atomic_commit_dispatch(dev, state, commit);
- if (ret) {
- DRM_ERROR("%s: atomic commit failed\n", __func__);
- drm_atomic_state_free(state);
- commit_destroy(commit);
- goto error;
- }
+ msm_queue_fence_cb(dev, &commit->fence_cb, commit->fence);
return 0;
}