@@ -82,6 +82,30 @@ void drm_hdcp_late_init(struct drm_connector *connector)
}
/**
+ * @drm_hdcp_connector_state_change_handler:
+ *
+ * Handler for the Connector state change.
+ */
+void drm_hdcp_connector_state_change_handler(struct drm_connector *connector)
+{
+ if (!connector->hdcp)
+ return;
+
+ if (connector->status == connector_status_connected) {
+
+ /* Probes the panel capability */
+ drm_hdcp_late_init(connector);
+ } else {
+ drm_hdcp_disable(connector);
+ connector->hdcp->ver_support_on_panel = 0;
+
+ /* Removing support for all versions */
+ connector->hdcp_state &= ~DRM_HDCP_VER_SUPPORT_MASK;
+ }
+}
+EXPORT_SYMBOL(drm_hdcp_connector_state_change_handler);
+
+/**
* @drm_hdcp_init:
* Initialization of the HDCP stack of the DRM
*
@@ -157,8 +157,17 @@ struct drm_hdcp {
DRM_HDCP_LINK_INTEGRITY_FAILED | \
DRM_HDCP_REAUTH_REQUESTED)
+#define DRM_HDCP_VER_SUPPORT_SHIFT 12
+#define DRM_HDCP_VER_SUPPORT_MASK (0xFFULL<< \
+ DRM_HDCP_VER_SUPPORT_SHIFT)
+#define DRM_HDCP_TYPE_SHIFT 4
+#define DRM_HDCP_TYPE_MASK (0xFFULL<<DRM_HDCP_TYPE_SHIFT)
+
/* Functions exported */
extern int drm_hdcp_init(struct drm_connector *connector,
struct drm_hdcp *hdcp,
uint8_t spec_supported);
+extern void drm_hdcp_connector_state_change_handler(
+ struct drm_connector *connector);
+
#endif /* __DRM_HDCP_H__ */
On hotplug/detection of connector Panel's HDCP capability is probed. On hot unplug of connector HDCP is diabled, if it has beed enabled. Signed-off-by: Ramalingam C <ramalingam.c@intel.com> --- drivers/gpu/drm/drm_hdcp.c | 24 ++++++++++++++++++++++++ include/drm/drm_hdcp.h | 9 +++++++++ 2 files changed, 33 insertions(+)