Loading drivers/gpu/msm/adreno_sysfs.c +53 −0 Original line number Diff line number Diff line Loading @@ -220,6 +220,23 @@ static int _preemption_store(struct adreno_device *adreno_dev, return 0; } static int _gmu_idle_level_store(struct adreno_device *adreno_dev, unsigned int val) { struct kgsl_device *device = KGSL_DEVICE(adreno_dev); struct gmu_device *gmu = &device->gmu; mutex_lock(&device->mutex); /* Power down the GPU before changing the idle level */ kgsl_pwrctrl_change_state(device, KGSL_STATE_SUSPEND); gmu->idle_level = val; kgsl_pwrctrl_change_state(device, KGSL_STATE_SLUMBER); mutex_unlock(&device->mutex); return 0; } static unsigned int _preemption_show(struct adreno_device *adreno_dev) { return adreno_is_preemption_execution_enabled(adreno_dev); Loading Loading @@ -268,6 +285,40 @@ static unsigned int _lm_show(struct adreno_device *adreno_dev) return test_bit(ADRENO_LM_CTRL, &adreno_dev->pwrctrl_flag); } static int _ifpc_store(struct adreno_device *adreno_dev, unsigned int val) { struct kgsl_device *device = KGSL_DEVICE(adreno_dev); struct gmu_device *gmu = &device->gmu; unsigned int requested_idle_level; if (!kgsl_gmu_isenabled(device) || !ADRENO_FEATURE(adreno_dev, ADRENO_IFPC)) return -EINVAL; if ((val && gmu->idle_level >= GPU_HW_IFPC) || (!val && gmu->idle_level < GPU_HW_IFPC)) return 0; if (val) requested_idle_level = GPU_HW_IFPC; else { if (ADRENO_FEATURE(adreno_dev, ADRENO_SPTP_PC)) requested_idle_level = GPU_HW_SPTP_PC; else requested_idle_level = GPU_HW_ACTIVE; } return _gmu_idle_level_store(adreno_dev, requested_idle_level); } static unsigned int _ifpc_show(struct adreno_device *adreno_dev) { struct kgsl_device *device = KGSL_DEVICE(adreno_dev); struct gmu_device *gmu = &device->gmu; return kgsl_gmu_isenabled(device) && gmu->idle_level >= GPU_HW_IFPC; } static ssize_t _sysfs_store_u32(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) Loading Loading @@ -366,6 +417,7 @@ static ADRENO_SYSFS_BOOL(lm); static ADRENO_SYSFS_BOOL(preemption); static ADRENO_SYSFS_BOOL(hwcg); static ADRENO_SYSFS_BOOL(throttling); static ADRENO_SYSFS_BOOL(ifpc); Loading @@ -386,6 +438,7 @@ static const struct device_attribute *_attr_list[] = { &adreno_attr_preempt_level.attr, &adreno_attr_usesgmem.attr, &adreno_attr_skipsaverestore.attr, &adreno_attr_ifpc.attr, NULL, }; Loading Loading
drivers/gpu/msm/adreno_sysfs.c +53 −0 Original line number Diff line number Diff line Loading @@ -220,6 +220,23 @@ static int _preemption_store(struct adreno_device *adreno_dev, return 0; } static int _gmu_idle_level_store(struct adreno_device *adreno_dev, unsigned int val) { struct kgsl_device *device = KGSL_DEVICE(adreno_dev); struct gmu_device *gmu = &device->gmu; mutex_lock(&device->mutex); /* Power down the GPU before changing the idle level */ kgsl_pwrctrl_change_state(device, KGSL_STATE_SUSPEND); gmu->idle_level = val; kgsl_pwrctrl_change_state(device, KGSL_STATE_SLUMBER); mutex_unlock(&device->mutex); return 0; } static unsigned int _preemption_show(struct adreno_device *adreno_dev) { return adreno_is_preemption_execution_enabled(adreno_dev); Loading Loading @@ -268,6 +285,40 @@ static unsigned int _lm_show(struct adreno_device *adreno_dev) return test_bit(ADRENO_LM_CTRL, &adreno_dev->pwrctrl_flag); } static int _ifpc_store(struct adreno_device *adreno_dev, unsigned int val) { struct kgsl_device *device = KGSL_DEVICE(adreno_dev); struct gmu_device *gmu = &device->gmu; unsigned int requested_idle_level; if (!kgsl_gmu_isenabled(device) || !ADRENO_FEATURE(adreno_dev, ADRENO_IFPC)) return -EINVAL; if ((val && gmu->idle_level >= GPU_HW_IFPC) || (!val && gmu->idle_level < GPU_HW_IFPC)) return 0; if (val) requested_idle_level = GPU_HW_IFPC; else { if (ADRENO_FEATURE(adreno_dev, ADRENO_SPTP_PC)) requested_idle_level = GPU_HW_SPTP_PC; else requested_idle_level = GPU_HW_ACTIVE; } return _gmu_idle_level_store(adreno_dev, requested_idle_level); } static unsigned int _ifpc_show(struct adreno_device *adreno_dev) { struct kgsl_device *device = KGSL_DEVICE(adreno_dev); struct gmu_device *gmu = &device->gmu; return kgsl_gmu_isenabled(device) && gmu->idle_level >= GPU_HW_IFPC; } static ssize_t _sysfs_store_u32(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) Loading Loading @@ -366,6 +417,7 @@ static ADRENO_SYSFS_BOOL(lm); static ADRENO_SYSFS_BOOL(preemption); static ADRENO_SYSFS_BOOL(hwcg); static ADRENO_SYSFS_BOOL(throttling); static ADRENO_SYSFS_BOOL(ifpc); Loading @@ -386,6 +438,7 @@ static const struct device_attribute *_attr_list[] = { &adreno_attr_preempt_level.attr, &adreno_attr_usesgmem.attr, &adreno_attr_skipsaverestore.attr, &adreno_attr_ifpc.attr, NULL, }; Loading