1 /* SPDX-License-Identifier: MIT */
3 * Copyright (C) 2020 Red Hat, Inc.
6 * Hans de Goede <hdegoede@redhat.com>
9 #ifndef __DRM_PRIVACY_SCREEN_CONSUMER_H__
10 #define __DRM_PRIVACY_SCREEN_CONSUMER_H__
12 #include <linux/device.h>
13 #include <drm/drm_connector.h>
15 struct drm_privacy_screen;
17 #if IS_ENABLED(CONFIG_DRM_PRIVACY_SCREEN)
18 struct drm_privacy_screen *drm_privacy_screen_get(struct device *dev,
20 void drm_privacy_screen_put(struct drm_privacy_screen *priv);
22 int drm_privacy_screen_set_sw_state(struct drm_privacy_screen *priv,
23 enum drm_privacy_screen_status sw_state);
24 void drm_privacy_screen_get_state(struct drm_privacy_screen *priv,
25 enum drm_privacy_screen_status *sw_state_ret,
26 enum drm_privacy_screen_status *hw_state_ret);
28 int drm_privacy_screen_register_notifier(struct drm_privacy_screen *priv,
29 struct notifier_block *nb);
30 int drm_privacy_screen_unregister_notifier(struct drm_privacy_screen *priv,
31 struct notifier_block *nb);
33 static inline struct drm_privacy_screen *drm_privacy_screen_get(struct device *dev,
36 return ERR_PTR(-ENODEV);
38 static inline void drm_privacy_screen_put(struct drm_privacy_screen *priv)
41 static inline int drm_privacy_screen_set_sw_state(struct drm_privacy_screen *priv,
42 enum drm_privacy_screen_status sw_state)
46 static inline void drm_privacy_screen_get_state(struct drm_privacy_screen *priv,
47 enum drm_privacy_screen_status *sw_state_ret,
48 enum drm_privacy_screen_status *hw_state_ret)
50 *sw_state_ret = PRIVACY_SCREEN_DISABLED;
51 *hw_state_ret = PRIVACY_SCREEN_DISABLED;
53 static inline int drm_privacy_screen_register_notifier(struct drm_privacy_screen *priv,
54 struct notifier_block *nb)
58 static inline int drm_privacy_screen_unregister_notifier(struct drm_privacy_screen *priv,
59 struct notifier_block *nb)