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

Commit be60d9a0 authored by Harshdeep Dhatt's avatar Harshdeep Dhatt
Browse files

msm: kgsl: Set bus scaling function during gmu probe



When setting the bus scaling function, we are checking for gmu
based targets before gmu has probed. Simplify this by setting the
bus scaling function to interconnect by default. Then, replace
it with gmu based routine during gmu probe. This works because
only gmu based targets set bus votes via gmu.

Change-Id: Ib332e736b39e0f38b1028049422ba95bd0370839
Signed-off-by: default avatarHarshdeep Dhatt <hdhatt@codeaurora.org>
parent 75a9117c
Loading
Loading
Loading
Loading
+1 −18
Original line number Diff line number Diff line
@@ -10,20 +10,6 @@
#include "kgsl_device.h"
#include "kgsl_trace.h"

static int gmu_bus_set(struct kgsl_device *device, int buslevel,
		u32 ab)
{
	struct kgsl_pwrctrl *pwr = &device->pwrctrl;
	int ret;

	ret = gmu_core_dcvs_set(device, INVALID_DCVS_IDX, buslevel);

	if (!ret)
		icc_set_bw(pwr->icc_path, MBps_to_icc(ab), 0);

	return ret;
}

static int interconnect_bus_set(struct kgsl_device *device, int level,
		u32 ab)
{
@@ -179,9 +165,6 @@ int kgsl_bus_init(struct kgsl_device *device, struct platform_device *pdev)
		return PTR_ERR(pwr->icc_path);
	}

	if (gmu_core_scales_bandwidth(device))
		pwr->bus_set = gmu_bus_set;
	else
	pwr->bus_set = interconnect_bus_set;

	return 0;
+17 −0
Original line number Diff line number Diff line
@@ -1282,6 +1282,20 @@ static void gmu_acd_probe(struct kgsl_device *device, struct gmu_device *gmu,
			"AOP mailbox init failed: %d\n", ret);
}

static int gmu_bus_set(struct kgsl_device *device, int buslevel,
	u32 ab)
{
	struct kgsl_pwrctrl *pwr = &device->pwrctrl;
	int ret;

	ret = gmu_core_dcvs_set(device, INVALID_DCVS_IDX, buslevel);

	if (!ret)
		icc_set_bw(pwr->icc_path, MBps_to_icc(ab), 0);

	return ret;
}

/* Do not access any GMU registers in GMU probe function */
static int gmu_probe(struct kgsl_device *device, struct device_node *node)
{
@@ -1409,6 +1423,9 @@ static int gmu_probe(struct kgsl_device *device, struct device_node *node)

	gmu_acd_probe(device, gmu, node);

	if (gmu_core_scales_bandwidth(device))
		pwr->bus_set = gmu_bus_set;

	set_bit(GMU_ENABLED, &device->gmu_core.flags);
	device->gmu_core.dev_ops = &adreno_a6xx_gmudev;