summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/host1x
diff options
context:
space:
mode:
authorDmitry Osipenko <digetx@gmail.com>2017-06-15 01:18:43 +0200
committerThierry Reding <treding@nvidia.com>2017-06-15 14:25:56 +0200
commit43240bbd871e2c8f89584d369278a3d18680d9ea (patch)
tree925ddae78046c366d0bbeb93657a73f6d77a2d88 /drivers/gpu/host1x
parentgpu: host1x: Refactor channel allocation code (diff)
downloadlinux-43240bbd871e2c8f89584d369278a3d18680d9ea.tar.xz
linux-43240bbd871e2c8f89584d369278a3d18680d9ea.zip
gpu: host1x: At first try a non-blocking allocation for the gather copy
The blocking gather copy allocation is a major performance downside of the Host1x firewall, it may take hundreds milliseconds which is unacceptable for the real-time graphics operations. Let's try a non-blocking allocation first as a least invasive solution, it makes opentegra (Xorg driver) performance indistinguishable with/without the firewall. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/gpu/host1x')
-rw-r--r--drivers/gpu/host1x/job.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/gpu/host1x/job.c b/drivers/gpu/host1x/job.c
index f32ae69a68c7..bee504406cfc 100644
--- a/drivers/gpu/host1x/job.c
+++ b/drivers/gpu/host1x/job.c
@@ -574,12 +574,20 @@ static inline int copy_gathers(struct host1x_job *job, struct device *dev)
size += g->words * sizeof(u32);
}
+ /*
+ * Try a non-blocking allocation from a higher priority pools first,
+ * as awaiting for the allocation here is a major performance hit.
+ */
job->gather_copy_mapped = dma_alloc_wc(dev, size, &job->gather_copy,
- GFP_KERNEL);
- if (!job->gather_copy_mapped) {
- job->gather_copy_mapped = NULL;
+ GFP_NOWAIT);
+
+ /* the higher priority allocation failed, try the generic-blocking */
+ if (!job->gather_copy_mapped)
+ job->gather_copy_mapped = dma_alloc_wc(dev, size,
+ &job->gather_copy,
+ GFP_KERNEL);
+ if (!job->gather_copy_mapped)
return -ENOMEM;
- }
job->gather_copy_size = size;