diff options
author | Ilan Aelion <iaelion@nvidia.com> | 2012-08-28 11:05:36 -0600 |
---|---|---|
committer | Varun Colbert <vcolbert@nvidia.com> | 2012-09-11 17:21:03 -0700 |
commit | 8aecb2c96834197427737ea4d06700a9eeda532b (patch) | |
tree | 5e2c87af71e950ed6b4d5c2a42804d08e7c40edb /drivers/misc | |
parent | 678708d95daa7d29ad5f49944f1b5385e3f27401 (diff) |
video: tegra: host: add idle time estimate in 3dfs
When a throughput hint is available, still keep track of the idle time
percentage and use both in gpu scaling. Also modifying fallback
scaling code to use same idle estimate used when a throughput hint is
available. Dropping different time frames for scaling up and down.
Bug 1034948
Bug 965517
Change-Id: Ib3945642768e36a6c0c50f4195c89e3bb67f8442
Signed-off-by: Ilan Aelion <iaelion@nvidia.com>
Reviewed-on: http://git-master/r/129410
(cherry picked from commit 1e9974097286a78f34367683a3921c9b5bf77d4d)
Reviewed-on: http://git-master/r/131155
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/tegra-throughput.c | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/drivers/misc/tegra-throughput.c b/drivers/misc/tegra-throughput.c index 366b0ecc10e6..d491ef8c06cf 100644 --- a/drivers/misc/tegra-throughput.c +++ b/drivers/misc/tegra-throughput.c @@ -46,35 +46,34 @@ static void set_throughput_hint(struct work_struct *work) static int throughput_flip_callback(void) { + long timediff; + ktime_t now; + /* only register flips when a single app is active */ if (multiple_app_disable) return NOTIFY_DONE; - else { - long timediff; - ktime_t now; - - now = ktime_get(); - if (last_flip.tv64 != 0) { - timediff = (long) ktime_us_delta(now, last_flip); - if (timediff > (long) USHRT_MAX) - last_frame_time = USHRT_MAX; - else - last_frame_time = (unsigned short) timediff; - - if (last_frame_time == 0) { - pr_warn("%s: flips %lld nsec apart\n", - __func__, now.tv64 - last_flip.tv64); - return NOTIFY_DONE; - } - - throughput_hint = - ((int) target_frame_time * 100)/last_frame_time; - - if (!work_pending(&work)) - schedule_work(&work); + + now = ktime_get(); + if (last_flip.tv64 != 0) { + timediff = (long) ktime_us_delta(now, last_flip); + if (timediff > (long) USHRT_MAX) + last_frame_time = USHRT_MAX; + else + last_frame_time = (unsigned short) timediff; + + if (last_frame_time == 0) { + pr_warn("%s: flips %lld nsec apart\n", + __func__, now.tv64 - last_flip.tv64); + return NOTIFY_DONE; } - last_flip = now; + + throughput_hint = + ((int) target_frame_time * 1000) / last_frame_time; + + if (!work_pending(&work)) + schedule_work(&work); } + last_flip = now; return NOTIFY_OK; } |