Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c01f1231 authored by Dhaval Patel's avatar Dhaval Patel
Browse files

msm: mdss: request ab/ib quota based on rt and nrt client



Non-RealTime(NRT) memory fetch should use NRT AXI
ports while RT usecase memory fetch should go through
RT AXI ports. Number of RT and NRT AXI ports can be
different from chipset to chipset. MDSS driver hardcodes
them to "2" for all usecases which won't apply for
all MDP cores Ex: MDPv17. This change removes AXI ports
hard coding and updates ab/ib request based on AXI
ports availability for respective chipset. It uses
uniform calculation method for ib/ab quota request on
RT and NRT AXI ports to reduce the driver complexity
and clean interface.

Change-Id: I015c5c8a64bdf62f5747fcbcf19ba00cd29e21b5
Signed-off-by: default avatarDhaval Patel <pdhaval@codeaurora.org>
parent 2d3171d7
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -182,6 +182,7 @@ Bus Scaling Data:
				src values allowed for MDSS are:
					22 = MSM_BUS_MASTER_MDP_PORT0
					23 = MSM_BUS_MASTER_MDP_PORT1
					25 = MSM_BUS_MASTER_ROTATOR
				dst values allowed for MDSS are:
					512 = MSM_BUS_SLAVE_EBI_CH0
				ab: Represents aggregated bandwidth.
@@ -193,6 +194,8 @@ Bus Scaling Data:
				ab and ib values defined here are random and
				bare no logic except for the use-case 0 where ab
				and ib values needs to be 0.
				* Define realtime vector properties followed by
				non-realtime vector properties.

- qcom,mdss-prefill-outstanding-buffer-bytes: The size of mdp outstanding buffer
				in bytes. The buffer is filled during prefill
@@ -272,6 +275,13 @@ Optional properties:
			    increased performance by prioritizing the real time
			    (rt) traffic over non real time (nrt) traffic to
			    access the memory.
- qcom,mdss-num-nrt-paths: Integer property represents the number of non-realtime
			    paths in each Bus Scaling Usecase. This value depends on
			    number of AXI ports are dedicated to non-realtime VBIF for
			    particular chipset. This property is mandatory when
			    "qcom,mdss-has-fixed-qos-arbiter-enabled" is enabled.
			    These paths must be defined after rt-paths in
			    "qcom,msm-bus,vectors-KBps" vector request.
- qcom,mdss-has-source-split: Boolean property to indicate if source split
			      feature is available or not.
- qcom,mdss-has-rotator-downscale: Boolean property to indicate if rotator
@@ -482,6 +492,7 @@ Example:
		qcom,msm-bus,num-cases = <3>;
		qcom,msm-bus,num-paths = <2>;
		qcom,mdss-dram-channels = <2>;
		qcom,mdss-num-nrt-paths = <1>;
		qcom,msm-bus,vectors-KBps =
			<22 512 0 0>, <23 512 0 0>,
			<22 512 0 6400000>, <23 512 0 6400000>,
+4 −8
Original line number Diff line number Diff line
@@ -346,8 +346,7 @@ static void mdp3_bus_scale_unregister(void)
	}
}

int mdp3_bus_scale_set_quota(int client, u64 ab_quota, u64 ab_quota_nrt,
								u64 ib_quota)
int mdp3_bus_scale_set_quota(int client, u64 ab_quota, u64 ib_quota)
{
	struct mdp3_bus_handle_map *bus_handle;
	int cur_bus_idx;
@@ -366,9 +365,6 @@ int mdp3_bus_scale_set_quota(int client, u64 ab_quota, u64 ab_quota_nrt,
		return -EINVAL;
	}

	if (ab_quota_nrt != 0)
		pr_err("Ignoring non zero NRT bus voting on mdp3\n");

	bus_handle->ab[client] = ab_quota;
	bus_handle->ib[client] = ib_quota;

@@ -633,9 +629,9 @@ void mdp3_bus_bw_iommu_enable(int enable, int client)
			ab += bus_handle->restore_ab[i];
			ib += bus_handle->restore_ib[i];
		}
		mdp3_bus_scale_set_quota(client, ab, 0, ib);
		mdp3_bus_scale_set_quota(client, ab, ib);
	} else if (!enable && ref_cnt == 0) {
		mdp3_bus_scale_set_quota(client, 0, 0, 0);
		mdp3_bus_scale_set_quota(client, 0, 0);
		mdp3_iommu_disable();
	} else if (ref_cnt < 0) {
		pr_err("Ref count < 0, bus client=%d, ref_cnt=%d",
@@ -1656,7 +1652,7 @@ static int mdp3_continuous_splash_on(struct mdss_panel_data *pdata)
	ab = panel_info->xres * panel_info->yres * 4;
	ab *= panel_info->mipi.frame_rate;
	ib = (ab * 3) / 2;
	rc = mdp3_bus_scale_set_quota(MDP3_CLIENT_DMA_P, ab, 0, ib);
	rc = mdp3_bus_scale_set_quota(MDP3_CLIENT_DMA_P, ab, ib);
	bus_handle->restore_ab[MDP3_CLIENT_DMA_P] = ab;
	bus_handle->restore_ib[MDP3_CLIENT_DMA_P] = ib;

+1 −2
Original line number Diff line number Diff line
@@ -174,8 +174,7 @@ void mdp3_irq_deregister(void);
int mdp3_clk_set_rate(int clk_type, unsigned long clk_rate, int client);
int mdp3_clk_enable(int enable, int dsi_clk);
int mdp3_res_update(int enable, int dsi_clk, int client);
int mdp3_bus_scale_set_quota(int client, u64 ab_quota, u64 ab_quota_nrt,
								u64 ib_quota);
int mdp3_bus_scale_set_quota(int client, u64 ab_quota, u64 ib_quota);
int mdp3_put_img(struct mdp3_img_data *data);
int mdp3_get_img(struct msmfb_data *img, struct mdp3_img_data *data);
int mdp3_iommu_enable(void);
+2 −2
Original line number Diff line number Diff line
@@ -354,9 +354,9 @@ static int mdp3_ctrl_res_req_bus(struct msm_fb_data_type *mfd, int status)
		ab = panel_info->xres * panel_info->yres * 4;
		ab *= panel_info->mipi.frame_rate;
		ib = (ab * 3) / 2;
		rc = mdp3_bus_scale_set_quota(MDP3_CLIENT_DMA_P, ab, 0, ib);
		rc = mdp3_bus_scale_set_quota(MDP3_CLIENT_DMA_P, ab, ib);
	} else {
		rc = mdp3_bus_scale_set_quota(MDP3_CLIENT_DMA_P, 0, 0, 0);
		rc = mdp3_bus_scale_set_quota(MDP3_CLIENT_DMA_P, 0, 0);
	}
	return rc;
}
+2 −2
Original line number Diff line number Diff line
@@ -347,7 +347,7 @@ int mdp3_ppp_vote_update(struct msm_fb_data_type *mfd)
		ab = ib / 2;
	else
		ab = req_bw;
	rc = mdp3_bus_scale_set_quota(MDP3_CLIENT_PPP, ab, 0, ib);
	rc = mdp3_bus_scale_set_quota(MDP3_CLIENT_PPP, ab, ib);
	if (rc < 0) {
		pr_err("%s: scale_set_quota failed\n", __func__);
		return rc;
@@ -381,7 +381,7 @@ int mdp3_ppp_turnon(struct msm_fb_data_type *mfd, int on_off)
		pr_err("%s: mdp3_clk_enable failed\n", __func__);
		return rc;
	}
	rc = mdp3_bus_scale_set_quota(MDP3_CLIENT_PPP, ab, 0, ib);
	rc = mdp3_bus_scale_set_quota(MDP3_CLIENT_PPP, ab, ib);
	if (rc < 0) {
		mdp3_res_update(!on_off, 0, MDP3_CLIENT_PPP);
		pr_err("%s: scale_set_quota failed\n", __func__);
Loading