Loading drivers/gpu/drm/msm/msm_gem.c +2 −1 Original line number Diff line number Diff line Loading @@ -341,7 +341,8 @@ int msm_gem_get_iova_locked(struct drm_gem_object *obj, int id, if (obj->import_attach && mmu->funcs->map_dma_buf) { ret = mmu->funcs->map_dma_buf(mmu, msm_obj->sgt, obj->import_attach->dmabuf, DMA_BIDIRECTIONAL); DMA_BIDIRECTIONAL, msm_obj->flags); if (ret) { DRM_ERROR("Unable to map dma buf\n"); return ret; Loading drivers/gpu/drm/msm/msm_gem.h +1 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ /* Additional internal-use only BO flags: */ #define MSM_BO_STOLEN 0x10000000 /* try to use stolen/splash memory */ #define MSM_BO_KEEPATTRS 0x20000000 /* keep h/w bus attributes */ struct msm_gem_object { struct drm_gem_object base; Loading drivers/gpu/drm/msm/msm_mmu.h +1 −1 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ struct msm_mmu_funcs { void (*unmap_sg)(struct msm_mmu *mmu, struct sg_table *sgt, enum dma_data_direction dir); int (*map_dma_buf)(struct msm_mmu *mmu, struct sg_table *sgt, struct dma_buf *dma_buf, int dir); struct dma_buf *dma_buf, int dir, u32 flags); void (*unmap_dma_buf)(struct msm_mmu *mmu, struct sg_table *sgt, struct dma_buf *dma_buf, int dir); void (*destroy)(struct msm_mmu *mmu); Loading drivers/gpu/drm/msm/msm_smmu.c +8 −3 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ #include <soc/qcom/secure_buffer.h> #include "msm_drv.h" #include "msm_gem.h" #include "msm_mmu.h" #ifndef SZ_4G Loading Loading @@ -220,14 +221,18 @@ static void msm_smmu_destroy(struct msm_mmu *mmu) } static int msm_smmu_map_dma_buf(struct msm_mmu *mmu, struct sg_table *sgt, struct dma_buf *dma_buf, int dir) struct dma_buf *dma_buf, int dir, u32 flags) { struct msm_smmu *smmu = to_msm_smmu(mmu); struct msm_smmu_client *client = msm_smmu_to_client(smmu); unsigned long attrs = 0x0; int ret; ret = msm_dma_map_sg_lazy(client->dev, sgt->sgl, sgt->nents, dir, dma_buf); if (flags & MSM_BO_KEEPATTRS) attrs |= DMA_ATTR_IOMMU_USE_UPSTREAM_HINT; ret = msm_dma_map_sg_attrs(client->dev, sgt->sgl, sgt->nents, dir, dma_buf, attrs); if (ret != sgt->nents) { DRM_ERROR("dma map sg failed\n"); return -ENOMEM; Loading Loading
drivers/gpu/drm/msm/msm_gem.c +2 −1 Original line number Diff line number Diff line Loading @@ -341,7 +341,8 @@ int msm_gem_get_iova_locked(struct drm_gem_object *obj, int id, if (obj->import_attach && mmu->funcs->map_dma_buf) { ret = mmu->funcs->map_dma_buf(mmu, msm_obj->sgt, obj->import_attach->dmabuf, DMA_BIDIRECTIONAL); DMA_BIDIRECTIONAL, msm_obj->flags); if (ret) { DRM_ERROR("Unable to map dma buf\n"); return ret; Loading
drivers/gpu/drm/msm/msm_gem.h +1 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ /* Additional internal-use only BO flags: */ #define MSM_BO_STOLEN 0x10000000 /* try to use stolen/splash memory */ #define MSM_BO_KEEPATTRS 0x20000000 /* keep h/w bus attributes */ struct msm_gem_object { struct drm_gem_object base; Loading
drivers/gpu/drm/msm/msm_mmu.h +1 −1 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ struct msm_mmu_funcs { void (*unmap_sg)(struct msm_mmu *mmu, struct sg_table *sgt, enum dma_data_direction dir); int (*map_dma_buf)(struct msm_mmu *mmu, struct sg_table *sgt, struct dma_buf *dma_buf, int dir); struct dma_buf *dma_buf, int dir, u32 flags); void (*unmap_dma_buf)(struct msm_mmu *mmu, struct sg_table *sgt, struct dma_buf *dma_buf, int dir); void (*destroy)(struct msm_mmu *mmu); Loading
drivers/gpu/drm/msm/msm_smmu.c +8 −3 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ #include <soc/qcom/secure_buffer.h> #include "msm_drv.h" #include "msm_gem.h" #include "msm_mmu.h" #ifndef SZ_4G Loading Loading @@ -220,14 +221,18 @@ static void msm_smmu_destroy(struct msm_mmu *mmu) } static int msm_smmu_map_dma_buf(struct msm_mmu *mmu, struct sg_table *sgt, struct dma_buf *dma_buf, int dir) struct dma_buf *dma_buf, int dir, u32 flags) { struct msm_smmu *smmu = to_msm_smmu(mmu); struct msm_smmu_client *client = msm_smmu_to_client(smmu); unsigned long attrs = 0x0; int ret; ret = msm_dma_map_sg_lazy(client->dev, sgt->sgl, sgt->nents, dir, dma_buf); if (flags & MSM_BO_KEEPATTRS) attrs |= DMA_ATTR_IOMMU_USE_UPSTREAM_HINT; ret = msm_dma_map_sg_attrs(client->dev, sgt->sgl, sgt->nents, dir, dma_buf, attrs); if (ret != sgt->nents) { DRM_ERROR("dma map sg failed\n"); return -ENOMEM; Loading