~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/drm/drm_privacy_screen_driver.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: MIT */
  2 /*
  3  * Copyright (C) 2020 Red Hat, Inc.
  4  *
  5  * Authors:
  6  * Hans de Goede <hdegoede@redhat.com>
  7  */
  8 
  9 #ifndef __DRM_PRIVACY_SCREEN_DRIVER_H__
 10 #define __DRM_PRIVACY_SCREEN_DRIVER_H__
 11 
 12 #include <linux/device.h>
 13 #include <linux/list.h>
 14 #include <linux/mutex.h>
 15 #include <drm/drm_connector.h>
 16 
 17 struct drm_privacy_screen;
 18 
 19 /**
 20  * struct drm_privacy_screen_ops - drm_privacy_screen operations
 21  *
 22  * Defines the operations which the privacy-screen class code may call.
 23  * These functions should be implemented by the privacy-screen driver.
 24  */
 25 struct drm_privacy_screen_ops {
 26         /**
 27          * @set_sw_state: Called to request a change of the privacy-screen
 28          * state. The privacy-screen class code contains a check to avoid this
 29          * getting called when the hw_state reports the state is locked.
 30          * It is the driver's responsibility to update sw_state and hw_state.
 31          * This is always called with the drm_privacy_screen's lock held.
 32          */
 33         int (*set_sw_state)(struct drm_privacy_screen *priv,
 34                             enum drm_privacy_screen_status sw_state);
 35         /**
 36          * @get_hw_state: Called to request that the driver gets the current
 37          * privacy-screen state from the hardware and then updates sw_state and
 38          * hw_state accordingly. This will be called by the core just before
 39          * the privacy-screen is registered in sysfs.
 40          */
 41         void (*get_hw_state)(struct drm_privacy_screen *priv);
 42 };
 43 
 44 /**
 45  * struct drm_privacy_screen - central privacy-screen structure
 46  *
 47  * Central privacy-screen structure, this contains the struct device used
 48  * to register the screen in sysfs, the screen's state, ops, etc.
 49  */
 50 struct drm_privacy_screen {
 51         /** @dev: device used to register the privacy-screen in sysfs. */
 52         struct device dev;
 53         /** @lock: mutex protection all fields in this struct. */
 54         struct mutex lock;
 55         /** @list: privacy-screen devices list list-entry. */
 56         struct list_head list;
 57         /** @notifier_head: privacy-screen notifier head. */
 58         struct blocking_notifier_head notifier_head;
 59         /**
 60          * @ops: &struct drm_privacy_screen_ops for this privacy-screen.
 61          * This is NULL if the driver has unregistered the privacy-screen.
 62          */
 63         const struct drm_privacy_screen_ops *ops;
 64         /**
 65          * @sw_state: The privacy-screen's software state, see
 66          * :ref:`Standard Connector Properties<standard_connector_properties>`
 67          * for more info.
 68          */
 69         enum drm_privacy_screen_status sw_state;
 70         /**
 71          * @hw_state: The privacy-screen's hardware state, see
 72          * :ref:`Standard Connector Properties<standard_connector_properties>`
 73          * for more info.
 74          */
 75         enum drm_privacy_screen_status hw_state;
 76         /**
 77          * @drvdata: Private data owned by the privacy screen provider
 78          */
 79         void *drvdata;
 80 };
 81 
 82 static inline
 83 void *drm_privacy_screen_get_drvdata(struct drm_privacy_screen *priv)
 84 {
 85         return priv->drvdata;
 86 }
 87 
 88 struct drm_privacy_screen *drm_privacy_screen_register(
 89         struct device *parent, const struct drm_privacy_screen_ops *ops,
 90         void *data);
 91 void drm_privacy_screen_unregister(struct drm_privacy_screen *priv);
 92 
 93 void drm_privacy_screen_call_notifier_chain(struct drm_privacy_screen *priv);
 94 
 95 #endif
 96 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php