diff mbox

[RFC,v1,09/20] drm/hdcp: Generic enable, disable and late_init

Message ID 1499848144-8456-10-git-send-email-ramalingam.c@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ramalingam C July 12, 2017, 8:28 a.m. UTC
Generic HDCP enable disable and late_init implemented.
When new HDCP version support is added to general stack corresponding
enable, disable and late_init will be invoked from these
implementation.

Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
---
 drivers/gpu/drm/drm_hdcp.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_hdcp.c b/drivers/gpu/drm/drm_hdcp.c
index 481bc24..ab80370 100644
--- a/drivers/gpu/drm/drm_hdcp.c
+++ b/drivers/gpu/drm/drm_hdcp.c
@@ -30,6 +30,57 @@ 
 #include <drm/drm_hdcp.h>
 #include <drm/drm_dp_helper.h>
 
+int drm_hdcp_enable(struct drm_connector *connector, uint8_t stream_type)
+{
+	struct drm_hdcp *hdcp = connector->hdcp;
+	int ret = -EINVAL;
+
+	if (!hdcp)
+		return ret;
+
+	if (connector->status != connector_status_connected) {
+		DRM_ERROR("Panel is not connected\n");
+		return ret;
+	}
+
+	/*
+	 * TODO: Invoke the Version specific hdcp_enable
+	 */
+
+	return 0;
+}
+
+int drm_hdcp_disable(struct drm_connector *connector)
+{
+	struct drm_hdcp *hdcp = connector->hdcp;
+
+	/* Skip if HDCP is not enabled or HDCP enable is not in progress */
+	if (!(connector->hdcp_state & DRM_HDCP_ENABLE ||
+			(hdcp->req_state & DRM_HDCP_ENABLE &&
+				connector->hdcp_state & DRM_HDCP_WIP))) {
+		DRM_ERROR("HDCP is not enabled\n");
+		return 0;
+	}
+
+	/*
+	 * TODO: Invoke the Version specific hdcp_disable
+	 */
+
+	return 0;
+}
+
+void drm_hdcp_late_init(struct drm_connector *connector)
+{
+	struct drm_hdcp *hdcp = connector->hdcp;
+
+	if (hdcp->hdcp_funcs->late_init)
+		hdcp->hdcp_funcs->late_init(hdcp);
+
+	/*
+	 * TODO: Invoke the Version specific late_init
+	 */
+}
+
 /**
  * @drm_hdcp_init:
  *	Initialization of the HDCP stack of the DRM