aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/host1x/bus.c
diff options
context:
space:
mode:
authorThierry Reding2019-06-05 10:46:05 +0200
committerThierry Reding2019-06-05 15:06:03 +0200
commit1e390478cfb527e34c9ab89ba57212cb05c33c51 (patch)
tree52f790df1855e6ba69265b2f73b3c270bed7c834 /drivers/gpu/host1x/bus.c
parent4bb923e8075f3acbe2e422e9bfd0235b21d3e643 (diff)
gpu: host1x: Increase maximum DMA segment size
Recent versions of the DMA API debug code have started to warn about violations of the maximum DMA segment size. This is because the segment size defaults to 64 KiB, which can easily be exceeded in large buffer allocations such as used in DRM/KMS for framebuffers. Technically the Tegra SMMU and ARM SMMU don't have a maximum segment size (they map individual pages irrespective of whether they are contiguous or not), so the choice of 4 MiB is a bit arbitrary here. The maximum segment size is a 32-bit unsigned integer, though, so we can't set it to the correct maximum size, which would be the size of the aperture. Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/gpu/host1x/bus.c')
-rw-r--r--drivers/gpu/host1x/bus.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/host1x/bus.c b/drivers/gpu/host1x/bus.c
index 103fffc1904b..c9a637d9417e 100644
--- a/drivers/gpu/host1x/bus.c
+++ b/drivers/gpu/host1x/bus.c
@@ -425,6 +425,9 @@ static int host1x_device_add(struct host1x *host1x,
of_dma_configure(&device->dev, host1x->dev->of_node, true);
+ device->dev.dma_parms = &device->dma_parms;
+ dma_set_max_seg_size(&device->dev, SZ_4M);
+
err = host1x_device_parse_dt(device, driver);
if (err < 0) {
kfree(device);