diff --git a/drivers/video/fbdev/msm/mdss.h b/drivers/video/fbdev/msm/mdss.h index 9d4a19cfc642..55fbd7c3a49a 100644 --- a/drivers/video/fbdev/msm/mdss.h +++ b/drivers/video/fbdev/msm/mdss.h @@ -30,6 +30,7 @@ #define MAX_DRV_SUP_MMB_BLKS 44 #define MAX_DRV_SUP_PIPES 10 +#define MAX_CLIENT_NAME_LEN 20 #define MDSS_PINCTRL_STATE_DEFAULT "mdss_default" #define MDSS_PINCTRL_STATE_SLEEP "mdss_sleep" @@ -174,6 +175,7 @@ enum mdss_qos_settings { }; struct reg_bus_client { + char name[MAX_CLIENT_NAME_LEN]; short usecase_ndx; u32 id; struct list_head list; @@ -463,7 +465,7 @@ void mdss_bus_bandwidth_ctrl(int enable); int mdss_iommu_ctrl(int enable); int mdss_bus_scale_set_quota(int client, u64 ab_quota, u64 ib_quota); int mdss_update_reg_bus_vote(struct reg_bus_client *, u32 usecase_ndx); -struct reg_bus_client *mdss_reg_bus_vote_client_create(void); +struct reg_bus_client *mdss_reg_bus_vote_client_create(char *client_name); void mdss_reg_bus_vote_client_destroy(struct reg_bus_client *); struct mdss_util_intf { diff --git a/drivers/video/fbdev/msm/mdss_dsi_clk.c b/drivers/video/fbdev/msm/mdss_dsi_clk.c index 139ba96cfcf0..c5b6ac9fa4a1 100644 --- a/drivers/video/fbdev/msm/mdss_dsi_clk.c +++ b/drivers/video/fbdev/msm/mdss_dsi_clk.c @@ -872,7 +872,7 @@ void *mdss_dsi_clk_init(struct mdss_dsi_clk_info *info) mngr->pre_clkoff_cb = info->pre_clkoff_cb; mngr->post_clkoff_cb = info->post_clkoff_cb; mngr->priv_data = info->priv_data; - mngr->reg_bus_clt = mdss_reg_bus_vote_client_create(); + mngr->reg_bus_clt = mdss_reg_bus_vote_client_create(info->name); if (IS_ERR_OR_NULL(mngr->reg_bus_clt)) { pr_err("Unable to get handle for reg bus vote\n"); kfree(mngr); diff --git a/drivers/video/fbdev/msm/mdss_hdmi_tx.c b/drivers/video/fbdev/msm/mdss_hdmi_tx.c index 6749de5e2154..2bb8d7313d90 100644 --- a/drivers/video/fbdev/msm/mdss_hdmi_tx.c +++ b/drivers/video/fbdev/msm/mdss_hdmi_tx.c @@ -2358,6 +2358,7 @@ static int hdmi_tx_config_power(struct hdmi_tx_ctrl *hdmi_ctrl, { int rc = 0; struct dss_module_power *power_data = NULL; + char name[MAX_CLIENT_NAME_LEN]; if (!hdmi_ctrl || module >= HDMI_TX_MAX_PM) { DEV_ERR("%s: Error: invalid input\n", __func__); @@ -2381,8 +2382,9 @@ static int hdmi_tx_config_power(struct hdmi_tx_ctrl *hdmi_ctrl, goto exit; } + snprintf(name, MAX_CLIENT_NAME_LEN, "hdmi:%u", module); hdmi_ctrl->pdata.reg_bus_clt[module] = - mdss_reg_bus_vote_client_create(); + mdss_reg_bus_vote_client_create(name); if (IS_ERR_OR_NULL(hdmi_ctrl->pdata.reg_bus_clt[module])) { pr_err("reg bus client create failed\n"); msm_dss_config_vreg(&hdmi_ctrl->pdev->dev, diff --git a/drivers/video/fbdev/msm/mdss_mdp.c b/drivers/video/fbdev/msm/mdss_mdp.c index 0bc0def0e3be..1585b4091e8b 100644 --- a/drivers/video/fbdev/msm/mdss_mdp.c +++ b/drivers/video/fbdev/msm/mdss_mdp.c @@ -371,19 +371,26 @@ static int mdss_mdp_bus_scale_set_quota(u64 ab_quota_rt, u64 ab_quota_nrt, return rc; } -struct reg_bus_client *mdss_reg_bus_vote_client_create() +struct reg_bus_client *mdss_reg_bus_vote_client_create(char *client_name) { struct reg_bus_client *client; static u32 id; + if (client_name == NULL) { + pr_err("client name is null\n"); + return ERR_PTR(-EINVAL); + } + client = kzalloc(sizeof(struct reg_bus_client), GFP_KERNEL); if (!client) return ERR_PTR(-ENOMEM); mutex_lock(&mdss_res->reg_bus_lock); + strlcpy(client->name, client_name, MAX_CLIENT_NAME_LEN); client->usecase_ndx = VOTE_INDEX_DISABLE; client->id = id; - pr_debug("bus vote client created:%p id :%d\n", client, id); + pr_debug("bus vote client %s created:%p id :%d\n", client_name, + client, id); id++; list_add(&client->list, &mdss_res->reg_bus_clist); mutex_unlock(&mdss_res->reg_bus_lock); @@ -396,8 +403,8 @@ void mdss_reg_bus_vote_client_destroy(struct reg_bus_client *client) if (!client) { pr_err("reg bus vote: invalid client handle\n"); } else { - pr_debug("bus vote client destroyed:%p id:%u\n", - client, client->id); + pr_debug("bus vote client %s destroyed:%p id:%u\n", + client->name, client, client->id); mutex_lock(&mdss_res->reg_bus_lock); list_del_init(&client->list); mutex_unlock(&mdss_res->reg_bus_lock); @@ -430,9 +437,9 @@ int mdss_update_reg_bus_vote(struct reg_bus_client *bus_client, u32 usecase_ndx) mdss_res->reg_bus_usecase_ndx = max_usecase_ndx; } - pr_debug("%pS: changed=%d current idx=%d request client id:%u idx:%d\n", + pr_debug("%pS: changed=%d current idx=%d request client %s id:%u idx:%d\n", __builtin_return_address(0), changed, max_usecase_ndx, - bus_client->id, usecase_ndx); + bus_client->name, bus_client->id, usecase_ndx); MDSS_XLOG(changed, max_usecase_ndx, bus_client->id, usecase_ndx); if (changed) ret = msm_bus_scale_client_update_request(mdss_res->reg_bus_hdl, @@ -1091,7 +1098,7 @@ static int mdss_mdp_irq_clk_setup(struct mdss_data_type *mdata) mdata->vdd_cx = NULL; } - mdata->reg_bus_clt = mdss_reg_bus_vote_client_create(); + mdata->reg_bus_clt = mdss_reg_bus_vote_client_create("mdp\0"); if (IS_ERR_OR_NULL(mdata->reg_bus_clt)) { pr_err("bus client register failed\n"); return PTR_ERR(mdata->reg_bus_clt); diff --git a/drivers/video/fbdev/msm/mdss_smmu.c b/drivers/video/fbdev/msm/mdss_smmu.c index e129068a97e8..406ec175a848 100644 --- a/drivers/video/fbdev/msm/mdss_smmu.c +++ b/drivers/video/fbdev/msm/mdss_smmu.c @@ -506,6 +506,7 @@ int mdss_smmu_probe(struct platform_device *pdev) const struct of_device_id *match; struct dss_module_power *mp; int disable_htw = 1; + char name[MAX_CLIENT_NAME_LEN]; if (!mdata) { pr_err("probe failed as mdata is not initialized\n"); @@ -569,7 +570,8 @@ int mdss_smmu_probe(struct platform_device *pdev) return rc; } - mdss_smmu->reg_bus_clt = mdss_reg_bus_vote_client_create(); + snprintf(name, MAX_CLIENT_NAME_LEN, "smmu:%u", domain); + mdss_smmu->reg_bus_clt = mdss_reg_bus_vote_client_create(name); if (IS_ERR_OR_NULL(mdss_smmu->reg_bus_clt)) { pr_err("mdss bus client register failed\n"); msm_dss_config_vreg(&pdev->dev, mp->vreg_config, mp->num_vreg,