Loading drivers/gpu/drm/msm/msm_iommu.c +5 −9 Original line number Diff line number Diff line Loading @@ -43,13 +43,13 @@ static void msm_iommu_detach(struct msm_mmu *mmu, const char **names, int cnt) iommu_detach_device(iommu->domain, mmu->dev); } static int msm_iommu_map(struct msm_mmu *mmu, uint32_t iova, static int msm_iommu_map(struct msm_mmu *mmu, dma_addr_t iova, struct sg_table *sgt, unsigned len, int prot) { struct msm_iommu *iommu = to_msm_iommu(mmu); struct iommu_domain *domain = iommu->domain; struct scatterlist *sg; unsigned int da = iova; dma_addr_t da = iova; unsigned int i, j; int ret; Loading @@ -57,11 +57,9 @@ static int msm_iommu_map(struct msm_mmu *mmu, uint32_t iova, return -EINVAL; for_each_sg(sgt->sgl, sg, sgt->nents, i) { u32 pa = sg_phys(sg) - sg->offset; dma_addr_t pa = sg_phys(sg) - sg->offset; size_t bytes = sg->length + sg->offset; VERB("map[%d]: %08x %08x(%zx)", i, iova, pa, bytes); ret = iommu_map(domain, da, pa, bytes, prot); if (ret) goto fail; Loading @@ -82,13 +80,13 @@ fail: return ret; } static int msm_iommu_unmap(struct msm_mmu *mmu, uint32_t iova, static int msm_iommu_unmap(struct msm_mmu *mmu, dma_addr_t iova, struct sg_table *sgt, unsigned len) { struct msm_iommu *iommu = to_msm_iommu(mmu); struct iommu_domain *domain = iommu->domain; struct scatterlist *sg; unsigned int da = iova; dma_addr_t da = iova; int i; for_each_sg(sgt->sgl, sg, sgt->nents, i) { Loading @@ -99,8 +97,6 @@ static int msm_iommu_unmap(struct msm_mmu *mmu, uint32_t iova, if (unmapped < bytes) return unmapped; VERB("unmap[%d]: %08x(%zx)", i, iova, bytes); BUG_ON(!PAGE_ALIGNED(bytes)); da += bytes; Loading drivers/gpu/drm/msm/msm_mmu.h +2 −2 Original line number Diff line number Diff line Loading @@ -35,9 +35,9 @@ enum msm_mmu_domain_type { struct msm_mmu_funcs { int (*attach)(struct msm_mmu *mmu, const char **names, int cnt); void (*detach)(struct msm_mmu *mmu, const char **names, int cnt); int (*map)(struct msm_mmu *mmu, uint32_t iova, struct sg_table *sgt, int (*map)(struct msm_mmu *mmu, dma_addr_t iova, struct sg_table *sgt, unsigned len, int prot); int (*unmap)(struct msm_mmu *mmu, uint32_t iova, struct sg_table *sgt, int (*unmap)(struct msm_mmu *mmu, dma_addr_t iova, struct sg_table *sgt, unsigned len); int (*map_sg)(struct msm_mmu *mmu, struct sg_table *sgt, enum dma_data_direction dir); Loading drivers/gpu/drm/msm/msm_smmu.c +7 −11 Original line number Diff line number Diff line Loading @@ -96,16 +96,17 @@ static void msm_smmu_detach(struct msm_mmu *mmu, const char **names, int cnt) DBG("detaching"); } static int msm_smmu_map(struct msm_mmu *mmu, uint32_t iova, static int msm_smmu_map(struct msm_mmu *mmu, dma_addr_t iova, struct sg_table *sgt, unsigned len, int prot) { struct msm_smmu *smmu = to_msm_smmu(mmu); struct msm_smmu_client *client = msm_smmu_to_client(smmu); struct iommu_domain *domain; struct scatterlist *sg; unsigned int da = iova; dma_addr_t da = iova; unsigned int i, j; int ret; size_t bytes; if (!client) return -ENODEV; Loading @@ -115,11 +116,9 @@ static int msm_smmu_map(struct msm_mmu *mmu, uint32_t iova, return -EINVAL; for_each_sg(sgt->sgl, sg, sgt->nents, i) { u32 pa = sg_phys(sg) - sg->offset; dma_addr_t pa = sg_phys(sg) - sg->offset; size_t bytes = sg->length + sg->offset; VERB("map[%d]: %08x %08x(%zx)", i, iova, pa, bytes); ret = iommu_map(domain, da, pa, bytes, prot); if (ret) goto fail; Loading @@ -133,8 +132,7 @@ fail: da = iova; for_each_sg(sgt->sgl, sg, i, j) { size_t bytes = sg->length + sg->offset; bytes = sg->length + sg->offset; iommu_unmap(domain, da, bytes); da += bytes; } Loading Loading @@ -164,14 +162,14 @@ static void msm_smmu_unmap_sg(struct msm_mmu *mmu, struct sg_table *sgt, dma_unmap_sg(client->dev, sgt->sgl, sgt->nents, dir); } static int msm_smmu_unmap(struct msm_mmu *mmu, uint32_t iova, static int msm_smmu_unmap(struct msm_mmu *mmu, dma_addr_t iova, struct sg_table *sgt, unsigned len) { struct msm_smmu *smmu = to_msm_smmu(mmu); struct msm_smmu_client *client = msm_smmu_to_client(smmu); struct iommu_domain *domain; struct scatterlist *sg; unsigned int da = iova; dma_addr_t da = iova; int i; if (!client) Loading @@ -189,8 +187,6 @@ static int msm_smmu_unmap(struct msm_mmu *mmu, uint32_t iova, if (unmapped < bytes) return unmapped; VERB("unmap[%d]: %08x(%zx)", i, iova, bytes); WARN_ON(!PAGE_ALIGNED(bytes)); da += bytes; Loading Loading
drivers/gpu/drm/msm/msm_iommu.c +5 −9 Original line number Diff line number Diff line Loading @@ -43,13 +43,13 @@ static void msm_iommu_detach(struct msm_mmu *mmu, const char **names, int cnt) iommu_detach_device(iommu->domain, mmu->dev); } static int msm_iommu_map(struct msm_mmu *mmu, uint32_t iova, static int msm_iommu_map(struct msm_mmu *mmu, dma_addr_t iova, struct sg_table *sgt, unsigned len, int prot) { struct msm_iommu *iommu = to_msm_iommu(mmu); struct iommu_domain *domain = iommu->domain; struct scatterlist *sg; unsigned int da = iova; dma_addr_t da = iova; unsigned int i, j; int ret; Loading @@ -57,11 +57,9 @@ static int msm_iommu_map(struct msm_mmu *mmu, uint32_t iova, return -EINVAL; for_each_sg(sgt->sgl, sg, sgt->nents, i) { u32 pa = sg_phys(sg) - sg->offset; dma_addr_t pa = sg_phys(sg) - sg->offset; size_t bytes = sg->length + sg->offset; VERB("map[%d]: %08x %08x(%zx)", i, iova, pa, bytes); ret = iommu_map(domain, da, pa, bytes, prot); if (ret) goto fail; Loading @@ -82,13 +80,13 @@ fail: return ret; } static int msm_iommu_unmap(struct msm_mmu *mmu, uint32_t iova, static int msm_iommu_unmap(struct msm_mmu *mmu, dma_addr_t iova, struct sg_table *sgt, unsigned len) { struct msm_iommu *iommu = to_msm_iommu(mmu); struct iommu_domain *domain = iommu->domain; struct scatterlist *sg; unsigned int da = iova; dma_addr_t da = iova; int i; for_each_sg(sgt->sgl, sg, sgt->nents, i) { Loading @@ -99,8 +97,6 @@ static int msm_iommu_unmap(struct msm_mmu *mmu, uint32_t iova, if (unmapped < bytes) return unmapped; VERB("unmap[%d]: %08x(%zx)", i, iova, bytes); BUG_ON(!PAGE_ALIGNED(bytes)); da += bytes; Loading
drivers/gpu/drm/msm/msm_mmu.h +2 −2 Original line number Diff line number Diff line Loading @@ -35,9 +35,9 @@ enum msm_mmu_domain_type { struct msm_mmu_funcs { int (*attach)(struct msm_mmu *mmu, const char **names, int cnt); void (*detach)(struct msm_mmu *mmu, const char **names, int cnt); int (*map)(struct msm_mmu *mmu, uint32_t iova, struct sg_table *sgt, int (*map)(struct msm_mmu *mmu, dma_addr_t iova, struct sg_table *sgt, unsigned len, int prot); int (*unmap)(struct msm_mmu *mmu, uint32_t iova, struct sg_table *sgt, int (*unmap)(struct msm_mmu *mmu, dma_addr_t iova, struct sg_table *sgt, unsigned len); int (*map_sg)(struct msm_mmu *mmu, struct sg_table *sgt, enum dma_data_direction dir); Loading
drivers/gpu/drm/msm/msm_smmu.c +7 −11 Original line number Diff line number Diff line Loading @@ -96,16 +96,17 @@ static void msm_smmu_detach(struct msm_mmu *mmu, const char **names, int cnt) DBG("detaching"); } static int msm_smmu_map(struct msm_mmu *mmu, uint32_t iova, static int msm_smmu_map(struct msm_mmu *mmu, dma_addr_t iova, struct sg_table *sgt, unsigned len, int prot) { struct msm_smmu *smmu = to_msm_smmu(mmu); struct msm_smmu_client *client = msm_smmu_to_client(smmu); struct iommu_domain *domain; struct scatterlist *sg; unsigned int da = iova; dma_addr_t da = iova; unsigned int i, j; int ret; size_t bytes; if (!client) return -ENODEV; Loading @@ -115,11 +116,9 @@ static int msm_smmu_map(struct msm_mmu *mmu, uint32_t iova, return -EINVAL; for_each_sg(sgt->sgl, sg, sgt->nents, i) { u32 pa = sg_phys(sg) - sg->offset; dma_addr_t pa = sg_phys(sg) - sg->offset; size_t bytes = sg->length + sg->offset; VERB("map[%d]: %08x %08x(%zx)", i, iova, pa, bytes); ret = iommu_map(domain, da, pa, bytes, prot); if (ret) goto fail; Loading @@ -133,8 +132,7 @@ fail: da = iova; for_each_sg(sgt->sgl, sg, i, j) { size_t bytes = sg->length + sg->offset; bytes = sg->length + sg->offset; iommu_unmap(domain, da, bytes); da += bytes; } Loading Loading @@ -164,14 +162,14 @@ static void msm_smmu_unmap_sg(struct msm_mmu *mmu, struct sg_table *sgt, dma_unmap_sg(client->dev, sgt->sgl, sgt->nents, dir); } static int msm_smmu_unmap(struct msm_mmu *mmu, uint32_t iova, static int msm_smmu_unmap(struct msm_mmu *mmu, dma_addr_t iova, struct sg_table *sgt, unsigned len) { struct msm_smmu *smmu = to_msm_smmu(mmu); struct msm_smmu_client *client = msm_smmu_to_client(smmu); struct iommu_domain *domain; struct scatterlist *sg; unsigned int da = iova; dma_addr_t da = iova; int i; if (!client) Loading @@ -189,8 +187,6 @@ static int msm_smmu_unmap(struct msm_mmu *mmu, uint32_t iova, if (unmapped < bytes) return unmapped; VERB("unmap[%d]: %08x(%zx)", i, iova, bytes); WARN_ON(!PAGE_ALIGNED(bytes)); da += bytes; Loading