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

Commit ad9b4b9c authored by Hareesh Gundu's avatar Hareesh Gundu Committed by Gerrit - the friendly Code Review server
Browse files

msm: kgsl: Add support to vote bimc-interface-clk per speed-bin



We support different gpu clock plans based on the different GPU
speed-bin configuration. Add support for bimc-interface-clk
voting per speed-bin specific to meet bandwidth requirements.

Change-Id: Ieea4c80a0c048c5bdb35b93ce1ae09687720f02e
Signed-off-by: default avatarHareesh Gundu <hareeshg@codeaurora.org>
parent bdf17c96
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -993,6 +993,26 @@ static int adreno_of_parse_pwrlevels(struct adreno_device *adreno_dev,
	return 0;
}

static void adreno_of_get_bimc_iface_clk(struct adreno_device *adreno_dev,
		struct device_node *node)
{
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
	struct kgsl_pwrctrl *pwr = &device->pwrctrl;

	/* Getting gfx-bimc-interface-clk frequency */
	if (!of_property_read_u32(node, "qcom,gpu-bimc-interface-clk-freq",
				&pwr->gpu_bimc_int_clk_freq)) {
		pwr->gpu_bimc_int_clk = devm_clk_get(&device->pdev->dev,
				"bimc_gpu_clk");
		if (IS_ERR_OR_NULL(pwr->gpu_bimc_int_clk)) {
			dev_err(&device->pdev->dev,
					"dt: Couldn't get bimc_gpu_clk (%d)\n",
					PTR_ERR(pwr->gpu_bimc_int_clk));
			pwr->gpu_bimc_int_clk = NULL;
		}
	}
}

static void adreno_of_get_initial_pwrlevel(struct adreno_device *adreno_dev,
		struct device_node *node)
{
@@ -1050,6 +1070,8 @@ static int adreno_of_get_legacy_pwrlevels(struct adreno_device *adreno_dev,

	adreno_of_get_limits(adreno_dev, parent);

	adreno_of_get_bimc_iface_clk(adreno_dev, parent);

	return 0;
}

@@ -1077,6 +1099,8 @@ static int adreno_of_get_pwrlevels(struct adreno_device *adreno_dev,

			adreno_of_get_initial_pwrlevel(adreno_dev, child);

			adreno_of_get_bimc_iface_clk(adreno_dev, child);

			/*
			 * Check for global throttle-pwrlevel first and override
			 * with speedbin specific one if found.
+0 −7
Original line number Diff line number Diff line
@@ -2266,13 +2266,6 @@ int kgsl_pwrctrl_init(struct kgsl_device *device)
	if (pwr->grp_clks[0] == NULL)
		pwr->grp_clks[0] = pwr->grp_clks[1];

	/* Getting gfx-bimc-interface-clk frequency */
	if (!of_property_read_u32(pdev->dev.of_node,
			"qcom,gpu-bimc-interface-clk-freq",
			&pwr->gpu_bimc_int_clk_freq))
		pwr->gpu_bimc_int_clk = devm_clk_get(&pdev->dev,
					"bimc_gpu_clk");

	if (of_property_read_bool(pdev->dev.of_node, "qcom,no-nap"))
		device->pwrctrl.ctrl_flags |= BIT(KGSL_PWRFLAGS_NAP_OFF);