summaryrefslogtreecommitdiff
path: root/drivers/video/tegra
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/video/tegra
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/video/tegra')
-rw-r--r--drivers/video/tegra/dc/ext/dev.c46
1 files changed, 29 insertions, 17 deletions
diff --git a/drivers/video/tegra/dc/ext/dev.c b/drivers/video/tegra/dc/ext/dev.c
index 92e42ce..8ec015c 100644
--- a/drivers/video/tegra/dc/ext/dev.c
+++ b/drivers/video/tegra/dc/ext/dev.c
@@ -274,31 +274,40 @@ static int tegra_dc_ext_set_windowattr(struct tegra_dc_ext *ext,
return 0;
}
-static struct srcu_notifier_head tegra_dc_flip_notifier_list;
-static bool init_tegra_dc_flip_notifier_list_called;
-static int __init init_tegra_dc_flip_notifier_list(void)
+static void (*flip_callback)(void);
+static spinlock_t flip_callback_lock;
+static bool init_tegra_dc_flip_callback_called;
+
+static int __init init_tegra_dc_flip_callback(void)
{
- srcu_init_notifier_head(&tegra_dc_flip_notifier_list);
- init_tegra_dc_flip_notifier_list_called = true;
+ spin_lock_init(&flip_callback_lock);
+ init_tegra_dc_flip_callback_called = true;
return 0;
}
-pure_initcall(init_tegra_dc_flip_notifier_list);
+pure_initcall(init_tegra_dc_flip_callback);
-int tegra_dc_register_flip_notifier(struct notifier_block *nb)
+int tegra_dc_set_flip_callback(void (*callback)(void))
{
- WARN_ON(!init_tegra_dc_flip_notifier_list_called);
+ WARN_ON(!init_tegra_dc_flip_callback_called);
+
+ spin_lock(&flip_callback_lock);
+ flip_callback = callback;
+ spin_unlock(&flip_callback_lock);
- return srcu_notifier_chain_register(
- &tegra_dc_flip_notifier_list, nb);
+ return 0;
}
-EXPORT_SYMBOL(tegra_dc_register_flip_notifier);
+EXPORT_SYMBOL(tegra_dc_set_flip_callback);
-int tegra_dc_unregister_flip_notifier(struct notifier_block *nb)
+int tegra_dc_unset_flip_callback()
{
- return srcu_notifier_chain_unregister(&tegra_dc_flip_notifier_list, nb);
+ spin_lock(&flip_callback_lock);
+ flip_callback = NULL;
+ spin_unlock(&flip_callback_lock);
+
+ return 0;
}
-EXPORT_SYMBOL(tegra_dc_unregister_flip_notifier);
+EXPORT_SYMBOL(tegra_dc_unset_flip_callback);
static void tegra_dc_ext_flip_worker(struct work_struct *work)
{
@@ -353,9 +362,12 @@ static void tegra_dc_ext_flip_worker(struct work_struct *work)
tegra_dc_update_windows(wins, nr_win);
/* TODO: implement swapinterval here */
tegra_dc_sync_windows(wins, nr_win);
- if (!tegra_dc_has_multiple_dc())
- srcu_notifier_call_chain(&tegra_dc_flip_notifier_list,
- 1UL, NULL);
+ if (!tegra_dc_has_multiple_dc()) {
+ spin_lock(&flip_callback_lock);
+ if (flip_callback)
+ flip_callback();
+ spin_unlock(&flip_callback_lock);
+ }
}
for (i = 0; i < DC_N_WINDOWS; i++) {