summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/msm/msm_gem_submit.c
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2016-03-16 01:26:28 +0300
committerRob Clark <robdclark@gmail.com>2016-05-08 17:22:15 +0300
commitb6295f9a38fc3f7d59ec0caa45aa803461c6cea5 (patch)
tree81f8e68dfaf8d900d86cd971e293d6a824a178d0 /drivers/gpu/drm/msm/msm_gem_submit.c
parentba00c3f2f0c84456ffe9d548823ff4fb8e4e7ed4 (diff)
downloadlinux-b6295f9a38fc3f7d59ec0caa45aa803461c6cea5.tar.xz
drm/msm: 'struct fence' conversion
Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/msm/msm_gem_submit.c')
-rw-r--r--drivers/gpu/drm/msm/msm_gem_submit.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c b/drivers/gpu/drm/msm/msm_gem_submit.c
index b231544b3f52..2661a7cb23c8 100644
--- a/drivers/gpu/drm/msm/msm_gem_submit.c
+++ b/drivers/gpu/drm/msm/msm_gem_submit.c
@@ -184,6 +184,22 @@ fail:
return ret;
}
+static int submit_fence_sync(struct msm_gem_submit *submit)
+{
+ int i, ret = 0;
+
+ for (i = 0; i < submit->nr_bos; i++) {
+ struct msm_gem_object *msm_obj = submit->bos[i].obj;
+ bool write = submit->bos[i].flags & MSM_SUBMIT_BO_WRITE;
+
+ ret = msm_gem_sync_object(&msm_obj->base, submit->gpu->fctx, write);
+ if (ret)
+ break;
+ }
+
+ return ret;
+}
+
static int submit_pin_objects(struct msm_gem_submit *submit)
{
int i, ret = 0;
@@ -358,6 +374,10 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
if (ret)
goto out;
+ ret = submit_fence_sync(submit);
+ if (ret)
+ goto out;
+
ret = submit_pin_objects(submit);
if (ret)
goto out;
@@ -424,7 +444,7 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
ret = msm_gpu_submit(gpu, submit, ctx);
- args->fence = submit->fence;
+ args->fence = submit->fence->seqno;
out:
submit_cleanup(submit, !!ret);