aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/host1x/dev.h
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2019-10-28 13:37:14 +0100
committerThierry Reding <treding@nvidia.com>2019-10-29 15:04:35 +0100
commit06867a362de08ff94fb573d84fd213795fbb3922 (patch)
treebfe85943af31ddc2c0bfd9ef57e2e7f131fc3219 /drivers/gpu/host1x/dev.h
parentgpu: host1x: Support DMA mapping of buffers (diff)
downloadlinux-dev-06867a362de08ff94fb573d84fd213795fbb3922.tar.xz
linux-dev-06867a362de08ff94fb573d84fd213795fbb3922.zip
gpu: host1x: Set DMA mask based on IOMMU setup
If the Tegra DRM clients are backed by an IOMMU, push buffers are likely to be allocated beyond the 32-bit boundary if sufficient system memory is available. This is problematic on earlier generations of Tegra where host1x supports a maximum of 32 address bits for the GATHER opcode. More recent versions of Tegra (Tegra186 and later) have a wide variant of the GATHER opcode, which allows addressing up to 64 bits of memory. If host1x itself is behind an IOMMU as well this doesn't matter because the IOMMU's input address space is restricted to 32 bits on generations without support for wide GATHER opcodes. However, if host1x is not behind an IOMMU, it won't be able to process push buffers beyond the 32-bit boundary on Tegra generations that don't support wide GATHER opcodes. Restrict the DMA mask to 32 bits on these generations prevents buffers from being allocated from beyond the 32-bit boundary. Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/gpu/host1x/dev.h')
-rw-r--r--drivers/gpu/host1x/dev.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/host1x/dev.h b/drivers/gpu/host1x/dev.h
index abafde7c665e..f781a9b0f39d 100644
--- a/drivers/gpu/host1x/dev.h
+++ b/drivers/gpu/host1x/dev.h
@@ -97,6 +97,7 @@ struct host1x_info {
int (*init)(struct host1x *host1x); /* initialize per SoC ops */
unsigned int sync_offset; /* offset of syncpoint registers */
u64 dma_mask; /* mask of addressable memory */
+ bool has_wide_gather; /* supports GATHER_W opcode */
bool has_hypervisor; /* has hypervisor registers */
unsigned int num_sid_entries;
const struct host1x_sid_entry *sid_table;