summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/etnaviv
diff options
context:
space:
mode:
authorLucas Stach <l.stach@pengutronix.de>2017-12-05 10:55:02 +0100
committerLucas Stach <l.stach@pengutronix.de>2018-02-12 16:31:00 +0100
commite0580254ae5c70f9fad3e24c20b92287ad817d8e (patch)
tree5d5c2ebd4c16de9fc472433971eb02dd48fed18c /drivers/gpu/drm/etnaviv
parent683da226f88dde7bf68940c21418995b63baae2f (diff)
downloadlinux-stable-e0580254ae5c70f9fad3e24c20b92287ad817d8e.tar.gz
linux-stable-e0580254ae5c70f9fad3e24c20b92287ad817d8e.tar.bz2
linux-stable-e0580254ae5c70f9fad3e24c20b92287ad817d8e.zip
drm/etnaviv: lock BOs after all other submit work is done
Populating objects, adding them to the GPU VM and patching/validating the command stream might take a lot of CPU time. There is no reason to hold all object reservations during that time. Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Diffstat (limited to 'drivers/gpu/drm/etnaviv')
-rw-r--r--drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c b/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
index 2e278a69f3f0..83339e0335ff 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
@@ -514,10 +514,6 @@ int etnaviv_ioctl_gem_submit(struct drm_device *dev, void *data,
if (ret)
goto err_submit_objects;
- ret = submit_lock_objects(submit, &ticket);
- if (ret)
- goto err_submit_objects;
-
if (!etnaviv_cmd_validate_one(gpu, stream, args->stream_size / 4,
relocs, args->nr_relocs)) {
ret = -EINVAL;
@@ -532,10 +528,6 @@ int etnaviv_ioctl_gem_submit(struct drm_device *dev, void *data,
}
}
- ret = submit_fence_sync(submit);
- if (ret)
- goto err_submit_objects;
-
ret = submit_pin_objects(submit);
if (ret)
goto err_submit_objects;
@@ -552,6 +544,14 @@ int etnaviv_ioctl_gem_submit(struct drm_device *dev, void *data,
memcpy(submit->cmdbuf.vaddr, stream, args->stream_size);
submit->cmdbuf.user_size = ALIGN(args->stream_size, 8);
+ ret = submit_lock_objects(submit, &ticket);
+ if (ret)
+ goto err_submit_objects;
+
+ ret = submit_fence_sync(submit);
+ if (ret)
+ goto err_submit_objects;
+
ret = etnaviv_sched_push_job(&ctx->sched_entity[args->pipe], submit);
if (ret)
goto err_submit_objects;