Loading drivers/video/msm/mdss/mdss.h +2 −0 Original line number Diff line number Diff line Loading @@ -482,6 +482,8 @@ struct mdss_util_intf { int (*get_iommu_domain)(u32 type); int (*iommu_attached)(void); int (*iommu_ctrl)(int enable); void (*iommu_lock)(void); void (*iommu_unlock)(void); void (*bus_bandwidth_ctrl)(int enable); int (*bus_scale_set_quota)(int client, u64 ab_quota, u64 ib_quota); int (*panel_intf_status)(u32 disp_num, u32 intf_type); Loading drivers/video/msm/mdss/mdss_dsi_host.c +6 −1 Original line number Diff line number Diff line Loading @@ -1862,11 +1862,13 @@ static int mdss_dsi_cmd_dma_tx(struct mdss_dsi_ctrl_pdata *ctrl, len = ALIGN(tp->len, 4); ctrl->dma_size = ALIGN(tp->len, SZ_4K); ctrl->mdss_util->iommu_lock(); if (ctrl->mdss_util->iommu_attached()) { ret = mdss_smmu_dsi_map_buffer(tp->dmap, domain, ctrl->dma_size, &(ctrl->dma_addr), tp->start, DMA_TO_DEVICE); if (IS_ERR_VALUE(ret)) { pr_err("unable to map dma memory to iommu(%d)\n", ret); ctrl->mdss_util->iommu_unlock(); return -ENOMEM; } ctrl->dmap_iommu_map = true; Loading Loading @@ -1971,6 +1973,7 @@ static int mdss_dsi_cmd_dma_tx(struct mdss_dsi_ctrl_pdata *ctrl, ctrl->dma_addr = 0; ctrl->dma_size = 0; end: ctrl->mdss_util->iommu_unlock(); return ret; } Loading Loading @@ -2315,6 +2318,7 @@ int mdss_dsi_cmdlist_commit(struct mdss_dsi_ctrl_pdata *ctrl, int from_mdp) struct dcs_cmd_req *req; struct mdss_panel_info *pinfo; struct mdss_rect *roi = NULL; bool use_iommu = false; int ret = -EINVAL; int rc = 0; bool hs_req = false; Loading Loading @@ -2407,6 +2411,7 @@ int mdss_dsi_cmdlist_commit(struct mdss_dsi_ctrl_pdata *ctrl, int from_mdp) mutex_unlock(&ctrl->cmd_mutex); return rc; } use_iommu = true; } } Loading @@ -2425,7 +2430,7 @@ int mdss_dsi_cmdlist_commit(struct mdss_dsi_ctrl_pdata *ctrl, int from_mdp) mdss_dsi_set_tx_power_mode(1, &ctrl->panel_data); if (!(req->flags & CMD_REQ_DMA_TPG)) { if (ctrl->mdss_util->iommu_ctrl) if (use_iommu) ctrl->mdss_util->iommu_ctrl(0); (void)mdss_dsi_bus_bandwidth_vote(ctrl->shared_data, false); Loading drivers/video/msm/mdss/mdss_mdp.c +3 −3 Original line number Diff line number Diff line Loading @@ -91,7 +91,7 @@ struct msm_mdp_interface mdp5 = { static DEFINE_SPINLOCK(mdp_lock); static DEFINE_MUTEX(mdp_clk_lock); static DEFINE_MUTEX(mdp_iommu_lock); static DEFINE_MUTEX(mdp_iommu_ref_cnt_lock); static DEFINE_MUTEX(mdp_fs_idle_pc_lock); static struct mdss_panel_intf pan_types[] = { Loading Loading @@ -817,7 +817,7 @@ int mdss_iommu_ctrl(int enable) struct mdss_data_type *mdata = mdss_mdp_get_mdata(); int rc = 0; mutex_lock(&mdp_iommu_lock); mutex_lock(&mdp_iommu_ref_cnt_lock); pr_debug("%pS: enable:%d ref_cnt:%d attach:%d hoff:%d\n", __builtin_return_address(0), enable, mdata->iommu_ref_cnt, mdata->iommu_attached, mdata->handoff_pending); Loading @@ -839,7 +839,7 @@ int mdss_iommu_ctrl(int enable) pr_err("unbalanced iommu ref\n"); } } mutex_unlock(&mdp_iommu_lock); mutex_unlock(&mdp_iommu_ref_cnt_lock); if (IS_ERR_VALUE(rc)) return rc; Loading drivers/video/msm/mdss/mdss_smmu.c +14 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,18 @@ #include "mdss_mdp.h" #include "mdss_smmu.h" static DEFINE_MUTEX(mdp_iommu_lock); void mdss_iommu_lock(void) { mutex_lock(&mdp_iommu_lock); } void mdss_iommu_unlock(void) { mutex_unlock(&mdp_iommu_lock); } static int mdss_smmu_util_parse_dt_clock(struct platform_device *pdev, struct dss_module_power *mp) { Loading Loading @@ -469,6 +481,8 @@ int mdss_smmu_init(struct mdss_data_type *mdata, struct device *dev) { mdss_smmu_device_create(dev); mdss_smmu_ops_init(mdata); mdata->mdss_util->iommu_lock = mdss_iommu_lock; mdata->mdss_util->iommu_unlock = mdss_iommu_unlock; return 0; } Loading Loading
drivers/video/msm/mdss/mdss.h +2 −0 Original line number Diff line number Diff line Loading @@ -482,6 +482,8 @@ struct mdss_util_intf { int (*get_iommu_domain)(u32 type); int (*iommu_attached)(void); int (*iommu_ctrl)(int enable); void (*iommu_lock)(void); void (*iommu_unlock)(void); void (*bus_bandwidth_ctrl)(int enable); int (*bus_scale_set_quota)(int client, u64 ab_quota, u64 ib_quota); int (*panel_intf_status)(u32 disp_num, u32 intf_type); Loading
drivers/video/msm/mdss/mdss_dsi_host.c +6 −1 Original line number Diff line number Diff line Loading @@ -1862,11 +1862,13 @@ static int mdss_dsi_cmd_dma_tx(struct mdss_dsi_ctrl_pdata *ctrl, len = ALIGN(tp->len, 4); ctrl->dma_size = ALIGN(tp->len, SZ_4K); ctrl->mdss_util->iommu_lock(); if (ctrl->mdss_util->iommu_attached()) { ret = mdss_smmu_dsi_map_buffer(tp->dmap, domain, ctrl->dma_size, &(ctrl->dma_addr), tp->start, DMA_TO_DEVICE); if (IS_ERR_VALUE(ret)) { pr_err("unable to map dma memory to iommu(%d)\n", ret); ctrl->mdss_util->iommu_unlock(); return -ENOMEM; } ctrl->dmap_iommu_map = true; Loading Loading @@ -1971,6 +1973,7 @@ static int mdss_dsi_cmd_dma_tx(struct mdss_dsi_ctrl_pdata *ctrl, ctrl->dma_addr = 0; ctrl->dma_size = 0; end: ctrl->mdss_util->iommu_unlock(); return ret; } Loading Loading @@ -2315,6 +2318,7 @@ int mdss_dsi_cmdlist_commit(struct mdss_dsi_ctrl_pdata *ctrl, int from_mdp) struct dcs_cmd_req *req; struct mdss_panel_info *pinfo; struct mdss_rect *roi = NULL; bool use_iommu = false; int ret = -EINVAL; int rc = 0; bool hs_req = false; Loading Loading @@ -2407,6 +2411,7 @@ int mdss_dsi_cmdlist_commit(struct mdss_dsi_ctrl_pdata *ctrl, int from_mdp) mutex_unlock(&ctrl->cmd_mutex); return rc; } use_iommu = true; } } Loading @@ -2425,7 +2430,7 @@ int mdss_dsi_cmdlist_commit(struct mdss_dsi_ctrl_pdata *ctrl, int from_mdp) mdss_dsi_set_tx_power_mode(1, &ctrl->panel_data); if (!(req->flags & CMD_REQ_DMA_TPG)) { if (ctrl->mdss_util->iommu_ctrl) if (use_iommu) ctrl->mdss_util->iommu_ctrl(0); (void)mdss_dsi_bus_bandwidth_vote(ctrl->shared_data, false); Loading
drivers/video/msm/mdss/mdss_mdp.c +3 −3 Original line number Diff line number Diff line Loading @@ -91,7 +91,7 @@ struct msm_mdp_interface mdp5 = { static DEFINE_SPINLOCK(mdp_lock); static DEFINE_MUTEX(mdp_clk_lock); static DEFINE_MUTEX(mdp_iommu_lock); static DEFINE_MUTEX(mdp_iommu_ref_cnt_lock); static DEFINE_MUTEX(mdp_fs_idle_pc_lock); static struct mdss_panel_intf pan_types[] = { Loading Loading @@ -817,7 +817,7 @@ int mdss_iommu_ctrl(int enable) struct mdss_data_type *mdata = mdss_mdp_get_mdata(); int rc = 0; mutex_lock(&mdp_iommu_lock); mutex_lock(&mdp_iommu_ref_cnt_lock); pr_debug("%pS: enable:%d ref_cnt:%d attach:%d hoff:%d\n", __builtin_return_address(0), enable, mdata->iommu_ref_cnt, mdata->iommu_attached, mdata->handoff_pending); Loading @@ -839,7 +839,7 @@ int mdss_iommu_ctrl(int enable) pr_err("unbalanced iommu ref\n"); } } mutex_unlock(&mdp_iommu_lock); mutex_unlock(&mdp_iommu_ref_cnt_lock); if (IS_ERR_VALUE(rc)) return rc; Loading
drivers/video/msm/mdss/mdss_smmu.c +14 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,18 @@ #include "mdss_mdp.h" #include "mdss_smmu.h" static DEFINE_MUTEX(mdp_iommu_lock); void mdss_iommu_lock(void) { mutex_lock(&mdp_iommu_lock); } void mdss_iommu_unlock(void) { mutex_unlock(&mdp_iommu_lock); } static int mdss_smmu_util_parse_dt_clock(struct platform_device *pdev, struct dss_module_power *mp) { Loading Loading @@ -469,6 +481,8 @@ int mdss_smmu_init(struct mdss_data_type *mdata, struct device *dev) { mdss_smmu_device_create(dev); mdss_smmu_ops_init(mdata); mdata->mdss_util->iommu_lock = mdss_iommu_lock; mdata->mdss_util->iommu_unlock = mdss_iommu_unlock; return 0; } Loading