]> git.samba.org - sfrench/cifs-2.6.git/commit
gpu: host1x: Set DMA mask based on IOMMU setup
authorThierry Reding <treding@nvidia.com>
Mon, 28 Oct 2019 12:37:14 +0000 (13:37 +0100)
committerThierry Reding <treding@nvidia.com>
Tue, 29 Oct 2019 14:04:35 +0000 (15:04 +0100)
commit06867a362de08ff94fb573d84fd213795fbb3922
treebfe85943af31ddc2c0bfd9ef57e2e7f131fc3219
parentaf1cbfb9bf0fe079ca328231451fd4db8b3eafec
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>
drivers/gpu/host1x/dev.c
drivers/gpu/host1x/dev.h