summaryrefslogtreecommitdiff
path: root/drivers/misc/tegra-throughput.c
diff options
context:
space:
mode:
authorArto Merilainen <amerilainen@nvidia.com>2013-09-25 15:39:34 +0300
committerAjay Nandakumar <anandakumarm@nvidia.com>2013-10-03 19:17:34 +0530
commit2e6522ef587a78687cf260ee18dcda98a92e8b61 (patch)
tree3672675b49e8474a8c09925fd3119f812671e008 /drivers/misc/tegra-throughput.c
parent904d3efc992e52d6d68b00ee4e73c92a3289fba2 (diff)
misc: tegra-throughput: Use notifiers
We used to deliver this information by calling directly a function inside nvhost_pod. This is not suitable for our needs as we want to be able to use the same governor with several different (graphics) devices in the same system. This patch modifies tegra-throughput to use notifier chain for delivering information about changed throughput hint. Bug 1364804 Change-Id: Ifce1c84ae68cdcf54b00402efa80aee0b220bc9e Signed-off-by: Arto Merilainen <amerilainen@nvidia.com> (cherry picked from commit 9f10cf7082055f81c201ab5f5574c2f8fe8c6795) Signed-off-by: Ajay Nandakumar <anandakumarm@nvidia.com>
Diffstat (limited to 'drivers/misc/tegra-throughput.c')
-rw-r--r--drivers/misc/tegra-throughput.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/misc/tegra-throughput.c b/drivers/misc/tegra-throughput.c
index 49b509348c3c..968371b0a073 100644
--- a/drivers/misc/tegra-throughput.c
+++ b/drivers/misc/tegra-throughput.c
@@ -27,6 +27,8 @@
#include <linux/throughput_ioctl.h>
#include <linux/module.h>
#include <linux/nvhost.h>
+#include <linux/notifier.h>
+#include <linux/tegra-throughput.h>
#include <mach/dc.h>
#define DEFAULT_SYNC_RATE 60000 /* 60 Hz */
@@ -46,11 +48,21 @@ static int throughput_hint;
static int sync_rate;
static int throughput_active_app_count;
+BLOCKING_NOTIFIER_HEAD(throughput_notifier_list);
+EXPORT_SYMBOL(throughput_notifier_list);
+
static void set_throughput_hint(struct work_struct *work)
{
/* notify throughput hint clients here */
- nvhost_scale3d_set_throughput_hint(throughput_hint);
+ blocking_notifier_call_chain(&throughput_notifier_list,
+ throughput_hint, NULL);
+}
+
+int tegra_throughput_get_hint(void)
+{
+ return throughput_hint;
}
+EXPORT_SYMBOL(tegra_throughput_get_hint);
static void throughput_flip_callback(void)
{