[Intel-gfx] [RFC v1 03/20] drm/sysfs: Generate drm uevent with custom string

Ramalingam C ramalingam.c at intel.com
Wed Jul 12 08:28:47 UTC 2017


Routine to generate DRM uevent with custom string is introduced.
This is required to notify the UMD about the HDCP link breakage
during the ongoing HDCP session. This could happen due to loss of
HDCP packet sync or reauthentication request from HDCP sink as per
the HDCP spec.

Signed-off-by: Ramalingam C <ramalingam.c at intel.com>
---
 drivers/gpu/drm/drm_sysfs.c | 17 +++++++++++++++++
 include/drm/drm_sysfs.h     |  1 +
 2 files changed, 18 insertions(+)

diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c
index 1c5b5ce..07c374a 100644
--- a/drivers/gpu/drm/drm_sysfs.c
+++ b/drivers/gpu/drm/drm_sysfs.c
@@ -320,6 +320,23 @@ void drm_sysfs_hotplug_event(struct drm_device *dev)
 }
 EXPORT_SYMBOL(drm_sysfs_hotplug_event);
 
+/**
+ * drm_sysfs_generate_uevent - generate a DRM uevent
+ * @dev: DRM device
+ *
+ * Send a uevent for the DRM device specified by @dev.
+ */
+void drm_sysfs_generate_uevent(struct drm_device *dev, char *event_string)
+{
+	char *envp[] = { event_string, NULL };
+
+	DRM_DEBUG("generating DRM uevent with %s\n", event_string);
+
+	kobject_uevent_env(&dev->primary->kdev->kobj, KOBJ_CHANGE, envp);
+}
+EXPORT_SYMBOL(drm_sysfs_generate_uevent);
+
+
 static void drm_sysfs_release(struct device *dev)
 {
 	kfree(dev);
diff --git a/include/drm/drm_sysfs.h b/include/drm/drm_sysfs.h
index 70c9a10..8bd358f 100644
--- a/include/drm/drm_sysfs.h
+++ b/include/drm/drm_sysfs.h
@@ -8,5 +8,6 @@ int drm_class_device_register(struct device *dev);
 void drm_class_device_unregister(struct device *dev);
 
 void drm_sysfs_hotplug_event(struct drm_device *dev);
+void drm_sysfs_generate_uevent(struct drm_device *dev, char *event_string);
 
 #endif
-- 
2.7.4



More information about the Intel-gfx mailing list