msm: mdss: consider memory controller channels for bw vote

Add property to sepecify the number of memory controller
channels. This property is used by the driver to
reduce the display bandwidth vote by the number of
channels.

Change-Id: Id8fbdc2cac532569627fd6b4c0bf4e71061f6673
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
This commit is contained in:
Ingrid Gallardo 2014-08-29 16:49:51 -07:00 committed by David Keitel
parent 684b3e4579
commit 6892685c74
3 changed files with 16 additions and 2 deletions

View file

@ -341,6 +341,8 @@ Optional properties:
for MDSS rotator which spread out rotator bandwidth request
so that rotator don't compete with other real time read
clients.
- qcom,mdss-dram-channels: This represents the number of channels in the
Bus memory controller.
Fudge Factors: Fudge factors are used to boost demand for
resources like bus bandswidth, clk rate etc. to
@ -466,6 +468,7 @@ Example:
qcom,msm-bus,name = "mdss_mdp";
qcom,msm-bus,num-cases = <3>;
qcom,msm-bus,num-paths = <2>;
qcom,mdss-dram-channels = <2>;
qcom,msm-bus,vectors-KBps =
<22 512 0 0>, <23 512 0 0>,
<22 512 0 6400000>, <23 512 0 6400000>,

View file

@ -159,6 +159,7 @@ struct mdss_data_type {
u32 rot_block_size;
u32 axi_port_cnt;
u32 bus_channels;
u32 curr_bw_uc_idx;
u32 bus_hdl;
struct msm_bus_scale_pdata *bus_scale_table;

View file

@ -352,6 +352,9 @@ int mdss_mdp_bus_scale_set_quota(u64 ab_quota_rt, u64 ab_quota_nrt,
new_uc_idx = (mdss_res->curr_bw_uc_idx %
(bw_table->num_usecases - 1)) + 1;
if (mdss_res->bus_channels > 0)
ib_quota = div_u64(ib_quota, mdss_res->bus_channels);
for (i = 0; i < mdss_res->axi_port_cnt; i++) {
vect = &bw_table->usecase[mdss_res->curr_bw_uc_idx].
vectors[i];
@ -367,8 +370,9 @@ int mdss_mdp_bus_scale_set_quota(u64 ab_quota_rt, u64 ab_quota_nrt,
vect->ab = ab_quota[i];
vect->ib = ib_quota;
pr_debug("uc_idx=%d path_idx=%d ab=%llu ib=%llu\n",
new_uc_idx, i, vect->ab, vect->ib);
pr_debug("uc_idx=%d path_idx=%d ab=%llu ib=%llu ch=%d\n",
new_uc_idx, i, vect->ab, vect->ib,
mdss_res->bus_channels);
}
}
mdss_res->curr_bw_uc_idx = new_uc_idx;
@ -2620,6 +2624,12 @@ static int mdss_mdp_parse_dt_misc(struct platform_device *pdev)
"qcom,mdss-traffic-shaper-enabled");
mdata->has_rot_dwnscale = of_property_read_bool(pdev->dev.of_node,
"qcom,mdss-has-rotator-downscale");
rc = of_property_read_u32(pdev->dev.of_node,
"qcom,mdss-dram-channels", &mdata->bus_channels);
if (rc)
pr_debug("number of channels property not specified\n");
return 0;
}