[PATCH v3 10/10] drm/i915: uevent for HDCP status change

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Invoking the uevent generator for the content protection property state
change of a connector. This helps the userspace to detect the new state
change without polling the property val.

Signed-off-by: Ramalingam C <ramalingam.c@xxxxxxxxx>
---
 drivers/gpu/drm/i915/intel_hdcp.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_hdcp.c b/drivers/gpu/drm/i915/intel_hdcp.c
index 1eea553cdf81..1c38026f4de7 100644
--- a/drivers/gpu/drm/i915/intel_hdcp.c
+++ b/drivers/gpu/drm/i915/intel_hdcp.c
@@ -8,6 +8,7 @@
 
 #include <drm/drm_hdcp.h>
 #include <drm/i915_component.h>
+#include <drm/drm_sysfs.h>
 #include <linux/i2c.h>
 #include <linux/random.h>
 #include <linux/component.h>
@@ -19,6 +20,14 @@
 #define ENCRYPT_STATUS_CHANGE_TIMEOUT_MS	50
 #define HDCP2_LC_RETRY_CNT			3
 
+static inline
+void intel_hdcp_state_change_event(struct drm_connector *connector)
+{
+	struct drm_property *property = connector->content_protection_property;
+
+	drm_sysfs_connector_status_event(connector, property);
+}
+
 static
 bool intel_hdcp_is_ksv_valid(u8 *ksv)
 {
@@ -943,6 +952,7 @@ static void intel_hdcp_prop_work(struct work_struct *work)
 	if (hdcp->value != DRM_MODE_CONTENT_PROTECTION_UNDESIRED) {
 		state = connector->base.state;
 		state->content_protection = hdcp->value;
+		intel_hdcp_state_change_event(&connector->base);
 	}
 
 	mutex_unlock(&hdcp->mutex);
@@ -2206,6 +2216,7 @@ int intel_hdcp_disable(struct intel_connector *connector)
 			ret = _intel_hdcp2_disable(connector);
 		else if (hdcp->hdcp_encrypted)
 			ret = _intel_hdcp_disable(connector);
+		intel_hdcp_state_change_event(&connector->base);
 	}
 
 	mutex_unlock(&hdcp->mutex);
-- 
2.19.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux