diff options
| author | Deepak Kumar <dkumar@codeaurora.org> | 2016-03-01 19:28:46 +0530 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-25 16:04:07 -0700 |
| commit | b00bed4b8d3c5c77fceb0ae9ee974992a398b1ad (patch) | |
| tree | 176f93036460d4b127890475a8f2d316850080cc /drivers/gpu | |
| parent | e22d001089f69c82f26a015a7f63b2330e6a4298 (diff) | |
msm: kgsl: Track and pass number of active context to governor
Track number of active context and pass it to governor along
with busy stats. This allows GPU DCVS to make decision based
on context count and busy stats, which helps in handling sudden
workloads.
Change-Id: I9b40e4917b30ee3f15f2c8e99669e090578f1289
Signed-off-by: Deepak Kumar <dkumar@codeaurora.org>
Signed-off-by: Divya Ponnusamy <pdivya@codeaurora.org>
Diffstat (limited to 'drivers/gpu')
| -rw-r--r-- | drivers/gpu/msm/kgsl_pwrscale.c | 26 | ||||
| -rw-r--r-- | drivers/gpu/msm/kgsl_trace.h | 12 |
2 files changed, 32 insertions, 6 deletions
diff --git a/drivers/gpu/msm/kgsl_pwrscale.c b/drivers/gpu/msm/kgsl_pwrscale.c index 5410c0c631d5..4ee1816a66f0 100644 --- a/drivers/gpu/msm/kgsl_pwrscale.c +++ b/drivers/gpu/msm/kgsl_pwrscale.c @@ -548,6 +548,8 @@ int kgsl_devfreq_get_dev_status(struct device *dev, stat->current_frequency = kgsl_pwrctrl_active_freq(&device->pwrctrl); + stat->private_data = &device->active_context_count; + /* * keep the latest devfreq_dev_status values * and vbif counters data @@ -567,7 +569,8 @@ int kgsl_devfreq_get_dev_status(struct device *dev, } kgsl_pwrctrl_busy_time(device, stat->total_time, stat->busy_time); - trace_kgsl_pwrstats(device, stat->total_time, &pwrscale->accum_stats); + trace_kgsl_pwrstats(device, stat->total_time, + &pwrscale->accum_stats, device->active_context_count); memset(&pwrscale->accum_stats, 0, sizeof(pwrscale->accum_stats)); mutex_unlock(&device->mutex); @@ -826,6 +829,27 @@ int kgsl_pwrscale_init(struct device *dev, const char *governor) data->disable_busy_time_burst = of_property_read_bool( device->pdev->dev.of_node, "qcom,disable-busy-time-burst"); + data->ctxt_aware_enable = + of_property_read_bool(device->pdev->dev.of_node, + "qcom,enable-ca-jump"); + + if (data->ctxt_aware_enable) { + if (of_property_read_u32(device->pdev->dev.of_node, + "qcom,ca-target-pwrlevel", + &data->bin.ctxt_aware_target_pwrlevel)) + data->bin.ctxt_aware_target_pwrlevel = 1; + + if ((data->bin.ctxt_aware_target_pwrlevel < 0) || + (data->bin.ctxt_aware_target_pwrlevel > + pwr->num_pwrlevels)) + data->bin.ctxt_aware_target_pwrlevel = 1; + + if (of_property_read_u32(device->pdev->dev.of_node, + "qcom,ca-busy-penalty", + &data->bin.ctxt_aware_busy_penalty)) + data->bin.ctxt_aware_busy_penalty = 12000; + } + /* * If there is a separate GX power rail, allow * independent modification to its voltage through diff --git a/drivers/gpu/msm/kgsl_trace.h b/drivers/gpu/msm/kgsl_trace.h index da7a282acc62..8988dc12839f 100644 --- a/drivers/gpu/msm/kgsl_trace.h +++ b/drivers/gpu/msm/kgsl_trace.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-2016, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -344,9 +344,9 @@ TRACE_EVENT(kgsl_gpubusy, TRACE_EVENT(kgsl_pwrstats, TP_PROTO(struct kgsl_device *device, s64 time, - struct kgsl_power_stats *pstats), + struct kgsl_power_stats *pstats, u32 ctxt_count), - TP_ARGS(device, time, pstats), + TP_ARGS(device, time, pstats, ctxt_count), TP_STRUCT__entry( __string(device_name, device->name) @@ -354,6 +354,7 @@ TRACE_EVENT(kgsl_pwrstats, __field(u64, busy_time) __field(u64, ram_time) __field(u64, ram_wait) + __field(u32, context_count) ), TP_fast_assign( @@ -362,12 +363,13 @@ TRACE_EVENT(kgsl_pwrstats, __entry->busy_time = pstats->busy_time; __entry->ram_time = pstats->ram_time; __entry->ram_wait = pstats->ram_wait; + __entry->context_count = ctxt_count; ), TP_printk( - "d_name=%s total=%lld busy=%lld ram_time=%lld ram_wait=%lld", + "d_name=%s total=%lld busy=%lld ram_time=%lld ram_wait=%lld context_count=%u", __get_str(device_name), __entry->total_time, __entry->busy_time, - __entry->ram_time, __entry->ram_wait + __entry->ram_time, __entry->ram_wait, __entry->context_count ) ); |
