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

Commit 6dbc72b6 authored by Kyle Piefer's avatar Kyle Piefer
Browse files

msm: kgsl: Use the GMU for bus DCVS



The GMU firmware supports executing bus DCVS votes.
Add this capability using HFI.

Change-Id: I92595a8940c79d9dc9371b3d3801892a090a51e1
Signed-off-by: default avatarCarter Cooper <ccooper@codeaurora.org>
Signed-off-by: default avatarKyle Piefer <kpiefer@codeaurora.org>
parent 18604f1e
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -593,7 +593,7 @@ static int gmu_memory_probe(struct kgsl_device *device,

/*
 * gmu_dcvs_set() - request GMU to change GPU frequency and/or bandwidth.
 * @gmu: Pointer to GMU device
 * @device: Pointer to the device
 * @gpu_pwrlevel: index to GPU DCVS table used by KGSL
 * @bus_level: index to GPU bus table used by KGSL
 *
@@ -618,9 +618,10 @@ static int gmu_dcvs_set(struct kgsl_device *device,
	if (bus_level < gmu->num_bwlevels && bus_level > 0)
		req.bw = bus_level;

	/* GMU will vote for slumber levels through the sleep sequence */
	if ((req.freq == INVALID_DCVS_IDX) &&
		(req.bw == INVALID_DCVS_IDX))
		return -EINVAL;
		return 0;

	if (ADRENO_QUIRK(adreno_dev, ADRENO_QUIRK_HFI_USE_REG)) {
		int ret = gmu_dev_ops->rpmh_gpu_pwrctrl(adreno_dev,
@@ -638,6 +639,9 @@ static int gmu_dcvs_set(struct kgsl_device *device,
		return ret;
	}

	if (!test_bit(GMU_HFI_ON, &gmu->flags))
		return 0;

	return hfi_send_req(gmu, H2F_MSG_GX_BW_PERF_VOTE, &req);
}

+3 −4
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@
#include "kgsl_pwrscale.h"
#include "kgsl_device.h"
#include "kgsl_trace.h"
#include "kgsl_gmu_core.h"

#define KGSL_PWRFLAGS_POWER_ON 0
#define KGSL_PWRFLAGS_CLK_ON   1
@@ -226,12 +227,10 @@ static int kgsl_bus_scale_request(struct kgsl_device *device,

	/* GMU scales BW */
	if (gmu_core_gpmu_isenabled(device))
		return 0;

	if (pwr->pcl) {
		ret = gmu_core_dcvs_set(device, INVALID_DCVS_IDX, buslevel);
	else if (pwr->pcl)
		/* Linux bus driver scales BW */
		ret = msm_bus_scale_client_update_request(pwr->pcl, buslevel);
	}

	if (ret)
		KGSL_PWR_ERR(device, "GPU BW scaling failure: %d\n", ret);