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

Commit a7253d4b authored by Razziell's avatar Razziell
Browse files

msm: kgsl: Report correct GPU frequency in sysfs

parent abfcd13d
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -798,12 +798,19 @@ static ssize_t kgsl_pwrctrl_gpuclk_show(struct device *dev,
				    struct device_attribute *attr,
				    char *buf)
{
	unsigned long freq;
	struct kgsl_device *device = kgsl_device_from_dev(dev);
	struct kgsl_pwrctrl *pwr;
	if (device == NULL)
		return 0;
	pwr = &device->pwrctrl;
	return snprintf(buf, PAGE_SIZE, "%ld\n", kgsl_pwrctrl_active_freq(pwr));

	if (device->state == KGSL_STATE_SLUMBER)
		freq = pwr->pwrlevels[pwr->num_pwrlevels - 1].gpu_freq;
	else
		freq = kgsl_pwrctrl_active_freq(pwr);

	return snprintf(buf, PAGE_SIZE, "%lu\n", freq);
}

static ssize_t __timer_store(struct device *dev, struct device_attribute *attr,