diff options
author | Kevin DuBois <kevindubois@google.com> | 2022-03-24 20:57:32 +0000 |
---|---|---|
committer | Kevin DuBois <kevindubois@google.com> | 2022-03-31 21:16:50 +0000 |
commit | 4f54cb18f51cb2bd21c2f79e841c2de8fd6e03bd (patch) | |
tree | e220cd820e143a053e845240dd812c6649b01c15 /mali_kbase/platform/pixel/pixel_gpu_sysfs.c | |
parent | 79c6f505d21ff58ffe5ac1da551819e5f6bf46a7 (diff) | |
download | gpu-4f54cb18f51cb2bd21c2f79e841c2de8fd6e03bd.tar.gz |
mali_kbase: HOST_CONTROLS_SC_RAILS with no pwr off
Sets the IFPO flag to on, but disables any actual turning off of the
rails for now.
This changes submission path of userspace threads, without turning rails
off while some firmware/shader dependencies are identified for
stability.
IFPO with shaders power actually turning on or off may be activated by
echo 1 > ${module_sysfs_dir}/ifpo
Bug: 226918775
Test: turn feature on and off repeatedly in loop.
Test: SST local run
Change-Id: Iabeae659ee9ef1f6a88b76df30dcbb0a16be06c6
Diffstat (limited to 'mali_kbase/platform/pixel/pixel_gpu_sysfs.c')
-rw-r--r-- | mali_kbase/platform/pixel/pixel_gpu_sysfs.c | 55 |
1 files changed, 54 insertions, 1 deletions
diff --git a/mali_kbase/platform/pixel/pixel_gpu_sysfs.c b/mali_kbase/platform/pixel/pixel_gpu_sysfs.c index 9e5dc63..c816460 100644 --- a/mali_kbase/platform/pixel/pixel_gpu_sysfs.c +++ b/mali_kbase/platform/pixel/pixel_gpu_sysfs.c @@ -690,6 +690,57 @@ static ssize_t governor_store(struct device *dev, struct device_attribute *attr, return ret; } +static ssize_t ifpo_show(struct device *dev, struct device_attribute *attr, char *buf) +{ +#ifdef CONFIG_MALI_HOST_CONTROLS_SC_RAILS + struct kbase_device *kbdev = dev->driver_data; + struct pixel_context *pc = kbdev->platform_context; + ssize_t ret = 0; + + if (!pc) + return -ENODEV; + + mutex_lock(&pc->pm.lock); + ret = scnprintf(buf, PAGE_SIZE, "%d\n", pc->pm.ifpo_enabled); + mutex_unlock(&pc->pm.lock); + return ret; +#else + return -ENOTSUPP; +#endif +} + +static ssize_t ifpo_store(struct device *dev, struct device_attribute *attr, + const char *buf, size_t count) +{ +#ifdef CONFIG_MALI_HOST_CONTROLS_SC_RAILS + int ret; + bool enabled; + struct kbase_device *kbdev = dev->driver_data; + struct pixel_context *pc = kbdev->platform_context; + if (!pc) + return -ENODEV; + + ret = strtobool(buf, &enabled); + if (ret) + return -EINVAL; + + mutex_lock(&kbdev->csf.scheduler.lock); + + if (!enabled) { + turn_on_sc_power_rails(kbdev); + } + + mutex_lock(&pc->pm.lock); + pc->pm.ifpo_enabled = enabled; + mutex_unlock(&pc->pm.lock); + mutex_unlock(&kbdev->csf.scheduler.lock); + + return count; +#else + return -ENOTSUPP; +#endif +} + /* Define devfreq-like attributes */ DEVICE_ATTR_RO(available_frequencies); @@ -705,6 +756,7 @@ DEVICE_ATTR_RO(time_in_state); DEVICE_ATTR_RO(trans_stat); DEVICE_ATTR_RO(available_governors); DEVICE_ATTR_RW(governor); +DEVICE_ATTR_RW(ifpo); /* Initialization code */ @@ -737,7 +789,8 @@ static struct { { "trans_stat", &dev_attr_trans_stat }, { "available_governors", &dev_attr_available_governors }, { "governor", &dev_attr_governor }, - { "trigger_core_dump", &dev_attr_trigger_core_dump } + { "trigger_core_dump", &dev_attr_trigger_core_dump }, + { "ifpo", &dev_attr_ifpo } }; /** |