video: tegra: host: Use nvmap_pin only for default ASID
Terje Bergstrom [Tue, 20 Aug 2013 07:55:46 +0000 (10:55 +0300)]
Retrieve the default ASID via tegra_smmu_get_asid(). If we're mapping
buffer to a non-default ASID, skip the nvmap_pin() path and map via
DMA Mapping API.

Bug 1351530

Change-Id: I5078033e71f759901e6e4bd8a27ede5f1d5fbc37
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/263758
Reviewed-by: Hiroshi Doyu <hdoyu@nvidia.com>
Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>

drivers/video/tegra/host/nvmap.c

index cd7540b..f5b875c 100644 (file)
@@ -177,7 +177,7 @@ struct sg_table *nvhost_nvmap_pin(struct mem_mgr *mgr,
                        return ERR_PTR(-ENOMEM);
                }
 
-               if (!IS_ERR_VALUE(addr))
+               if (asid == tegra_smmu_get_asid(NULL) && !IS_ERR_VALUE(addr))
                        as_priv->flags |= BIT(FLAG_NVMAP_MAPPED);
 
                priv->as[asid] = as_priv;