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

Commit 9767c521 authored by Harshdeep Dhatt's avatar Harshdeep Dhatt
Browse files

msm: kgsl: Add support for tuning bus accesses for bus dcvs



If the tuning parameter is present in the devicetree, do not use a
floating water-mark approach for bus dcvs. This fixes an issue where
we upvote due to stalled cycles but never down vote even when stalled
cycles have receded below the threshold.

Change-Id: Ia799b33a31de1c5e4ff4ad5b3f30d4585ec85e3c
Signed-off-by: default avatarHarshdeep Dhatt <hdhatt@codeaurora.org>
parent 9b483b27
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -100,10 +100,11 @@ static int devfreq_gpubw_get_target(struct devfreq *df,

	/*
	 * If there's a new high watermark, update the cutoffs and send the
	 * FAST hint.  Otherwise check the current value against the current
	 * FAST hint, provided that we are using a floating watermark.
	 * Otherwise check the current value against the current
	 * cutoffs.
	 */
	if (norm_max_cycles > priv->bus.max) {
	if (norm_max_cycles > priv->bus.max && priv->bus.floating) {
		_update_cutoff(priv, norm_max_cycles);
		bus_profile->flag = DEVFREQ_FLAG_FAST_HINT;
	} else {
+4 −29
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ static unsigned int counter_delta(struct kgsl_device *device,
static struct devfreq_msm_adreno_tz_data adreno_tz_data = {
	.bus = {
		.max = 350,
		.floating = true,
	},
	.device_id = KGSL_DEVICE_3D0,
};
@@ -877,32 +878,6 @@ static void adreno_of_get_ca_aware_properties(struct adreno_device *adreno_dev,
	}
}

static int _of_property_read_ddrtype(struct device_node *node, const char *base,
		u32 *ptr)
{
	char str[32];
	int ddr = of_fdt_get_ddrtype();

	/* of_fdt_get_ddrtype returns error if the DDR type isn't determined */
	if (ddr >= 0) {
		int ret;

		/* Construct expanded string for the DDR type  */
		ret = snprintf(str, sizeof(str), "%s-ddr%d", base, ddr);

		/* WARN_ON() if the array size was too small for the string */
		if (WARN_ON(ret > sizeof(str)))
			return -ENOMEM;

		/* Read the expanded string */
		if (!of_property_read_u32(node, str, ptr))
			return 0;
	}

	/* Read the default string */
	return of_property_read_u32(node, base, ptr);
}

static int adreno_of_parse_pwrlevels(struct adreno_device *adreno_dev,
		struct device_node *node)
{
@@ -950,7 +925,7 @@ static int adreno_of_parse_pwrlevels(struct adreno_device *adreno_dev,
		of_property_read_u32(child, "qcom,acd-level",
			&level->acd_level);

		ret = _of_property_read_ddrtype(child,
		ret = kgsl_of_property_read_ddrtype(child,
			"qcom,bus-freq", &level->bus_freq);
		if (ret) {
			dev_err(device->dev,
@@ -960,11 +935,11 @@ static int adreno_of_parse_pwrlevels(struct adreno_device *adreno_dev,
		}

		level->bus_min = level->bus_freq;
		_of_property_read_ddrtype(child,
		kgsl_of_property_read_ddrtype(child,
			"qcom,bus-min", &level->bus_min);

		level->bus_max = level->bus_freq;
		_of_property_read_ddrtype(child,
		kgsl_of_property_read_ddrtype(child,
			"qcom,bus-max", &level->bus_max);
	}

+26 −0
Original line number Diff line number Diff line
@@ -4976,6 +4976,32 @@ int kgsl_request_irq(struct platform_device *pdev, const char *name,
	return ret ? ret : num;
}

int kgsl_of_property_read_ddrtype(struct device_node *node, const char *base,
		u32 *ptr)
{
	char str[32];
	int ddr = of_fdt_get_ddrtype();

	/* of_fdt_get_ddrtype returns error if the DDR type isn't determined */
	if (ddr >= 0) {
		int ret;

		/* Construct expanded string for the DDR type  */
		ret = snprintf(str, sizeof(str), "%s-ddr%d", base, ddr);

		/* WARN_ON() if the array size was too small for the string */
		if (WARN_ON(ret > sizeof(str)))
			return -ENOMEM;

		/* Read the expanded string */
		if (!of_property_read_u32(node, str, ptr))
			return 0;
	}

	/* Read the default string */
	return of_property_read_u32(node, base, ptr);
}

int kgsl_device_platform_probe(struct kgsl_device *device)
{
	int status = -EINVAL;
+16 −0
Original line number Diff line number Diff line
@@ -918,6 +918,22 @@ void kgsl_snapshot_add_section(struct kgsl_device *device, u16 id,
	size_t (*func)(struct kgsl_device *, u8 *, size_t, void *),
	void *priv);

/**
 * kgsl_of_property_read_ddrtype - Get property from devicetree based on
 * the type of DDR.
 * @node: Devicetree node
 * @base: prefix string of the property
 * @ptr:  Pointer to store the value of the property
 *
 * First look up the devicetree property based on the prefix string and DDR
 * type. If property is not specified per DDR type, then look for the property
 * based on prefix string only.
 *
 * Return: 0 on success or error code on failure.
 */
int kgsl_of_property_read_ddrtype(struct device_node *node, const char *base,
		u32 *ptr);

/**
 * kgsl_query_property_list - Get a list of valid properties
 * @device: A KGSL device handle
+3 −0
Original line number Diff line number Diff line
@@ -1012,6 +1012,9 @@ int kgsl_pwrscale_init(struct device *dev, const char *governor)
		data->bus.ib = &pwr->bus_ib[0];
		data->bus.index = &pwr->bus_index[0];
		data->bus.width = pwr->bus_width;
		if (!kgsl_of_property_read_ddrtype(device->pdev->dev.of_node,
			"qcom,bus-accesses", &data->bus.max))
			data->bus.floating = false;
	} else
		data->bus.num = 0;

Loading