aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Osipenko <digetx@gmail.com>2017-06-14 19:18:43 -0400
committerThierry Reding <treding@nvidia.com>2017-06-15 08:25:56 -0400
commit43240bbd871e2c8f89584d369278a3d18680d9ea (patch)
tree925ddae78046c366d0bbeb93657a73f6d77a2d88
parent8474b02531c4881a762c52ef869c52429e38633f (diff)
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>
-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)
574 size += g->words * sizeof(u32); 574 size += g->words * sizeof(u32);
575 } 575 }
576 576
577 /*
578 * Try a non-blocking allocation from a higher priority pools first,
579 * as awaiting for the allocation here is a major performance hit.
580 */
577 job->gather_copy_mapped = dma_alloc_wc(dev, size, &job->gather_copy, 581 job->gather_copy_mapped = dma_alloc_wc(dev, size, &job->gather_copy,
578 GFP_KERNEL); 582 GFP_NOWAIT);
579 if (!job->gather_copy_mapped) { 583
580 job->gather_copy_mapped = NULL; 584 /* the higher priority allocation failed, try the generic-blocking */
585 if (!job->gather_copy_mapped)
586 job->gather_copy_mapped = dma_alloc_wc(dev, size,
587 &job->gather_copy,
588 GFP_KERNEL);
589 if (!job->gather_copy_mapped)
581 return -ENOMEM; 590 return -ENOMEM;
582 }
583 591
584 job->gather_copy_size = size; 592 job->gather_copy_size = size;
585 593