Loading drivers/gpu/msm/kgsl_pwrctrl.c +12 −9 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2010-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2010-2021, The Linux Foundation. All rights reserved. */ #include <linux/interconnect.h> Loading Loading @@ -297,7 +297,8 @@ static void kgsl_pwrctrl_set_thermal_pwrlevel(struct kgsl_device *device, if (level >= pwr->num_pwrlevels) level = pwr->num_pwrlevels - 1; pwr->thermal_pwrlevel = level; pwr->sysfs_thermal_pwrlevel = level; pwr->thermal_pwrlevel = max(pwr->cooling_thermal_pwrlevel, pwr->sysfs_thermal_pwrlevel); /* Update the current level using the new limit */ kgsl_pwrctrl_pwrlevel_change(device, pwr->active_pwrlevel); Loading Loading @@ -921,7 +922,7 @@ static ssize_t _max_clock_mhz_show(struct kgsl_device *device, char *buf) struct kgsl_pwrctrl *pwr = &device->pwrctrl; return scnprintf(buf, PAGE_SIZE, "%d\n", pwr->pwrlevels[pwr->max_pwrlevel].gpu_freq / 1000000); pwr->pwrlevels[pwr->thermal_pwrlevel].gpu_freq / 1000000); } static ssize_t max_clock_mhz_show(struct device *dev, Loading @@ -937,7 +938,6 @@ static ssize_t _max_clock_mhz_store(struct kgsl_device *device, { u32 freq; int ret, level; struct kgsl_pwrctrl *pwr = &device->pwrctrl; ret = kstrtou32(buf, 0, &freq); if (ret) Loading @@ -947,11 +947,12 @@ static ssize_t _max_clock_mhz_store(struct kgsl_device *device, if (level < 0) return level; mutex_lock(&device->mutex); pwr->max_pwrlevel = min_t(unsigned int, level, pwr->min_pwrlevel); kgsl_pwrctrl_pwrlevel_change(device, pwr->active_pwrlevel); mutex_unlock(&device->mutex); /* * You would think this would set max_pwrlevel but the legacy behavior * is that it set thermal_pwrlevel instead so we don't want to mess with * that. */ kgsl_pwrctrl_set_thermal_pwrlevel(device, level); return count; } Loading Loading @@ -1552,6 +1553,8 @@ int kgsl_pwrctrl_init(struct kgsl_device *device) pwr->max_pwrlevel = 0; pwr->min_pwrlevel = pwr->num_pwrlevels - 1; pwr->thermal_pwrlevel = 0; pwr->sysfs_thermal_pwrlevel = 0; pwr->cooling_thermal_pwrlevel = 0; pwr->thermal_pwrlevel_floor = pwr->min_pwrlevel; pwr->wakeup_maxpwrlevel = 0; Loading drivers/gpu/msm/kgsl_pwrctrl.h +6 −2 Original line number Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2010-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2010-2021, The Linux Foundation. All rights reserved. */ #ifndef __KGSL_PWRCTRL_H #define __KGSL_PWRCTRL_H Loading Loading @@ -89,7 +89,9 @@ struct kgsl_pwrlevel { * @nb - Notifier block to receive GPU OPP change event * @active_pwrlevel - The currently active power level * @previous_pwrlevel - The power level before transition * @thermal_pwrlevel - maximum powerlevel constraint from thermal * @thermal_pwrlevel - consolidated maximum thermal powerlevel constraint * @sysfs_thermal_pwrlevel - maximum powerlevel constraint from sysfs * @cooling_thermal_pwrlevel - maximum pwrlevel constraint from devfreq cooling fw * @thermal_pwrlevel_floor - minimum powerlevel constraint from thermal * @default_pwrlevel - device wake up power level * @max_pwrlevel - maximum allowable powerlevel per the user Loading Loading @@ -133,6 +135,8 @@ struct kgsl_pwrctrl { unsigned int active_pwrlevel; unsigned int previous_pwrlevel; unsigned int thermal_pwrlevel; unsigned int sysfs_thermal_pwrlevel; unsigned int cooling_thermal_pwrlevel; unsigned int thermal_pwrlevel_floor; unsigned int default_pwrlevel; unsigned int wakeup_maxpwrlevel; Loading drivers/gpu/msm/kgsl_pwrscale.c +3 −2 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2010-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2010-2021, The Linux Foundation. All rights reserved. */ #include <linux/devfreq_cooling.h> Loading Loading @@ -654,7 +654,8 @@ static int opp_notify(struct notifier_block *nb, min_level = level; } pwr->thermal_pwrlevel = max_level; pwr->cooling_thermal_pwrlevel = max_level; pwr->thermal_pwrlevel = max(pwr->cooling_thermal_pwrlevel, pwr->sysfs_thermal_pwrlevel); pwr->thermal_pwrlevel_floor = min_level; /* Update the current level using the new limit */ Loading Loading
drivers/gpu/msm/kgsl_pwrctrl.c +12 −9 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2010-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2010-2021, The Linux Foundation. All rights reserved. */ #include <linux/interconnect.h> Loading Loading @@ -297,7 +297,8 @@ static void kgsl_pwrctrl_set_thermal_pwrlevel(struct kgsl_device *device, if (level >= pwr->num_pwrlevels) level = pwr->num_pwrlevels - 1; pwr->thermal_pwrlevel = level; pwr->sysfs_thermal_pwrlevel = level; pwr->thermal_pwrlevel = max(pwr->cooling_thermal_pwrlevel, pwr->sysfs_thermal_pwrlevel); /* Update the current level using the new limit */ kgsl_pwrctrl_pwrlevel_change(device, pwr->active_pwrlevel); Loading Loading @@ -921,7 +922,7 @@ static ssize_t _max_clock_mhz_show(struct kgsl_device *device, char *buf) struct kgsl_pwrctrl *pwr = &device->pwrctrl; return scnprintf(buf, PAGE_SIZE, "%d\n", pwr->pwrlevels[pwr->max_pwrlevel].gpu_freq / 1000000); pwr->pwrlevels[pwr->thermal_pwrlevel].gpu_freq / 1000000); } static ssize_t max_clock_mhz_show(struct device *dev, Loading @@ -937,7 +938,6 @@ static ssize_t _max_clock_mhz_store(struct kgsl_device *device, { u32 freq; int ret, level; struct kgsl_pwrctrl *pwr = &device->pwrctrl; ret = kstrtou32(buf, 0, &freq); if (ret) Loading @@ -947,11 +947,12 @@ static ssize_t _max_clock_mhz_store(struct kgsl_device *device, if (level < 0) return level; mutex_lock(&device->mutex); pwr->max_pwrlevel = min_t(unsigned int, level, pwr->min_pwrlevel); kgsl_pwrctrl_pwrlevel_change(device, pwr->active_pwrlevel); mutex_unlock(&device->mutex); /* * You would think this would set max_pwrlevel but the legacy behavior * is that it set thermal_pwrlevel instead so we don't want to mess with * that. */ kgsl_pwrctrl_set_thermal_pwrlevel(device, level); return count; } Loading Loading @@ -1552,6 +1553,8 @@ int kgsl_pwrctrl_init(struct kgsl_device *device) pwr->max_pwrlevel = 0; pwr->min_pwrlevel = pwr->num_pwrlevels - 1; pwr->thermal_pwrlevel = 0; pwr->sysfs_thermal_pwrlevel = 0; pwr->cooling_thermal_pwrlevel = 0; pwr->thermal_pwrlevel_floor = pwr->min_pwrlevel; pwr->wakeup_maxpwrlevel = 0; Loading
drivers/gpu/msm/kgsl_pwrctrl.h +6 −2 Original line number Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2010-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2010-2021, The Linux Foundation. All rights reserved. */ #ifndef __KGSL_PWRCTRL_H #define __KGSL_PWRCTRL_H Loading Loading @@ -89,7 +89,9 @@ struct kgsl_pwrlevel { * @nb - Notifier block to receive GPU OPP change event * @active_pwrlevel - The currently active power level * @previous_pwrlevel - The power level before transition * @thermal_pwrlevel - maximum powerlevel constraint from thermal * @thermal_pwrlevel - consolidated maximum thermal powerlevel constraint * @sysfs_thermal_pwrlevel - maximum powerlevel constraint from sysfs * @cooling_thermal_pwrlevel - maximum pwrlevel constraint from devfreq cooling fw * @thermal_pwrlevel_floor - minimum powerlevel constraint from thermal * @default_pwrlevel - device wake up power level * @max_pwrlevel - maximum allowable powerlevel per the user Loading Loading @@ -133,6 +135,8 @@ struct kgsl_pwrctrl { unsigned int active_pwrlevel; unsigned int previous_pwrlevel; unsigned int thermal_pwrlevel; unsigned int sysfs_thermal_pwrlevel; unsigned int cooling_thermal_pwrlevel; unsigned int thermal_pwrlevel_floor; unsigned int default_pwrlevel; unsigned int wakeup_maxpwrlevel; Loading
drivers/gpu/msm/kgsl_pwrscale.c +3 −2 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2010-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2010-2021, The Linux Foundation. All rights reserved. */ #include <linux/devfreq_cooling.h> Loading Loading @@ -654,7 +654,8 @@ static int opp_notify(struct notifier_block *nb, min_level = level; } pwr->thermal_pwrlevel = max_level; pwr->cooling_thermal_pwrlevel = max_level; pwr->thermal_pwrlevel = max(pwr->cooling_thermal_pwrlevel, pwr->sysfs_thermal_pwrlevel); pwr->thermal_pwrlevel_floor = min_level; /* Update the current level using the new limit */ Loading