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

Commit a50934b0 authored by Narendra Muppalla's avatar Narendra Muppalla
Browse files

drm/msm/sde: set minimum ib vote for core, llcc and dram



Add minimum ib vote property on CRTC for core, llcc and ddr nodes
in sde driver. Client should read this IB vote value for
each node and should provide BW vote by considering the floor
value for that node.

Change-Id: I25e9abfd4cc110b81c372ed70b174dc3ad59e4ca
Signed-off-by: default avatarNarendra Muppalla <NarendraM@codeaurora.org>
parent 1d9aee75
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -281,6 +281,18 @@ Optional properties:
				core ib calculation.
- qcom,sde-core-clk-ff:		A string entry indicating the fudge factor for
				core clock calculation.
- qcom,sde-min-core-ib-kbps:	This u32 value indicates the minimum mnoc ib
				vote in Kbps that can be reduced without hitting underflow.
				BW calculation logic will choose the IB bandwidth requirement
				based on usecase if this floor value is not defined.
- qcom,sde-min-llcc-ib-kbps:	This u32 value indicates the minimum llcc ib
				vote in Kbps that can be reduced without hitting underflow.
				BW calculation logic will choose the IB bandwidth requirement
				based on usecase if this floor value is not defined.
- qcom,sde-min-dram-ib-kbps:	This u32 value indicates the minimum dram ib
				vote in Kbps that can be reduced without hitting underflow.
				BW calculation logic will choose the IB bandwidth requirement
				based on usecase if this floor value is not defined.
- qcom,sde-comp-ratio-rt:	A string entry indicating the compression ratio
				for each supported compressed format on realtime interface.
				The string is composed of one or more of
@@ -572,6 +584,9 @@ Example:

    qcom,sde-core-ib-ff = "1.1";
    qcom,sde-core-clk-ff = "1.0";
    qcom,sde-min-core-ib-kbps = <2400000>;
    qcom,sde-min-llcc-ib-kbps = <800000>;
    qcom,sde-min-dram-ib-kbps = <800000>;
    qcom,sde-comp-ratio-rt = "NV12/5/1/1.1 AB24/5/1/1.2 XB24/5/1/1.3";
    qcom,sde-comp-ratio-nrt = "NV12/5/1/1.1 AB24/5/1/1.2 XB24/5/1/1.3";
    qcom,sde-undersized-prefill-lines = <4>;
+6 −0
Original line number Diff line number Diff line
@@ -722,6 +722,12 @@ int sde_core_perf_debugfs_init(struct sde_core_perf *perf,
			(u32 *)&catalog->perf.max_bw_low);
	debugfs_create_u32("threshold_high", 0600, perf->debugfs_root,
			(u32 *)&catalog->perf.max_bw_high);
	debugfs_create_u32("min_core_ib", 0600, perf->debugfs_root,
			(u32 *)&catalog->perf.min_core_ib);
	debugfs_create_u32("min_llcc_ib", 0600, perf->debugfs_root,
			(u32 *)&catalog->perf.min_llcc_ib);
	debugfs_create_u32("min_dram_ib", 0600, perf->debugfs_root,
			(u32 *)&catalog->perf.min_dram_ib);
	debugfs_create_file("perf_mode", 0600, perf->debugfs_root,
			(u32 *)perf, &sde_core_perf_mode_fops);
	debugfs_create_u32("bw_vote_mode", 0600, perf->debugfs_root,
+9 −0
Original line number Diff line number Diff line
@@ -3853,6 +3853,15 @@ static void sde_crtc_install_properties(struct drm_crtc *crtc,
	if (catalog->perf.max_bw_high)
		sde_kms_info_add_keyint(info, "max_bandwidth_high",
				catalog->perf.max_bw_high * 1000LL);
	if (catalog->perf.min_core_ib)
		sde_kms_info_add_keyint(info, "min_core_ib",
				catalog->perf.min_core_ib * 1000LL);
	if (catalog->perf.min_llcc_ib)
		sde_kms_info_add_keyint(info, "min_llcc_ib",
				catalog->perf.min_llcc_ib * 1000LL);
	if (catalog->perf.min_dram_ib)
		sde_kms_info_add_keyint(info, "min_dram_ib",
				catalog->perf.min_dram_ib * 1000LL);
	if (sde_kms->perf.max_core_clk_rate)
		sde_kms_info_add_keyint(info, "max_mdp_clk",
				sde_kms->perf.max_core_clk_rate);
+18 −0
Original line number Diff line number Diff line
@@ -146,6 +146,9 @@ enum sde_prop {
enum {
	PERF_MAX_BW_LOW,
	PERF_MAX_BW_HIGH,
	PERF_MIN_CORE_IB,
	PERF_MIN_LLCC_IB,
	PERF_MIN_DRAM_IB,
	PERF_CORE_IB_FF,
	PERF_CORE_CLK_FF,
	PERF_COMP_RATIO_RT,
@@ -376,6 +379,9 @@ static struct sde_prop_type sde_prop[] = {
static struct sde_prop_type sde_perf_prop[] = {
	{PERF_MAX_BW_LOW, "qcom,sde-max-bw-low-kbps", false, PROP_TYPE_U32},
	{PERF_MAX_BW_HIGH, "qcom,sde-max-bw-high-kbps", false, PROP_TYPE_U32},
	{PERF_MIN_CORE_IB, "qcom,sde-min-core-ib-kbps", false, PROP_TYPE_U32},
	{PERF_MIN_LLCC_IB, "qcom,sde-min-llcc-ib-kbps", false, PROP_TYPE_U32},
	{PERF_MIN_DRAM_IB, "qcom,sde-min-dram-ib-kbps", false, PROP_TYPE_U32},
	{PERF_CORE_IB_FF, "qcom,sde-core-ib-ff", false, PROP_TYPE_STRING},
	{PERF_CORE_CLK_FF, "qcom,sde-core-clk-ff", false, PROP_TYPE_STRING},
	{PERF_COMP_RATIO_RT, "qcom,sde-comp-ratio-rt", false,
@@ -2691,6 +2697,18 @@ static int sde_perf_parse_dt(struct device_node *np, struct sde_mdss_cfg *cfg)
			prop_exists[PERF_MAX_BW_HIGH] ?
			PROP_VALUE_ACCESS(prop_value, PERF_MAX_BW_HIGH, 0) :
			DEFAULT_MAX_BW_HIGH;
	cfg->perf.min_core_ib =
			prop_exists[PERF_MIN_CORE_IB] ?
			PROP_VALUE_ACCESS(prop_value, PERF_MIN_CORE_IB, 0) :
			DEFAULT_MAX_BW_LOW;
	cfg->perf.min_llcc_ib =
			prop_exists[PERF_MIN_LLCC_IB] ?
			PROP_VALUE_ACCESS(prop_value, PERF_MIN_LLCC_IB, 0) :
			DEFAULT_MAX_BW_LOW;
	cfg->perf.min_dram_ib =
			prop_exists[PERF_MIN_DRAM_IB] ?
			PROP_VALUE_ACCESS(prop_value, PERF_MIN_DRAM_IB, 0) :
			DEFAULT_MAX_BW_LOW;

	/*
	 * The following performance parameters (e.g. core_ib_ff) are
+7 −0
Original line number Diff line number Diff line
@@ -800,6 +800,10 @@ struct sde_perf_cdp_cfg {
 * struct sde_perf_cfg - performance control settings
 * @max_bw_low         low threshold of maximum bandwidth (kbps)
 * @max_bw_high        high threshold of maximum bandwidth (kbps)
 * @min_core_ib        minimum bandwidth for core (kbps)
 * @min_core_ib        minimum mnoc ib vote in kbps
 * @min_llcc_ib        minimum llcc ib vote in kbps
 * @min_dram_ib        minimum dram ib vote in kbps
 * @core_ib_ff         core instantaneous bandwidth fudge factor
 * @core_clk_ff        core clock fudge factor
 * @comp_ratio_rt      string of 0 or more of <fourcc>/<ven>/<mod>/<comp ratio>
@@ -821,6 +825,9 @@ struct sde_perf_cdp_cfg {
struct sde_perf_cfg {
	u32 max_bw_low;
	u32 max_bw_high;
	u32 min_core_ib;
	u32 min_llcc_ib;
	u32 min_dram_ib;
	const char *core_ib_ff;
	const char *core_clk_ff;
	const char *comp_ratio_rt;