drm/tegra: gem: Remove premature import restrictions
authorThierry Reding <treding@nvidia.com>
Tue, 3 Dec 2019 16:19:08 +0000 (17:19 +0100)
committerThierry Reding <treding@nvidia.com>
Wed, 4 Dec 2019 12:36:23 +0000 (13:36 +0100)
commit49f821919bb9d45de7f1cde6072de01d36235b5d
tree8f12ee098efe70df2c5c9823477ef4860fff7a10
parent1f16deac766926f1f59a7c038e939b09ef8edfc8
drm/tegra: gem: Remove premature import restrictions

All the display related blocks on Tegra require contiguous memory. Using
the DMA API, there is no knowing at import time which device will end up
using the buffer, so it's not known whether or not an IOMMU will be used
to map the buffer.

Move the check for non-contiguous buffers/mappings to the tegra_dc_pin()
function which is now the earliest point where it is known if a DMA BUF
can be used by the given device or not.

v2: add check for contiguous buffer/mapping in tegra_dc_pin()

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/gpu/drm/tegra/gem.c
drivers/gpu/drm/tegra/plane.c