Skip to content
This repository has been archived by the owner on Apr 10, 2024. It is now read-only.

Commit

Permalink
msm: kgsl: Report correct GPU frequency in sysfs
Browse files Browse the repository at this point in the history
Change-Id: I1aac90d0554b9de0511ffb78042177a5a23855ce
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Signed-off-by: PainKiller3 <ninadpatil100@gmail.com>
Signed-off-by: MadeOfGreat <ravenklawasd@gmail.com>
Signed-off-by: CloudedQuartz <ravenklawasd@gmail.com>
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
  • Loading branch information
myfluxi authored and baalajimaestro committed Mar 25, 2021
1 parent dae8a35 commit c30a84d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion drivers/gpu/msm/kgsl_pwrctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -922,13 +922,20 @@ 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,
Expand Down

0 comments on commit c30a84d

Please sign in to comment.