summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/msm/msm_drv.c
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2014-11-07 18:10:04 -0500
committerRob Clark <robdclark@gmail.com>2014-11-16 14:27:35 -0500
commit69193e5060dd1c8f7cd614bad05f33f3e042ae6d (patch)
tree94f8c5ab7e2847e8955cbd6323c7365dbf83e918 /drivers/gpu/drm/msm/msm_drv.c
parenta8cecf33249b80d8a3c2ca5df1c45eb3b5231b28 (diff)
downloadlinux-69193e5060dd1c8f7cd614bad05f33f3e042ae6d.tar.gz
linux-69193e5060dd1c8f7cd614bad05f33f3e042ae6d.tar.bz2
linux-69193e5060dd1c8f7cd614bad05f33f3e042ae6d.zip
drm/msm: small fence cleanup
Give ourselves a way to wait for certain fence #.. makes it easier to wait on a set of bo's, which we'll need for atomic. Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/msm/msm_drv.c')
-rw-r--r--drivers/gpu/drm/msm/msm_drv.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index 5717d4ec1a2c..1456b1c3e890 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -619,6 +619,26 @@ int msm_wait_fence_interruptable(struct drm_device *dev, uint32_t fence,
return ret;
}
+int msm_queue_fence_cb(struct drm_device *dev,
+ struct msm_fence_cb *cb, uint32_t fence)
+{
+ struct msm_drm_private *priv = dev->dev_private;
+ int ret = 0;
+
+ mutex_lock(&dev->struct_mutex);
+ if (!list_empty(&cb->work.entry)) {
+ ret = -EINVAL;
+ } else if (fence > priv->completed_fence) {
+ cb->fence = fence;
+ list_add_tail(&cb->work.entry, &priv->fence_cbs);
+ } else {
+ queue_work(priv->wq, &cb->work);
+ }
+ mutex_unlock(&dev->struct_mutex);
+
+ return ret;
+}
+
/* called from workqueue */
void msm_update_fence(struct drm_device *dev, uint32_t fence)
{