drm/tegra: uapi: Fix wrong mapping end address in case of disabled IOMMU
authorDmitry Osipenko <digetx@gmail.com>
Tue, 17 Aug 2021 02:01:52 +0000 (05:01 +0300)
committerThierry Reding <treding@nvidia.com>
Thu, 16 Sep 2021 16:06:51 +0000 (18:06 +0200)
All jobs are failing on Tegra20 because it doesn't use IOMMU and mapping
function uses size of mapping that is zero instead of BO size, fix it.

Fixes: d7c591bc1a3f ("drm/tegra: Implement new UAPI")
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/gpu/drm/tegra/uapi.c

index dc16a24f4dbe2df287fc296d5381686b0dc41f14..690a339c52ec6efebd6cbd5f5eff9529e26d5c10 100644 (file)
@@ -222,7 +222,7 @@ int tegra_drm_ioctl_channel_map(struct drm_device *drm, void *data, struct drm_f
                mapping->iova = sg_dma_address(mapping->sgt->sgl);
        }
 
-       mapping->iova_end = mapping->iova + host1x_to_tegra_bo(mapping->bo)->size;
+       mapping->iova_end = mapping->iova + host1x_to_tegra_bo(mapping->bo)->gem.size;
 
        err = xa_alloc(&context->mappings, &args->mapping, mapping, XA_LIMIT(1, U32_MAX),
                       GFP_KERNEL);