summaryrefslogtreecommitdiff
path: root/drivers/misc
diff options
context:
space:
mode:
authorIlan Aelion <iaelion@nvidia.com>2012-08-10 13:53:10 -0600
committerSimone Willett <swillett@nvidia.com>2012-08-16 11:02:18 -0700
commitaa0cae6ab52a7fc278ee3cc29d56cc4daa807004 (patch)
tree6ddb563481c62ac85907faf2e6b9a4216bf3a042 /drivers/misc
parent833e152507b2351ae71de1a2b224745f550f8f7e (diff)
video: tegra: dc: disuse notifier
Due to issues with rcu notifiers on secureos, modifying dc flip notifications to use a simple callback instead. Bug 1028850 Change-Id: Iebf2a6d64d7316e3df2b88444201f9f9a29698c5 Signed-off-by: Ilan Aelion <iaelion@nvidia.com> Reviewed-on: http://git-master/r/123103 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Jon Mayo <jmayo@nvidia.com> Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/tegra-throughput.c36
1 files changed, 10 insertions, 26 deletions
diff --git a/drivers/misc/tegra-throughput.c b/drivers/misc/tegra-throughput.c
index 26573d8afc1a..366b0ecc10e6 100644
--- a/drivers/misc/tegra-throughput.c
+++ b/drivers/misc/tegra-throughput.c
@@ -19,7 +19,6 @@
#include <linux/kthread.h>
#include <linux/ktime.h>
-#include <linux/notifier.h>
#include <linux/miscdevice.h>
#include <linux/fs.h>
#include <linux/init.h>
@@ -45,12 +44,10 @@ static void set_throughput_hint(struct work_struct *work)
nvhost_scale3d_set_throughput_hint(throughput_hint);
}
-static int throughput_flip_notifier(struct notifier_block *nb,
- unsigned long val,
- void *data)
+static int throughput_flip_callback(void)
{
- /* only register flips when a single display is active */
- if (val != 1 || multiple_app_disable)
+ /* only register flips when a single app is active */
+ if (multiple_app_disable)
return NOTIFY_DONE;
else {
long timediff;
@@ -65,7 +62,7 @@ static int throughput_flip_notifier(struct notifier_block *nb,
last_frame_time = (unsigned short) timediff;
if (last_frame_time == 0) {
- pr_warn("%s: notifications %lld nsec apart\n",
+ pr_warn("%s: flips %lld nsec apart\n",
__func__, now.tv64 - last_flip.tv64);
return NOTIFY_DONE;
}
@@ -82,10 +79,6 @@ static int throughput_flip_notifier(struct notifier_block *nb,
return NOTIFY_OK;
}
-static struct notifier_block throughput_flip_nb = {
- .notifier_call = throughput_flip_notifier,
-};
-
static int sync_rate;
static int throughput_active_app_count;
@@ -104,17 +97,15 @@ static void reset_target_frame_time(void)
__func__, sync_rate, target_frame_time);
}
-static int notifier_initialized;
+static int callback_initialized;
static int throughput_open(struct inode *inode, struct file *file)
{
- int need_init = 0;
-
spin_lock(&lock);
- if (!notifier_initialized) {
- notifier_initialized = 1;
- need_init = 1;
+ if (!callback_initialized) {
+ callback_initialized = 1;
+ tegra_dc_set_flip_callback(throughput_flip_callback);
}
throughput_active_app_count++;
@@ -123,8 +114,6 @@ static int throughput_open(struct inode *inode, struct file *file)
spin_unlock(&lock);
- if (need_init)
- tegra_dc_register_flip_notifier(&throughput_flip_nb);
pr_debug("throughput_open node %p file %p\n", inode, file);
@@ -133,23 +122,18 @@ static int throughput_open(struct inode *inode, struct file *file)
static int throughput_release(struct inode *inode, struct file *file)
{
- int need_deinit = 0;
-
spin_lock(&lock);
throughput_active_app_count--;
if (throughput_active_app_count == 0) {
reset_target_frame_time();
multiple_app_disable = 0;
- notifier_initialized = 0;
- need_deinit = 1;
+ callback_initialized = 0;
+ tegra_dc_unset_flip_callback();
}
spin_unlock(&lock);
- if (need_deinit)
- tegra_dc_unregister_flip_notifier(&throughput_flip_nb);
-
pr_debug("throughput_release node %p file %p\n", inode, file);
return 0;