diff --git a/msm/sde/sde_core_perf.c b/msm/sde/sde_core_perf.c index 94f8774ab4..421343b2c6 100644 --- a/msm/sde/sde_core_perf.c +++ b/msm/sde/sde_core_perf.c @@ -663,8 +663,7 @@ exit: static void _sde_core_perf_crtc_update_bus(struct sde_kms *kms, struct drm_crtc *crtc, u32 bus_id) { - u64 bw_sum_of_intfs = 0, bus_ab_quota, bus_ib_quota; - struct sde_core_perf_params perf = { { 0 } }; + u64 bw_sum_of_intfs = 0, bus_ib_quota = 0, bus_ab_quota; enum sde_crtc_client_type client_vote, curr_client_type = sde_crtc_get_client_type(crtc); struct drm_crtc *tmp_crtc; @@ -672,7 +671,6 @@ static void _sde_core_perf_crtc_update_bus(struct sde_kms *kms, struct msm_drm_private *priv = kms->dev->dev_private; struct sde_crtc *sde_crtc; - u64 tmp_max_per_pipe_ib; u64 tmp_bw_ctl; drm_for_each_crtc(tmp_crtc, crtc->dev) { @@ -682,27 +680,21 @@ static void _sde_core_perf_crtc_update_bus(struct sde_kms *kms, /* use current perf, which are the values voted */ sde_crtc = to_sde_crtc(tmp_crtc); - tmp_max_per_pipe_ib = - sde_crtc->cur_perf.max_per_pipe_ib[bus_id]; tmp_bw_ctl = sde_crtc->cur_perf.bw_ctl[bus_id]; - perf.max_per_pipe_ib[bus_id] = - max(perf.max_per_pipe_ib[bus_id], - tmp_max_per_pipe_ib); bw_sum_of_intfs += tmp_bw_ctl; - SDE_DEBUG("crtc=%d bus_id=%d bw=%llu perf_pipe:%llu\n", + SDE_DEBUG("crtc=%d bus_id=%d bw=%llu\n", tmp_crtc->base.id, bus_id, - tmp_bw_ctl, tmp_max_per_pipe_ib); + tmp_bw_ctl); } } bus_ab_quota = max(bw_sum_of_intfs, kms->perf.perf_tune.min_bus_vote); bus_ab_quota = min(bus_ab_quota, kms->catalog->perf.max_bw_high*1000ULL); - bus_ib_quota = perf.max_per_pipe_ib[bus_id]; if (kms->perf.perf_tune.mode == SDE_PERF_MODE_FIXED) { bus_ab_quota = max(kms->perf.fix_core_ab_vote, diff --git a/msm/sde_power_handle.c b/msm/sde_power_handle.c index 839326cb2d..909d909c6c 100644 --- a/msm/sde_power_handle.c +++ b/msm/sde_power_handle.c @@ -479,9 +479,24 @@ static int sde_power_mnoc_bus_parse(struct platform_device *pdev, static int sde_power_bus_parse(struct platform_device *pdev, struct sde_power_handle *phandle) { - int i, j, rc = 0; + int i, j, ib_quota_count, rc = 0; bool active_only = false; struct sde_power_data_bus_handle *pdbus = phandle->data_bus_handle; + u32 ib_quota[SDE_POWER_HANDLE_DBUS_ID_MAX]; + + ib_quota_count = of_property_count_u32_elems(pdev->dev.of_node, "qcom,sde-ib-bw-vote"); + if (ib_quota_count > 0) { + if (ib_quota_count != SDE_POWER_HANDLE_DBUS_ID_MAX) { + pr_err("wrong size for qcom,sde-ib-bw-vote\n"); + return -EINVAL; + } + + for (i = 0; i < SDE_POWER_HANDLE_DBUS_ID_MAX; ++i) { + of_property_read_u32_index(pdev->dev.of_node, + "qcom,sde-ib-bw-vote", i, &ib_quota[i]); + phandle->ib_quota[i] = ib_quota[i]*1000; + } + } /* reg bus */ rc = sde_power_reg_bus_parse(pdev, &phandle->reg_bus_handle); @@ -833,16 +848,17 @@ int sde_power_resource_enable(struct sde_power_handle *phandle, bool enable) sde_power_event_trigger_locked(phandle, SDE_POWER_EVENT_PRE_ENABLE); - for (i = 0; i < SDE_POWER_HANDLE_DBUS_ID_MAX && - phandle->data_bus_handle[i].data_paths_cnt > 0; i++) { - rc = _sde_power_data_bus_set_quota( - &phandle->data_bus_handle[i], - SDE_POWER_HANDLE_ENABLE_BUS_AB_QUOTA, - SDE_POWER_HANDLE_ENABLE_BUS_IB_QUOTA); - if (rc) { - pr_err("failed to set data bus vote id=%d rc=%d\n", - i, rc); - goto vreg_err; + for (i = SDE_POWER_HANDLE_DBUS_ID_MNOC; i < SDE_POWER_HANDLE_DBUS_ID_MAX; i++) { + if (phandle->data_bus_handle[i].data_paths_cnt > 0) { + rc = _sde_power_data_bus_set_quota( + &phandle->data_bus_handle[i], + SDE_POWER_HANDLE_ENABLE_BUS_AB_QUOTA, + phandle->ib_quota[i]); + if (rc) { + pr_err("failed to set data bus vote id=%d rc=%d\n", + i, rc); + goto vreg_err; + } } } rc = msm_dss_enable_vreg(mp->vreg_config, mp->num_vreg, diff --git a/msm/sde_power_handle.h b/msm/sde_power_handle.h index 5c8057acd0..a2bc6a8cd4 100644 --- a/msm/sde_power_handle.h +++ b/msm/sde_power_handle.h @@ -158,6 +158,7 @@ struct sde_power_event { * @rsc_client: sde rsc client pointer * @rsc_client_init: boolean to control rsc client create * @mmrm_enable: boolean to indicate if mmrm is enabled + * @ib_quota: ib quota of the given bus */ struct sde_power_handle { struct dss_module_power mp; @@ -171,6 +172,7 @@ struct sde_power_handle { struct sde_rsc_client *rsc_client; bool rsc_client_init; bool mmrm_enable; + u64 ib_quota[SDE_POWER_HANDLE_DBUS_ID_MAX]; }; /**