diff options
author | Rob Clark <robdclark@gmail.com> | 2016-03-16 18:18:17 -0400 |
---|---|---|
committer | Rob Clark <robdclark@gmail.com> | 2016-05-08 10:22:14 -0400 |
commit | ba00c3f2f0c84456ffe9d548823ff4fb8e4e7ed4 (patch) | |
tree | 1cddb413a2c1f4281f938f356bf74cfaf33cedcc /drivers/gpu/drm/msm/msm_fence.c | |
parent | ca762a8ae7f453978a4769af9dcd3cb08e45b932 (diff) | |
download | linux-ba00c3f2f0c84456ffe9d548823ff4fb8e4e7ed4.tar.bz2 |
drm/msm: remove fence_cbs
This was only used for atomic commit these days. So instead just give
atomic it's own work-queue where we can do a block on each bo in turn.
Simplifies things a whole bunch and makes the 'struct fence' conversion
easier.
Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/msm/msm_fence.c')
-rw-r--r-- | drivers/gpu/drm/msm/msm_fence.c | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/drivers/gpu/drm/msm/msm_fence.c b/drivers/gpu/drm/msm/msm_fence.c index f0ed6a680653..088610ca80ca 100644 --- a/drivers/gpu/drm/msm/msm_fence.c +++ b/drivers/gpu/drm/msm/msm_fence.c @@ -33,7 +33,6 @@ msm_fence_context_alloc(struct drm_device *dev, const char *name) fctx->dev = dev; fctx->name = name; init_waitqueue_head(&fctx->event); - INIT_LIST_HEAD(&fctx->fence_cbs); return fctx; } @@ -86,54 +85,12 @@ int msm_wait_fence(struct msm_fence_context *fctx, uint32_t fence, return ret; } -int msm_queue_fence_cb(struct msm_fence_context *fctx, - struct msm_fence_cb *cb, uint32_t fence) -{ - struct msm_drm_private *priv = fctx->dev->dev_private; - int ret = 0; - - mutex_lock(&fctx->dev->struct_mutex); - if (!list_empty(&cb->work.entry)) { - ret = -EINVAL; - } else if (fence > fctx->completed_fence) { - cb->fence = fence; - list_add_tail(&cb->work.entry, &fctx->fence_cbs); - } else { - queue_work(priv->wq, &cb->work); - } - mutex_unlock(&fctx->dev->struct_mutex); - - return ret; -} - /* called from workqueue */ void msm_update_fence(struct msm_fence_context *fctx, uint32_t fence) { - struct msm_drm_private *priv = fctx->dev->dev_private; - mutex_lock(&fctx->dev->struct_mutex); fctx->completed_fence = max(fence, fctx->completed_fence); - - while (!list_empty(&fctx->fence_cbs)) { - struct msm_fence_cb *cb; - - cb = list_first_entry(&fctx->fence_cbs, - struct msm_fence_cb, work.entry); - - if (cb->fence > fctx->completed_fence) - break; - - list_del_init(&cb->work.entry); - queue_work(priv->wq, &cb->work); - } - mutex_unlock(&fctx->dev->struct_mutex); wake_up_all(&fctx->event); } - -void __msm_fence_worker(struct work_struct *work) -{ - struct msm_fence_cb *cb = container_of(work, struct msm_fence_cb, work); - cb->func(cb); -} |