summaryrefslogtreecommitdiffstats
path: root/include/drm
diff options
context:
space:
mode:
authorRajat Jain <rajatja@google.com>2022-01-07 11:02:06 -0800
committerHans de Goede <hdegoede@redhat.com>2022-01-10 12:17:37 +0100
commit30598d925d466c53c4c218a58f80e043cfe9b085 (patch)
tree36f18c5df9338fe87af1be984e244a3c06076848 /include/drm
parent3dbc84a595d17f64f14fcea00120d31e33e98880 (diff)
downloadlinux-30598d925d466c53c4c218a58f80e043cfe9b085.tar.bz2
drm/privacy_screen: Add drvdata in drm_privacy_screen
Allow a privacy screen provider to stash its private data pointer in the drm_privacy_screen, and update the drm_privacy_screen_register() call to accept that. Also introduce a *_get_drvdata() so that it can retrieved back when needed. This also touches the IBM Thinkpad platform driver, the only user of privacy screen today, to pass NULL for now to the updated API. Signed-off-by: Rajat Jain <rajatja@google.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220107190208.95479-1-rajatja@google.com
Diffstat (limited to 'include/drm')
-rw-r--r--include/drm/drm_privacy_screen_driver.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/include/drm/drm_privacy_screen_driver.h b/include/drm/drm_privacy_screen_driver.h
index 24591b607675..4ef246d5706f 100644
--- a/include/drm/drm_privacy_screen_driver.h
+++ b/include/drm/drm_privacy_screen_driver.h
@@ -73,10 +73,21 @@ struct drm_privacy_screen {
* for more info.
*/
enum drm_privacy_screen_status hw_state;
+ /**
+ * @drvdata: Private data owned by the privacy screen provider
+ */
+ void *drvdata;
};
+static inline
+void *drm_privacy_screen_get_drvdata(struct drm_privacy_screen *priv)
+{
+ return priv->drvdata;
+}
+
struct drm_privacy_screen *drm_privacy_screen_register(
- struct device *parent, const struct drm_privacy_screen_ops *ops);
+ struct device *parent, const struct drm_privacy_screen_ops *ops,
+ void *data);
void drm_privacy_screen_unregister(struct drm_privacy_screen *priv);
void drm_privacy_screen_call_notifier_chain(struct drm_privacy_screen *priv);