aboutsummaryrefslogtreecommitdiff
path: root/include/drm/drm_privacy_screen_driver.h
diff options
context:
space:
mode:
authorGravatar Hans de Goede <hdegoede@redhat.com> 2021-10-05 22:23:16 +0200
committerGravatar Hans de Goede <hdegoede@redhat.com> 2021-10-14 13:12:25 +0200
commit8a12b170558aabb31cc98fda0da6a56b518cadaa (patch)
tree09f3df415d74132ec03a82e4b15c1e3962697553 /include/drm/drm_privacy_screen_driver.h
parentdrm/privacy-screen: Add X86 specific arch init code (diff)
downloadlinux-8a12b170558aabb31cc98fda0da6a56b518cadaa.tar.gz
linux-8a12b170558aabb31cc98fda0da6a56b518cadaa.tar.bz2
linux-8a12b170558aabb31cc98fda0da6a56b518cadaa.zip
drm/privacy-screen: Add notifier support (v2)
Add support for privacy-screen consumers to register a notifier to be notified of external (e.g. done by the hw itself on a hotkey press) state changes. Changes in v2: - Drop WARN_ON(mutex_is_locked(&priv->lock)) check in drm_privacy_screen_call_notifier_chain() it may be locked by another thread, which would lead to a false-positive triggering of the check Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20211005202322.700909-5-hdegoede@redhat.com
Diffstat (limited to 'include/drm/drm_privacy_screen_driver.h')
-rw-r--r--include/drm/drm_privacy_screen_driver.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/drm/drm_privacy_screen_driver.h b/include/drm/drm_privacy_screen_driver.h
index 5187ae52eb03..24591b607675 100644
--- a/include/drm/drm_privacy_screen_driver.h
+++ b/include/drm/drm_privacy_screen_driver.h
@@ -54,6 +54,8 @@ struct drm_privacy_screen {
struct mutex lock;
/** @list: privacy-screen devices list list-entry. */
struct list_head list;
+ /** @notifier_head: privacy-screen notifier head. */
+ struct blocking_notifier_head notifier_head;
/**
* @ops: &struct drm_privacy_screen_ops for this privacy-screen.
* This is NULL if the driver has unregistered the privacy-screen.
@@ -77,4 +79,6 @@ struct drm_privacy_screen *drm_privacy_screen_register(
struct device *parent, const struct drm_privacy_screen_ops *ops);
void drm_privacy_screen_unregister(struct drm_privacy_screen *priv);
+void drm_privacy_screen_call_notifier_chain(struct drm_privacy_screen *priv);
+
#endif