Loading drivers/video/fbdev/msm/mdss_mdp_splash_logo.c +29 −16 Original line number Diff line number Diff line Loading @@ -149,7 +149,7 @@ static int mdss_mdp_splash_iommu_attach(struct msm_fb_data_type *mfd) { struct mdss_overlay_private *mdp5_data = mfd_to_mdp5_data(mfd); struct mdss_data_type *mdata = mdss_mdp_get_mdata(); int rc, ret; int ret; /* * iommu dynamic attach for following conditions. Loading @@ -166,26 +166,41 @@ static int mdss_mdp_splash_iommu_attach(struct msm_fb_data_type *mfd) return -EPERM; } rc = mdss_smmu_map(MDSS_IOMMU_DOMAIN_UNSECURE, mdp5_data->splash_mem_addr, mdp5_data->splash_mem_addr, mdp5_data->splash_mem_size, IOMMU_READ | IOMMU_NOEXEC); if (rc) { pr_debug("iommu memory mapping failed rc=%d\n", rc); } else { /* * Putting handoff pending to false to ensure smmu attach happens * with early flag attribute */ mdata->handoff_pending = false; ret = mdss_smmu_set_attribute(MDSS_IOMMU_DOMAIN_UNSECURE, EARLY_MAP, 1); if (ret) { pr_debug("mdss set attribute failed for early map\n"); goto end; } ret = mdss_iommu_ctrl(1); if (IS_ERR_VALUE((unsigned long)ret)) { pr_err("mdss iommu attach failed\n"); mdss_smmu_unmap(MDSS_IOMMU_DOMAIN_UNSECURE, goto end; } ret = mdss_smmu_map(MDSS_IOMMU_DOMAIN_UNSECURE, mdp5_data->splash_mem_addr, mdp5_data->splash_mem_size); mdp5_data->splash_mem_addr, mdp5_data->splash_mem_size, IOMMU_READ | IOMMU_NOEXEC); if (ret) { pr_err("iommu memory mapping failed ret=%d\n", ret); } else { pr_debug("iommu map passed for PA=VA\n"); mfd->splash_info.iommu_dynamic_attached = true; } } return rc; ret = mdss_smmu_set_attribute(MDSS_IOMMU_DOMAIN_UNSECURE, EARLY_MAP, 0); end: mdata->handoff_pending = true; return ret; } static void mdss_mdp_splash_unmap_splash_mem(struct msm_fb_data_type *mfd) Loading @@ -193,12 +208,10 @@ static void mdss_mdp_splash_unmap_splash_mem(struct msm_fb_data_type *mfd) struct mdss_overlay_private *mdp5_data = mfd_to_mdp5_data(mfd); if (mfd->splash_info.iommu_dynamic_attached) { mdss_smmu_unmap(MDSS_IOMMU_DOMAIN_UNSECURE, mdp5_data->splash_mem_addr, mdp5_data->splash_mem_size); mdss_iommu_ctrl(0); mfd->splash_info.iommu_dynamic_attached = false; } } Loading drivers/video/fbdev/msm/mdss_smmu.c +21 −0 Original line number Diff line number Diff line Loading @@ -180,6 +180,27 @@ static int mdss_smmu_enable_power(struct mdss_smmu_client *mdss_smmu, return rc; } int mdss_smmu_set_attribute(int domain, int flag, int val) { int rc = 0, domain_attr = 0; struct mdss_smmu_client *mdss_smmu = mdss_smmu_get_cb(domain); if (!mdss_smmu) { pr_err("not able to get smmu context\n"); return -EINVAL; } if (flag == EARLY_MAP) domain_attr = DOMAIN_ATTR_EARLY_MAP; else goto end; rc = iommu_domain_set_attr(mdss_smmu->mmu_mapping->domain, domain_attr, &val); end: return rc; } /* * mdss_smmu_v2_attach() * Loading drivers/video/fbdev/msm/mdss_smmu.h +5 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,11 @@ struct mdss_smmu_domain { void mdss_smmu_register(struct device *dev); int mdss_smmu_init(struct mdss_data_type *mdata, struct device *dev); int mdss_smmu_set_attribute(int domain, int flag, int val); enum smmu_attributes { EARLY_MAP }; static inline int mdss_smmu_dma_data_direction(int dir) { Loading Loading
drivers/video/fbdev/msm/mdss_mdp_splash_logo.c +29 −16 Original line number Diff line number Diff line Loading @@ -149,7 +149,7 @@ static int mdss_mdp_splash_iommu_attach(struct msm_fb_data_type *mfd) { struct mdss_overlay_private *mdp5_data = mfd_to_mdp5_data(mfd); struct mdss_data_type *mdata = mdss_mdp_get_mdata(); int rc, ret; int ret; /* * iommu dynamic attach for following conditions. Loading @@ -166,26 +166,41 @@ static int mdss_mdp_splash_iommu_attach(struct msm_fb_data_type *mfd) return -EPERM; } rc = mdss_smmu_map(MDSS_IOMMU_DOMAIN_UNSECURE, mdp5_data->splash_mem_addr, mdp5_data->splash_mem_addr, mdp5_data->splash_mem_size, IOMMU_READ | IOMMU_NOEXEC); if (rc) { pr_debug("iommu memory mapping failed rc=%d\n", rc); } else { /* * Putting handoff pending to false to ensure smmu attach happens * with early flag attribute */ mdata->handoff_pending = false; ret = mdss_smmu_set_attribute(MDSS_IOMMU_DOMAIN_UNSECURE, EARLY_MAP, 1); if (ret) { pr_debug("mdss set attribute failed for early map\n"); goto end; } ret = mdss_iommu_ctrl(1); if (IS_ERR_VALUE((unsigned long)ret)) { pr_err("mdss iommu attach failed\n"); mdss_smmu_unmap(MDSS_IOMMU_DOMAIN_UNSECURE, goto end; } ret = mdss_smmu_map(MDSS_IOMMU_DOMAIN_UNSECURE, mdp5_data->splash_mem_addr, mdp5_data->splash_mem_size); mdp5_data->splash_mem_addr, mdp5_data->splash_mem_size, IOMMU_READ | IOMMU_NOEXEC); if (ret) { pr_err("iommu memory mapping failed ret=%d\n", ret); } else { pr_debug("iommu map passed for PA=VA\n"); mfd->splash_info.iommu_dynamic_attached = true; } } return rc; ret = mdss_smmu_set_attribute(MDSS_IOMMU_DOMAIN_UNSECURE, EARLY_MAP, 0); end: mdata->handoff_pending = true; return ret; } static void mdss_mdp_splash_unmap_splash_mem(struct msm_fb_data_type *mfd) Loading @@ -193,12 +208,10 @@ static void mdss_mdp_splash_unmap_splash_mem(struct msm_fb_data_type *mfd) struct mdss_overlay_private *mdp5_data = mfd_to_mdp5_data(mfd); if (mfd->splash_info.iommu_dynamic_attached) { mdss_smmu_unmap(MDSS_IOMMU_DOMAIN_UNSECURE, mdp5_data->splash_mem_addr, mdp5_data->splash_mem_size); mdss_iommu_ctrl(0); mfd->splash_info.iommu_dynamic_attached = false; } } Loading
drivers/video/fbdev/msm/mdss_smmu.c +21 −0 Original line number Diff line number Diff line Loading @@ -180,6 +180,27 @@ static int mdss_smmu_enable_power(struct mdss_smmu_client *mdss_smmu, return rc; } int mdss_smmu_set_attribute(int domain, int flag, int val) { int rc = 0, domain_attr = 0; struct mdss_smmu_client *mdss_smmu = mdss_smmu_get_cb(domain); if (!mdss_smmu) { pr_err("not able to get smmu context\n"); return -EINVAL; } if (flag == EARLY_MAP) domain_attr = DOMAIN_ATTR_EARLY_MAP; else goto end; rc = iommu_domain_set_attr(mdss_smmu->mmu_mapping->domain, domain_attr, &val); end: return rc; } /* * mdss_smmu_v2_attach() * Loading
drivers/video/fbdev/msm/mdss_smmu.h +5 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,11 @@ struct mdss_smmu_domain { void mdss_smmu_register(struct device *dev); int mdss_smmu_init(struct mdss_data_type *mdata, struct device *dev); int mdss_smmu_set_attribute(int domain, int flag, int val); enum smmu_attributes { EARLY_MAP }; static inline int mdss_smmu_dma_data_direction(int dir) { Loading